diff options
author | Shinwoo Kim <cinoo.kim@samsung.com> | 2020-02-04 12:14:23 +0900 |
---|---|---|
committer | Hermet Park <hermetpark@gmail.com> | 2020-02-04 12:14:25 +0900 |
commit | 8986f8d2dc6c2aeb5d1c3a4c9cdafaffcf88c901 (patch) | |
tree | 0a8e63aff4675a620a2405cd48e8ac7541519062 | |
parent | 50f3648391c1fc6045bf29168e7ff9d9f65cbdf4 (diff) |
evas proxy: make it work for load_region
Summary:
This makes a proxy object use a selective region of a source object.
So far a proxy has not worked for load_region at all.
This should be better solution than https://phab.enlightenment.org/D10604
introducing new interface.
This is useful when the source is too big to allocate a proxy surface.
This will be used by elm_scroller to solve following issue.
[Issue]
If size of elm_sclloer content is too big, then the proxy of
elm_scroller to show loop effect does not work. Because
evas_gl_common_image_surface_new does not allow
bigger size surface than max_texture_size
Reviewers: Hermet, jsuya
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10626
-rw-r--r-- | src/lib/evas/canvas/evas_object_image.c | 3 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_render.c | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index ab4d5e6f4c..e2bfebfedb 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c | |||
@@ -2355,7 +2355,8 @@ _evas_image_pixels_get(Eo *eo_obj, Evas_Object_Protected_Data *obj, | |||
2355 | *uvw = *imagew; | 2355 | *uvw = *imagew; |
2356 | *uvh = *imageh; | 2356 | *uvh = *imageh; |
2357 | } | 2357 | } |
2358 | else if (oi && oi->engine_data) | 2358 | else if (oi && oi->engine_data && |
2359 | (!o->cur->source || o->load_opts->region.w == 0 || o->load_opts->region.h == 0)) | ||
2359 | { | 2360 | { |
2360 | if (oi->has_filter) | 2361 | if (oi->has_filter) |
2361 | pixels = evas_filter_output_buffer_get(source->object); | 2362 | pixels = evas_filter_output_buffer_get(source->object); |
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index d655bbdc27..f5ebf9c2c1 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c | |||
@@ -2323,6 +2323,7 @@ evas_render_proxy_subrender(Evas *eo_e, void *output, Evas_Object *eo_source, Ev | |||
2323 | int level = 1; | 2323 | int level = 1; |
2324 | void *ctx; | 2324 | void *ctx; |
2325 | int w, h, off_x = 0, off_y = 0; | 2325 | int w, h, off_x = 0, off_y = 0; |
2326 | Eina_Rectangle lr; | ||
2326 | 2327 | ||
2327 | #ifdef REND_DBG | 2328 | #ifdef REND_DBG |
2328 | level = __RD_level; | 2329 | level = __RD_level; |
@@ -2333,7 +2334,16 @@ evas_render_proxy_subrender(Evas *eo_e, void *output, Evas_Object *eo_source, Ev | |||
2333 | source = efl_data_scope_get(eo_source, EFL_CANVAS_OBJECT_CLASS); | 2334 | source = efl_data_scope_get(eo_source, EFL_CANVAS_OBJECT_CLASS); |
2334 | proxy = efl_data_scope_get(eo_proxy, EFL_CANVAS_OBJECT_CLASS); | 2335 | proxy = efl_data_scope_get(eo_proxy, EFL_CANVAS_OBJECT_CLASS); |
2335 | 2336 | ||
2336 | if (proxy->proxy->proxies || (!proxy->cur->clipper) || (!proxy->cur->has_fixed_size)) | 2337 | evas_object_image_load_region_get(eo_proxy, &lr.x, &lr.y, &lr.w, &lr.h); |
2338 | |||
2339 | if (lr.w > 0 && lr.h > 0) | ||
2340 | { | ||
2341 | w = lr.w; | ||
2342 | h = lr.h; | ||
2343 | off_x = -lr.x; | ||
2344 | off_y = -lr.y; | ||
2345 | } | ||
2346 | else if (proxy->proxy->proxies || (!proxy->cur->clipper) || (!proxy->cur->has_fixed_size)) | ||
2337 | { | 2347 | { |
2338 | /* make full surface available if this proxy is being sampled from */ | 2348 | /* make full surface available if this proxy is being sampled from */ |
2339 | w = source->cur->geometry.w; | 2349 | w = source->cur->geometry.w; |