Bug 1496726 - Fix how some display item containers were missing from the clip optimization exclusion list. r=mstange
authorAndrew Osmond <aosmond@mozilla.com>
Sat, 06 Oct 2018 16:26:23 -0400
changeset 496043 13430c50d08491283e924ac2598b95528aebe642
parent 496042 e1c02731e238c9ddc4c03d624b388563953be819
child 496044 a7a2ce19cf57ed93bcf26d6fce128d6a2497ecc8
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1496726
milestone64.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 1496726 - Fix how some display item containers were missing from the clip optimization exclusion list. r=mstange Differential Revision: https://phabricator.services.mozilla.com/D7966
gfx/layers/wr/ClipManager.cpp
--- a/gfx/layers/wr/ClipManager.cpp
+++ b/gfx/layers/wr/ClipManager.cpp
@@ -157,49 +157,25 @@ ClipManager::BeginItem(nsDisplayItem* aI
     asr = static_cast<nsDisplayStickyPosition*>(aItem)->GetContainerASR();
   }
 
   // In most cases we can combine the leaf of the clip chain with the clip rect
   // of the display item. This reduces the number of clip items, which avoids
   // some overhead further down the pipeline.
   bool separateLeaf = false;
   if (clip && clip->mASR == asr && clip->mClip.GetRoundedRectCount() == 0) {
-    switch (type) {
-      case DisplayItemType::TYPE_BLEND_CONTAINER:
-      case DisplayItemType::TYPE_BLEND_MODE:
-      case DisplayItemType::TYPE_FILTER:
-      case DisplayItemType::TYPE_FIXED_POSITION:
-      case DisplayItemType::TYPE_MASK:
-      case DisplayItemType::TYPE_OPACITY:
-      case DisplayItemType::TYPE_OWN_LAYER:
-      case DisplayItemType::TYPE_PERSPECTIVE:
-      case DisplayItemType::TYPE_RESOLUTION:
-      case DisplayItemType::TYPE_SCROLL_INFO_LAYER:
-      case DisplayItemType::TYPE_STICKY_POSITION:
-      case DisplayItemType::TYPE_SUBDOCUMENT:
-      case DisplayItemType::TYPE_SVG_WRAPPER:
-      case DisplayItemType::TYPE_TABLE_BLEND_CONTAINER:
-      case DisplayItemType::TYPE_TABLE_BLEND_MODE:
-      case DisplayItemType::TYPE_TABLE_FIXED_POSITION:
-      case DisplayItemType::TYPE_TRANSFORM:
-      case DisplayItemType::TYPE_WRAP_LIST:
-        // Container display items are not currently supported because the clip
-        // rect of a stacking context is not handled the same as normal display
-        // items.
-        break;
-      case DisplayItemType::TYPE_TEXT:
-        // Text with shadows interprets the text display item clip rect and
-        // clips from the clip chain differently.
-        if (aItem->Frame()->StyleText()->HasTextShadow()) {
-          break;
-        }
-        MOZ_FALLTHROUGH;
-      default:
-        separateLeaf = true;
-        break;
+    if (type == DisplayItemType::TYPE_TEXT) {
+      // Text with shadows interprets the text display item clip rect and
+      // clips from the clip chain differently.
+      separateLeaf = !aItem->Frame()->StyleText()->HasTextShadow();
+    } else {
+      // Container display items are not currently supported because the clip
+      // rect of a stacking context is not handled the same as normal display
+      // items.
+      separateLeaf = aItem->GetChildren() == nullptr;
     }
   }
 
   ItemClips clips(asr, clip, separateLeaf);
   MOZ_ASSERT(!mItemClipStack.empty());
   if (clips.HasSameInputs(mItemClipStack.top())) {
     // Early-exit because if the clips are the same as aItem's previous sibling,
     // then we don't need to do do the work of popping the old stuff and then