Bug 1217168 - Respect layer clip rects during plugin visibility computation. r=jimm, a=ritu
authorMarkus Stange <mstange@themasta.com>
Tue, 27 Oct 2015 21:06:57 +0100
changeset 305455 d6e5df20ab6195aee11a8928e81e532026a676d6
parent 305454 a47427a35e8c7172d06a38b8cada675a4504a3b5
child 305456 348be28b64b62abc5b3b0a45de9575a7f754d5b6
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, ritu
bugs1217168
milestone44.0a2
Bug 1217168 - Respect layer clip rects during plugin visibility computation. r=jimm, a=ritu
gfx/layers/Layers.cpp
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -1049,16 +1049,22 @@ Layer::GetVisibleRegionRelativeToRootLay
       }
 
       // Retreive the translation from sibling to |layer|. The accumulated
       // visible region is currently oriented with |layer|.
       IntPoint siblingOffset = RoundedToInt(siblingMatrix.GetTranslation());
       nsIntRegion siblingVisibleRegion(sibling->GetEffectiveVisibleRegion());
       // Translate the siblings region to |layer|'s origin.
       siblingVisibleRegion.MoveBy(-siblingOffset.x, -siblingOffset.y);
+      // Apply the sibling's clip.
+      // Layer clip rects are not affected by the layer's transform.
+      Maybe<ParentLayerIntRect> clipRect = sibling->GetEffectiveClipRect();
+      if (clipRect) {
+        siblingVisibleRegion.AndWith(ParentLayerIntRect::ToUntyped(*clipRect));
+      }
       // Subtract the sibling visible region from the visible region of |this|.
       aResult.SubOut(siblingVisibleRegion);
     }
 
     // Keep track of the total offset for aLayerOffset.  We use this in plugin
     // positioning code.
     offset += currentLayerOffset;
   }