diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 84a7a7369554..52cc3ccffedd 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -388,23 +388,19 @@ LayerManagerComposite::Render() } // Allow widget to render a custom background. - mCompositor->SaveState(); mCompositor->GetWidget()->DrawWindowUnderlay(this, nsIntRect(actualBounds.x, actualBounds.y, actualBounds.width, actualBounds.height)); - mCompositor->RestoreState(); // Render our layers. RootLayer()->RenderLayer(clipRect); // Allow widget to render a custom foreground. - mCompositor->SaveState(); mCompositor->GetWidget()->DrawWindowOverlay(this, nsIntRect(actualBounds.x, actualBounds.y, actualBounds.width, actualBounds.height)); - mCompositor->RestoreState(); // Debugging RenderDebugOverlay(actualBounds); diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 5021b837ddf0..2afaafa6d90f 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -47,6 +47,8 @@ using mozilla::unused; #include "mozilla/layers/APZCTreeManager.h" #include "GLContext.h" #include "GLContextProvider.h" +#include "ScopedGLHelpers.h" +#include "mozilla/layers/CompositorOGL.h" #include "nsTArray.h" @@ -2380,6 +2382,10 @@ nsWindow::DrawWindowUnderlay(LayerManagerComposite* aManager, nsIntRect aRect) return; } + gl::GLContext* gl = static_cast(aManager->GetCompositor())->gl(); + gl::ScopedGLState scopedScissorTestState(gl, LOCAL_GL_SCISSOR_TEST); + gl::ScopedScissorRect scopedScissorRectState(gl); + client->ActivateProgram(); if (!mLayerRendererFrame.BeginDrawing(&jniFrame)) return; if (!mLayerRendererFrame.DrawBackground(&jniFrame)) return; @@ -2402,6 +2408,10 @@ nsWindow::DrawWindowOverlay(LayerManagerComposite* aManager, nsIntRect aRect) GeckoLayerClient* client = AndroidBridge::Bridge()->GetLayerClient(); + gl::GLContext* gl = static_cast(aManager->GetCompositor())->gl(); + gl::ScopedGLState scopedScissorTestState(gl, LOCAL_GL_SCISSOR_TEST); + gl::ScopedScissorRect scopedScissorRectState(gl); + client->ActivateProgram(); if (!mLayerRendererFrame.DrawForeground(&jniFrame)) return; if (!mLayerRendererFrame.EndDrawing(&jniFrame)) return; diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index dcc02fe89ec0..9add0157f0c4 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -62,6 +62,7 @@ #include "GLContextProvider.h" #include "GLContextCGL.h" #include "GLUploadHelpers.h" +#include "ScopedGLHelpers.h" #include "mozilla/layers/GLManager.h" #include "mozilla/layers/CompositorOGL.h" #include "mozilla/layers/BasicCompositor.h" @@ -2089,6 +2090,10 @@ nsChildView::DrawWindowOverlay(LayerManagerComposite* aManager, nsIntRect aRect) void nsChildView::DrawWindowOverlay(GLManager* aManager, nsIntRect aRect) { + GLContext* gl = aManager->gl(); + ScopedGLState scopedScissorTestState(gl, LOCAL_GL_SCISSOR_TEST); + ScopedScissorRect scopedScissorRectState(gl); + MaybeDrawTitlebar(aManager, aRect); MaybeDrawResizeIndicator(aManager, aRect); MaybeDrawRoundedCorners(aManager, aRect);