From ec9eb77ab352c95f6f425399a5c262305ecbe5c5 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Mon, 26 Aug 2019 00:58:43 +0000 Subject: [PATCH] Bug 1576499 - Change where aClipRectOut is set, in two BeginFrame implementations. r=mattwoodrow There are three circumstances that make these transformations equivalent: - aClipRectIn and aClipRectOut are never both non-null. - The value of *aClipRectOut is ignored if *aRenderBoundsOut is empty. - aRenderBounds.TopLeft() is always (0, 0) because the ClientLayerManager calls targetBounds.MoveTo(0, 0) on the rect that eventually becomes aRenderBounds. (targetBounds -> Transaction::mTargetBounds -> TargetConfig::naturalBounds() -> LayerManagerComposite::mRenderBounds) Depends on D43367 Differential Revision: https://phabricator.services.mozilla.com/D43368 --HG-- extra : moz-landing-system : lando --- gfx/layers/basic/BasicCompositor.cpp | 6 +++--- gfx/layers/opengl/CompositorOGL.cpp | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gfx/layers/basic/BasicCompositor.cpp b/gfx/layers/basic/BasicCompositor.cpp index 9187799bb850..47728d7e7501 100644 --- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -1036,14 +1036,14 @@ void BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion, if (aRenderBoundsOut) { *aRenderBoundsOut = rect; } + if (aClipRectOut) { + *aClipRectOut = rect; + } if (aClipRectIn) { mRenderTarget->mDrawTarget->PushClipRect(Rect(*aClipRectIn)); } else { mRenderTarget->mDrawTarget->PushClipRect(Rect(rect)); - if (aClipRectOut) { - *aClipRectOut = rect; - } } } diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index d9e14d3b34f4..b0abb1af2c04 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -889,6 +889,9 @@ void CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion, if (aRenderBoundsOut) { *aRenderBoundsOut = rect; } + if (aClipRectOut) { + *aClipRectOut = rect; + } // We can't draw anything to something with no area // so just return @@ -948,10 +951,6 @@ void CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion, SetRenderTarget(rt); mWindowRenderTarget = mCurrentRenderTarget; - if (aClipRectOut && !aClipRectIn) { - *aClipRectOut = IntRect(IntPoint(), rect.Size()); - } - #if defined(MOZ_WIDGET_ANDROID) if ((mSurfaceOrigin.x > 0) || (mSurfaceOrigin.y > 0)) { mGLContext->fClearColor(