Bug 556850 - WebGL compilation busted for Qt builds. r=vladimir
authorOleg Romashin <romaxa@gmail.com>
Wed, 07 Apr 2010 03:53:18 -0400
changeset 40530 6f1a38b947547060aeb6967afb74f632a944d655
parent 40529 e0321787e483d7911834bfebee67811ba0f89c6e
child 40531 6db519c93627697eec2a5398397a6f3188ae1114
push id12650
push userromaxa@gmail.com
push dateWed, 07 Apr 2010 04:02:43 +0000
treeherdermozilla-central@6db519c93627 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvladimir
bugs556850
milestone1.9.3a4pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 556850 - WebGL compilation busted for Qt builds. r=vladimir
content/canvas/src/nsGLPbufferEGL.cpp
--- a/content/canvas/src/nsGLPbufferEGL.cpp
+++ b/content/canvas/src/nsGLPbufferEGL.cpp
@@ -44,17 +44,27 @@
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsIPrefService.h"
 
 #include "gfxContext.h"
 
 #include "glwrap.h"
 
 #ifdef MOZ_X11
+#ifdef MOZ_WIDGET_GTK2
 #include <gdk/gdkx.h>
+#define DISPLAY gdk_x11_get_default_xdisplay
+
+#elif defined(MOZ_WIDGET_QT)
+#ifdef CursorShape
+#undef CursorShape
+#endif
+#include <QX11Info>
+#define DISPLAY QX11Info::display
+#endif
 
 typedef Display* EGLNativeDisplayType;
 typedef Window EGLNativeWindowType;
 typedef Pixmap EGLNativePixmapType;
 #endif
 
 #ifdef WINCE
 typedef HDC EGLNativeDisplayType;
@@ -227,17 +237,17 @@ nsGLPbufferEGL::Init(mozilla::WebGLConte
     gEGLWrap.fGetConfigAttrib(mDisplay, cfg, EGL_NATIVE_VISUAL_ID, &visid);
 
     XVisualInfo vinfo;
     vinfo.visualid = visid;
     int pad;
 
     LogMessage("Visual ID: %d\n", visid);
 
-    XVisualInfo *vf = XGetVisualInfo(gdk_x11_get_default_xdisplay(), VisualIDMask, &vinfo, &pad);
+    XVisualInfo *vf = XGetVisualInfo(DISPLAY(), VisualIDMask, &vinfo, &pad);
 
     if (!vf) {
         LogMessage("Null VisualInfo!");
         return PR_FALSE;
     }
 
     LogMessage("Visual: 0x%08x\n", vf->visual);
 
@@ -344,33 +354,33 @@ nsGLPbufferEGL::Resize(PRInt32 width, PR
 
     mSurface = gEGLWrap.fCreatePbufferSurface(mDisplay, mConfig, attrs);
     if (!mSurface) {
         LogMessage("Canvas 3D: eglCreatePbufferSurface failed");
         return PR_FALSE;
     }
 #else
 
-    mXlibSurface = new gfxXlibSurface(gdk_x11_get_default_xdisplay(),
+    mXlibSurface = new gfxXlibSurface(DISPLAY(),
                                         mVisual,
                                         gfxIntSize(width, height),
                                         32);
     if (!mXlibSurface || mXlibSurface->CairoStatus() != 0) {
 #ifdef DEBUG_vladimir
         fprintf (stderr, "Failed to create gfxXlibSurface");
 #endif
         return PR_FALSE;
     }
 
     LogMessage("Created gfxXlibSurface, Drawable: 0x%08x", mXlibSurface->XDrawable());
 
     // we need to XSync to ensure that the Pixmap is created on the server side,
     // otherwise eglCreatePixmapSurface will fail (because it isn't part of the normal
     // X protocol).
-    XSync(gdk_x11_get_default_xdisplay(), 0);
+    XSync(DISPLAY(), 0);
 
     EGLint attrs[] = {
         EGL_NONE
     };
 
     Pixmap px = (Pixmap) mXlibSurface->XDrawable();
 
     mSurface = gEGLWrap.fCreatePixmapSurface(mDisplay, mConfig, (EGLNativePixmapType) px, attrs);