--- a/gfx/layers/composite/GPUVideoTextureHost.cpp
+++ b/gfx/layers/composite/GPUVideoTextureHost.cpp
@@ -129,17 +129,17 @@ GPUVideoTextureHost::AddWRImage(wr::WebR
MOZ_ASSERT(mWrappedTextureHost);
mWrappedTextureHost->AddWRImage(aAPI, aImageKeys, aExtID);
}
void
GPUVideoTextureHost::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{
MOZ_ASSERT(mWrappedTextureHost);
MOZ_ASSERT(aImageKeys.length() > 0);
mWrappedTextureHost->PushExternalImage(aBuilder,
aBounds,
--- a/gfx/layers/composite/GPUVideoTextureHost.h
+++ b/gfx/layers/composite/GPUVideoTextureHost.h
@@ -52,17 +52,17 @@ public:
const std::function<wr::ImageKey()>& aImageKeyAllocator) override;
virtual void AddWRImage(wr::WebRenderAPI* aAPI,
Range<const wr::ImageKey>& aImageKeys,
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;
protected:
RefPtr<TextureHost> mWrappedTextureHost;
};
} // namespace layers
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -620,17 +620,17 @@ BufferTextureHost::AddWRImage(wr::WebRen
WrExternalImageBufferType::ExternalBuffer,
2);
}
}
void
BufferTextureHost::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{
if (GetFormat() != gfx::SurfaceFormat::YUV) {
MOZ_ASSERT(aImageKeys.length() == 1);
aBuilder.PushImage(aBounds, aClip, aFilter, aImageKeys[0]);
} else {
MOZ_ASSERT(aImageKeys.length() == 3);
--- a/gfx/layers/composite/TextureHost.h
+++ b/gfx/layers/composite/TextureHost.h
@@ -639,17 +639,17 @@ public:
const wr::ExternalImageId& aExtID)
{
MOZ_ASSERT_UNREACHABLE("No AddWRImage() implementation for this TextureHost type.");
}
// Put all necessary WR commands into DisplayListBuilder for this textureHost rendering.
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aKeys)
{
MOZ_ASSERT_UNREACHABLE("No PushExternalImage() implementation for this TextureHost type.");
}
protected:
void ReadUnlock();
@@ -745,17 +745,17 @@ public:
const std::function<wr::ImageKey()>& aImageKeyAllocator) override;
virtual void AddWRImage(wr::WebRenderAPI* aAPI,
Range<const wr::ImageKey>& aImageKeys,
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;
protected:
bool Upload(nsIntRegion *aRegion = nullptr);
bool UploadIfNeeded();
bool MaybeUpload(nsIntRegion *aRegion);
bool EnsureWrappingTextureSource();
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -913,17 +913,17 @@ DXGITextureHostD3D11::AddWRImage(wr::Web
const wr::ExternalImageId& aExtID)
{
MOZ_ASSERT_UNREACHABLE("No AddWRImage() implementation for this DXGITextureHostD3D11 type.");
}
void
DXGITextureHostD3D11::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{
MOZ_ASSERT_UNREACHABLE("No PushExternalImage() implementation for this DXGITextureHostD3D11 type.");
}
DXGIYCbCrTextureHostD3D11::DXGIYCbCrTextureHostD3D11(TextureFlags aFlags,
const SurfaceDescriptorDXGIYCbCr& aDescriptor)
@@ -1080,17 +1080,17 @@ DXGIYCbCrTextureHostD3D11::AddWRImage(wr
const wr::ExternalImageId& aExtID)
{
MOZ_ASSERT_UNREACHABLE("No AddWRImage() implementation for this DXGIYCbCrTextureHostD3D11 type.");
}
void
DXGIYCbCrTextureHostD3D11::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{
MOZ_ASSERT_UNREACHABLE("No PushExternalImage() implementation for this DXGIYCbCrTextureHostD3D11 type.");
}
bool
DXGIYCbCrTextureHostD3D11::AcquireTextureSource(CompositableTextureSourceRef& aTexture)
--- a/gfx/layers/d3d11/TextureD3D11.h
+++ b/gfx/layers/d3d11/TextureD3D11.h
@@ -330,17 +330,17 @@ public:
const std::function<wr::ImageKey()>& aImageKeyAllocator) override;
virtual void AddWRImage(wr::WebRenderAPI* aAPI,
Range<const wr::ImageKey>& aImageKeys,
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;
protected:
bool LockInternal();
void UnlockInternal();
bool EnsureTextureSource();
@@ -391,17 +391,17 @@ public:
const std::function<wr::ImageKey()>& aImageKeyAllocator) override;
virtual void AddWRImage(wr::WebRenderAPI* aAPI,
Range<const wr::ImageKey>& aImageKeys,
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;
private:
bool EnsureTextureSource();
protected:
RefPtr<ID3D11Device> GetDevice();
--- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
+++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
@@ -220,17 +220,17 @@ MacIOSurfaceTextureHostOGL::AddWRImage(w
MOZ_ASSERT_UNREACHABLE("unexpected to be called");
}
}
}
void
MacIOSurfaceTextureHostOGL::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{
switch (GetFormat()) {
case gfx::SurfaceFormat::R8G8B8X8:
case gfx::SurfaceFormat::R8G8B8A8:
case gfx::SurfaceFormat::B8G8R8A8:
case gfx::SurfaceFormat::B8G8R8X8: {
--- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
+++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
@@ -68,17 +68,17 @@ public:
const std::function<wr::ImageKey()>& aImageKeyAllocator) override;
virtual void AddWRImage(wr::WebRenderAPI* aAPI,
Range<const wr::ImageKey>& aImageKeys,
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;
protected:
GLTextureSource* CreateTextureSourceForPlane(size_t aPlane);
RefPtr<GLTextureSource> mTextureSource;
RefPtr<MacIOSurface> mSurface;
--- a/gfx/layers/wr/WebRenderBridgeChild.cpp
+++ b/gfx/layers/wr/WebRenderBridgeChild.cpp
@@ -212,19 +212,18 @@ WebRenderBridgeChild::PushGlyphs(wr::Dis
wr_glyph_instances.SetLength(glyphs.Length());
for (size_t j = 0; j < glyphs.Length(); j++) {
wr_glyph_instances[j].index = glyphs[j].mIndex;
wr_glyph_instances[j].point = aSc.ToRelativeWrPoint(
LayerPoint::FromUnknownPoint(glyphs[j].mPosition));
}
- WrClipRegionToken clipRegion = aBuilder.PushClipRegion(aSc.ToRelativeWrRect(aClip));
aBuilder.PushText(aSc.ToRelativeWrRect(aBounds),
- clipRegion,
+ aSc.ToRelativeWrRect(aClip),
glyph_array.color().value(),
key,
Range<const WrGlyphInstance>(wr_glyph_instances.Elements(), wr_glyph_instances.Length()),
aFont->GetSize());
}
}
--- a/gfx/layers/wr/WebRenderCanvasLayer.cpp
+++ b/gfx/layers/wr/WebRenderCanvasLayer.cpp
@@ -64,31 +64,30 @@ WebRenderCanvasLayer::RenderLayer(wr::Di
}
ScrollingLayersHelper scroller(this, aBuilder, aSc);
StackingContextHelper sc(aSc, aBuilder, this, transform);
LayerRect rect(0, 0, mBounds.width, mBounds.height);
DumpLayerInfo("CanvasLayer", rect);
- WrClipRegionToken clip = aBuilder.PushClipRegion(sc.ToRelativeWrRect(rect));
-
wr::ImageRendering filter = wr::ToImageRendering(mSamplingFilter);
if (gfxPrefs::LayersDump()) {
printf_stderr("CanvasLayer %p texture-filter=%s\n",
this->GetLayer(),
Stringify(filter).c_str());
}
WrImageKey key = GetImageKey();
WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(mExternalImageId.value(), key));
WrManager()->AddImageKeyForDiscard(key);
- aBuilder.PushImage(sc.ToRelativeWrRect(rect), clip, filter, key);
+ WrRect r = sc.ToRelativeWrRect(rect);
+ aBuilder.PushImage(r, r, filter, key);
}
void
WebRenderCanvasLayer::AttachCompositable()
{
mCanvasClient->Connect();
}
--- a/gfx/layers/wr/WebRenderColorLayer.cpp
+++ b/gfx/layers/wr/WebRenderColorLayer.cpp
@@ -23,15 +23,14 @@ WebRenderColorLayer::RenderLayer(wr::Dis
const StackingContextHelper& aSc)
{
ScrollingLayersHelper scroller(this, aBuilder, aSc);
StackingContextHelper sc(aSc, aBuilder, this);
LayerRect rect = Bounds();
DumpLayerInfo("ColorLayer", rect);
- WrClipRegionToken clip = aBuilder.PushClipRegion(sc.ToRelativeWrRect(rect));
-
- aBuilder.PushRect(sc.ToRelativeWrRect(rect), clip, wr::ToWrColor(mColor));
+ WrRect r = sc.ToRelativeWrRect(rect);
+ aBuilder.PushRect(r, r, wr::ToWrColor(mColor));
}
} // namespace layers
} // namespace mozilla
--- a/gfx/layers/wr/WebRenderCompositableHolder.cpp
+++ b/gfx/layers/wr/WebRenderCompositableHolder.cpp
@@ -274,32 +274,30 @@ WebRenderCompositableHolder::ApplyAsyncI
WrTransformStyle::Flat,
holder->mMixBlendMode,
nsTArray<WrFilterOp>());
LayerRect rect(0, 0, holder->mCurrentTexture->GetSize().width, holder->mCurrentTexture->GetSize().height);
if (holder->mScaleToSize.isSome()) {
rect = LayerRect(0, 0, holder->mScaleToSize.value().width, holder->mScaleToSize.value().height);
}
- WrClipRegionToken clip = builder.PushClipRegion(
- wr::ToWrRect(rect), nullptr);
if (useExternalImage) {
MOZ_ASSERT(holder->mCurrentTexture->AsWebRenderTextureHost());
Range<const wr::ImageKey> range_keys(&keys[0], keys.Length());
holder->mCurrentTexture->PushExternalImage(builder,
wr::ToWrRect(rect),
- clip,
+ wr::ToWrRect(rect),
holder->mFilter,
range_keys);
HoldExternalImage(pipelineId, epoch, holder->mCurrentTexture->AsWebRenderTextureHost());
} else {
MOZ_ASSERT(keys.Length() == 1);
builder.PushImage(wr::ToWrRect(rect),
- clip,
+ wr::ToWrRect(rect),
holder->mFilter,
keys[0]);
}
builder.PopStackingContext();
}
wr::BuiltDisplayList dl;
WrSize builderContentSize;
--- a/gfx/layers/wr/WebRenderContainerLayer.cpp
+++ b/gfx/layers/wr/WebRenderContainerLayer.cpp
@@ -145,14 +145,14 @@ WebRenderRefLayer::RenderLayer(wr::Displ
// we need to apply that transform to the bounds before we pass it on to WR.
// The conversion from ParentLayerPixel to LayerPixel below is a result of
// changing the reference layer from "this layer" to the "the layer that
// created aSc".
LayerRect rect = ViewAs<LayerPixel>(bounds,
PixelCastJustification::MovingDownToChildren);
DumpLayerInfo("RefLayer", rect);
- WrClipRegionToken clipRegion = aBuilder.PushClipRegion(aSc.ToRelativeWrRect(rect));
- aBuilder.PushIFrame(aSc.ToRelativeWrRect(rect), clipRegion, wr::AsPipelineId(mId));
+ WrRect r = aSc.ToRelativeWrRect(rect);
+ aBuilder.PushIFrame(r, r, wr::AsPipelineId(mId));
}
} // namespace layers
} // namespace mozilla
--- a/gfx/layers/wr/WebRenderDisplayItemLayer.cpp
+++ b/gfx/layers/wr/WebRenderDisplayItemLayer.cpp
@@ -134,22 +134,21 @@ WebRenderDisplayItemLayer::PushItemAsBlo
MOZ_ASSERT(context);
mItem->Paint(mBuilder, context);
}
wr::ByteBuffer bytes(recorder->mOutputStream.mLength, (uint8_t*)recorder->mOutputStream.mData);
WrRect dest = aSc.ToRelativeWrRect(imageRect + offset);
- WrClipRegionToken clipRegion = aBuilder.PushClipRegion(dest);
WrImageKey key = GetImageKey();
WrBridge()->SendAddBlobImage(key, imageSize.ToUnknownSize(), imageSize.width * 4, dt->GetFormat(), bytes);
WrManager()->AddImageKeyForDiscard(key);
aBuilder.PushImage(dest,
- clipRegion,
+ dest,
wr::ImageRendering::Auto,
key);
return true;
}
} // namespace layers
} // namespace mozilla
--- a/gfx/layers/wr/WebRenderImageLayer.cpp
+++ b/gfx/layers/wr/WebRenderImageLayer.cpp
@@ -154,18 +154,18 @@ WebRenderImageLayer::RenderLayer(wr::Dis
// context need to be done manually and pushed over to the parent side,
// where it will be done when we build the display list for the iframe.
// That happens in WebRenderCompositableHolder.
LayerRect rect = ViewAs<LayerPixel>(bounds,
PixelCastJustification::MovingDownToChildren);
DumpLayerInfo("Image Layer async", rect);
- WrClipRegionToken clipRegion = aBuilder.PushClipRegion(aSc.ToRelativeWrRect(rect));
- aBuilder.PushIFrame(aSc.ToRelativeWrRect(rect), clipRegion, mPipelineId.ref());
+ WrRect r = aSc.ToRelativeWrRect(rect);
+ aBuilder.PushIFrame(r, r, mPipelineId.ref());
gfx::Matrix4x4 scTransform = GetTransform();
// Translate is applied as part of PushIFrame()
scTransform.PostTranslate(-rect.x, -rect.y, 0);
// Adjust transform as to apply origin
LayerPoint scOrigin = Bounds().TopLeft();
scTransform.PreTranslate(-scOrigin.x, -scOrigin.y, 0);
@@ -210,27 +210,26 @@ WebRenderImageLayer::RenderLayer(wr::Dis
LayerRect rect(0, 0, size.width, size.height);
if (mScaleMode != ScaleMode::SCALE_NONE) {
NS_ASSERTION(mScaleMode == ScaleMode::STRETCH,
"No other scalemodes than stretch and none supported yet.");
rect = LayerRect(0, 0, mScaleToSize.width, mScaleToSize.height);
}
- WrClipRegionToken clip = aBuilder.PushClipRegion(
- sc.ToRelativeWrRect(rect));
wr::ImageRendering filter = wr::ToImageRendering(mSamplingFilter);
DumpLayerInfo("Image Layer", rect);
if (gfxPrefs::LayersDump()) {
printf_stderr("ImageLayer %p texture-filter=%s \n",
GetLayer(),
Stringify(filter).c_str());
}
- aBuilder.PushImage(sc.ToRelativeWrRect(rect), clip, filter, mKey.value());
+ WrRect r = sc.ToRelativeWrRect(rect);
+ aBuilder.PushImage(r, r, filter, mKey.value());
}
Maybe<WrImageMask>
WebRenderImageLayer::RenderMaskLayer(const StackingContextHelper& aSc,
const gfx::Matrix4x4& aTransform)
{
if (!mContainer) {
return Nothing();
--- a/gfx/layers/wr/WebRenderPaintedLayer.cpp
+++ b/gfx/layers/wr/WebRenderPaintedLayer.cpp
@@ -95,23 +95,22 @@ WebRenderPaintedLayer::CreateWebRenderDi
const StackingContextHelper& aSc)
{
ScrollingLayersHelper scroller(this, aBuilder, aSc);
StackingContextHelper sc(aSc, aBuilder, this);
LayerRect rect = Bounds();
DumpLayerInfo("PaintedLayer", rect);
- WrClipRegionToken clip = aBuilder.PushClipRegion(sc.ToRelativeWrRect(rect));
-
WrImageKey key = GetImageKey();
WrBridge()->AddWebRenderParentCommand(OpAddExternalImage(mExternalImageId.value(), key));
WrManager()->AddImageKeyForDiscard(key);
- aBuilder.PushImage(sc.ToRelativeWrRect(rect), clip, wr::ImageRendering::Auto, key);
+ WrRect r = sc.ToRelativeWrRect(rect);
+ aBuilder.PushImage(r, r, wr::ImageRendering::Auto, key);
}
void
WebRenderPaintedLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc)
{
if (!SetupExternalImages()) {
return;
--- a/gfx/layers/wr/WebRenderPaintedLayerBlob.cpp
+++ b/gfx/layers/wr/WebRenderPaintedLayerBlob.cpp
@@ -84,15 +84,14 @@ WebRenderPaintedLayerBlob::RenderLayer(w
MOZ_ASSERT(GetInvalidRegion().IsEmpty());
}
ScrollingLayersHelper scroller(this, aBuilder, aSc);
StackingContextHelper sc(aSc, aBuilder, this);
LayerRect rect = Bounds();
DumpLayerInfo("PaintedLayer", rect);
- WrClipRegionToken clip = aBuilder.PushClipRegion(sc.ToRelativeWrRect(rect));
-
- aBuilder.PushImage(sc.ToRelativeWrRect(rect), clip, wr::ImageRendering::Auto, mImageKey.value());
+ WrRect r = sc.ToRelativeWrRect(rect);
+ aBuilder.PushImage(r, r, wr::ImageRendering::Auto, mImageKey.value());
}
} // namespace layers
} // namespace mozilla
--- a/gfx/layers/wr/WebRenderTextureHost.cpp
+++ b/gfx/layers/wr/WebRenderTextureHost.cpp
@@ -174,17 +174,17 @@ WebRenderTextureHost::AddWRImage(wr::Web
MOZ_ASSERT(mExternalImageId == aExtID);
mWrappedTextureHost->AddWRImage(aAPI, aImageKeys, aExtID);
}
void
WebRenderTextureHost::PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys)
{
MOZ_ASSERT(mWrappedTextureHost);
MOZ_ASSERT(aImageKeys.length() > 0);
mWrappedTextureHost->PushExternalImage(aBuilder,
aBounds,
--- a/gfx/layers/wr/WebRenderTextureHost.h
+++ b/gfx/layers/wr/WebRenderTextureHost.h
@@ -69,17 +69,17 @@ public:
const std::function<wr::ImageKey()>& aImageKeyAllocator) override;
virtual void AddWRImage(wr::WebRenderAPI* aAPI,
Range<const wr::ImageKey>& aImageKeys,
const wr::ExternalImageId& aExtID) override;
virtual void PushExternalImage(wr::DisplayListBuilder& aBuilder,
const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
Range<const wr::ImageKey>& aImageKeys) override;
protected:
void CreateRenderTextureHost(const SurfaceDescriptor& aDesc, TextureHost* aTexture);
RefPtr<TextureHost> mWrappedTextureHost;
wr::ExternalImageId mExternalImageId;
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -647,264 +647,254 @@ void
DisplayListBuilder::PopClipAndScrollInfo()
{
WRDL_LOG("PopClipAndScroll\n");
wr_dp_pop_clip_and_scroll_info(mWrState);
}
void
DisplayListBuilder::PushRect(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrColor& aColor)
{
- WRDL_LOG("PushRect b=%s c=%s\n",
+ WRDL_LOG("PushRect b=%s cl=%s c=%s\n",
Stringify(aBounds).c_str(),
+ Stringify(aClip).c_str(),
Stringify(aColor).c_str());
- wr_dp_push_rect(mWrState, aBounds, aClip, aColor);
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
+ wr_dp_push_rect(mWrState, aBounds, tok, aColor);
}
void
DisplayListBuilder::PushLinearGradient(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrPoint& aStartPoint,
const WrPoint& aEndPoint,
const nsTArray<WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSize aTileSize,
const WrSize aTileSpacing)
{
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
wr_dp_push_linear_gradient(mWrState,
- aBounds, aClip,
+ aBounds, tok,
aStartPoint, aEndPoint,
aStops.Elements(), aStops.Length(),
aExtendMode,
aTileSize, aTileSpacing);
}
void
DisplayListBuilder::PushRadialGradient(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrPoint& aCenter,
const WrSize& aRadius,
const nsTArray<WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSize aTileSize,
const WrSize aTileSpacing)
{
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
wr_dp_push_radial_gradient(mWrState,
- aBounds, aClip,
+ aBounds, tok,
aCenter, aRadius,
aStops.Elements(), aStops.Length(),
aExtendMode,
aTileSize, aTileSpacing);
}
void
DisplayListBuilder::PushImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
wr::ImageKey aImage)
{
WrSize size;
size.width = aBounds.width;
size.height = aBounds.height;
PushImage(aBounds, aClip, size, size, aFilter, aImage);
}
void
DisplayListBuilder::PushImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrSize& aStretchSize,
const WrSize& aTileSpacing,
wr::ImageRendering aFilter,
wr::ImageKey aImage)
{
- WRDL_LOG("PushImage b=%s s=%s t=%s\n", Stringify(aBounds).c_str(),
- Stringify(aStretchSize).c_str(), Stringify(aTileSpacing).c_str());
- wr_dp_push_image(mWrState, aBounds, aClip, aStretchSize, aTileSpacing, aFilter, aImage);
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
+ WRDL_LOG("PushImage b=%s cl=%s s=%s t=%s\n", Stringify(aBounds).c_str(),
+ Stringify(aClip).c_str(), Stringify(aStretchSize).c_str(),
+ Stringify(aTileSpacing).c_str());
+ wr_dp_push_image(mWrState, aBounds, tok, aStretchSize, aTileSpacing, aFilter, aImage);
}
void
DisplayListBuilder::PushYCbCrPlanarImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageKey aImageChannel0,
wr::ImageKey aImageChannel1,
wr::ImageKey aImageChannel2,
WrYuvColorSpace aColorSpace,
wr::ImageRendering aRendering)
{
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
wr_dp_push_yuv_planar_image(mWrState,
aBounds,
- aClip,
+ tok,
aImageChannel0,
aImageChannel1,
aImageChannel2,
aColorSpace,
aRendering);
}
void
DisplayListBuilder::PushNV12Image(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageKey aImageChannel0,
wr::ImageKey aImageChannel1,
WrYuvColorSpace aColorSpace,
wr::ImageRendering aRendering)
{
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
wr_dp_push_yuv_NV12_image(mWrState,
aBounds,
- aClip,
+ tok,
aImageChannel0,
aImageChannel1,
aColorSpace,
aRendering);
}
void
DisplayListBuilder::PushYCbCrInterleavedImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageKey aImageChannel0,
WrYuvColorSpace aColorSpace,
wr::ImageRendering aRendering)
{
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
wr_dp_push_yuv_interleaved_image(mWrState,
aBounds,
- aClip,
+ tok,
aImageChannel0,
aColorSpace,
aRendering);
}
void
DisplayListBuilder::PushIFrame(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
PipelineId aPipeline)
{
- wr_dp_push_iframe(mWrState, aBounds, aClip, aPipeline);
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
+ wr_dp_push_iframe(mWrState, aBounds, tok, aPipeline);
}
void
DisplayListBuilder::PushBorder(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrBorderSide& aTop,
const WrBorderSide& aRight,
const WrBorderSide& aBottom,
const WrBorderSide& aLeft,
const WrBorderRadius& aRadius)
{
- wr_dp_push_border(mWrState, aBounds, aClip,
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
+ wr_dp_push_border(mWrState, aBounds, tok,
aWidths, aTop, aRight, aBottom, aLeft, aRadius);
}
void
DisplayListBuilder::PushBorderImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrBorderWidths& aWidths,
wr::ImageKey aImage,
const WrNinePatchDescriptor& aPatch,
const WrSideOffsets2Df32& aOutset,
const WrRepeatMode& aRepeatHorizontal,
const WrRepeatMode& aRepeatVertical)
{
- wr_dp_push_border_image(mWrState, aBounds, aClip,
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
+ wr_dp_push_border_image(mWrState, aBounds, tok,
aWidths, aImage, aPatch, aOutset,
aRepeatHorizontal, aRepeatVertical);
}
void
DisplayListBuilder::PushBorderGradient(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrPoint& aStartPoint,
const WrPoint& aEndPoint,
const nsTArray<WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSideOffsets2Df32& aOutset)
{
- wr_dp_push_border_gradient(mWrState, aBounds, aClip,
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
+ wr_dp_push_border_gradient(mWrState, aBounds, tok,
aWidths, aStartPoint, aEndPoint,
aStops.Elements(), aStops.Length(),
aExtendMode, aOutset);
}
void
DisplayListBuilder::PushBorderRadialGradient(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrPoint& aCenter,
const WrSize& aRadius,
const nsTArray<WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSideOffsets2Df32& aOutset)
{
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
wr_dp_push_border_radial_gradient(
- mWrState, aBounds, aClip, aWidths, aCenter,
+ mWrState, aBounds, tok, aWidths, aCenter,
aRadius, aStops.Elements(), aStops.Length(),
aExtendMode, aOutset);
}
void
DisplayListBuilder::PushText(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const gfx::Color& aColor,
wr::FontKey aFontKey,
Range<const WrGlyphInstance> aGlyphBuffer,
float aGlyphSize)
{
- wr_dp_push_text(mWrState, aBounds, aClip,
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
+ wr_dp_push_text(mWrState, aBounds, tok,
ToWrColor(aColor),
aFontKey,
&aGlyphBuffer[0], aGlyphBuffer.length(),
aGlyphSize);
}
void
DisplayListBuilder::PushBoxShadow(const WrRect& aRect,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrRect& aBoxBounds,
const WrPoint& aOffset,
const WrColor& aColor,
const float& aBlurRadius,
const float& aSpreadRadius,
const float& aBorderRadius,
const WrBoxShadowClipMode& aClipMode)
{
- wr_dp_push_box_shadow(mWrState, aRect, aClip,
+ WrClipRegionToken tok = wr_dp_push_clip_region(mWrState, aClip, nullptr, 0, nullptr);
+ wr_dp_push_box_shadow(mWrState, aRect, tok,
aBoxBounds, aOffset, aColor,
aBlurRadius, aSpreadRadius, aBorderRadius,
aClipMode);
}
-WrClipRegionToken
-DisplayListBuilder::PushClipRegion(const WrRect& aMain,
- const WrImageMask* aMask)
-{
- WRDL_LOG("PushClipRegion r=%s m=%p b=%s\n", Stringify(aMain).c_str(), aMask,
- aMask ? Stringify(aMask->rect).c_str() : "none");
- return wr_dp_push_clip_region(mWrState,
- aMain,
- nullptr, 0,
- aMask);
-}
-
-WrClipRegionToken
-DisplayListBuilder::PushClipRegion(const WrRect& aMain,
- const nsTArray<WrComplexClipRegion>& aComplex,
- const WrImageMask* aMask)
-{
- WRDL_LOG("PushClipRegion r=%s cl=%d m=%p b=%s\n", Stringify(aMain).c_str(),
- (int)aComplex.Length(), aMask,
- aMask ? Stringify(aMask->rect).c_str() : "none");
- return wr_dp_push_clip_region(mWrState,
- aMain,
- aComplex.Elements(), aComplex.Length(),
- aMask);
-}
-
Maybe<WrClipId>
DisplayListBuilder::TopmostClipId()
{
if (mClipIdStack.empty()) {
return Nothing();
}
return Some(mClipIdStack.back());
}
--- a/gfx/webrender_bindings/WebRenderAPI.h
+++ b/gfx/webrender_bindings/WebRenderAPI.h
@@ -169,133 +169,127 @@ public:
const WrRect& aClipRect);
void PopScrollLayer();
void PushClipAndScrollInfo(const layers::FrameMetrics::ViewID& aScrollId,
const WrClipId* aClipId);
void PopClipAndScrollInfo();
void PushRect(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrColor& aColor);
void PushLinearGradient(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrPoint& aStartPoint,
const WrPoint& aEndPoint,
const nsTArray<WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSize aTileSize,
const WrSize aTileSpacing);
void PushRadialGradient(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrPoint& aCenter,
const WrSize& aRadius,
const nsTArray<WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSize aTileSize,
const WrSize aTileSpacing);
void PushImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageRendering aFilter,
wr::ImageKey aImage);
void PushImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrSize& aStretchSize,
const WrSize& aTileSpacing,
wr::ImageRendering aFilter,
wr::ImageKey aImage);
void PushYCbCrPlanarImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageKey aImageChannel0,
wr::ImageKey aImageChannel1,
wr::ImageKey aImageChannel2,
WrYuvColorSpace aColorSpace,
wr::ImageRendering aFilter);
void PushNV12Image(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageKey aImageChannel0,
wr::ImageKey aImageChannel1,
WrYuvColorSpace aColorSpace,
wr::ImageRendering aFilter);
void PushYCbCrInterleavedImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::ImageKey aImageChannel0,
WrYuvColorSpace aColorSpace,
wr::ImageRendering aFilter);
void PushIFrame(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
wr::PipelineId aPipeline);
void PushBorder(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrBorderSide& aTop,
const WrBorderSide& aRight,
const WrBorderSide& aBbottom,
const WrBorderSide& aLeft,
const WrBorderRadius& aRadius);
void PushBorderImage(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrBorderWidths& aWidths,
wr::ImageKey aImage,
const WrNinePatchDescriptor& aPatch,
const WrSideOffsets2Df32& aOutset,
const WrRepeatMode& aRepeatHorizontal,
const WrRepeatMode& aRepeatVertical);
void PushBorderGradient(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrPoint& aStartPoint,
const WrPoint& aEndPoint,
const nsTArray<WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSideOffsets2Df32& aOutset);
void PushBorderRadialGradient(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrBorderWidths& aWidths,
const WrPoint& aCenter,
const WrSize& aRadius,
const nsTArray<WrGradientStop>& aStops,
wr::GradientExtendMode aExtendMode,
const WrSideOffsets2Df32& aOutset);
void PushText(const WrRect& aBounds,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const gfx::Color& aColor,
wr::FontKey aFontKey,
Range<const WrGlyphInstance> aGlyphBuffer,
float aGlyphSize);
void PushBoxShadow(const WrRect& aRect,
- const WrClipRegionToken aClip,
+ const WrRect& aClip,
const WrRect& aBoxBounds,
const WrPoint& aOffset,
const WrColor& aColor,
const float& aBlurRadius,
const float& aSpreadRadius,
const float& aBorderRadius,
const WrBoxShadowClipMode& aClipMode);
- WrClipRegionToken PushClipRegion(const WrRect& aMain,
- const WrImageMask* aMask = nullptr);
- WrClipRegionToken PushClipRegion(const WrRect& aMain,
- const nsTArray<WrComplexClipRegion>& aComplex,
- const WrImageMask* aMask = nullptr);
-
// Returns the clip id that was most recently pushed with PushClip and that
// has not yet been popped with PopClip. Return Nothing() if the clip stack
// is empty.
Maybe<WrClipId> TopmostClipId();
// Returns the scroll id that was pushed just before the given scroll id. This
// function returns Nothing() if the given scrollid has not been encountered,
// or if it is the rootmost scroll id (and therefore has no ancestor).
Maybe<layers::FrameMetrics::ViewID> ParentScrollIdFor(layers::FrameMetrics::ViewID aScrollId);
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -461,20 +461,18 @@ BulletRenderer::CreateWebRenderCommandsF
if (key.isNothing()) {
return;
}
const int32_t appUnitsPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect destRect = LayoutDeviceRect::FromAppUnits(mDest, appUnitsPerDevPixel);
WrRect dest = aSc.ToRelativeWrRectRounded(destRect);
- WrClipRegionToken clipRegion = aBuilder.PushClipRegion(dest);
-
aBuilder.PushImage(dest,
- clipRegion,
+ dest,
WrImageRendering::Auto,
key.value());
}
void
BulletRenderer::CreateWebRenderCommandsForPath(nsDisplayItem* aItem,
wr::DisplayListBuilder& aBuilder,
const layers::StackingContextHelper& aSc,
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -316,17 +316,17 @@ nsDisplayCanvasBackgroundColor::CreateWe
nsRect bgClipRect = frame->CanvasArea() + offset;
int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect rect = LayoutDeviceRect::FromAppUnits(
bgClipRect, appUnitsPerDevPixel);
WrRect transformedRect = aSc.ToRelativeWrRect(rect);
aBuilder.PushRect(transformedRect,
- aBuilder.PushClipRegion(transformedRect),
+ transformedRect,
wr::ToWrColor(ToDeviceColor(mColor)));
}
#ifdef MOZ_DUMP_PAINTING
void
nsDisplayCanvasBackgroundColor::WriteDebugInfo(std::stringstream& aStream)
{
aStream << " (rgba "
--- a/layout/painting/nsCSSRenderingBorders.cpp
+++ b/layout/painting/nsCSSRenderingBorders.cpp
@@ -3556,23 +3556,22 @@ nsCSSBorderRenderer::CreateWebRenderComm
{
LayoutDeviceRect outerRect = LayoutDeviceRect::FromUnknownRect(mOuterRect);
WrRect transformedRect = aSc.ToRelativeWrRect(outerRect);
WrBorderSide side[4];
NS_FOR_CSS_SIDES(i) {
side[i] = wr::ToWrBorderSide(ToDeviceColor(mBorderColors[i]), mBorderStyles[i]);
}
- WrClipRegionToken clipRegion = aBuilder.PushClipRegion(transformedRect);
WrBorderRadius borderRadius = wr::ToWrBorderRadius(LayerSize(mBorderRadii[0].width, mBorderRadii[0].height),
LayerSize(mBorderRadii[1].width, mBorderRadii[1].height),
LayerSize(mBorderRadii[3].width, mBorderRadii[3].height),
LayerSize(mBorderRadii[2].width, mBorderRadii[2].height));
aBuilder.PushBorder(transformedRect,
- clipRegion,
+ transformedRect,
wr::ToWrBorderWidths(mBorderWidths[0], mBorderWidths[1], mBorderWidths[2], mBorderWidths[3]),
side[0], side[1], side[2], side[3],
borderRadius);
}
/* static */Maybe<nsCSSBorderImageRenderer>
nsCSSBorderImageRenderer::CreateBorderImageRenderer(nsPresContext* aPresContext,
nsIFrame* aForFrame,
--- a/layout/painting/nsCSSRenderingGradients.cpp
+++ b/layout/painting/nsCSSRenderingGradients.cpp
@@ -1079,30 +1079,30 @@ nsCSSGradientRenderer::BuildWebRenderDis
lineStart.y = (lineStart.y - srcTransform.y) * srcTransform.height;
if (mGradient->mShape == NS_STYLE_GRADIENT_SHAPE_LINEAR) {
lineEnd.x = (lineEnd.x - srcTransform.x) * srcTransform.width;
lineEnd.y = (lineEnd.y - srcTransform.y) * srcTransform.height;
aBuilder.PushLinearGradient(
wrGradientBounds,
- aBuilder.PushClipRegion(wrClipBounds),
+ wrClipBounds,
mozilla::wr::ToWrPoint(lineStart),
mozilla::wr::ToWrPoint(lineEnd),
stops,
extendMode,
mozilla::wr::ToWrSize(layerFirstTileSize),
mozilla::wr::ToWrSize(tileSpacing));
} else {
gradientRadius.width *= srcTransform.width;
gradientRadius.height *= srcTransform.height;
aBuilder.PushRadialGradient(
wrGradientBounds,
- aBuilder.PushClipRegion(wrClipBounds),
+ wrClipBounds,
mozilla::wr::ToWrPoint(lineStart),
mozilla::wr::ToWrSize(gradientRadius),
stops,
extendMode,
mozilla::wr::ToWrSize(layerFirstTileSize),
mozilla::wr::ToWrSize(tileSpacing));
}
}
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -4613,22 +4613,22 @@ nsDisplayCaret::CreateWebRenderCommands(
LayoutDeviceRect devHookRect = LayoutDeviceRect::FromAppUnits(
hookRect + ToReferenceFrame(), appUnitsPerDevPixel);
WrRect caret = aSc.ToRelativeWrRectRounded(devCaretRect);
WrRect hook = aSc.ToRelativeWrRectRounded(devHookRect);
// Note, WR will pixel snap anything that is layout aligned.
aBuilder.PushRect(caret,
- aBuilder.PushClipRegion(caret),
+ caret,
wr::ToWrColor(color));
if (!devHookRect.IsEmpty()) {
aBuilder.PushRect(hook,
- aBuilder.PushClipRegion(hook),
+ hook,
wr::ToWrColor(color));
}
}
LayerState
nsDisplayCaret::GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters)
@@ -4890,17 +4890,17 @@ nsDisplayBorder::CreateBorderImageWebRen
}
Maybe<wr::ImageKey> key = aLayer->SendImageContainer(container, aParentCommands);
if (key.isNothing()) {
return;
}
aBuilder.PushBorderImage(dest,
- aBuilder.PushClipRegion(clip),
+ clip,
wr::ToWrBorderWidths(widths[0], widths[1], widths[2], widths[3]),
key.value(),
wr::ToWrNinePatchDescriptor(
(float)(mBorderImageRenderer->mImageSize.width) / appUnitsPerDevPixel,
(float)(mBorderImageRenderer->mImageSize.height) / appUnitsPerDevPixel,
wr::ToWrSideOffsets2Du32(slice[0], slice[1], slice[2], slice[3])),
wr::ToWrSideOffsets2Df32(outset[0], outset[1], outset[2], outset[3]),
wr::ToWrRepeatMode(mBorderImageRenderer->mRepeatModeHorizontal),
@@ -4923,26 +4923,26 @@ nsDisplayBorder::CreateBorderImageWebRen
if (gradientData->mShape == NS_STYLE_GRADIENT_SHAPE_LINEAR) {
LayerPoint startPoint = LayerPoint(dest.x, dest.y);
startPoint = startPoint + ViewAs<LayerPixel>(lineStart, PixelCastJustification::WebRenderHasUnitResolution);
LayerPoint endPoint = LayerPoint(dest.x, dest.y);
endPoint = endPoint + ViewAs<LayerPixel>(lineEnd, PixelCastJustification::WebRenderHasUnitResolution);
aBuilder.PushBorderGradient(dest,
- aBuilder.PushClipRegion(clip),
+ clip,
wr::ToWrBorderWidths(widths[0], widths[1], widths[2], widths[3]),
wr::ToWrPoint(startPoint),
wr::ToWrPoint(endPoint),
stops,
extendMode,
wr::ToWrSideOffsets2Df32(outset[0], outset[1], outset[2], outset[3]));
} else {
aBuilder.PushBorderRadialGradient(dest,
- aBuilder.PushClipRegion(clip),
+ clip,
wr::ToWrBorderWidths(widths[0], widths[1], widths[2], widths[3]),
wr::ToWrPoint(lineStart),
wr::ToWrSize(gradientRadius),
stops,
extendMode,
wr::ToWrSideOffsets2Df32(outset[0], outset[1], outset[2], outset[3]));
}
break;
@@ -5259,17 +5259,17 @@ nsDisplayBoxShadowOuter::CreateWebRender
WrRect deviceClipRect = aSc.ToRelativeWrRect(clipRect);
// TODO: support non-uniform border radius.
float borderRadius = hasBorderRadius ? borderRadii.TopLeft().width
: 0.0;
float spreadRadius = float(shadow->mSpread) / float(appUnitsPerDevPixel);
aBuilder.PushBoxShadow(deviceBoxRect,
- aBuilder.PushClipRegion(deviceClipRect),
+ deviceClipRect,
deviceBoxRect,
wr::ToWrPoint(shadowOffset),
wr::ToWrColor(shadowColor),
blurRadius,
spreadRadius,
borderRadius,
WrBoxShadowClipMode::Outset);
}
@@ -5416,17 +5416,17 @@ nsDisplayBoxShadowInner::CreateInsetBoxS
float blurRadius = float(shadowItem->mRadius) / float(appUnitsPerDevPixel);
// TODO: WR doesn't support non-uniform border radii
float borderRadius = innerRadii.TopLeft().width;
// NOTE: Any spread radius > 0 will render nothing. WR Bug.
float spreadRadius = float(shadowItem->mSpread) / float(appUnitsPerDevPixel);
aBuilder.PushBoxShadow(wr::ToWrRect(deviceBoxRect),
- aBuilder.PushClipRegion(deviceClipRect),
+ deviceClipRect,
wr::ToWrRect(deviceBoxRect),
wr::ToWrPoint(shadowOffset),
wr::ToWrColor(shadowColor),
blurRadius,
spreadRadius,
borderRadius,
WrBoxShadowClipMode::Inset
);
--- a/layout/painting/nsImageRenderer.cpp
+++ b/layout/painting/nsImageRenderer.cpp
@@ -647,17 +647,17 @@ nsImageRenderer::BuildWebRenderDisplayIt
aFill.XMost() - firstTilePos.x, aFill.YMost() - firstTilePos.y),
appUnitsPerDevPixel);
WrRect fill = aSc.ToRelativeWrRect(fillRect);
WrRect clip = aSc.ToRelativeWrRect(
LayoutDeviceRect::FromAppUnits(aFill, appUnitsPerDevPixel));
LayoutDeviceSize gapSize = LayoutDeviceSize::FromAppUnits(
aRepeatSize - aDest.Size(), appUnitsPerDevPixel);
- aBuilder.PushImage(fill, aBuilder.PushClipRegion(clip),
+ aBuilder.PushImage(fill, clip,
wr::ToWrSize(destRect.Size()), wr::ToWrSize(gapSize),
wr::ImageRendering::Auto, key.value());
break;
}
default:
break;
}
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -7427,20 +7427,19 @@ BCBlockDirSeg::CreateWebRenderCommands(B
WrBorderRadius borderRadii = wr::ToWrBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
// All border style is set to none except left side. So setting the widths of
// each side to width of rect is fine.
WrBorderWidths borderWidths = wr::ToWrBorderWidths(transformedRect.width,
transformedRect.width,
transformedRect.width,
transformedRect.width);
- WrClipRegionToken clipRegion = aBuilder.PushClipRegion(transformedRect);
transformedRect.width *= 2.0f;
aBuilder.PushBorder(transformedRect,
- clipRegion,
+ transformedRect,
borderWidths,
wrSide[0], wrSide[1], wrSide[2], wrSide[3],
borderRadii);
}
/**
* Advance the start point of a segment
*/
@@ -7686,20 +7685,19 @@ BCInlineDirSeg::CreateWebRenderCommands(
WrBorderRadius borderRadii = wr::ToWrBorderRadius( {0, 0}, {0, 0}, {0, 0}, {0, 0} );
// All border style is set to none except top side. So setting the widths of
// each side to height of rect is fine.
WrBorderWidths borderWidths = wr::ToWrBorderWidths(transformedRect.height,
transformedRect.height,
transformedRect.height,
transformedRect.height);
- WrClipRegionToken clipRegion = aBuilder.PushClipRegion(transformedRect);
transformedRect.height *= 2.0f;
aBuilder.PushBorder(transformedRect,
- clipRegion,
+ transformedRect,
borderWidths,
wrSide[0], wrSide[1], wrSide[2], wrSide[3],
borderRadii);
}
/**
* Advance the start point of a segment
*/
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -2102,19 +2102,18 @@ nsChildView::AddWindowOverlayWebRenderCo
updatedTitlebarRegion.SetEmpty();
}
if (!updatedTitlebarRegion.IsEmpty()) {
aWrBridge->SendUpdateImage(*mTitlebarImageKey, size, format, buffer);
}
WrRect rect = wr::ToWrRect(mTitlebarRect);
- WrClipRegionToken clip = aBuilder.PushClipRegion(rect, nullptr);
aBuilder.PushImage(WrRect{ 0, 0, float(size.width), float(size.height) },
- clip, wr::ImageRendering::Auto, *mTitlebarImageKey);
+ rect, wr::ImageRendering::Auto, *mTitlebarImageKey);
}
}
void
nsChildView::CleanupWebRenderWindowOverlay(layers::WebRenderBridgeChild* aWrBridge)
{
if (mTitlebarImageKey) {
aWrBridge->SendDeleteImage(*mTitlebarImageKey);