Bug 916116 - Avoid some code duplication in Gralloc textures. r=sotaro
This commit is contained in:
@@ -117,8 +117,7 @@ void GrallocTextureSourceOGL::BindTexture(GLenum aTextureUnit)
|
||||
MOZ_ASSERT(gl());
|
||||
gl()->MakeCurrent();
|
||||
|
||||
mQuirks->SetCompositor(mCompositor);
|
||||
GLuint tex = static_cast<CompositableQuirksGonkOGL*>(mQuirks.get())->GetTexture();
|
||||
GLuint tex = GetGLTexture();
|
||||
GLuint textureTarget = GetTextureTarget();
|
||||
|
||||
gl()->fActiveTexture(aTextureUnit);
|
||||
@@ -179,8 +178,7 @@ GrallocTextureSourceOGL::SetCompositableQuirks(CompositableQuirks* aQuirks)
|
||||
DeallocateDeviceData();
|
||||
|
||||
gl()->MakeCurrent();
|
||||
mQuirks->SetCompositor(mCompositor);
|
||||
GLuint tex = static_cast<CompositableQuirksGonkOGL*>(mQuirks.get())->GetTexture();
|
||||
GLuint tex = GetGLTexture();
|
||||
GLuint textureTarget = GetTextureTarget();
|
||||
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
@@ -310,8 +308,7 @@ GrallocTextureSourceOGL::GetAsSurface() {
|
||||
MOZ_ASSERT(gl());
|
||||
gl()->MakeCurrent();
|
||||
|
||||
mQuirks->SetCompositor(mCompositor);
|
||||
GLuint tex = static_cast<CompositableQuirksGonkOGL*>(mQuirks.get())->GetTexture();
|
||||
GLuint tex = GetGLTexture();
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
gl()->fBindTexture(GetTextureTarget(), tex);
|
||||
if (!mEGLImage) {
|
||||
@@ -326,6 +323,13 @@ GrallocTextureSourceOGL::GetAsSurface() {
|
||||
return surf.forget();
|
||||
}
|
||||
|
||||
GLuint
|
||||
GrallocTextureSourceOGL::GetGLTexture()
|
||||
{
|
||||
mQuirks->SetCompositor(mCompositor);
|
||||
return static_cast<CompositableQuirksGonkOGL*>(mQuirks.get())->GetTexture();
|
||||
}
|
||||
|
||||
void
|
||||
GrallocTextureHostOGL::SetCompositableQuirks(CompositableQuirks* aQuirks)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user