Bug 814979 - Fennec build fails with Mer SDK: invalid inclusion of GLXLibrary.h. r=glandium,mattwoodrow
authorOleg Romashin <romaxa@gmail.com>
Mon, 26 Nov 2012 00:08:22 -0800
changeset 114134 5f4ff39ef24f8e2f1617bc725376767c9c28cfe9
parent 114133 45c61a3e967863e83f9f7f704ade5b2824b4f344
child 114135 537865efa1821d4d4064f0e8857bf6bb19f1e327
push id23906
push userryanvm@gmail.com
push dateTue, 27 Nov 2012 01:52:32 +0000
treeherdermozilla-central@1489b6c2d1d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, mattwoodrow
bugs814979
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 814979 - Fennec build fails with Mer SDK: invalid inclusion of GLXLibrary.h. r=glandium,mattwoodrow
configure.in
gfx/layers/opengl/CanvasLayerOGL.cpp
gfx/layers/opengl/CanvasLayerOGL.h
gfx/layers/opengl/ImageLayerOGL.cpp
gfx/thebes/gfxXlibSurface.cpp
gfx/thebes/gfxXlibSurface.h
--- a/configure.in
+++ b/configure.in
@@ -6699,16 +6699,17 @@ MOZ_ARG_WITH_STRING(gl-provider,
     MOZ_GL_PROVIDER="$val"])
 
 if test -n "$MOZ_GL_PROVIDER"; then
 MOZ_GL_DEFAULT_PROVIDER=$MOZ_GL_PROVIDER
 AC_SUBST(MOZ_GL_PROVIDER)
 AC_DEFINE_UNQUOTED(MOZ_GL_PROVIDER, GLContextProvider$MOZ_GL_PROVIDER)
 fi
 AC_SUBST(MOZ_GL_DEFAULT_PROVIDER)
+AC_DEFINE_UNQUOTED(GL_PROVIDER_$MOZ_GL_DEFAULT_PROVIDER)
 
 dnl ========================================================
 dnl = faststripe theme
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(faststripe,
 [  --enable-faststripe     Use faststripe theme],
     MOZ_THEME_FASTSTRIPE=1,
     MOZ_THEME_FASTSTRIPE= )
