mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 850566 - Part 2: Render gralloc buffer by using image size. r=roc
This commit is contained in:
parent
acdad56971
commit
4d258d24a3
@ -996,6 +996,7 @@ ShadowImageLayerOGL::RenderLayer(int aPreviousFrameBuffer,
|
|||||||
const SurfaceDescriptorGralloc& desc = img->get_SurfaceDescriptor().get_SurfaceDescriptorGralloc();
|
const SurfaceDescriptorGralloc& desc = img->get_SurfaceDescriptor().get_SurfaceDescriptorGralloc();
|
||||||
sp<GraphicBuffer> graphicBuffer = GrallocBufferActor::GetFrom(desc);
|
sp<GraphicBuffer> graphicBuffer = GrallocBufferActor::GetFrom(desc);
|
||||||
mSize = gfxIntSize(graphicBuffer->getWidth(), graphicBuffer->getHeight());
|
mSize = gfxIntSize(graphicBuffer->getWidth(), graphicBuffer->getHeight());
|
||||||
|
mPictureRect = nsIntRect(0, 0, desc.size().width, desc.size().height);
|
||||||
if (!mExternalBufferTexture.IsAllocated()) {
|
if (!mExternalBufferTexture.IsAllocated()) {
|
||||||
mExternalBufferTexture.Allocate(gl());
|
mExternalBufferTexture.Allocate(gl());
|
||||||
}
|
}
|
||||||
@ -1061,14 +1062,17 @@ ShadowImageLayerOGL::RenderLayer(int aPreviousFrameBuffer,
|
|||||||
|
|
||||||
program->Activate();
|
program->Activate();
|
||||||
program->SetLayerQuadRect(nsIntRect(0, 0,
|
program->SetLayerQuadRect(nsIntRect(0, 0,
|
||||||
mSize.width, mSize.height));
|
mPictureRect.width,
|
||||||
|
mPictureRect.height));
|
||||||
program->SetLayerTransform(GetEffectiveTransform());
|
program->SetLayerTransform(GetEffectiveTransform());
|
||||||
program->SetLayerOpacity(GetEffectiveOpacity());
|
program->SetLayerOpacity(GetEffectiveOpacity());
|
||||||
program->SetRenderOffset(aOffset);
|
program->SetRenderOffset(aOffset);
|
||||||
program->SetTextureUnit(0);
|
program->SetTextureUnit(0);
|
||||||
program->LoadMask(GetMaskLayer());
|
program->LoadMask(GetMaskLayer());
|
||||||
|
|
||||||
mOGLManager->BindAndDrawQuad(program);
|
mOGLManager->BindAndDrawQuadWithTextureRect(program,
|
||||||
|
mPictureRect,
|
||||||
|
nsIntSize(mSize.width, mSize.height));
|
||||||
|
|
||||||
// Make sure that we release the underlying external image
|
// Make sure that we release the underlying external image
|
||||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||||
|
Loading…
Reference in New Issue
Block a user