Bug 1355045 - Transform bounds before making relative to parent in GetWrRelBounds. r?ethlin
MozReview-Commit-ID: 7xLzPM1lmz0
--- a/gfx/layers/wr/WebRenderLayerManager.cpp
+++ b/gfx/layers/wr/WebRenderLayerManager.cpp
@@ -153,24 +153,24 @@ WebRenderLayer::GetWrBoundTransform()
transform._42 = 0.0f;
transform._43 = 0.0f;
return transform;
}
gfx::Rect
WebRenderLayer::GetWrRelBounds()
{
- gfx::Rect relBounds = VisibleBoundsRelativeToParent();
+ gfx::Rect bounds = IntRectToRect(GetLayer()->GetVisibleRegion().GetBounds().ToUnknownRect());
gfx::Matrix4x4 transform = GetWrBoundTransform();
if (!transform.IsIdentity()) {
// WR will only apply the 'translate' of the transform, so we need to do the scale/rotation manually.
- relBounds.MoveTo(transform.TransformPoint(relBounds.TopLeft()));
+ bounds.MoveTo(transform.TransformPoint(bounds.TopLeft()));
}
- return relBounds;
+ return RelativeToParent(bounds);
}
void
WebRenderLayer::DumpLayerInfo(const char* aLayerType, gfx::Rect& aRect)
{
if (!gfxPrefs::LayersDump()) {
return;
}