summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_draw_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2007-10-02 03:40:14 +0000
committerCarsten Haitzler <raster@rasterman.com>2007-10-02 03:40:14 +0000
commit2ea744bc1b4fdacdfaa458b027020b196c5ec5d5 (patch)
treefe41f517d3574e554fdc012ebf1702017c4721e1 /legacy/evas/src/lib/engines/common/evas_draw_main.c
parent7aa0a51a2f9276a0ed8e30ee406d0b44d489751e (diff)
working on optimising software-x11 with the one-buffer persistence idea that
software-16 uses. it works and in some cases gets massive speedups (70%+) but in a few its slowdowns (30% down) in expedite tests - why, i don't know. it should be the same or better in all tests. disabled for now - also not complete. < 32bpp wont' work and not sure rotation works and masks don't work either. SVN revision: 31928
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_draw_main.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_draw_main.c b/legacy/evas/src/lib/engines/common/evas_draw_main.c
index 389a17b979..cf9c784f8d 100644
--- a/legacy/evas/src/lib/engines/common/evas_draw_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_draw_main.c
@@ -25,17 +25,19 @@ evas_common_draw_context_cutouts_add(Cutout_Rects* rects,
25{ 25{
26 Cutout_Rect* rect; 26 Cutout_Rect* rect;
27 27
28 if (rects->max < rects->active + 1) { 28 if (rects->max < (rects->active + 1))
29 rects->max += 8; 29 {
30 rects->rects = realloc(rects->rects, sizeof(Cutout_Rect) * rects->max); 30 rects->max += 32;
31 } 31 rects->rects = realloc(rects->rects, sizeof(Cutout_Rect) * rects->max);
32 }
32 33
33 rect = rects->rects + rects->active++; 34 rect = rects->rects + rects->active;
34 rect->x = x; 35 rect->x = x;
35 rect->y = y; 36 rect->y = y;
36 rect->w = w; 37 rect->w = w;
37 rect->h = h; 38 rect->h = h;
38 39 rects->active++;
40
39 return rect; 41 return rect;
40} 42}
41 43
@@ -43,11 +45,13 @@ EAPI void
43evas_common_draw_context_cutouts_del(Cutout_Rects* rects, 45evas_common_draw_context_cutouts_del(Cutout_Rects* rects,
44 int index) 46 int index)
45{ 47{
46 if (index >= 0 && index < rects->active) 48 if ((index >= 0) && (index < rects->active))
47 { 49 {
48 Cutout_Rect* rect = rects->rects + index; 50 Cutout_Rect* rect;
49 51
50 memmove(rect, rect + 1, sizeof (Cutout_Rect) * (rects->active - index - 1)); 52 rect = rects->rects + index;
53 memmove(rect, rect + 1,
54 sizeof(Cutout_Rect) * (rects->active - index - 1));
51 rects->active--; 55 rects->active--;
52 } 56 }
53} 57}
@@ -176,6 +180,12 @@ evas_common_draw_context_unset_multiplier(RGBA_Draw_Context *dc)
176EAPI void 180EAPI void
177evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w, int h) 181evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int w, int h)
178{ 182{
183 if (dc->clip.use)
184 {
185 RECTS_CLIP_TO_RECT(x, y, w, h,
186 dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
187 if ((w < 1) || (h < 1)) return;
188 }
179 evas_common_draw_context_cutouts_add(&dc->cutout, x, y, w, h); 189 evas_common_draw_context_cutouts_add(&dc->cutout, x, y, w, h);
180} 190}
181 191