[cogl/wip/runtime-egl-platform: 2/12] Remove CoglXlibDisplay



commit 9230e1964707d4ba22ba949eb00e304ec304435b
Author: Neil Roberts <neil linux intel com>
Date:   Mon Dec 12 13:46:45 2011 +0000

    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.

 cogl/Makefile.am                      |    1 -
 cogl/cogl-glx-display-private.h       |    4 +--
 cogl/cogl-xlib-display-private.h      |   35 ---------------------------------
 cogl/winsys/cogl-winsys-egl-private.h |    3 +-
 cogl/winsys/cogl-winsys-egl.c         |   13 ++++-------
 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 c0eac28..7deea82 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 f422842..d302369 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/winsys/cogl-winsys-egl-private.h b/cogl/winsys/cogl-winsys-egl-private.h
index cd0896f..9d51d12 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 f3141c9..4ae4587 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 e1dbdbe..107829f 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]