Bug 1267438 - Use IntersectMaybeRects() in Layer::GetCombinedClipRect(). r=mstange draft
authorBotond Ballo <botond@mozilla.com>
Fri, 29 Apr 2016 15:44:08 -0400
changeset 363524 09606811c5005f956c2684062f2ffa919e99f329
parent 357075 86ced7735a7db45a74209efc6a1d8a2e0c5d77ab
child 363525 c46d0d27145df9b268e70ab5aed67c8c64df9433
push id17233
push userbballo@mozilla.com
push dateThu, 05 May 2016 00:23:30 +0000
reviewersmstange
bugs1267438
milestone49.0a1
Bug 1267438 - Use IntersectMaybeRects() in Layer::GetCombinedClipRect(). r=mstange MozReview-Commit-ID: 5DkpzyFrDQ0
gfx/layers/Layers.cpp
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -1104,26 +1104,17 @@ Layer::GetVisibleRegionRelativeToRootLay
 }
 
 Maybe<ParentLayerIntRect>
 Layer::GetCombinedClipRect() const
 {
   Maybe<ParentLayerIntRect> clip = GetClipRect();
 
   for (size_t i = 0; i < mScrollMetadata.Length(); i++) {
-    if (!mScrollMetadata[i].HasClipRect()) {
-      continue;
-    }
-
-    const ParentLayerIntRect& other = mScrollMetadata[i].ClipRect();
-    if (clip) {
-      clip = Some(clip.value().Intersect(other));
-    } else {
-      clip = Some(other);
-    }
+    clip = IntersectMaybeRects(clip, mScrollMetadata[i].GetClipRect());
   }
 
   return clip;
 }
 
 ContainerLayer::ContainerLayer(LayerManager* aManager, void* aImplData)
   : Layer(aManager, aImplData),
     mFirstChild(nullptr),