Bug 1302470 Part 5: Change nsDisplayList::GetOpaqueRegion non-opaque lists to build up a region from its children. r=mattwoodrow
☠☠ backed out by 28f8fc94cf1a ☠ ☠
authorBrad Werth <bwerth@mozilla.com>
Thu, 20 Apr 2017 10:50:41 -0700
changeset 402426 4fc16536ce41582bf99fedd22eb1b3bf3242d3a2
parent 402425 71de099b2eb7b7b6620008811f4344c978264945
child 402427 eb2930fc7c597cc894eec94344af56804a1d157f
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1302470
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1302470 Part 5: Change nsDisplayList::GetOpaqueRegion non-opaque lists to build up a region from its children. r=mattwoodrow MozReview-Commit-ID: LEuvazbz1X
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -5495,22 +5495,30 @@ nsDisplayWrapList::ComputeVisibility(nsD
   aBuilder->SubtractFromVisibleRegion(aVisibleRegion, removed);
 
   return retval;
 }
 
 nsRegion
 nsDisplayWrapList::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
                                    bool* aSnap) {
-  *aSnap = false;
   nsRegion result;
   if (mList.IsOpaque()) {
     // Everything within GetBounds that's visible is opaque.
     result = GetBounds(aBuilder, aSnap);
-  }
+  } else if (aBuilder->HitTestShouldStopAtFirstOpaque()) {
+    // If we care about an accurate opaque region, iterate the display list
+    // and build up a region of opaque bounds.
+    nsDisplayItem* item = mList.GetBottom();
+    while (item) {
+      result.OrWith(item->GetOpaqueRegion(aBuilder, aSnap));
+      item = item->GetAbove();
+    }
+  }
+  *aSnap = false;
   return result;
 }
 
 Maybe<nscolor>
 nsDisplayWrapList::IsUniform(nsDisplayListBuilder* aBuilder) {
   // We could try to do something but let's conservatively just return Nothing.
   return Nothing();
 }