зеркало из https://github.com/mozilla/gecko-dev.git
Bug 956401 - 5/9 - Let DrawWindow{Under,Over}lay take care of saving and restoring GL state - r=nrc
This commit is contained in:
Родитель
89a33dce75
Коммит
f89d762216
|
@ -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);
|
||||
|
|
|
@ -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<CompositorOGL*>(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<CompositorOGL*>(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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче