summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_draw_main.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-10-13 12:10:34 -0700
committerCedric BAIL <cedric@osg.samsung.com>2015-10-13 12:10:34 -0700
commit8a39069b64507650c6746f5e93b4aa86934f588a (patch)
tree54cc1736fc92e0212262f5522c27f2febae2f35c /src/lib/evas/common/evas_draw_main.c
parent0d6c53268d8dbf0a6239e264f01a01fe9e48cc9c (diff)
evas: fix performance regression by reducing the unecessary memcpy we are doing.
Actually copying max is pretty useless and super slow. We usually have something like 1024 slot in a context, but a very small amount of them are acutally active. It would be better to actually do some kind of copy on write technique here, but as Eina_Cow doesn't handle array and we are close to a release, let's be conservative.
Diffstat (limited to 'src/lib/evas/common/evas_draw_main.c')
-rw-r--r--src/lib/evas/common/evas_draw_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/evas/common/evas_draw_main.c b/src/lib/evas/common/evas_draw_main.c
index b444608..460a296 100644
--- a/src/lib/evas/common/evas_draw_main.c
+++ b/src/lib/evas/common/evas_draw_main.c
@@ -16,11 +16,12 @@ evas_common_draw_context_cutouts_dup(Cutout_Rects *rects2, const Cutout_Rects *r
16{ 16{
17 if (!rects) return; 17 if (!rects) return;
18 rects2->active = rects->active; 18 rects2->active = rects->active;
19 rects2->max = rects->max; 19 rects2->max = rects->active;
20 rects2->last_add = rects->last_add; 20 rects2->last_add = rects->last_add;
21 if (rects->max > 0) 21 rects2->rects = NULL;
22 if (rects2->max > 0)
22 { 23 {
23 const size_t sz = sizeof(Cutout_Rect) * rects->max; 24 const size_t sz = sizeof(Cutout_Rect) * rects2->max;
24 rects2->rects = malloc(sz); 25 rects2->rects = malloc(sz);
25 memcpy(rects2->rects, rects->rects, sz); 26 memcpy(rects2->rects, rects->rects, sz);
26 } 27 }