Bug 913443 - Move IsWidgetLayerManager() check out of UpdateCommonClipCount. r=roc
authorMarkus Stange <mstange@themasta.com>
Tue, 03 Mar 2015 17:00:55 -0500
changeset 231934 eaa3b47fe9ded6abaea39d67e96869dc4ef43136
parent 231933 66fe954cbf8c9099955453b2f46da3948e0323b2
child 231935 c58f78777ab1cbb7d032b6ed11d70b7e7763c483
push id28364
push usercbook@mozilla.com
push dateThu, 05 Mar 2015 14:12:01 +0000
treeherdermozilla-central@fa59461863f5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs913443
milestone39.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 913443 - Move IsWidgetLayerManager() check out of UpdateCommonClipCount. r=roc UpdateCommonClipCount accesses the PaintedLayerData's mLayer field in order to get the layer manager. We want to be able to call UpdateCommonClipCount when mLayer is null.
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -2028,20 +2028,16 @@ ContainerState::FindOpaqueBackgroundColo
   }
   return mContainerUniformBackgroundColor;
 }
 
 void
 PaintedLayerData::UpdateCommonClipCount(
     const DisplayItemClip& aCurrentClip)
 {
-  if (!mLayer->Manager()->IsWidgetLayerManager()) {
-    return;
-  }
-
   if (mCommonClipCount >= 0) {
     mCommonClipCount = mItemClip.GetCommonRoundedRectCount(aCurrentClip, mCommonClipCount);
   } else {
     // first item in the layer
     mCommonClipCount = aCurrentClip.GetRoundedRectCount();
   }
 }
 
@@ -3204,17 +3200,19 @@ ContainerState::ProcessDisplayItems(nsDi
 
       if (itemType == nsDisplayItem::TYPE_LAYER_EVENT_REGIONS) {
         nsDisplayLayerEventRegions* eventRegions =
             static_cast<nsDisplayLayerEventRegions*>(item);
         paintedLayerData->AccumulateEventRegions(eventRegions);
       } else {
         // check to see if the new item has rounded rect clips in common with
         // other items in the layer
-        paintedLayerData->UpdateCommonClipCount(itemClip);
+        if (mManager->IsWidgetLayerManager()) {
+          paintedLayerData->UpdateCommonClipCount(itemClip);
+        }
 
         InvalidateForLayerChange(item, paintedLayerData->mLayer);
 
         mLayerBuilder->AddPaintedDisplayItem(paintedLayerData, item, itemClip,
                                             *this, layerState, topLeft);
         nsIntRegion opaquePixels = ComputeOpaqueRect(item,
             animatedGeometryRoot, paintedLayerData->mFixedPosFrameForLayerData,
             itemClip, aList,