Bug 850566 - Part 2: Render gralloc buffer by using image size. r=roc, a=tef+

This commit is contained in:
Sotaro Ikeda 2013-04-09 16:51:11 -04:00
Родитель 52fe7717a6
Коммит df05e11542
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -960,6 +960,7 @@ ShadowImageLayerOGL::RenderLayer(int aPreviousFrameBuffer,
const SurfaceDescriptorGralloc& desc = img->get_SurfaceDescriptor().get_SurfaceDescriptorGralloc();
sp<GraphicBuffer> 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);