Bug 1576499 - Turn aClipRectIn into a Maybe and rename it to aClipRect, now that aClipRectOut is gone. r=mattwoodrow

Depends on D43372

Differential Revision: https://phabricator.services.mozilla.com/D43373

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-08-26 00:58:44 +00:00
Родитель eebce2e2ca
Коммит 865a952e99
8 изменённых файлов: 16 добавлений и 20 удалений

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

@ -404,7 +404,7 @@ class Compositor : public TextureSourceProvider {
* compositors where the performance for compositing the entire window is
* sufficient.
*
* aClipRectIn is the clip rect for the window in window space (optional).
* aClipRect is the clip rect for the window in window space (optional).
* aRenderBounds bounding rect for rendering, in user space.
* aOpaqueRegion is the area that contains opaque content.
*
@ -413,7 +413,7 @@ class Compositor : public TextureSourceProvider {
* is returned empty, composition should be aborted.
*/
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect* aClipRectIn,
const Maybe<gfx::IntRect>& aClipRect,
const gfx::IntRect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
NativeLayer* aNativeLayer,

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

@ -887,7 +887,7 @@ bool BasicCompositor::BlitRenderTarget(CompositingRenderTarget* aSource,
}
void BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
const IntRect* aClipRectIn,
const Maybe<IntRect>& aClipRect,
const IntRect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
NativeLayer* aNativeLayer,
@ -1036,17 +1036,13 @@ void BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
*aRenderBoundsOut = rect;
}
if (aClipRectIn) {
mRenderTarget->mDrawTarget->PushClipRect(Rect(*aClipRectIn));
} else {
mRenderTarget->mDrawTarget->PushClipRect(Rect(rect));
}
mRenderTarget->mDrawTarget->PushClipRect(Rect(aClipRect.valueOr(rect)));
}
void BasicCompositor::EndFrame() {
Compositor::EndFrame();
// Pop aClipRectIn/bounds rect
// Pop aClipRect/bounds rect
mRenderTarget->mDrawTarget->PopClip();
if (StaticPrefs::nglayout_debug_widget_update_flashing()) {

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

@ -117,7 +117,7 @@ class BasicCompositor : public Compositor {
void ClearRect(const gfx::Rect& aRect) override;
void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect* aClipRectIn,
const Maybe<gfx::IntRect>& aClipRect,
const gfx::IntRect& aRenderBounds,
const nsIntRegion& aOpaqueRegion, NativeLayer* aNativeLayer,
gfx::IntRect* aRenderBoundsOut = nullptr) override;

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

@ -988,9 +988,9 @@ bool LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion,
IntRect actualBounds;
Maybe<IntRect> rootLayerClip = mRoot->GetClipRect().map(
[](const ParentLayerIntRect& r) { return r.ToUnknownRect(); });
mCompositor->BeginFrame(
aInvalidRegion, rootLayerClip ? &*rootLayerClip : nullptr, mRenderBounds,
aOpaqueRegion, mNativeLayerForEntireWindow, &actualBounds);
mCompositor->BeginFrame(aInvalidRegion, rootLayerClip, mRenderBounds,
aOpaqueRegion, mNativeLayerForEntireWindow,
&actualBounds);
IntRect clipRect = rootLayerClip.valueOr(actualBounds);
#if defined(MOZ_WIDGET_ANDROID)
ScreenCoord offset = GetContentShiftForToolbar();
@ -1227,7 +1227,7 @@ void LayerManagerComposite::RenderToPresentationSurface() {
IntRect bounds = IntRect::Truncate(0, 0, scale * pageWidth, actualHeight);
IntRect actualBounds;
MOZ_ASSERT(mRoot->GetOpacity() == 1);
mCompositor->BeginFrame(invalid, nullptr, bounds, nsIntRegion(), nullptr,
mCompositor->BeginFrame(invalid, Nothing(), bounds, nsIntRegion(), nullptr,
&actualBounds);
// The Java side of Fennec sets a scissor rect that accounts for

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

@ -1095,7 +1095,7 @@ void CompositorD3D11::DrawGeometry(const Geometry& aGeometry,
}
void CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
const IntRect* aClipRectIn,
const Maybe<IntRect>& aClipRect,
const IntRect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
NativeLayer* aNativeLayer,
@ -1148,8 +1148,8 @@ void CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
IntRect invalidRect = invalidRegionSafe.GetBounds();
IntRect clipRect = invalidRect;
if (aClipRectIn) {
clipRect.IntersectRect(clipRect, *aClipRectIn);
if (aClipRect) {
clipRect.IntersectRect(clipRect, *aClipRect);
}
if (clipRect.IsEmpty()) {

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

@ -93,7 +93,7 @@ class CompositorD3D11 : public Compositor {
* Start a new frame.
*/
void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect* aClipRectIn,
const Maybe<gfx::IntRect>& aClipRect,
const gfx::IntRect& aRenderBounds,
const nsIntRegion& aOpaqueRegion, NativeLayer* aNativeLayer,
gfx::IntRect* aRenderBoundsOut = nullptr) override;

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

@ -869,7 +869,7 @@ CompositorOGL::RenderTargetForNativeLayer(NativeLayer* aNativeLayer,
}
void CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion,
const IntRect* aClipRectIn,
const Maybe<IntRect>& aClipRect,
const IntRect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
NativeLayer* aNativeLayer,

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

@ -367,7 +367,7 @@ class CompositorOGL final : public Compositor {
/* Start a new frame.
*/
void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect* aClipRectIn,
const Maybe<gfx::IntRect>& aClipRect,
const gfx::IntRect& aRenderBounds,
const nsIntRegion& aOpaqueRegion, NativeLayer* aNativeLayer,
gfx::IntRect* aRenderBoundsOut = nullptr) override;