hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8986f8d2dc6c2aeb5d1c3a4c9cdafaffcf88c901

commit 8986f8d2dc6c2aeb5d1c3a4c9cdafaffcf88c901
Author: Shinwoo Kim <[email protected]>
Date:   Tue Feb 4 12:14:23 2020 +0900

    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
---
 src/lib/evas/canvas/evas_object_image.c |  3 ++-
 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,
         *uvw = *imagew;
         *uvh = *imageh;
      }
-   else if (oi && oi->engine_data)
+   else if (oi && oi->engine_data &&
+            (!o->cur->source || o->load_opts->region.w == 0 || 
o->load_opts->region.h == 0))
      {
         if (oi->has_filter)
           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
    int level = 1;
    void *ctx;
    int w, h, off_x = 0, off_y = 0;
+   Eina_Rectangle lr;
 
 #ifdef REND_DBG
    level = __RD_level;
@@ -2333,7 +2334,16 @@ evas_render_proxy_subrender(Evas *eo_e, void *output, 
Evas_Object *eo_source, Ev
    source = efl_data_scope_get(eo_source, EFL_CANVAS_OBJECT_CLASS);
    proxy = efl_data_scope_get(eo_proxy, EFL_CANVAS_OBJECT_CLASS);
 
-   if (proxy->proxy->proxies || (!proxy->cur->clipper) || 
(!proxy->cur->has_fixed_size))
+   evas_object_image_load_region_get(eo_proxy, &lr.x, &lr.y, &lr.w, &lr.h);
+
+   if (lr.w > 0 && lr.h > 0)
+     {
+        w = lr.w;
+        h = lr.h;
+        off_x = -lr.x;
+        off_y = -lr.y;
+     }
+   else if (proxy->proxy->proxies || (!proxy->cur->clipper) || 
(!proxy->cur->has_fixed_size))
      {
         /* make full surface available if this proxy is being sampled from */
         w = source->cur->geometry.w;

-- 


Reply via email to