Bug 916116 - Avoid some code duplication in Gralloc textures. r=sotaro
This commit is contained in:
@@ -1123,8 +1123,7 @@ GrallocDeprecatedTextureHostOGL::SwapTexturesImpl(const SurfaceDescriptor& aImag
|
||||
mIsRBSwapped);
|
||||
|
||||
mTextureTarget = TextureTargetForAndroidPixelFormat(mGraphicBuffer->getPixelFormat());
|
||||
mQuirks->SetCompositor(mCompositor);
|
||||
GLuint tex = static_cast<CompositableQuirksGonkOGL*>(mQuirks.get())->GetTexture();
|
||||
GLuint tex = GetGLTexture();
|
||||
// delete old EGLImage
|
||||
DeleteTextures();
|
||||
|
||||
@@ -1162,8 +1161,7 @@ void GrallocDeprecatedTextureHostOGL::BindTexture(GLenum aTextureUnit)
|
||||
MOZ_ASSERT(gl());
|
||||
gl()->MakeCurrent();
|
||||
|
||||
mQuirks->SetCompositor(mCompositor);
|
||||
GLuint tex = static_cast<CompositableQuirksGonkOGL*>(mQuirks.get())->GetTexture();
|
||||
GLuint tex = GetGLTexture();
|
||||
|
||||
gl()->fActiveTexture(aTextureUnit);
|
||||
gl()->fBindTexture(mTextureTarget, tex);
|
||||
@@ -1242,6 +1240,14 @@ GrallocDeprecatedTextureHostOGL::GetRenderState()
|
||||
|
||||
return LayerRenderState();
|
||||
}
|
||||
|
||||
GLuint
|
||||
GrallocDeprecatedTextureHostOGL::GetGLTexture()
|
||||
{
|
||||
mQuirks->SetCompositor(mCompositor);
|
||||
return static_cast<CompositableQuirksGonkOGL*>(mQuirks.get())->GetTexture();
|
||||
}
|
||||
|
||||
#endif // MOZ_WIDGET_GONK
|
||||
|
||||
already_AddRefed<gfxImageSurface>
|
||||
@@ -1299,8 +1305,7 @@ already_AddRefed<gfxImageSurface>
|
||||
GrallocDeprecatedTextureHostOGL::GetAsSurface() {
|
||||
gl()->MakeCurrent();
|
||||
|
||||
mQuirks->SetCompositor(mCompositor);
|
||||
GLuint tex = static_cast<CompositableQuirksGonkOGL*>(mQuirks.get())->GetTexture();
|
||||
GLuint tex = GetGLTexture();
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
gl()->fBindTexture(mTextureTarget, tex);
|
||||
if (!mEGLImage) {
|
||||
|
||||
Reference in New Issue
Block a user