Bug 1360246 - Clean up WebRenderRefLayer::RenderLayer. r=nical
This cleans up WebRenderRefLayer::RenderLayer to use typed coordinate
systems and the StackingContextHelper. Note that this patch contains a
functional change, because the clip rect pushed no longer includes the
transform on the ref layer itself. It's not clear to me why we were doing
that, and didn't seem correct.
MozReview-Commit-ID: K7FoeLnXc56
--- a/gfx/layers/wr/WebRenderContainerLayer.cpp
+++ b/gfx/layers/wr/WebRenderContainerLayer.cpp
@@ -104,26 +104,17 @@ WebRenderContainerLayer::RenderLayer(wr:
}
aBuilder.PopClip();
}
void
WebRenderRefLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc)
{
- gfx::Matrix4x4 transform;// = GetTransform();
- gfx::Rect relBounds = TransformedVisibleBoundsRelativeToParent();
-
- WrClipRegion clipRegion = aBuilder.BuildClipRegion(wr::ToWrRect(relBounds));
+ LayerRect rect = Bounds();
+ DumpLayerInfo("RefLayer", rect);
- if (gfxPrefs::LayersDump()) {
- printf_stderr("RefLayer %p (%" PRIu64 ") using bounds/overflow=%s, transform=%s\n",
- this->GetLayer(),
- mId,
- Stringify(relBounds).c_str(),
- Stringify(transform).c_str());
- }
-
- aBuilder.PushIFrame(wr::ToWrRect(relBounds), clipRegion, wr::AsPipelineId(mId));
+ WrClipRegion clipRegion = aBuilder.BuildClipRegion(aSc.ToRelativeWrRect(rect));
+ aBuilder.PushIFrame(aSc.ToRelativeWrRect(rect), clipRegion, wr::AsPipelineId(mId));
}
} // namespace layers
} // namespace mozilla