--- a/gfx/layers/opengl/CanvasLayerOGL.cpp
+++ b/gfx/layers/opengl/CanvasLayerOGL.cpp
@@ -124,17 +124,17 @@ CanvasLayerOGL::Initialize(const Data& a
     return;
   } else if (aData.mDrawTarget) {
     mDrawTarget = aData.mDrawTarget;
     mCanvasSurface = gfxPlatform::GetPlatform()->GetThebesSurfaceForDrawTarget(mDrawTarget);
     mNeedsYFlip = false;
   } else if (aData.mSurface) {
     mCanvasSurface = aData.mSurface;
     mNeedsYFlip = false;
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
     if (aData.mSurface->GetType() == gfxASurface::SurfaceTypeXlib) {
         gfxXlibSurface *xsurf = static_cast<gfxXlibSurface*>(aData.mSurface);
         mPixmap = xsurf->GetGLXPixmap();
         if (mPixmap) {
             if (aData.mSurface->GetContentType() == gfxASurface::CONTENT_COLOR_ALPHA) {
                 mLayerProgram = gl::RGBALayerProgramType;
             } else {
                 mLayerProgram = gl::RGBXLayerProgramType;
@@ -183,17 +183,17 @@ CanvasLayerOGL::UpdateSurface()
   if (!IsDirty())
     return;
   Painted();
 
   if (mDestroyed || mDelayedUpdates) {
     return;
   }
 
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
   if (mPixmap) {
     return;
   }
 #endif
 
   if (mCanvasGLContext) {
     mCanvasGLContext->MakeCurrent();
   }
@@ -303,17 +303,17 @@ CanvasLayerOGL::RenderLayer(int aPreviou
                                    true,
                                    drawRect.TopLeft());
   }
 
   if (!program) {
     program = mOGLManager->GetProgram(mLayerProgram, GetMaskLayer());
   }
 
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
   if (mPixmap && !mDelayedUpdates) {
     sDefGLXLib.BindTexImage(mPixmap);
   }
 #endif
 
   gl()->ApplyFilterToBoundTexture(mFilter);
 
   program->Activate();
@@ -329,17 +329,17 @@ CanvasLayerOGL::RenderLayer(int aPreviou
   program->LoadMask(GetMaskLayer());
 
   if (gl()->CanUploadNonPowerOfTwo()) {
     mOGLManager->BindAndDrawQuad(program, mNeedsYFlip ? true : false);
   } else {
     mOGLManager->BindAndDrawQuadWithTextureRect(program, drawRect, drawRect.Size());
   }
 
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
   if (mPixmap && !mDelayedUpdates) {
     sDefGLXLib.ReleaseTexImage(mPixmap);
   }
 #endif
 
   if (useGLContext) {
     gl()->UnbindTex2DOffscreen(mCanvasGLContext);
   }
--- a/gfx/layers/opengl/CanvasLayerOGL.h
+++ b/gfx/layers/opengl/CanvasLayerOGL.h
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_CANVASLAYEROGL_H
 #define GFX_CANVASLAYEROGL_H
 
 
 #include "LayerManagerOGL.h"
 #include "gfxASurface.h"
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
 #include "GLXLibrary.h"
 #include "mozilla/X11Util.h"
 #endif
 
 #include "mozilla/Preferences.h"
 
 namespace mozilla {
 namespace layers {
@@ -26,17 +26,17 @@ class THEBES_API CanvasLayerOGL :
 public:
   CanvasLayerOGL(LayerManagerOGL *aManager)
     : CanvasLayer(aManager, NULL),
       LayerOGL(aManager),
       mLayerProgram(gl::RGBALayerProgramType),
       mTexture(0),
       mTextureTarget(LOCAL_GL_TEXTURE_2D),
       mDelayedUpdates(false)
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
       ,mPixmap(0)
 #endif
   { 
       mImplData = static_cast<LayerOGL*>(this);
       mForceReadback = Preferences::GetBool("webgl.force-layers-readback", false);
   }
   ~CanvasLayerOGL() { Destroy(); }
 
@@ -60,17 +60,17 @@ protected:
 
   GLuint mTexture;
   GLenum mTextureTarget;
 
   bool mDelayedUpdates;
   bool mGLBufferIsPremultiplied;
   bool mNeedsYFlip;
   bool mForceReadback;
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
   GLXPixmap mPixmap;
 #endif
 
   nsRefPtr<gfxImageSurface> mCachedTempSurface;
   gfxIntSize mCachedSize;
   gfxASurface::gfxImageFormat mCachedFormat;
 
   gfxImageSurface* GetTempSurface(const gfxIntSize& aSize,
--- a/gfx/layers/opengl/ImageLayerOGL.cpp
+++ b/gfx/layers/opengl/ImageLayerOGL.cpp
@@ -9,17 +9,17 @@
 #include "ImageContainer.h" // for PlanarYCBCRImage
 #include "mozilla/layers/ShmemYCbCrImage.h"
 #include "ipc/AutoOpenSurface.h"
 #include "ImageLayerOGL.h"
 #include "gfxImageSurface.h"
 #include "gfxUtils.h"
 #include "yuv_convert.h"
 #include "GLContextProvider.h"
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
 # include "GLXLibrary.h"
 # include "gfxXlibSurface.h"
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
 #include "nsSurfaceTexture.h"
 #endif
 
@@ -556,17 +556,17 @@ ImageLayerOGL::AllocateTexturesCairo(Cai
   mozilla::gl::GLContext *gl = texture.GetGLContext();
   gl->MakeCurrent();
 
   GLuint tex = texture.GetTextureID();
   gl->fActiveTexture(LOCAL_GL_TEXTURE0);
 
   SetClamping(gl, tex);
 
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
   if (aImage->mSurface->GetType() == gfxASurface::SurfaceTypeXlib) {
     gfxXlibSurface *xsurf =
       static_cast<gfxXlibSurface*>(aImage->mSurface.get());
     GLXPixmap pixmap = xsurf->GetGLXPixmap();
     if (pixmap) {
       if (aImage->mSurface->GetContentType()
           == gfxASurface::CONTENT_COLOR_ALPHA) {
         backendData->mLayerProgram = gl::RGBALayerProgramType;
--- a/gfx/thebes/gfxXlibSurface.cpp
+++ b/gfx/thebes/gfxXlibSurface.cpp
@@ -18,43 +18,43 @@ using namespace mozilla;
 
 // Although the dimension parameters in the xCreatePixmapReq wire protocol are
 // 16-bit unsigned integers, the server's CreatePixmap returns BadAlloc if
 // either dimension cannot be represented by a 16-bit *signed* integer.
 #define XLIB_IMAGE_SIDE_SIZE_LIMIT 0x7fff
 
 gfxXlibSurface::gfxXlibSurface(Display *dpy, Drawable drawable, Visual *visual)
     : mPixmapTaken(false), mDisplay(dpy), mDrawable(drawable)
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
     , mGLXPixmap(None)
 #endif
 {
     DoSizeQuery();
     cairo_surface_t *surf = cairo_xlib_surface_create(dpy, drawable, visual, mSize.width, mSize.height);
     Init(surf);
 }
 
 gfxXlibSurface::gfxXlibSurface(Display *dpy, Drawable drawable, Visual *visual, const gfxIntSize& size)
     : mPixmapTaken(false), mDisplay(dpy), mDrawable(drawable), mSize(size)
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
     , mGLXPixmap(None)
 #endif
 {
     NS_ASSERTION(CheckSurfaceSize(size, XLIB_IMAGE_SIDE_SIZE_LIMIT),
                  "Bad size");
 
     cairo_surface_t *surf = cairo_xlib_surface_create(dpy, drawable, visual, mSize.width, mSize.height);
     Init(surf);
 }
 
 gfxXlibSurface::gfxXlibSurface(Screen *screen, Drawable drawable, XRenderPictFormat *format,
                                const gfxIntSize& size)
     : mPixmapTaken(false), mDisplay(DisplayOfScreen(screen)),
       mDrawable(drawable), mSize(size)
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
       , mGLXPixmap(None)
 #endif
 {
     NS_ASSERTION(CheckSurfaceSize(size, XLIB_IMAGE_SIDE_SIZE_LIMIT),
                  "Bad Size");
 
     cairo_surface_t *surf =
         cairo_xlib_surface_create_with_xrender_format(mDisplay, drawable,
@@ -62,32 +62,32 @@ gfxXlibSurface::gfxXlibSurface(Screen *s
                                                       mSize.width, mSize.height);
     Init(surf);
 }
 
 gfxXlibSurface::gfxXlibSurface(cairo_surface_t *csurf)
     : mPixmapTaken(false),
       mSize(cairo_xlib_surface_get_width(csurf),
             cairo_xlib_surface_get_height(csurf))
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
       , mGLXPixmap(None)
 #endif
 {
     NS_PRECONDITION(cairo_surface_status(csurf) == 0,
                     "Not expecting an error surface");
 
     mDrawable = cairo_xlib_surface_get_drawable(csurf);
     mDisplay = cairo_xlib_surface_get_display(csurf);
 
     Init(csurf, true);
 }
 
 gfxXlibSurface::~gfxXlibSurface()
 {
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
     if (mGLXPixmap) {
         gl::sDefGLXLib.DestroyPixmap(mGLXPixmap);
     }
 #endif
     // gfxASurface's destructor calls RecordMemoryFreed().
     if (mPixmapTaken) {
         XFreePixmap (mDisplay, mDrawable);
     }
@@ -212,17 +212,17 @@ gfxXlibSurface::CreateSimilarSurface(gfx
     }
 
     return gfxASurface::CreateSimilarSurface(aContent, aSize);
 }
 
 void
 gfxXlibSurface::Finish()
 {
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
     if (mGLXPixmap) {
         gl::sDefGLXLib.DestroyPixmap(mGLXPixmap);
         mGLXPixmap = None;
     }
 #endif
     gfxASurface::Finish();
 }
 
@@ -513,17 +513,17 @@ gfxXlibSurface::XScreen()
 }
 
 XRenderPictFormat*
 gfxXlibSurface::XRenderFormat()
 {
     return cairo_xlib_surface_get_xrender_format(CairoSurface());
 }
 
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
 GLXPixmap
 gfxXlibSurface::GetGLXPixmap()
 {
     if (!mGLXPixmap) {
 #ifdef DEBUG
         // cairo_surface_has_show_text_glyphs is used solely for the
         // side-effect of setting the error on surface if
         // cairo_surface_finish() has been called.
--- a/gfx/thebes/gfxXlibSurface.h
+++ b/gfx/thebes/gfxXlibSurface.h
@@ -6,17 +6,17 @@
 #ifndef GFX_XLIBSURFACE_H
 #define GFX_XLIBSURFACE_H
 
 #include "gfxASurface.h"
 
 #include <X11/extensions/Xrender.h>
 #include <X11/Xlib.h>
 
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
 #include "GLXLibrary.h"
 #endif
 
 class THEBES_API gfxXlibSurface : public gfxASurface {
 public:
     // construct a wrapper around the specified drawable with dpy/visual.
     // Will use XGetGeometry to query the window/pixmap size.
     gfxXlibSurface(Display *dpy, Drawable drawable, Visual *visual);
@@ -71,17 +71,17 @@ public:
 
     // Find a visual and colormap pair suitable for rendering to this surface.
     bool GetColormapAndVisual(Colormap* colormap, Visual **visual);
 
     // This surface is a wrapper around X pixmaps, which are stored in the X
     // server, not the main application.
     virtual gfxASurface::MemoryLocation GetMemoryLocation() const;
 
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
     GLXPixmap GetGLXPixmap();
 #endif
 
     // Return true if cairo will take its slow path when this surface is used
     // in a pattern with EXTEND_PAD.  As a workaround for XRender's RepeatPad
     // not being implemented correctly on old X servers, cairo avoids XRender
     // and instead reads back to perform EXTEND_PAD with pixman.  Cairo does
     // this for servers older than xorg-server 1.7.
@@ -98,14 +98,14 @@ protected:
     
     Display *mDisplay;
     Drawable mDrawable;
 
     void DoSizeQuery();
 
     gfxIntSize mSize;
 
-#if !defined(MOZ_PLATFORM_MAEMO)
+#if defined(GL_PROVIDER_GLX)
     GLXPixmap mGLXPixmap;
 #endif
 };
 
 #endif /* GFX_XLIBSURFACE_H */