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 315a6b0d177230d594ac511d8c574eebd7a2f1c5..78d921f5cf675ac7936cf7f8addc56f7227ff7bf 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
@@ -70,7 +70,6 @@ |
#include "platform/graphics/paint/TransformDisplayItem.h" |
#include "wtf/CurrentTime.h" |
#include "wtf/text/StringBuilder.h" |
-#include <memory> |
namespace blink { |
@@ -222,9 +221,9 @@ CompositedLayerMapping::~CompositedLayerMapping() |
destroyGraphicsLayers(); |
} |
-std::unique_ptr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(CompositingReasons reasons, SquashingDisallowedReasons squashingDisallowedReasons) |
+PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(CompositingReasons reasons, SquashingDisallowedReasons squashingDisallowedReasons) |
{ |
- std::unique_ptr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(this); |
+ OwnPtr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(this); |
graphicsLayer->setCompositingReasons(reasons); |
graphicsLayer->setSquashingDisallowedReasons(squashingDisallowedReasons); |
@@ -502,7 +501,7 @@ bool CompositedLayerMapping::updateGraphicsLayerConfiguration() |
updateChildClippingMaskLayer(needsChildClippingMask); |
- if (layerToApplyChildClippingMask == m_graphicsLayer.get()) { |
+ if (layerToApplyChildClippingMask == m_graphicsLayer) { |
if (m_graphicsLayer->maskLayer() != m_childClippingMaskLayer.get()) { |
m_graphicsLayer->setMaskLayer(m_childClippingMaskLayer.get()); |
maskLayerChanged = true; |
@@ -1330,7 +1329,7 @@ void CompositedLayerMapping::setBackgroundLayerPaintsFixedRootBackground(bool ba |
m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootBackground; |
} |
-bool CompositedLayerMapping::toggleScrollbarLayerIfNeeded(std::unique_ptr<GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason) |
+bool CompositedLayerMapping::toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>& layer, bool needsLayer, CompositingReasons reason) |
{ |
if (needsLayer == !!layer) |
return false; |
@@ -2250,7 +2249,7 @@ IntRect CompositedLayerMapping::recomputeInterestRect(const GraphicsLayer* graph |
IntSize offsetFromAnchorLayoutObject; |
const LayoutBoxModelObject* anchorLayoutObject; |
- if (graphicsLayer == m_squashingLayer.get()) { |
+ if (graphicsLayer == m_squashingLayer) { |
// 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) |
@@ -2261,7 +2260,7 @@ IntRect CompositedLayerMapping::recomputeInterestRect(const GraphicsLayer* graph |
anchorLayoutObject = m_squashedLayers[0].paintLayer->layoutObject(); |
offsetFromAnchorLayoutObject = m_squashedLayers[0].offsetFromLayoutObject; |
} else { |
- ASSERT(graphicsLayer == m_graphicsLayer.get() || graphicsLayer == m_scrollingContentsLayer.get()); |
+ ASSERT(graphicsLayer == m_graphicsLayer || graphicsLayer == m_scrollingContentsLayer); |
anchorLayoutObject = m_owningLayer.layoutObject(); |
offsetFromAnchorLayoutObject = graphicsLayer->offsetFromLayoutObject(); |
adjustForCompositedScrolling(graphicsLayer, offsetFromAnchorLayoutObject); |
@@ -2346,7 +2345,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.get() && graphicsLayer != m_squashingLayer.get() && graphicsLayer != m_squashingLayer.get() && graphicsLayer != m_scrollingContentsLayer.get())) |
+ || (graphicsLayer != m_graphicsLayer && graphicsLayer != m_squashingLayer && graphicsLayer != m_squashingLayer && graphicsLayer != m_scrollingContentsLayer)) |
return wholeLayerRect; |
IntRect newInterestRect = recomputeInterestRect(graphicsLayer); |
@@ -2405,7 +2404,7 @@ void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G |
if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) |
paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; |
- if (graphicsLayer == m_backgroundLayer.get()) |
+ if (graphicsLayer == m_backgroundLayer) |
paintLayerFlags |= (PaintLayerPaintingRootBackgroundOnly | PaintLayerPaintingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroundPhase to walk child layers. |
else if (compositor()->fixedRootBackgroundLayer()) |
paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |