| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| index 78d921f5cf675ac7936cf7f8addc56f7227ff7bf..315a6b0d177230d594ac511d8c574eebd7a2f1c5 100644
|
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| @@ -70,6 +70,7 @@
|
| #include "platform/graphics/paint/TransformDisplayItem.h"
|
| #include "wtf/CurrentTime.h"
|
| #include "wtf/text/StringBuilder.h"
|
| +#include <memory>
|
|
|
| namespace blink {
|
|
|
| @@ -221,9 +222,9 @@ CompositedLayerMapping::~CompositedLayerMapping()
|
| destroyGraphicsLayers();
|
| }
|
|
|
| -PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(CompositingReasons reasons, SquashingDisallowedReasons squashingDisallowedReasons)
|
| +std::unique_ptr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(CompositingReasons reasons, SquashingDisallowedReasons squashingDisallowedReasons)
|
| {
|
| - OwnPtr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(this);
|
| + std::unique_ptr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(this);
|
|
|
| graphicsLayer->setCompositingReasons(reasons);
|
| graphicsLayer->setSquashingDisallowedReasons(squashingDisallowedReasons);
|
| @@ -501,7 +502,7 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration()
|
|
|
| updateChildClippingMaskLayer(needsChildClippingMask);
|
|
|
| - if (layerToApplyChildClippingMask == m_graphicsLayer) {
|
| + if (layerToApplyChildClippingMask == m_graphicsLayer.get()) {
|
| if (m_graphicsLayer->maskLayer() != m_childClippingMaskLayer.get()) {
|
| m_graphicsLayer->setMaskLayer(m_childClippingMaskLayer.get());
|
| maskLayerChanged = true;
|
| @@ -1329,7 +1330,7 @@ void CompositedLayerMapping::setBackgroundLayerPaintsFixedRootBackground(bool ba
|
| m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootBackground;
|
| }
|
|
|
| -bool CompositedLayerMapping::toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason)
|
| +bool CompositedLayerMapping::toggleScrollbarLayerIfNeeded(std::unique_ptr<GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason)
|
| {
|
| if (needsLayer == !!layer)
|
| return false;
|
| @@ -2249,7 +2250,7 @@ IntRect CompositedLayerMapping::recomputeInterestRect(const GraphicsLayer* graph
|
|
|
| IntSize offsetFromAnchorLayoutObject;
|
| const LayoutBoxModelObject* anchorLayoutObject;
|
| - if (graphicsLayer == m_squashingLayer) {
|
| + if (graphicsLayer == m_squashingLayer.get()) {
|
| // TODO(chrishtr): this is a speculative fix for crbug.com/561306. However, it should never be the case that
|
| // m_squashingLayer exists yet m_squashedLayers.size() == 0. There must be a bug elsewhere.
|
| if (m_squashedLayers.size() == 0)
|
| @@ -2260,7 +2261,7 @@ IntRect CompositedLayerMapping::recomputeInterestRect(const GraphicsLayer* graph
|
| anchorLayoutObject = m_squashedLayers[0].paintLayer->layoutObject();
|
| offsetFromAnchorLayoutObject = m_squashedLayers[0].offsetFromLayoutObject;
|
| } else {
|
| - ASSERT(graphicsLayer == m_graphicsLayer || graphicsLayer == m_scrollingContentsLayer);
|
| + ASSERT(graphicsLayer == m_graphicsLayer.get() || graphicsLayer == m_scrollingContentsLayer.get());
|
| anchorLayoutObject = m_owningLayer.layoutObject();
|
| offsetFromAnchorLayoutObject = graphicsLayer->offsetFromLayoutObject();
|
| adjustForCompositedScrolling(graphicsLayer, offsetFromAnchorLayoutObject);
|
| @@ -2345,7 +2346,7 @@ IntRect CompositedLayerMapping::computeInterestRect(const GraphicsLayer* graphic
|
| // Paint the whole layer if "mainFrameClipsContent" is false, meaning that WebPreferences::record_whole_document is true.
|
| bool shouldPaintWholePage = !m_owningLayer.layoutObject()->document().settings()->mainFrameClipsContent();
|
| if (shouldPaintWholePage
|
| - || (graphicsLayer != m_graphicsLayer && graphicsLayer != m_squashingLayer && graphicsLayer != m_squashingLayer && graphicsLayer != m_scrollingContentsLayer))
|
| + || (graphicsLayer != m_graphicsLayer.get() && graphicsLayer != m_squashingLayer.get() && graphicsLayer != m_squashingLayer.get() && graphicsLayer != m_scrollingContentsLayer.get()))
|
| return wholeLayerRect;
|
|
|
| IntRect newInterestRect = recomputeInterestRect(graphicsLayer);
|
| @@ -2404,7 +2405,7 @@ void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G
|
| if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll)
|
| paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase;
|
|
|
| - if (graphicsLayer == m_backgroundLayer)
|
| + if (graphicsLayer == m_backgroundLayer.get())
|
| paintLayerFlags |= (PaintLayerPaintingRootBackgroundOnly | PaintLayerPaintingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroundPhase to walk child layers.
|
| else if (compositor()->fixedRootBackgroundLayer())
|
| paintLayerFlags |= PaintLayerPaintingSkipRootBackground;
|
|
|