Loading layout/painting/FrameLayerBuilder.cpp +17 −29 Original line number Diff line number Diff line Loading @@ -2011,19 +2011,6 @@ FrameLayerBuilder::DidBeginRetainedLayerTransaction(LayerManager* aManager) } } void FrameLayerBuilder::StoreOptimizedLayerForFrame(nsDisplayItem* aItem, Layer* aLayer) { if (!mRetainingManager) { return; } DisplayItemData* data = GetDisplayItemDataForManager(aItem, aLayer->Manager()); NS_ASSERTION(data, "Must have already stored data for this item!"); data->mOptLayer = aLayer; data->mItem = nullptr; } void FrameLayerBuilder::DidEndTransaction() { Loading Loading @@ -3192,16 +3179,6 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB mNewChildLayers[data->mNewChildLayersIndex].mLayer = paintedLayer.forget(); } for (auto& item : data->mAssignedDisplayItems) { MOZ_ASSERT(item.mItem->GetType() != DisplayItemType::TYPE_LAYER_EVENT_REGIONS); MOZ_ASSERT(item.mItem->GetType() != DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO); InvalidateForLayerChange(item.mItem, data->mLayer, item.mDisplayItemData); mLayerBuilder->AddPaintedDisplayItem(data, item, *this, data->mAnimatedGeometryRootOffset); item.mDisplayItemData = nullptr; } PaintedDisplayItemLayerUserData* userData = GetPaintedDisplayItemLayerUserData(data->mLayer); NS_ASSERTION(userData, "where did our user data go?"); userData->mLastItemCount = data->mAssignedDisplayItems.Length(); Loading Loading @@ -3246,10 +3223,6 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB data->mLayer->SetVisibleRegion(LayerIntRegion()); data->mLayer->InvalidateWholeLayer(); data->mLayer->SetEventRegions(EventRegions()); for (auto& item : data->mAssignedDisplayItems) { mLayerBuilder->StoreOptimizedLayerForFrame(item.mItem, layer); } } } Loading @@ -3260,6 +3233,15 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB FLB_LOG_PAINTED_LAYER_DECISION(data, " Selected painted layer=%p\n", layer.get()); } for (auto& item : data->mAssignedDisplayItems) { MOZ_ASSERT(item.mItem->GetType() != DisplayItemType::TYPE_LAYER_EVENT_REGIONS); MOZ_ASSERT(item.mItem->GetType() != DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO); InvalidateForLayerChange(item.mItem, data->mLayer, item.mDisplayItemData); mLayerBuilder->AddPaintedDisplayItem(data, item, *this, layer); item.mDisplayItemData = nullptr; } if (mLayerBuilder->IsBuildingRetainedLayers()) { newLayerEntry->mVisibleRegion = data->mVisibleRegion; newLayerEntry->mOpaqueRegion = data->mOpaqueRegion; Loading Loading @@ -4785,7 +4767,7 @@ void FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData, AssignedDisplayItem& aItem, ContainerState& aContainerState, const nsPoint& aTopLeft) Layer* aLayer) { PaintedLayer* layer = aLayerData->mLayer; PaintedDisplayItemLayerUserData* paintedData = Loading @@ -4801,7 +4783,7 @@ FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData, // We need to grab these before updating the DisplayItemData because it will overwrite them. nsRegion clip; if (aItem.mClip.ComputeRegionInClips(&aItem.mDisplayItemData->GetClip(), aTopLeft - paintedData->mLastAnimatedGeometryRootOrigin, aLayerData->mAnimatedGeometryRootOffset - paintedData->mLastAnimatedGeometryRootOrigin, &clip)) { intClip = clip.GetBounds().ScaleToOutsidePixels(paintedData->mXScale, paintedData->mYScale, Loading @@ -4823,6 +4805,12 @@ FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData, data = StoreDataForFrame(aItem.mItem, layer, aItem.mLayerState, nullptr); } data->mInactiveManager = tempManager; // We optimized this PaintedLayer into a ColorLayer/ImageLayer. Store the optimized // layer here. if (aLayer != layer) { data->mOptLayer = aLayer; data->mItem = nullptr; } } if (tempManager) { Loading layout/painting/FrameLayerBuilder.h +2 −10 Original line number Diff line number Diff line Loading @@ -510,10 +510,10 @@ public: * aItem must have an underlying frame. * @param aTopLeft offset from active scrolled root to reference frame */ void AddPaintedDisplayItem(PaintedLayerData* aLayer, void AddPaintedDisplayItem(PaintedLayerData* aLayerData, AssignedDisplayItem& aAssignedDisplayItem, ContainerState& aContainerState, const nsPoint& aTopLeft); Layer* aLayer); /** * Calls GetOldLayerForFrame on the underlying frame of the display item, Loading Loading @@ -590,14 +590,6 @@ public: */ static gfxSize GetPaintedLayerScaleForFrame(nsIFrame* aFrame); /** * Stores a Layer as the dedicated layer in the DisplayItemData for a given frame/key pair. * * Used when we optimize a PaintedLayer into an ImageLayer and want to retroactively update the * DisplayItemData so we can retrieve the layer from within layout. */ void StoreOptimizedLayerForFrame(nsDisplayItem* aItem, Layer* aLayer); static void RemoveFrameFromLayerManager(const nsIFrame* aFrame, SmallPointerArray<DisplayItemData>& aArray); Loading Loading
layout/painting/FrameLayerBuilder.cpp +17 −29 Original line number Diff line number Diff line Loading @@ -2011,19 +2011,6 @@ FrameLayerBuilder::DidBeginRetainedLayerTransaction(LayerManager* aManager) } } void FrameLayerBuilder::StoreOptimizedLayerForFrame(nsDisplayItem* aItem, Layer* aLayer) { if (!mRetainingManager) { return; } DisplayItemData* data = GetDisplayItemDataForManager(aItem, aLayer->Manager()); NS_ASSERTION(data, "Must have already stored data for this item!"); data->mOptLayer = aLayer; data->mItem = nullptr; } void FrameLayerBuilder::DidEndTransaction() { Loading Loading @@ -3192,16 +3179,6 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB mNewChildLayers[data->mNewChildLayersIndex].mLayer = paintedLayer.forget(); } for (auto& item : data->mAssignedDisplayItems) { MOZ_ASSERT(item.mItem->GetType() != DisplayItemType::TYPE_LAYER_EVENT_REGIONS); MOZ_ASSERT(item.mItem->GetType() != DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO); InvalidateForLayerChange(item.mItem, data->mLayer, item.mDisplayItemData); mLayerBuilder->AddPaintedDisplayItem(data, item, *this, data->mAnimatedGeometryRootOffset); item.mDisplayItemData = nullptr; } PaintedDisplayItemLayerUserData* userData = GetPaintedDisplayItemLayerUserData(data->mLayer); NS_ASSERTION(userData, "where did our user data go?"); userData->mLastItemCount = data->mAssignedDisplayItems.Length(); Loading Loading @@ -3246,10 +3223,6 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB data->mLayer->SetVisibleRegion(LayerIntRegion()); data->mLayer->InvalidateWholeLayer(); data->mLayer->SetEventRegions(EventRegions()); for (auto& item : data->mAssignedDisplayItems) { mLayerBuilder->StoreOptimizedLayerForFrame(item.mItem, layer); } } } Loading @@ -3260,6 +3233,15 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB FLB_LOG_PAINTED_LAYER_DECISION(data, " Selected painted layer=%p\n", layer.get()); } for (auto& item : data->mAssignedDisplayItems) { MOZ_ASSERT(item.mItem->GetType() != DisplayItemType::TYPE_LAYER_EVENT_REGIONS); MOZ_ASSERT(item.mItem->GetType() != DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO); InvalidateForLayerChange(item.mItem, data->mLayer, item.mDisplayItemData); mLayerBuilder->AddPaintedDisplayItem(data, item, *this, layer); item.mDisplayItemData = nullptr; } if (mLayerBuilder->IsBuildingRetainedLayers()) { newLayerEntry->mVisibleRegion = data->mVisibleRegion; newLayerEntry->mOpaqueRegion = data->mOpaqueRegion; Loading Loading @@ -4785,7 +4767,7 @@ void FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData, AssignedDisplayItem& aItem, ContainerState& aContainerState, const nsPoint& aTopLeft) Layer* aLayer) { PaintedLayer* layer = aLayerData->mLayer; PaintedDisplayItemLayerUserData* paintedData = Loading @@ -4801,7 +4783,7 @@ FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData, // We need to grab these before updating the DisplayItemData because it will overwrite them. nsRegion clip; if (aItem.mClip.ComputeRegionInClips(&aItem.mDisplayItemData->GetClip(), aTopLeft - paintedData->mLastAnimatedGeometryRootOrigin, aLayerData->mAnimatedGeometryRootOffset - paintedData->mLastAnimatedGeometryRootOrigin, &clip)) { intClip = clip.GetBounds().ScaleToOutsidePixels(paintedData->mXScale, paintedData->mYScale, Loading @@ -4823,6 +4805,12 @@ FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData, data = StoreDataForFrame(aItem.mItem, layer, aItem.mLayerState, nullptr); } data->mInactiveManager = tempManager; // We optimized this PaintedLayer into a ColorLayer/ImageLayer. Store the optimized // layer here. if (aLayer != layer) { data->mOptLayer = aLayer; data->mItem = nullptr; } } if (tempManager) { Loading
layout/painting/FrameLayerBuilder.h +2 −10 Original line number Diff line number Diff line Loading @@ -510,10 +510,10 @@ public: * aItem must have an underlying frame. * @param aTopLeft offset from active scrolled root to reference frame */ void AddPaintedDisplayItem(PaintedLayerData* aLayer, void AddPaintedDisplayItem(PaintedLayerData* aLayerData, AssignedDisplayItem& aAssignedDisplayItem, ContainerState& aContainerState, const nsPoint& aTopLeft); Layer* aLayer); /** * Calls GetOldLayerForFrame on the underlying frame of the display item, Loading Loading @@ -590,14 +590,6 @@ public: */ static gfxSize GetPaintedLayerScaleForFrame(nsIFrame* aFrame); /** * Stores a Layer as the dedicated layer in the DisplayItemData for a given frame/key pair. * * Used when we optimize a PaintedLayer into an ImageLayer and want to retroactively update the * DisplayItemData so we can retrieve the layer from within layout. */ void StoreOptimizedLayerForFrame(nsDisplayItem* aItem, Layer* aLayer); static void RemoveFrameFromLayerManager(const nsIFrame* aFrame, SmallPointerArray<DisplayItemData>& aArray); Loading