Bug 860446: Properly readback from WebGL with B2G. r=bjacob
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 11 Apr 2013 12:37:07 -0400
changeset 128830 e82da4f52af889a3e5f665b159ffa365cfe1dd28
parent 128829 6248d561a9788f9acb506842760b7f63cee86ec8
child 128831 ed781d87fc46957d7803d1b0692b3010fa257cb7
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersbjacob
bugs860446
milestone23.0a1
Bug 860446: Properly readback from WebGL with B2G. r=bjacob
gfx/layers/basic/BasicCanvasLayer.h
gfx/layers/opengl/TextureHostOGL.cpp
gfx/layers/opengl/TextureHostOGL.h
--- a/gfx/layers/basic/BasicCanvasLayer.h
+++ b/gfx/layers/basic/BasicCanvasLayer.h
@@ -143,17 +143,17 @@ public:
 private:
   BasicShadowLayerManager* BasicManager()
   {
     return static_cast<BasicShadowLayerManager*>(mManager);
   }
 
   CompositableType GetCompositableClientType()
   {
-    if (mGLContext) {
+    if (mGLContext && XRE_GetProcessType() == GeckoProcessType_Default) {
       return BUFFER_IMAGE_BUFFERED;
     }
     return BUFFER_IMAGE_SINGLE;
   }
 
   bool mBufferIsOpaque;
   RefPtr<CanvasClient> mCanvasClient;
 };
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -642,16 +642,22 @@ void GrallocTextureHostOGL::BindTexture(
   MOZ_ASSERT(mGLTexture);
 
   mGL->MakeCurrent();
   mGL->fActiveTexture(aTextureUnit);
   mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, mGLTexture);
   mGL->fActiveTexture(LOCAL_GL_TEXTURE0);
 }
 
+bool
+GrallocTextureHostOGL::IsValid() const
+{
+  return !!mGraphicBuffer.get();
+}
+
 GrallocTextureHostOGL::~GrallocTextureHostOGL()
 {
   DeleteTextures();
 }
 
 bool
 GrallocTextureHostOGL::Lock()
 {
--- a/gfx/layers/opengl/TextureHostOGL.h
+++ b/gfx/layers/opengl/TextureHostOGL.h
@@ -577,21 +577,17 @@ public:
            : gl::RGBALayerProgramType;
   }
 
   GLenum GetWrapMode() const MOZ_OVERRIDE
   {
     return LOCAL_GL_CLAMP_TO_EDGE;
   }
 
-
-  bool IsValid() const MOZ_OVERRIDE
-  {
-    return !!mGLTexture;
-  }
+  bool IsValid() const MOZ_OVERRIDE;
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   virtual const char* Name() { return "GrallocTextureHostOGL"; }
 #endif
 
   void BindTexture(GLenum aTextureUnit) MOZ_OVERRIDE;
 
   virtual gfx::SurfaceFormat GetFormat() const;