summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-07 20:03:37 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-12 13:40:20 +0900
commit512fb7f193975d411b4f471c14e1f0171e52e7d3 (patch)
treeda94e5fe995d253d1239d8b0d4aa0814cae142b2 /src/lib/evas/canvas
parent48fb969e2062a0b76feb5a6b3465e18b462431c3 (diff)
Evas snapshot: Fix proxies of snapshot objects
This was broken because the wrong image size was used in the proxy's fast path (proxy of another image). Why did snapshot use a specific surface_w,h instead of reusing the usual cur->image.w,h? (@cedric) Simplify code.
Diffstat (limited to 'src/lib/evas/canvas')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 7214b9af0d..6b05037921 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -69,8 +69,6 @@ struct _Evas_Object_Image_Pixels
69 69
70 Evas_Video_Surface video; 70 Evas_Video_Surface video;
71 unsigned int video_caps; 71 unsigned int video_caps;
72
73 int surface_w, surface_h; /* used by snapshot feature */
74}; 72};
75 73
76struct _Evas_Object_Image_State 74struct _Evas_Object_Image_State
@@ -3313,8 +3311,8 @@ _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
3313 else if (obj->cur->snapshot) 3311 else if (obj->cur->snapshot)
3314 { 3312 {
3315 pixels = o->engine_data; 3313 pixels = o->engine_data;
3316 imagew = o->pixels->surface_w; 3314 imagew = o->cur->image.w;
3317 imageh = o->pixels->surface_h; 3315 imageh = o->cur->image.h;
3318 uvw = imagew; 3316 uvw = imagew;
3319 uvh = imageh; 3317 uvh = imageh;
3320 } 3318 }
@@ -4790,24 +4788,24 @@ _evas_object_image_surface_get(Evas_Object *eo, Evas_Object_Protected_Data *obj)
4790 Evas_Image_Data *pd = eo_data_scope_get(eo, EVAS_IMAGE_CLASS); 4788 Evas_Image_Data *pd = eo_data_scope_get(eo, EVAS_IMAGE_CLASS);
4791 4789
4792 if (pd->engine_data && 4790 if (pd->engine_data &&
4793 pd->pixels->surface_w == obj->cur->geometry.w && 4791 (pd->cur->image.w == obj->cur->geometry.w) &&
4794 pd->pixels->surface_h == obj->cur->geometry.h) 4792 (pd->cur->image.h == obj->cur->geometry.h))
4795 return pd->engine_data; 4793 return pd->engine_data;
4796 4794
4797 if (pd->engine_data) 4795 if (pd->engine_data)
4798 ENFN->image_free(ENDT, pd->engine_data); 4796 ENFN->image_free(ENDT, pd->engine_data);
4799 4797
4800 // FIXME: alpha forced to 1 for now, need to figure out Evas alpha here 4798 // FIXME: alpha forced to 1 for now, need to figure out Evas alpha here
4801 EINA_COW_PIXEL_WRITE_BEGIN(pd, pixi_write) 4799 EINA_COW_IMAGE_STATE_WRITE_BEGIN(pd, state_write)
4802 { 4800 {
4803 pd->engine_data = ENFN->image_map_surface_new(ENDT, 4801 pd->engine_data = ENFN->image_map_surface_new(ENDT,
4804 obj->cur->geometry.w, 4802 obj->cur->geometry.w,
4805 obj->cur->geometry.h, 4803 obj->cur->geometry.h,
4806 1); 4804 1);
4807 pixi_write->surface_w = obj->cur->geometry.w; 4805 state_write->image.w = obj->cur->geometry.w;
4808 pixi_write->surface_h = obj->cur->geometry.h; 4806 state_write->image.h = obj->cur->geometry.h;
4809 } 4807 }
4810 EINA_COW_PIXEL_WRITE_END(pd, pixi_write); 4808 EINA_COW_IMAGE_STATE_WRITE_END(pd, state_write);
4811 4809
4812 return pd->engine_data; 4810 return pd->engine_data;
4813} 4811}