Bug 788042 - Use MOZ_X11 instead of MOZ_WIDGET_GTK2 under gfx/layers. r=karlt
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Tue, 04 Sep 2012 21:01:57 -0400
changeset 106336 4e1c9887f87d20afc5746cc707f1533f79cc77c6
parent 106335 5567d9cccba45b68bbe46c62c5b97ee8c0a5900d
child 106337 bc9be79a2eeb1883b19f3cab74ce821c7b45be95
push id58
push usershu@rfrn.org
push dateFri, 07 Sep 2012 18:20:16 +0000
reviewerskarlt
bugs788042
milestone18.0a1
Bug 788042 - Use MOZ_X11 instead of MOZ_WIDGET_GTK2 under gfx/layers. r=karlt
gfx/layers/opengl/CanvasLayerOGL.cpp
gfx/layers/opengl/CanvasLayerOGL.h
--- a/gfx/layers/opengl/CanvasLayerOGL.cpp
+++ b/gfx/layers/opengl/CanvasLayerOGL.cpp
@@ -79,17 +79,17 @@ CanvasLayerOGL::Initialize(const Data& a
 
   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_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
     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;
@@ -175,17 +175,17 @@ CanvasLayerOGL::UpdateSurface()
   if (!mDirty)
     return;
   mDirty = false;
 
   if (mDestroyed || mDelayedUpdates) {
     return;
   }
 
-#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
   if (mPixmap) {
     return;
   }
 #endif
 
   if (mCanvasGLContext) {
     mCanvasGLContext->MakeCurrent();
   }
@@ -281,17 +281,17 @@ CanvasLayerOGL::RenderLayer(int aPreviou
                                    true,
                                    drawRect.TopLeft());
   }
 
   if (!program) {
     program = mOGLManager->GetProgram(mLayerProgram, GetMaskLayer());
   }
 
-#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
   if (mPixmap && !mDelayedUpdates) {
     sGLXLibrary.BindTexImage(mPixmap);
   }
 #endif
 
   gl()->ApplyFilterToBoundTexture(mFilter);
 
   program->Activate();
@@ -307,17 +307,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_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
   if (mPixmap && !mDelayedUpdates) {
     sGLXLibrary.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_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
 #include "GLXLibrary.h"
 #include "mozilla/X11Util.h"
 #endif
 
 #include "mozilla/Preferences.h"
 
 namespace mozilla {
 namespace layers {
@@ -25,17 +25,17 @@ class THEBES_API CanvasLayerOGL :
 {
 public:
   CanvasLayerOGL(LayerManagerOGL *aManager)
     : CanvasLayer(aManager, NULL),
       LayerOGL(aManager),
       mTexture(0),
       mTextureTarget(LOCAL_GL_TEXTURE_2D),
       mDelayedUpdates(false)
-#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
       ,mPixmap(0)
 #endif
   { 
       mImplData = static_cast<LayerOGL*>(this);
       mForceReadback = Preferences::GetBool("webgl.force-layers-readback", false);
   }
   ~CanvasLayerOGL() { Destroy(); }
 
@@ -59,17 +59,17 @@ protected:
 
   GLuint mTexture;
   GLenum mTextureTarget;
 
   bool mDelayedUpdates;
   bool mGLBufferIsPremultiplied;
   bool mNeedsYFlip;
   bool mForceReadback;
-#if defined(MOZ_WIDGET_GTK2) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
   GLXPixmap mPixmap;
 #endif
 
   nsRefPtr<gfxImageSurface> mCachedTempSurface;
   gfxIntSize mCachedSize;
   gfxASurface::gfxImageFormat mCachedFormat;
 
   gfxImageSurface* GetTempSurface(const gfxIntSize& aSize,