app: align display paint area to a coarse grid
Align rectangles added to the display paint area, in
gimp_display_paint_area(), to a coarse grid, to reduce the
complexity of ther overall area. This is similar to commit
49285463e6
, however the alignment
happens in display space, instead of image space.
This commit is contained in:
@ -50,7 +50,10 @@
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
#define FLUSH_NOW_INTERVAL 20000 /* 20 ms in microseconds */
|
||||
#define FLUSH_NOW_INTERVAL 20000 /* 20 ms in microseconds */
|
||||
|
||||
#define PAINT_AREA_CHUNK_WIDTH 32
|
||||
#define PAINT_AREA_CHUNK_HEIGHT 32
|
||||
|
||||
|
||||
enum
|
||||
@ -902,5 +905,13 @@ gimp_display_paint_area (GimpDisplay *display,
|
||||
x2 = ceil (x2_f + 0.5);
|
||||
y2 = ceil (y2_f + 0.5);
|
||||
|
||||
/* align transformed area to a coarse grid, to simplify the
|
||||
* invalidated area
|
||||
*/
|
||||
x1 = floor ((gdouble) x1 / PAINT_AREA_CHUNK_WIDTH) * PAINT_AREA_CHUNK_WIDTH;
|
||||
y1 = floor ((gdouble) y1 / PAINT_AREA_CHUNK_HEIGHT) * PAINT_AREA_CHUNK_HEIGHT;
|
||||
x2 = ceil ((gdouble) x2 / PAINT_AREA_CHUNK_WIDTH) * PAINT_AREA_CHUNK_WIDTH;
|
||||
y2 = ceil ((gdouble) y2 / PAINT_AREA_CHUNK_HEIGHT) * PAINT_AREA_CHUNK_HEIGHT;
|
||||
|
||||
gimp_display_shell_expose_area (shell, x1, y1, x2 - x1, y2 - y1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user