diff options
author | Neil Roberts <neil@linux.intel.com> | 2011-12-12 13:46:45 +0000 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2011-12-12 16:14:18 +0000 |
commit | 7f74712a79fba503e279b8c02e5efb5308ea6827 (patch) | |
tree | e620effb5eb9ca52bdd2e8b596a01f9796b72830 | |
parent | a8f84af7760e5927111a3610bf0b8f8529b8f8d6 (diff) | |
download | cogl-7f74712a79fba503e279b8c02e5efb5308ea6827.tar.gz |
Remove CoglXlibDisplay
CoglXlibDisplay just contained one member called dummy_xwin. This was
not shared outside of the respective winsys's so I don't think it
really makes sense to have a separate shared struct for it. It seems
more like an implementation detail that is specific to the winsys
because for example it may be that the EGL winsys could use the
surfaceless extension and not bother with a dummy window. This will
also make it easier to factor out the Xlib-specific data in
CoglDisplayEGL to the platform data.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
-rw-r--r-- | cogl/Makefile.am | 1 | ||||
-rw-r--r-- | cogl/cogl-glx-display-private.h | 4 | ||||
-rw-r--r-- | cogl/cogl-xlib-display-private.h | 35 | ||||
-rw-r--r-- | cogl/winsys/cogl-winsys-egl-private.h | 3 | ||||
-rw-r--r-- | cogl/winsys/cogl-winsys-egl.c | 13 | ||||
-rw-r--r-- | cogl/winsys/cogl-winsys-glx.c | 18 |
6 files changed, 14 insertions, 60 deletions
diff --git a/cogl/Makefile.am b/cogl/Makefile.am index c0eac283..7deea825 100644 --- a/cogl/Makefile.am +++ b/cogl/Makefile.am @@ -351,7 +351,6 @@ cogl_sources_c += \ $(srcdir)/cogl-x11-renderer-private.h \ $(srcdir)/cogl-xlib-renderer-private.h \ $(srcdir)/cogl-xlib-renderer.c \ - $(srcdir)/cogl-xlib-display-private.h \ $(srcdir)/cogl-xlib.c \ $(srcdir)/cogl-xlib-private.h \ $(srcdir)/winsys/cogl-texture-pixmap-x11.c \ diff --git a/cogl/cogl-glx-display-private.h b/cogl/cogl-glx-display-private.h index f4228421..d3023699 100644 --- a/cogl/cogl-glx-display-private.h +++ b/cogl/cogl-glx-display-private.h @@ -26,7 +26,6 @@ #define __COGL_DISPLAY_GLX_PRIVATE_H #include "cogl-object-private.h" -#include "cogl-xlib-display-private.h" typedef struct _CoglGLXCachedConfig { @@ -41,8 +40,6 @@ typedef struct _CoglGLXCachedConfig typedef struct _CoglGLXDisplay { - CoglXlibDisplay _parent; - CoglGLXCachedConfig glx_cached_configs[COGL_GLX_N_CACHED_CONFIGS]; gboolean found_fbconfig; @@ -52,6 +49,7 @@ typedef struct _CoglGLXDisplay /* Single context for all wins */ GLXContext glx_context; GLXWindow dummy_glxwin; + Window dummy_xwin; } CoglGLXDisplay; #endif /* __COGL_DISPLAY_GLX_PRIVATE_H */ diff --git a/cogl/cogl-xlib-display-private.h b/cogl/cogl-xlib-display-private.h deleted file mode 100644 index 80c30f2f..00000000 --- a/cogl/cogl-xlib-display-private.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Cogl - * - * An object oriented GL/GLES Abstraction/Utility Layer - * - * Copyright (C) 2011 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - * - * - */ - -#ifndef __COGL_DISPLAY_XLIB_PRIVATE_H -#define __COGL_DISPLAY_XLIB_PRIVATE_H - -#include <X11/Xlib.h> - -typedef struct _CoglXlibDisplay -{ - Window dummy_xwin; -} CoglXlibDisplay; - -#endif /* __COGL_DISPLAY_XLIB_PRIVATE_H */ diff --git a/cogl/winsys/cogl-winsys-egl-private.h b/cogl/winsys/cogl-winsys-egl-private.h index cd0896f2..9d51d125 100644 --- a/cogl/winsys/cogl-winsys-egl-private.h +++ b/cogl/winsys/cogl-winsys-egl-private.h @@ -30,7 +30,6 @@ #include "cogl-context-private.h" #ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT #include "cogl-xlib-renderer-private.h" -#include "cogl-xlib-display-private.h" #endif #ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT #include <wayland-client.h> @@ -106,7 +105,7 @@ typedef struct _CoglRendererEGL typedef struct _CoglDisplayEGL { #ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT - CoglXlibDisplay _parent; + Window dummy_xwin; #endif EGLContext egl_context; diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c index f3141c94..4ae45871 100644 --- a/cogl/winsys/cogl-winsys-egl.c +++ b/cogl/winsys/cogl-winsys-egl.c @@ -42,7 +42,6 @@ #include "cogl-onscreen-template-private.h" #ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT #include "cogl-xlib-renderer-private.h" -#include "cogl-xlib-display-private.h" #include "cogl-xlib-renderer.h" #endif @@ -571,7 +570,6 @@ try_create_context (CoglDisplay *display, CoglRenderer *renderer = display->renderer; CoglDisplayEGL *egl_display = display->winsys; #ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT - CoglXlibDisplay *xlib_display = display->winsys; CoglXlibRenderer *xlib_renderer = _cogl_xlib_renderer_get_data (renderer); #endif @@ -659,7 +657,7 @@ try_create_context (CoglDisplay *display, AllocNone); attrs.border_pixel = 0; - xlib_display->dummy_xwin = + egl_display->dummy_xwin = XCreateWindow (xlib_renderer->xdpy, DefaultRootWindow (xlib_renderer->xdpy), -100, -100, 1, 1, @@ -677,7 +675,7 @@ try_create_context (CoglDisplay *display, egl_display->dummy_surface = eglCreateWindowSurface (edpy, egl_display->egl_config, - (NativeWindowType) xlib_display->dummy_xwin, + (NativeWindowType) egl_display->dummy_xwin, NULL); if (egl_display->dummy_surface == EGL_NO_SURFACE) @@ -882,7 +880,6 @@ cleanup_context (CoglDisplay *display) CoglDisplayEGL *egl_display = display->winsys; CoglRendererEGL *egl_renderer = renderer->winsys; #ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT - CoglXlibDisplay *xlib_display = display->winsys; CoglXlibRenderer *xlib_renderer = _cogl_xlib_renderer_get_data (renderer); #endif @@ -924,10 +921,10 @@ cleanup_context (CoglDisplay *display) egl_display->dummy_surface = EGL_NO_SURFACE; } - if (xlib_display->dummy_xwin) + if (egl_display->dummy_xwin) { - XDestroyWindow (xlib_renderer->xdpy, xlib_display->dummy_xwin); - xlib_display->dummy_xwin = None; + XDestroyWindow (xlib_renderer->xdpy, egl_display->dummy_xwin); + egl_display->dummy_xwin = None; } break; #endif diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c index e1dbdbe1..107829f9 100644 --- a/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/winsys/cogl-winsys-glx.c @@ -39,7 +39,6 @@ #include "cogl-renderer-private.h" #include "cogl-glx-renderer-private.h" #include "cogl-onscreen-template-private.h" -#include "cogl-xlib-display-private.h" #include "cogl-glx-display-private.h" #include "cogl-private.h" #include "cogl-texture-2d-private.h" @@ -583,7 +582,6 @@ static gboolean create_context (CoglDisplay *display, GError **error) { CoglGLXDisplay *glx_display = display->winsys; - CoglXlibDisplay *xlib_display = display->winsys; CoglXlibRenderer *xlib_renderer = _cogl_xlib_renderer_get_data (display->renderer); CoglGLXRenderer *glx_renderer = display->renderer->winsys; @@ -661,7 +659,7 @@ create_context (CoglDisplay *display, GError **error) AllocNone); attrs.border_pixel = 0; - xlib_display->dummy_xwin = + glx_display->dummy_xwin = XCreateWindow (xlib_renderer->xdpy, DefaultRootWindow (xlib_renderer->xdpy), -100, -100, 1, 1, @@ -680,14 +678,14 @@ create_context (CoglDisplay *display, GError **error) glx_display->dummy_glxwin = glx_renderer->glXCreateWindow (xlib_renderer->xdpy, config, - xlib_display->dummy_xwin, + glx_display->dummy_xwin, NULL); } if (glx_display->dummy_glxwin) dummy_drawable = glx_display->dummy_glxwin; else - dummy_drawable = xlib_display->dummy_xwin; + dummy_drawable = glx_display->dummy_xwin; COGL_NOTE (WINSYS, "Selecting dummy 0x%x for the GLX context", (unsigned int) dummy_drawable); @@ -714,7 +712,6 @@ static void _cogl_winsys_display_destroy (CoglDisplay *display) { CoglGLXDisplay *glx_display = display->winsys; - CoglXlibDisplay *xlib_display = display->winsys; CoglXlibRenderer *xlib_renderer = _cogl_xlib_renderer_get_data (display->renderer); CoglGLXRenderer *glx_renderer = display->renderer->winsys; @@ -737,10 +734,10 @@ _cogl_winsys_display_destroy (CoglDisplay *display) glx_display->dummy_glxwin = None; } - if (xlib_display->dummy_xwin) + if (glx_display->dummy_xwin) { - XDestroyWindow (xlib_renderer->xdpy, xlib_display->dummy_xwin); - xlib_display->dummy_xwin = None; + XDestroyWindow (xlib_renderer->xdpy, glx_display->dummy_xwin); + glx_display->dummy_xwin = None; } g_slice_free (CoglGLXDisplay, display->winsys); @@ -1028,7 +1025,6 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen) { CoglContext *context = COGL_FRAMEBUFFER (onscreen)->context; CoglContextGLX *glx_context = context->winsys; - CoglXlibDisplay *xlib_display = context->display->winsys; CoglGLXDisplay *glx_display = context->display->winsys; CoglXlibRenderer *xlib_renderer = _cogl_xlib_renderer_get_data (context->display->renderer); @@ -1042,7 +1038,7 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen) { drawable = glx_display->dummy_glxwin ? - glx_display->dummy_glxwin : xlib_display->dummy_xwin; + glx_display->dummy_glxwin : glx_display->dummy_xwin; if (glx_context->current_drawable == drawable) return; |