Backed out changeset a23a23055e13 (bug 863498) for compilation failures on a CLOSED TREE
authorEd Morley <emorley@mozilla.com>
Thu, 09 May 2013 17:31:59 +0100
changeset 131735 59fe6fbf1adfdebed604b3aab0695d2304416367
parent 131734 8a44a72db55bd422467b2f57db24e7242cce444d
child 131736 0f05638c8f26579812daae21af7bf72613182525
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
bugs863498
milestone23.0a1
backs outa23a23055e1370d6420649ee491ec1d6415602a5
Backed out changeset a23a23055e13 (bug 863498) for compilation failures on a CLOSED TREE
gfx/layers/opengl/TextureHostOGL.cpp
gfx/layers/opengl/TextureHostOGL.h
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -258,16 +258,17 @@ SharedTextureHostOGL::SwapTexturesImpl(c
   mShareType = texture.shareType();
   mSharedHandle = newHandle;
 
   GLContext::SharedHandleDetails handleDetails;
   if (mSharedHandle && mGL->GetSharedHandleDetails(mShareType, mSharedHandle, handleDetails)) {
     mTextureTarget = handleDetails.mTarget;
     mShaderProgram = handleDetails.mProgramType;
     mFormat = FormatFromShaderType(mShaderProgram);
+    mTextureTransform = handleDetails.mTextureTransform;
   }
 }
 
 bool
 SharedTextureHostOGL::Lock()
 {
   MakeTextureIfNeeded(mGL, mTextureHandle);
 
@@ -283,30 +284,16 @@ SharedTextureHostOGL::Lock()
 
 void
 SharedTextureHostOGL::Unlock()
 {
   mGL->DetachSharedHandle(mShareType, mSharedHandle);
   mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, 0);
 }
 
-
-gfx3DMatrix
-SharedTextureHostOGL::GetTextureTransform() MOZ_OVERRIDE
-{
-  GLContext::SharedHandleDetails handleDetails;
-  // GetSharedHandleDetails can call into Java which we'd
-  // rather not do from the compositor
-  if (mSharedHandle) {
-    mGL->GetSharedHandleDetails(mShareType, mSharedHandle, handleDetails);
-  }
-  return handleDetails.mTextureTransform;
-}
-
-
 void
 SurfaceStreamHostOGL::SetCompositor(Compositor* aCompositor)
 {
   CompositorOGL* glCompositor = static_cast<CompositorOGL*>(aCompositor);
   if (mGL && !glCompositor) {
     DeleteTextures();
   }
   mGL = glCompositor ? glCompositor->gl() : nullptr;
--- a/gfx/layers/opengl/TextureHostOGL.h
+++ b/gfx/layers/opengl/TextureHostOGL.h
@@ -46,17 +46,17 @@ public:
   virtual void BindTexture(GLenum aTextureUnit) = 0;
   virtual gfx::IntSize GetSize() const = 0;
   virtual gl::ShaderProgramType GetShaderProgram() const {
     MOZ_NOT_REACHED("unhandled shader type");
   }
   // TODO: Noone's implementing this anymore, should see if we need this.
   virtual GLenum GetTextureTarget() const { return LOCAL_GL_TEXTURE_2D; }
   virtual GLenum GetWrapMode() const = 0;// { return LOCAL_GL_CLAMP_TO_EDGE; } // default
-  virtual gfx3DMatrix GetTextureTransform() { return gfx3DMatrix(); }
+  virtual gfx3DMatrix GetTextureTransform() const { return gfx3DMatrix(); }
 };
 
 inline gl::ShaderProgramType
 GetProgramTypeForTexture(const TextureHost *aTextureHost)
 {
   switch (aTextureHost->GetFormat()) {
   case gfx::FORMAT_B8G8R8A8:
     return gl::BGRALayerProgramType;;
@@ -355,33 +355,37 @@ public:
   GLuint GetTextureID() { return mTextureHandle; }
   ContentType GetContentType()
   {
     return (mFormat == gfx::FORMAT_B8G8R8A8) ?
              gfxASurface::CONTENT_COLOR_ALPHA :
              gfxASurface::CONTENT_COLOR;
   }
 
-  virtual gfx3DMatrix GetTextureTransform() MOZ_OVERRIDE;
+  virtual gfx3DMatrix GetTextureTransform() const MOZ_OVERRIDE
+  {
+    return mTextureTransform;
+  }
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   virtual const char* Name() { return "SharedTextureHostOGL"; }
 #endif
 
 protected:
   void DeleteTextures();
 
   gfx::IntSize mSize;
   nsRefPtr<gl::GLContext> mGL;
   GLuint mTextureHandle;
   GLenum mWrapMode;
   GLenum mTextureTarget;
   gl::SharedTextureHandle mSharedHandle;
   gl::ShaderProgramType mShaderProgram;
   gl::GLContext::SharedTextureShareType mShareType;
+  gfx3DMatrix mTextureTransform;
 };
 
 class SurfaceStreamHostOGL : public TextureHost
                            , public TextureSourceOGL
 {
 public:
   typedef gfxASurface::gfxContentType ContentType;
   typedef mozilla::gl::GLContext GLContext;