Bug 505115 - Part 1 - Fix OpenGL container layer to support transforming children.r=vlad,a=roc

This commit is contained in:
Matt Woodrow 2010-09-07 17:35:50 -07:00
Родитель d4a94ad6e6
Коммит c1cd7cba11
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -159,13 +159,15 @@ ContainerLayerOGL::RenderLayer(int aPreviousFrameBuffer,
nsIntRect visibleRect = mVisibleRegion.GetBounds(); nsIntRect visibleRect = mVisibleRegion.GetBounds();
float opacity = GetOpacity(); float opacity = GetOpacity();
if (opacity != 1.0) { if (opacity != 1.0 || !mTransform.IsIdentity()) {
mOGLManager->CreateFBOWithTexture(visibleRect.width, mOGLManager->CreateFBOWithTexture(visibleRect.width,
visibleRect.height, visibleRect.height,
&frameBuffer, &frameBuffer,
&containerSurface); &containerSurface);
childOffset.x = visibleRect.x; childOffset.x = visibleRect.x;
childOffset.y = visibleRect.y; childOffset.y = visibleRect.y;
mOGLManager->gl()->fClearColor(0, 0, 0, 0);
mOGLManager->gl()->fClear(LOCAL_GL_COLOR_BUFFER_BIT);
} else { } else {
frameBuffer = aPreviousFrameBuffer; frameBuffer = aPreviousFrameBuffer;
} }
@ -193,7 +195,7 @@ ContainerLayerOGL::RenderLayer(int aPreviousFrameBuffer,
: nsnull; : nsnull;
} }
if (opacity != 1.0) { if (opacity != 1.0 || !mTransform.IsIdentity()) {
// Unbind the current framebuffer and rebind the previous one. // Unbind the current framebuffer and rebind the previous one.
gl()->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, aPreviousFrameBuffer); gl()->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, aPreviousFrameBuffer);
gl()->fDeleteFramebuffers(1, &frameBuffer); gl()->fDeleteFramebuffers(1, &frameBuffer);