derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4d430a98bfef0df78836d5458bc2c4c4282ca558

commit 4d430a98bfef0df78836d5458bc2c4c4282ca558
Author: Derek Foreman <[email protected]>
Date:   Fri Jan 26 11:17:23 2018 -0600

    ecore_wl2: Add API surface_buffer_create
    
    The specific surface code only needs these generic surface bits to pass
    to buffer_create, so make a helper function for that instead of queries
    for w, h, and alpha.
---
 src/lib/ecore_wl2/Ecore_Wl2.h         |  1 +
 src/lib/ecore_wl2/ecore_wl2_surface.c | 20 ++++++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 62d3888ea2..899df00c26 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -2022,6 +2022,7 @@ EAPI int  ecore_wl2_surface_assign(Ecore_Wl2_Surface 
*surface);
 EAPI void ecore_wl2_surface_post(Ecore_Wl2_Surface *surface, Eina_Rectangle 
*rects, unsigned int count);
 EAPI void ecore_wl2_surface_flush(Ecore_Wl2_Surface *surface);
 EAPI void ecore_wl2_window_surface_flush(Ecore_Wl2_Window *window);
+EAPI Ecore_Wl2_Buffer *ecore_wl2_surface_buffer_create(Ecore_Wl2_Surface 
*surface);
 
 # endif
 
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c 
b/src/lib/ecore_wl2/ecore_wl2_surface.c
index ca5bfc5a51..f9c1d8bc7d 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface.c
@@ -90,12 +90,7 @@ _evas_dmabuf_surface_wait(Ecore_Wl2_Surface *s)
 
    if (!best && (eina_list_count(s->buffers) < MAX_BUFFERS))
      {
-        Ecore_Wl2_Display *ewd;
-
-        ewd = ecore_wl2_window_display_get(s->wl2_win);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
-
-        best = ecore_wl2_buffer_create(ewd, s->w, s->h, s->alpha);
+        best = ecore_wl2_surface_buffer_create(s);
         /* Start at -1 so it's age is incremented to 0 for first draw */
         ecore_wl2_buffer_age_set(best, -1);
         s->buffers = eina_list_append(s->buffers, best);
@@ -259,3 +254,16 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool 
alpha)
    free(out);
    return NULL;
 }
+
+EAPI Ecore_Wl2_Buffer *
+ecore_wl2_surface_buffer_create(Ecore_Wl2_Surface *surface)
+{
+   Ecore_Wl2_Display *ewd;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
+
+   ewd = ecore_wl2_window_display_get(surface->wl2_win);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ewd, NULL);
+
+   return ecore_wl2_buffer_create(ewd, surface->w, surface->h, surface->alpha);
+}

-- 


Reply via email to