devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=1b3c77bbe958d91bd7d175eb5e1115f22dbf79cc

commit 1b3c77bbe958d91bd7d175eb5e1115f22dbf79cc
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Mon Nov 3 12:26:40 2014 -0500

    e-comp-wl: Start on implementing subsurface commit functions
    
    NB: Not complete yet
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/bin/e_comp_wl.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 75 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 2cd8f52..86361a5 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -987,7 +987,8 @@ static void
 _e_comp_wl_surface_cb_commit(struct wl_client *client EINA_UNUSED, struct 
wl_resource *resource)
 {
    E_Pixmap *ep;
-   E_Client *ec;
+   E_Client *ec, *subc;
+   Eina_List *l;
 
    DBG("Surface Commit: %d", wl_resource_get_id(resource));
 
@@ -1010,9 +1011,20 @@ _e_comp_wl_surface_cb_commit(struct wl_client *client 
EINA_UNUSED, struct wl_res
    /* trap for clients which are being deleted */
    if (e_object_is_del(E_OBJECT(ec))) return;
 
+   /* call the subsurface commit function
+    * 
+    * NB: Returns true on success */
+   if (e_comp_wl_subsurface_commit(ec)) return;
+
    /* handle actual surface commit */
    if (!e_comp_wl_surface_commit(ec))
      ERR("Failed to commit surface: %d", wl_resource_get_id(resource));
+
+   EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc)
+     {
+        if (ec != subc)
+          _e_comp_wl_subsurface_parent_commit(subc, EINA_FALSE);
+     }
 }
 
 static void 
@@ -1282,6 +1294,37 @@ _e_comp_wl_subsurface_destroy(struct wl_resource 
*resource)
    ec->comp_data->sub.data = NULL;
 }
 
+static Eina_Bool 
+_e_comp_wl_subsurface_synchronized_get(E_Comp_Wl_Subsuf_Data *sdata)
+{
+   while (sdata)
+     {
+        if (sdata->synchronized) return EINA_TRUE;
+        if (!sdata->parent) return EINA_FALSE;
+        sdata = sdata->parent->comp_data->sub.data;
+     }
+
+   return EINA_FALSE;
+}
+
+static void 
+_e_comp_wl_subsurface_commit_to_cache(E_Client *ec)
+{
+
+}
+
+static void 
+_e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
+{
+
+}
+
+static void 
+_e_comp_wl_subsurface_parent_commit(E_Client *ec, Eina_Bool 
parent_synchronized)
+{
+
+}
+
 static void 
 _e_comp_wl_subsurface_cb_destroy(struct wl_client *client EINA_UNUSED, struct 
wl_resource *resource)
 {
@@ -2220,3 +2263,34 @@ unmap:
 
    return EINA_TRUE;
 }
+
+EINTERN Eina_Bool 
+e_comp_wl_subsurface_commit(E_Client *ec)
+{
+   E_Comp_Wl_Subsurf_Data *sdata;
+
+   /* check for valid subcompositor data */
+   if (!(sdata = ec->comp_data->sub.data)) return EINA_FALSE;
+
+   if (_e_comp_wl_subsurface_synchronized_get(sdata))
+     _e_comp_wl_subsurface_commit_to_cache(ec);
+   else
+     {
+        E_Client *subc;
+        Eina_List *l;
+
+        if (sdata->cached.has_data)
+          {
+             _e_comp_wl_subsurface_commit_to_cache(ec);
+             _e_comp_wl_subsurface_commit_from_cache(ec);
+          }
+        else
+          e_comp_wl_surface_commit(ec);
+
+        EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc)
+          {
+             if (ec != subc)
+               _e_comp_wl_subsurface_parent_commit(subc, EINA_FALSE);
+          }
+     }
+}

-- 


Reply via email to