Bug 1355045 - Transform bounds before making relative to parent in GetWrRelBounds. r?ethlin draft
authorJamie Nicol <jnicol@mozilla.com>
Fri, 07 Apr 2017 15:13:50 +0100
changeset 559693 a6959ef776374844daeb3fc7e7dc3f56b5e9b4be
parent 559692 b47985cfad21e8afb2bc3915483cd233424efa35
child 623466 0d08008934fbfbd7e98d26c29437b13ba1cd2757
push id53169
push userbmo:jnicol@mozilla.com
push dateMon, 10 Apr 2017 12:10:58 +0000
reviewersethlin
bugs1355045
milestone55.0a1
Bug 1355045 - Transform bounds before making relative to parent in GetWrRelBounds. r?ethlin MozReview-Commit-ID: 7xLzPM1lmz0
gfx/layers/wr/WebRenderLayerManager.cpp
--- 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;
   }