[Mesa-dev] [PATCH 06/10] egl/surfaceless: inline surfaceless_alloc_image()

Emil Velikov emil.l.velikov at gmail.com
Fri Aug 3 12:44:22 UTC 2018


From: Emil Velikov <emil.velikov at collabora.com>

The helper calls a single function - there's limited benefit in having
it as-is.

Inline, as with follow-up patch we'll tweak the createImage invocation.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/egl/drivers/dri2/platform_surfaceless.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c
index a5e6f976ad2..ef34c5db373 100644
--- a/src/egl/drivers/dri2/platform_surfaceless.c
+++ b/src/egl/drivers/dri2/platform_surfaceless.c
@@ -37,19 +37,6 @@
 #include "egl_dri2_fallbacks.h"
 #include "loader.h"
 
-static __DRIimage*
-surfaceless_alloc_image(struct dri2_egl_display *dri2_dpy,
-                     struct dri2_egl_surface *dri2_surf)
-{
-   return dri2_dpy->image->createImage(
-            dri2_dpy->dri_screen,
-            dri2_surf->base.Width,
-            dri2_surf->base.Height,
-            dri2_surf->visual,
-            0,
-            NULL);
-}
-
 static void
 surfaceless_free_images(struct dri2_egl_surface *dri2_surf)
 {
@@ -95,8 +82,11 @@ surfaceless_image_get_buffers(__DRIdrawable *driDrawable,
    if (buffer_mask & __DRI_IMAGE_BUFFER_FRONT) {
 
       if (!dri2_surf->front)
-         dri2_surf->front =
-            surfaceless_alloc_image(dri2_dpy, dri2_surf);
+         dri2_surf->front = dri2_dpy->image->createImage(dri2_dpy->dri_screen,
+                                                         dri2_surf->base.Width,
+                                                         dri2_surf->base.Height,
+                                                         dri2_surf->visual,
+                                                         0, NULL);
 
       buffers->image_mask |= __DRI_IMAGE_BUFFER_FRONT;
       buffers->front = dri2_surf->front;
-- 
2.18.0



More information about the mesa-dev mailing list