From df05e115421e27158f819a30bc23c6949d7695e7 Mon Sep 17 00:00:00 2001 From: Sotaro Ikeda Date: Tue, 9 Apr 2013 16:51:11 -0400 Subject: [PATCH] Bug 850566 - Part 2: Render gralloc buffer by using image size. r=roc, a=tef+ --- gfx/layers/opengl/ImageLayerOGL.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gfx/layers/opengl/ImageLayerOGL.cpp b/gfx/layers/opengl/ImageLayerOGL.cpp index 04fce61b8cc8..cc3818ecf8b3 100644 --- a/gfx/layers/opengl/ImageLayerOGL.cpp +++ b/gfx/layers/opengl/ImageLayerOGL.cpp @@ -960,6 +960,7 @@ ShadowImageLayerOGL::RenderLayer(int aPreviousFrameBuffer, const SurfaceDescriptorGralloc& desc = img->get_SurfaceDescriptor().get_SurfaceDescriptorGralloc(); sp graphicBuffer = GrallocBufferActor::GetFrom(desc); mSize = gfxIntSize(graphicBuffer->getWidth(), graphicBuffer->getHeight()); + mPictureRect = nsIntRect(0, 0, desc.size().width, desc.size().height); if (!mExternalBufferTexture.IsAllocated()) { mExternalBufferTexture.Allocate(gl()); } @@ -1025,14 +1026,17 @@ ShadowImageLayerOGL::RenderLayer(int aPreviousFrameBuffer, program->Activate(); program->SetLayerQuadRect(nsIntRect(0, 0, - mSize.width, mSize.height)); + mPictureRect.width, + mPictureRect.height)); program->SetLayerTransform(GetEffectiveTransform()); program->SetLayerOpacity(GetEffectiveOpacity()); program->SetRenderOffset(aOffset); program->SetTextureUnit(0); program->LoadMask(GetMaskLayer()); - mOGLManager->BindAndDrawQuad(program); + mOGLManager->BindAndDrawQuadWithTextureRect(program, + mPictureRect, + nsIntSize(mSize.width, mSize.height)); // Make sure that we release the underlying external image gl()->fActiveTexture(LOCAL_GL_TEXTURE0);