summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/software_gdi/evas_outbuf.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2017-08-13 21:08:53 +0200
committerCedric BAIL <cedric@osg.samsung.com>2017-08-14 10:16:05 -0700
commitff0d8ef0a418c334b1e8abbf83d9fab281937a3e (patch)
tree6c8df6a4485de2a932e18406432460b2f2ac93f9 /src/modules/evas/engines/software_gdi/evas_outbuf.c
parent87c9b111d1bbf4988caead460710a3481911cd81 (diff)
evas GDI engine: improve speed
expedite mean value goes from ~125 to ~205 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/modules/evas/engines/software_gdi/evas_outbuf.c')
-rw-r--r--src/modules/evas/engines/software_gdi/evas_outbuf.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/modules/evas/engines/software_gdi/evas_outbuf.c b/src/modules/evas/engines/software_gdi/evas_outbuf.c
index e58692e..5ec4443 100644
--- a/src/modules/evas/engines/software_gdi/evas_outbuf.c
+++ b/src/modules/evas/engines/software_gdi/evas_outbuf.c
@@ -17,7 +17,6 @@ _find_gdiob(HDC dc, BITMAPINFO_GDI *bitmap_info, int depth, int w, int h, void *
17 int sz; 17 int sz;
18 int lbytes; 18 int lbytes;
19 int bpp; 19 int bpp;
20 int fitness = 0x7fffffff;
21 20
22 bpp = depth >> 3; 21 bpp = depth >> 3;
23 if (bpp == 3) bpp = 4; 22 if (bpp == 3) bpp = 4;
@@ -25,28 +24,18 @@ _find_gdiob(HDC dc, BITMAPINFO_GDI *bitmap_info, int depth, int w, int h, void *
25 sz = lbytes * h; 24 sz = lbytes * h;
26 EINA_LIST_FOREACH(gdipool, l, gdiob2) 25 EINA_LIST_FOREACH(gdipool, l, gdiob2)
27 { 26 {
28 int szdif;
29
30 if ((gdiob2->dc != dc) || 27 if ((gdiob2->dc != dc) ||
31 (gdiob2->bitmap_info != bitmap_info) || 28 (gdiob2->bitmap_info != bitmap_info) ||
32 (gdiob2->depth != depth)) 29 (gdiob2->depth != depth))
33 continue; 30 continue;
34 szdif = gdiob2->psize - sz; 31 if (gdiob2->psize == sz)
35 if (szdif < 0) continue;
36 if (szdif == 0)
37 { 32 {
38 gdiob = gdiob2; 33 gdiob = gdiob2;
39 gdil = l; 34 gdil = l;
40 goto have_gdiob; 35 goto have_gdiob;
41 } 36 }
42 if (szdif < fitness)
43 {
44 fitness = szdif;
45 gdiob = gdiob2;
46 gdil = l;
47 }
48 } 37 }
49 if ((fitness > (100 * 100)) || (!gdiob)) 38 if (!gdiob)
50 return evas_software_gdi_output_buffer_new(dc, bitmap_info, depth, w, h, data); 39 return evas_software_gdi_output_buffer_new(dc, bitmap_info, depth, w, h, data);
51 40
52 have_gdiob: 41 have_gdiob:
@@ -319,8 +308,10 @@ evas_software_gdi_outbuf_new_region_for_update(Outbuf *buf,
319/* w, h, NULL); */ 308/* w, h, NULL); */
320 } 309 }
321 if ((buf->priv.gdi.region) || (buf->priv.destination_alpha)) 310 if ((buf->priv.gdi.region) || (buf->priv.destination_alpha))
322 /* FIXME: faster memset! */ 311 {
323 memset(im->image.data, 0, w * h * sizeof(DATA32)); 312 /* FIXME: faster memset! */
313 /* memset(im->image.data, 0, w * h * sizeof(DATA32)); */
314 }
324 315
325 buf->priv.pending_writes = eina_list_append(buf->priv.pending_writes, im); 316 buf->priv.pending_writes = eina_list_append(buf->priv.pending_writes, im);
326 return im; 317 return im;