From: Emil Velikov <emil.veli...@collabora.com>

Allows us to consolidate native platform specifics in once place.
Will be reused in later commit(s).

Cc: Ian Romanick <ian.d.roman...@intel.com>
Signed-off-by: Emil Velikov <emil.veli...@collabora.com>
---
 tests/egl/egl-util.c | 12 +++++++++---
 tests/egl/egl-util.h |  3 +++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/tests/egl/egl-util.c b/tests/egl/egl-util.c
index 92a799185..fa6d482ed 100644
--- a/tests/egl/egl-util.c
+++ b/tests/egl/egl-util.c
@@ -84,15 +84,21 @@ egl_init_test(struct egl_test *test)
        test->stop_on_failure = true;
 }
 
+EGLNativePixmapType
+egl_util_create_native_pixmap(struct egl_state *state, int width, int height)
+{
+       return XCreatePixmap(state->dpy, state->win,
+                            width, height, state->depth);
+}
+
 EGLSurface
 egl_util_create_pixmap(struct egl_state *state,
                       int width, int height, const EGLint *attribs)
 {
-       Pixmap pixmap;
+       EGLNativePixmapType pixmap;
        EGLSurface surf;
 
-       pixmap = XCreatePixmap(state->dpy, state->win,
-                              width, height, state->depth);
+       pixmap = egl_util_create_native_pixmap(state, width, height);
 
        surf = eglCreatePixmapSurface(state->egl_dpy, state->cfg,
                                      pixmap, attribs);
diff --git a/tests/egl/egl-util.h b/tests/egl/egl-util.h
index 614e58648..428e144b4 100644
--- a/tests/egl/egl-util.h
+++ b/tests/egl/egl-util.h
@@ -64,6 +64,9 @@ static const EGLint egl_default_window_height = 300;
 void
 egl_init_test(struct egl_test *test);
 
+EGLNativePixmapType
+egl_util_create_native_pixmap(struct egl_state *state, int width, int height);
+
 EGLSurface
 egl_util_create_pixmap(struct egl_state *state,
                       int width, int height, const EGLint *attribs);
-- 
2.15.0

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to