summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-06-22 12:46:16 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-06-23 08:15:42 -0500
commit7365c087c7feb218881fb8de9e371312bf1421cc (patch)
tree8b926f82b26ec65f32cd21a259e439145231151c
parent6043e115866c65b321ad5db456841a0f3c8dbe5f (diff)
downloadefl-7365c087c7feb218881fb8de9e371312bf1421cc.tar.gz
evas_render: Use hardware planes
This is a very simple proof of concept for using hardware planes for evas image objects. Right now only dmabuf objects will be dropped into planes, and they're considered in the order they're in in the scene graph with no attention paid to which objects will have the most benefit from being on a plane at all. There's nothing to prevent your mouse cursor from consuming the only hardware plane capable of UHD video. :) This is mostly just to help test the low level functionality in the engines and ecore_drm2 that enable hardware planes. Smarter plane usage is coming.
-rw-r--r--src/lib/evas/canvas/evas_render.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index bb84209109..e02ee0d5ef 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1360,6 +1360,9 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj)
Eina_Bool surface_below, stacking_check, object_above = EINA_FALSE;
Eina_Bool ignore_window;
+ if (!_evas_object_image_can_use_plane(obj))
+ return EINA_FALSE;
+
video_parent = _evas_object_image_video_parent_get(eo_obj);
/* Check if any one is the stack make this object mapped */
@@ -3075,6 +3078,7 @@ evas_render_updates_internal(Evas *eo_e,
unsigned int i;
Phase1_Context p1ctx;
int redraw_all = 0;
+ Evas_Active_Entry *ao;
Evas_Render_Mode render_mode = !do_async ?
EVAS_RENDER_MODE_SYNC :
EVAS_RENDER_MODE_ASYNC_INIT;
@@ -3157,6 +3161,30 @@ evas_render_updates_internal(Evas *eo_e,
else
_evas_object_image_video_overlay_hide(eo_obj);
}
+
+ /* check if individual image objects can be dropped into hardware planes */
+ if (ENFN->image_plane_assign)
+ EINA_INARRAY_FOREACH(&evas->active_objects, ao)
+ {
+ Evas_Object_Protected_Data *obj;
+ Evas_Object *eo_obj;
+
+ obj = ao->obj;
+ eo_obj = obj->object;
+
+ if (!efl_isa(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS)) continue;
+
+ if (evas_object_image_video_surface_get(eo_obj)) continue;
+
+ _evas_object_image_plane_release(eo_obj, obj);
+ if (!_evas_render_can_use_overlay(e, eo_obj))
+ {
+ /* This may free up things temporarily allocated by
+ * _can_use_overlay() testing in the engine */
+ _evas_object_image_plane_release(eo_obj, obj);
+ }
+ }
+
eina_evlog("+render_phase1_direct", eo_e, 0.0, NULL);
/* phase 1.8. pre render for proxy */
_evas_render_phase1_direct(e, &e->active_objects, &e->restack_objects,