Bug 863498. Get the SurfaceTexture transform every draw. r=nical

ShadowImageLayerOGL::RenderLayer used to call gl()->GetSharedHandleDetails()
directly and uses that result.

This makes us do something similar. As a concequence we also drop the
mTextureTransform member because we are not caching it anymore.

I do wonder if it would make more sense for the content thread to send
the transform along with the update to make sure that it always matches.
This would also make it so that we have no chance of causing a GC
in the compositor to get the transform by calling through java.

--HG--
extra : rebase_source : 7520870d8f0f0bb81c4acbb3b2011f8b0056d53f
This commit is contained in:
Jeff Muizelaar 2013-05-08 18:04:59 -04:00
parent 2186ab5dce
commit c75c330cdb
2 changed files with 16 additions and 7 deletions

View File

@ -263,7 +263,6 @@ SharedTextureHostOGL::SwapTexturesImpl(const SurfaceDescriptor& aImage,
mTextureTarget = handleDetails.mTarget;
mShaderProgram = handleDetails.mProgramType;
mFormat = FormatFromShaderType(mShaderProgram);
mTextureTransform = handleDetails.mTextureTransform;
}
}
@ -289,6 +288,20 @@ SharedTextureHostOGL::Unlock()
mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, 0);
}
gfx3DMatrix
SharedTextureHostOGL::GetTextureTransform()
{
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)
{

View File

@ -51,7 +51,7 @@ public:
// 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() const { return gfx3DMatrix(); }
virtual gfx3DMatrix GetTextureTransform() { return gfx3DMatrix(); }
};
inline gl::ShaderProgramType
@ -360,10 +360,7 @@ public:
gfxASurface::CONTENT_COLOR;
}
virtual gfx3DMatrix GetTextureTransform() const MOZ_OVERRIDE
{
return mTextureTransform;
}
virtual gfx3DMatrix GetTextureTransform() MOZ_OVERRIDE;
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() { return "SharedTextureHostOGL"; }
@ -380,7 +377,6 @@ protected:
gl::SharedTextureHandle mSharedHandle;
gl::ShaderProgramType mShaderProgram;
gl::GLContext::SharedTextureShareType mShareType;
gfx3DMatrix mTextureTransform;
};
class SurfaceStreamHostOGL : public TextureHost