evas proxy: make it work for load_region
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 4 Feb 2020 03:14:23 +0000 (12:14 +0900)
committerHermet Park <hermetpark@gmail.com>
Wed, 12 Feb 2020 09:41:09 +0000 (18:41 +0900)
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

Change-Id: I9a8d80eca88a5f2d1d1c1b5425294bcd4017bfa9

src/lib/evas/canvas/evas_object_image.c
src/lib/evas/canvas/evas_render.c

index 8fb91847c4bb933dd9630b75dc5d6ec15bbbe19a..7f4327fcc2bdb094d83f8518fcdc29dbf3b84175 100755 (executable)
@@ -2399,8 +2399,8 @@ _evas_image_pixels_get(Eo *eo_obj, Evas_Object_Protected_Data *obj,
      }
    else if (oi && oi->engine_data &&
             //TIZEN_ONLY(20191107): proxy uses part of source
-            (obj->proxy->src_region.w == 0 || obj->proxy->src_region.h == 0))
-            //
+            ((obj->proxy->src_region.w == 0 || obj->proxy->src_region.h == 0) ||
+             (!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);
index 46a747700a8f1fbf10f394c75da378df8d8681be..ff3f47a4d23ab42aef435cea9d0c472a9603c054 100644 (file)
@@ -2351,6 +2351,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;
@@ -2374,6 +2375,15 @@ evas_render_proxy_subrender(Evas *eo_e, void *output, Evas_Object *eo_source, Ev
         off_y = -proxy->proxy->src_region.y;
      }
    //
+   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 */