summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gmail.com>2023-01-29 01:32:55 +0000
committerEmmanuele Bassi <ebassi@gmail.com>2023-01-29 01:32:55 +0000
commit47a932bffc16323b58e3c8f9bc3fe0d821838a84 (patch)
treeb0d9cd60f7c43739d890571ecbed3d686727e189 /test
parent1e8be6bbc790aa31649a14f6e97fbab9cbd7ed53 (diff)
parentb5793081d095a13517e157d793b367e4527fd39d (diff)
downloadcairo-47a932bffc16323b58e3c8f9bc3fe0d821838a84.tar.gz
Merge branch 'no-more-gl' into 'master'
Drop cairo-gl See merge request cairo/cairo!287
Diffstat (limited to 'test')
-rw-r--r--test/api-special-cases.c41
-rw-r--r--test/egl-oversized-surface.c117
-rw-r--r--test/egl-surface-source.c135
-rw-r--r--test/error-setters.c8
-rw-r--r--test/gl-device-release.c182
-rw-r--r--test/gl-oversized-surface.c88
-rw-r--r--test/gl-surface-source.c111
-rw-r--r--test/meson.build15
8 files changed, 0 insertions, 697 deletions
diff --git a/test/api-special-cases.c b/test/api-special-cases.c
index ce54200b7..d926aa652 100644
--- a/test/api-special-cases.c
+++ b/test/api-special-cases.c
@@ -63,9 +63,6 @@
#include "cairo-test.h"
-#if CAIRO_HAS_GL_SURFACE
-#include <cairo-gl.h>
-#endif
#if CAIRO_HAS_PDF_SURFACE
#include <cairo-pdf.h>
#endif
@@ -1312,38 +1309,6 @@ test_cairo_tee_surface_index (cairo_surface_t *surface)
#endif /* CAIRO_HAS_TEE_SURFACE */
-#if CAIRO_HAS_GL_SURFACE
-
-static cairo_test_status_t
-test_cairo_gl_surface_set_size (cairo_surface_t *surface)
-{
- cairo_gl_surface_set_size (surface, 5, 5);
- return CAIRO_TEST_SUCCESS;
-}
-
-static cairo_test_status_t
-test_cairo_gl_surface_get_width (cairo_surface_t *surface)
-{
- unsigned int width = cairo_gl_surface_get_width (surface);
- return width == 0 || surface_has_type (surface, CAIRO_SURFACE_TYPE_GL) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
-}
-
-static cairo_test_status_t
-test_cairo_gl_surface_get_height (cairo_surface_t *surface)
-{
- unsigned int height = cairo_gl_surface_get_height (surface);
- return height == 0 || surface_has_type (surface, CAIRO_SURFACE_TYPE_GL) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
-}
-
-static cairo_test_status_t
-test_cairo_gl_surface_swapbuffers (cairo_surface_t *surface)
-{
- cairo_gl_surface_swapbuffers (surface);
- return CAIRO_TEST_SUCCESS;
-}
-
-#endif /* CAIRO_HAS_GL_SURFACE */
-
#if CAIRO_HAS_PDF_SURFACE
static cairo_test_status_t
@@ -1675,12 +1640,6 @@ struct {
TEST (cairo_tee_surface_remove, CAIRO_SURFACE_TYPE_TEE, TRUE),
TEST (cairo_tee_surface_index, CAIRO_SURFACE_TYPE_TEE, FALSE),
#endif
-#if CAIRO_HAS_GL_SURFACE
- TEST (cairo_gl_surface_set_size, CAIRO_SURFACE_TYPE_GL, TRUE),
- TEST (cairo_gl_surface_get_width, CAIRO_SURFACE_TYPE_GL, FALSE),
- TEST (cairo_gl_surface_get_height, CAIRO_SURFACE_TYPE_GL, FALSE),
- TEST (cairo_gl_surface_swapbuffers, CAIRO_SURFACE_TYPE_GL, TRUE),
-#endif
#if CAIRO_HAS_PDF_SURFACE
TEST (cairo_pdf_surface_restrict_to_version, CAIRO_SURFACE_TYPE_PDF, TRUE),
TEST (cairo_pdf_surface_set_size, CAIRO_SURFACE_TYPE_PDF, TRUE),
diff --git a/test/egl-oversized-surface.c b/test/egl-oversized-surface.c
deleted file mode 100644
index cb85a628d..000000000
--- a/test/egl-oversized-surface.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright © 2014 Samsung Electronics
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Author: Ravi Nanjundappa <nravi.n@samsung.com>
- */
-
-/*
- * This test exercises error scenario for over sized egl surface
- *
- */
-
-#include "cairo-test.h"
-#include <cairo-gl.h>
-#include <assert.h>
-#include <limits.h>
-
-static cairo_test_status_t
-preamble (cairo_test_context_t *test_ctx)
-{
- EGLint rgba_attribs[] = {
- EGL_RED_SIZE, 8,
- EGL_GREEN_SIZE, 8,
- EGL_BLUE_SIZE, 8,
- EGL_ALPHA_SIZE, 8,
- EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
-#if CAIRO_HAS_GL_SURFACE
- EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
-#elif CAIRO_HAS_GLESV2_SURFACE
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
-#endif
- EGL_NONE
- };
- const EGLint ctx_attribs[] = {
-#if CAIRO_HAS_GLESV2_SURFACE
- EGL_CONTEXT_CLIENT_VERSION, 2,
-#endif
- EGL_NONE
- };
-
- EGLDisplay dpy;
- EGLContext ctx;
- EGLConfig config;
- EGLint numConfigs;
- int major, minor;
- cairo_device_t *device;
- cairo_surface_t *oversized_surface;
- cairo_test_status_t test_status = CAIRO_TEST_SUCCESS;
-
- dpy = eglGetDisplay (EGL_DEFAULT_DISPLAY);
- if (! eglInitialize (dpy, &major, &minor)) {
- test_status = CAIRO_TEST_UNTESTED;
- goto CLEANUP_1;
- }
-
- eglChooseConfig (dpy, rgba_attribs, &config, 1, &numConfigs);
- if (numConfigs == 0) {
- test_status = CAIRO_TEST_UNTESTED;
- goto CLEANUP_1;
- }
-
-#if CAIRO_HAS_GL_SURFACE
- eglBindAPI (EGL_OPENGL_API);
-#elif CAIRO_HAS_GLESV2_SURFACE
- eglBindAPI (EGL_OPENGL_ES_API);
-#endif
-
- ctx = eglCreateContext (dpy, config, EGL_NO_CONTEXT,
- ctx_attribs);
- if (ctx == EGL_NO_CONTEXT) {
- test_status = CAIRO_TEST_UNTESTED;
- goto CLEANUP_2;
- }
-
- device = cairo_egl_device_create (dpy, ctx);
-
- oversized_surface = cairo_gl_surface_create (device, CAIRO_CONTENT_COLOR_ALPHA, INT_MAX, INT_MAX);
- if (cairo_surface_status (oversized_surface) != CAIRO_STATUS_INVALID_SIZE)
- test_status = CAIRO_TEST_FAILURE;
-
- cairo_device_destroy (device);
- eglDestroyContext (dpy, ctx);
- eglMakeCurrent (dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- ctx = EGL_NO_CONTEXT;
-
-CLEANUP_2:
- eglTerminate (dpy);
-
-CLEANUP_1:
- return test_status;
-}
-
-CAIRO_TEST (egl_oversized_surface,
- "Test that creating a surface beyond texture limits results in an error surface",
- "egl", /* keywords */
- NULL, /* requirements */
- 0, 0,
- preamble, NULL)
diff --git a/test/egl-surface-source.c b/test/egl-surface-source.c
deleted file mode 100644
index 4a84d7042..000000000
--- a/test/egl-surface-source.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright © 2014 Samsung Electronics
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Author: Ravi Nanjundappa <nravi.n@samsung.com>
- */
-
-/*
- * This case tests using a EGL surface as the source
- *
- */
-
-#include "cairo-test.h"
-#include <cairo-gl.h>
-
-#include "surface-source.c"
-
-struct closure {
- EGLDisplay dpy;
- EGLContext ctx;
-};
-
-static void
-cleanup (void *data)
-{
- struct closure *arg = data;
-
- eglDestroyContext (arg->dpy, arg->ctx);
- eglMakeCurrent (arg->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- eglTerminate (arg->dpy);
-
- free (arg);
-}
-
-static cairo_surface_t *
-create_source_surface (int size)
-{
- EGLint config_attribs[] = {
- EGL_RED_SIZE, 8,
- EGL_GREEN_SIZE, 8,
- EGL_BLUE_SIZE, 8,
- EGL_ALPHA_SIZE, 8,
- EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
-#if CAIRO_HAS_GL_SURFACE
- EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
-#elif CAIRO_HAS_GLESV2_SURFACE
- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
-#endif
- EGL_NONE
- };
- const EGLint ctx_attribs[] = {
-#if CAIRO_HAS_GLESV2_SURFACE
- EGL_CONTEXT_CLIENT_VERSION, 2,
-#endif
- EGL_NONE
- };
-
- struct closure *arg;
- cairo_device_t *device;
- cairo_surface_t *surface;
- EGLConfig config;
- EGLint numConfigs;
- EGLDisplay dpy;
- EGLContext ctx;
- int major, minor;
-
- dpy = eglGetDisplay (EGL_DEFAULT_DISPLAY);
- if (! eglInitialize (dpy, &major, &minor)) {
- return NULL;
- }
-
- eglChooseConfig (dpy, config_attribs, &config, 1, &numConfigs);
- if (numConfigs == 0) {
- return NULL;
- }
-
-#if CAIRO_HAS_GL_SURFACE
- eglBindAPI (EGL_OPENGL_API);
-#elif CAIRO_HAS_GLESV2_SURFACE
- eglBindAPI (EGL_OPENGL_ES_API);
-#endif
-
- ctx = eglCreateContext (dpy, config, EGL_NO_CONTEXT,
- ctx_attribs);
- if (ctx == EGL_NO_CONTEXT) {
- eglTerminate (dpy);
- return NULL;
- }
-
- arg = xmalloc (sizeof (struct closure));
- arg->dpy = dpy;
- arg->ctx = ctx;
- device = cairo_egl_device_create (dpy, ctx);
- if (cairo_device_set_user_data (device,
- (cairo_user_data_key_t *) cleanup,
- arg,
- cleanup))
- {
- cleanup (arg);
- return NULL;
- }
-
- surface = cairo_gl_surface_create (device,
- CAIRO_CONTENT_COLOR_ALPHA,
- size, size);
- cairo_device_destroy (device);
-
- return surface;
-}
-
-CAIRO_TEST (egl_surface_source,
- "Test using a EGL surface as the source",
- "source", /* keywords */
- NULL, /* requirements */
- SIZE, SIZE,
- preamble, draw)
diff --git a/test/error-setters.c b/test/error-setters.c
index c69a6d89b..ecbb78fde 100644
--- a/test/error-setters.c
+++ b/test/error-setters.c
@@ -29,9 +29,6 @@
#include "cairo-test.h"
-#if CAIRO_HAS_GL_SURFACE
-#include <cairo-gl.h>
-#endif
#if CAIRO_HAS_PDF_SURFACE
#include <cairo-pdf.h>
#endif
@@ -53,11 +50,6 @@ preamble (cairo_test_context_t *ctx)
/* get the error surface */
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, INT_MAX, INT_MAX);
-#if CAIRO_HAS_GL_SURFACE
- cairo_gl_surface_set_size (surface, 0, 0);
- cairo_gl_surface_swapbuffers (surface);
-#endif
-
#if CAIRO_HAS_PDF_SURFACE
cairo_pdf_surface_restrict_to_version (surface, CAIRO_PDF_VERSION_1_4);
cairo_pdf_surface_set_size (surface, 0, 0);
diff --git a/test/gl-device-release.c b/test/gl-device-release.c
deleted file mode 100644
index 7f554be30..000000000
--- a/test/gl-device-release.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright © 2012 Igalia S.L.
- * Copyright © 2009 Eric Anholt
- * Copyright © 2009 Chris Wilson
- * Copyright © 2005 Red Hat, Inc
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of
- * Chris Wilson not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Chris Wilson makes no representations about the
- * suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * IGALIA S.L. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL CHRIS WILSON BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Martin Robinson <mrobinson@igalia.com>
- */
-
-#include "cairo-test.h"
-#include <cairo-gl.h>
-#include <assert.h>
-
-static Window
-create_test_window (Display *display,
- GLXContext glx_context,
- XVisualInfo *visual_info)
-{
- Colormap colormap;
- XSetWindowAttributes window_attributes;
- Window window = None;
-
- colormap = XCreateColormap (display,
- RootWindow (display, visual_info->screen),
- visual_info->visual,
- AllocNone);
- window_attributes.colormap = colormap;
- window_attributes.border_pixel = 0;
- window = XCreateWindow (display, RootWindow (display, visual_info->screen),
- -1, -1, 1, 1, 0,
- visual_info->depth,
- InputOutput,
- visual_info->visual,
- CWBorderPixel | CWColormap, &window_attributes);
- XFreeColormap (display, colormap);
-
- XFlush (display);
- return window;
-}
-
-static cairo_bool_t
-multithread_makecurrent_available (Display *display)
-{
- const char *extensions = glXQueryExtensionsString (display,
- DefaultScreen (display));
- return !! strstr(extensions, "GLX_MESA_multithread_makecurrent");
-}
-
-static void
-draw_to_surface (cairo_surface_t *surface)
-{
- cairo_t *cr = cairo_create (surface);
- cairo_paint (cr);
- cairo_destroy (cr);
-}
-
-static cairo_test_status_t
-preamble (cairo_test_context_t *test_ctx)
-{
- int rgba_attribs[] = {
- GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- GLX_ALPHA_SIZE, 1,
- GLX_DOUBLEBUFFER,
- None
- };
-
- XVisualInfo *visual_info;
- GLXContext glx_context;
- cairo_device_t *device;
- Display *display;
- Window test_window;
- cairo_surface_t *window_surface;
- cairo_bool_t has_multithread_makecurrent;
-
- display = XOpenDisplay (NULL);
- if (display == NULL)
- return CAIRO_TEST_UNTESTED;
-
- visual_info = glXChooseVisual (display, DefaultScreen (display), rgba_attribs);
- if (visual_info == NULL) {
- XCloseDisplay (display);
- return CAIRO_TEST_UNTESTED;
- }
-
- glx_context = glXCreateContext (display, visual_info, NULL, True);
- if (glx_context == NULL) {
- XCloseDisplay (display);
- return CAIRO_TEST_UNTESTED;
- }
-
- test_window = create_test_window (display, glx_context, visual_info);
- XFree (visual_info);
- if (test_window == None) {
- XCloseDisplay (display);
- return CAIRO_TEST_UNTESTED;
- }
-
- has_multithread_makecurrent = multithread_makecurrent_available (display);
-
- glXMakeCurrent (display, None, None);
-
- /* Creating the device should actually change the GL context, because of
- * the creation/activation of a dummy window used for texture surfaces. */
- device = cairo_glx_device_create (display, glx_context);
-
- /* It's important that when multithread_makecurrent isn't available the
- * Cairo backend clears the current context, so that the dummy texture
- * window is not active while the device is unlocked. */
- if (has_multithread_makecurrent) {
- assert (None != glXGetCurrentDrawable ());
- assert (display == glXGetCurrentDisplay ());
- assert (glx_context == glXGetCurrentContext ());
- } else {
- assert (None == glXGetCurrentDrawable ());
- assert (None == glXGetCurrentDisplay ());
- assert (None == glXGetCurrentContext ());
- }
-
- window_surface = cairo_gl_surface_create_for_window (device, test_window,
- 1, 1);
- assert (cairo_surface_status (window_surface) == CAIRO_STATUS_SUCCESS);
-
- draw_to_surface (window_surface);
- if (has_multithread_makecurrent) {
- assert (test_window == glXGetCurrentDrawable ());
- assert (display == glXGetCurrentDisplay ());
- assert (glx_context == glXGetCurrentContext ());
- } else {
- assert (None == glXGetCurrentDrawable ());
- assert (None == glXGetCurrentDisplay ());
- assert (None == glXGetCurrentContext ());
- }
-
- /* In this case, drawing to the window surface will not change the current
- * GL context, so Cairo setting the current surface and context to none. */
- glXMakeCurrent (display, test_window, glx_context);
- draw_to_surface (window_surface);
- assert (test_window == glXGetCurrentDrawable ());
- assert (display == glXGetCurrentDisplay ());
- assert (glx_context == glXGetCurrentContext ());
-
- /* There should be no context change when destroying the device. */
- cairo_device_destroy (device);
- assert (test_window == glXGetCurrentDrawable ());
- assert (display == glXGetCurrentDisplay ());
- assert (glx_context == glXGetCurrentContext ());
-
- glXDestroyContext(display, glx_context);
- XDestroyWindow (display, test_window);
- XCloseDisplay (display);
-
- return CAIRO_TEST_SUCCESS;
-}
-
-CAIRO_TEST (gl_device_creation_changes_context,
- "Test that using the Cairo GL backend leaves the current GL context in the appropriate state",
- "gl", /* keywords */
- NULL, /* requirements */
- 0, 0,
- preamble, NULL)
diff --git a/test/gl-oversized-surface.c b/test/gl-oversized-surface.c
deleted file mode 100644
index 4c46efd80..000000000
--- a/test/gl-oversized-surface.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright © 2012 Igalia S.L.
- * Copyright © 2009 Eric Anholt
- * Copyright © 2009 Chris Wilson
- * Copyright © 2005 Red Hat, Inc
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of
- * Chris Wilson not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Chris Wilson makes no representations about the
- * suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * IGALIA S.L. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL CHRIS WILSON BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Martin Robinson <mrobinson@igalia.com>
- */
-
-#include "cairo-test.h"
-#include <cairo-gl.h>
-#include <assert.h>
-#include <limits.h>
-
-static cairo_test_status_t
-preamble (cairo_test_context_t *test_ctx)
-{
- int rgba_attribs[] = {
- GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- GLX_ALPHA_SIZE, 1,
- GLX_DOUBLEBUFFER,
- None
- };
-
- Display *display;
- XVisualInfo *visual_info;
- GLXContext glx_context;
- cairo_device_t *device;
- cairo_surface_t *oversized_surface;
- cairo_test_status_t test_status = CAIRO_TEST_SUCCESS;
-
- display = XOpenDisplay (NULL);
- if (display == NULL)
- return CAIRO_TEST_UNTESTED;
-
- visual_info = glXChooseVisual (display, DefaultScreen (display), rgba_attribs);
- if (visual_info == NULL) {
- XCloseDisplay (display);
- return CAIRO_TEST_UNTESTED;
- }
-
- glx_context = glXCreateContext (display, visual_info, NULL, True);
- if (glx_context == NULL) {
- XCloseDisplay (display);
- return CAIRO_TEST_UNTESTED;
- }
-
- device = cairo_glx_device_create (display, glx_context);
-
- oversized_surface = cairo_gl_surface_create (device, CAIRO_CONTENT_COLOR_ALPHA, INT_MAX, INT_MAX);
- if (cairo_surface_status (oversized_surface) != CAIRO_STATUS_INVALID_SIZE)
- test_status = CAIRO_TEST_FAILURE;
-
- cairo_device_destroy (device);
- glXDestroyContext(display, glx_context);
- XCloseDisplay (display);
-
- return test_status;
-}
-
-CAIRO_TEST (gl_oversized_surface,
- "Test that creating a surface beyond texture limits results in an error surface",
- "gl", /* keywords */
- NULL, /* requirements */
- 0, 0,
- preamble, NULL)
diff --git a/test/gl-surface-source.c b/test/gl-surface-source.c
deleted file mode 100644
index 09d4d9c47..000000000
--- a/test/gl-surface-source.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright © 2008 Chris Wilson
- * Copyright © 2010 Intel Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of
- * Chris Wilson not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Chris Wilson makes no representations about the
- * suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * CHRIS WILSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL CHRIS WILSON BE LIABLE FOR ANY SPECIAL,
- * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
- * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Chris Wilson <chris@chris-wilson.co.uk>
- */
-
-#include "cairo-test.h"
-#include <cairo-gl.h>
-
-#include "surface-source.c"
-
-struct closure {
- Display *dpy;
- GLXContext ctx;
-};
-
-static void
-cleanup (void *data)
-{
- struct closure *arg = data;
-
- glXDestroyContext (arg->dpy, arg->ctx);
- XCloseDisplay (arg->dpy);
-
- free (arg);
-}
-
-static cairo_surface_t *
-create_source_surface (int size)
-{
- int rgba_attribs[] = {
- GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- GLX_ALPHA_SIZE, 1,
- GLX_DOUBLEBUFFER,
- None
- };
- XVisualInfo *visinfo;
- GLXContext ctx;
- struct closure *arg;
- cairo_device_t *device;
- cairo_surface_t *surface;
- Display *dpy;
-
- dpy = XOpenDisplay (NULL);
- if (dpy == NULL)
- return NULL;
-
- visinfo = glXChooseVisual (dpy, DefaultScreen (dpy), rgba_attribs);
- if (visinfo == NULL) {
- XCloseDisplay (dpy);
- return NULL;
- }
-
- ctx = glXCreateContext (dpy, visinfo, NULL, True);
- XFree (visinfo);
-
- if (ctx == NULL) {
- XCloseDisplay (dpy);
- return NULL;
- }
-
- arg = xmalloc (sizeof (struct closure));
- arg->dpy = dpy;
- arg->ctx = ctx;
- device = cairo_glx_device_create (dpy, ctx);
- if (cairo_device_set_user_data (device,
- (cairo_user_data_key_t *) cleanup,
- arg,
- cleanup))
- {
- cleanup (arg);
- return NULL;
- }
-
- surface = cairo_gl_surface_create (device,
- CAIRO_CONTENT_COLOR_ALPHA,
- size, size);
- cairo_device_destroy (device);
-
- return surface;
-}
-
-CAIRO_TEST (gl_surface_source,
- "Test using a GL surface as the source",
- "source", /* keywords */
- NULL, /* requirements */
- SIZE, SIZE,
- preamble, draw)
diff --git a/test/meson.build b/test/meson.build
index e5b4f89d5..b18a23f48 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -439,17 +439,6 @@ test_ft_svg_ttx_font_sources = [
'ft-svg-render-color.c'
]
-test_gl_sources = [
- 'gl-device-release.c',
- 'gl-oversized-surface.c',
- 'gl-surface-source.c',
-]
-
-test_egl_sources = [
- 'egl-oversized-surface.c',
- 'egl-surface-source.c',
-]
-
test_quartz_sources = [
'quartz-surface-source.c',
'quartz-color-font.c',
@@ -596,10 +585,6 @@ if feature_conf.get('CAIRO_HAS_XLIB_XRENDER_SURFACE', 0) == 1
test_sources += test_xlib_xrender_sources
endif
-if feature_conf.get('CAIRO_HAS_EGL_FUNCTIONS', 0) == 1
- test_sources += test_egl_sources
-endif
-
if has_multipage_surfaces
test_sources += test_multi_page_sources
endif