Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
index 93154db8fa0c64b6e60702df94630dde442daa80..ffe6c9ce1b32251e2c88962ca69e2ce98680ffa7 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
@@ -33,7 +33,6 @@
#include "platform/graphics/GraphicsLayer.h"
#include "platform/graphics/GraphicsLayerClient.h"
#include "wtf/Allocator.h"
-#include <memory>
namespace blink {
@@ -249,8 +248,8 @@ private:
void createPrimaryGraphicsLayer();
void destroyGraphicsLayers();
- std::unique_ptr<GraphicsLayer> createGraphicsLayer(CompositingReasons, SquashingDisallowedReasons = SquashingDisallowedReasonsNone);
- bool toggleScrollbarLayerIfNeeded(std::unique_ptr<GraphicsLayer>&, bool needsLayer, CompositingReasons);
+ PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons, SquashingDisallowedReasons = SquashingDisallowedReasonsNone);
+ bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, CompositingReasons);
LayoutBoxModelObject* layoutObject() const { return m_owningLayer.layoutObject(); }
PaintLayerCompositor* compositor() const { return m_owningLayer.compositor(); }
@@ -364,18 +363,18 @@ private:
// In this case B is clipped by another layer that doesn't happen to be its ancestor: A.
// So we create an ancestor clipping layer for B, [+], which ensures that B is clipped
// as if it had been A's descendant.
- std::unique_ptr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clipped by an ancestor which is not a stacking context.
- std::unique_ptr<GraphicsLayer> m_graphicsLayer;
- std::unique_ptr<GraphicsLayer> m_childContainmentLayer; // Only used if we have clipping on a stacking context with compositing children.
- std::unique_ptr<GraphicsLayer> m_childTransformLayer; // Only used if we have perspective.
- std::unique_ptr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using composited scrolling.
- std::unique_ptr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling.
+ OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clipped by an ancestor which is not a stacking context.
+ OwnPtr<GraphicsLayer> m_graphicsLayer;
+ OwnPtr<GraphicsLayer> m_childContainmentLayer; // Only used if we have clipping on a stacking context with compositing children.
+ OwnPtr<GraphicsLayer> m_childTransformLayer; // Only used if we have perspective.
+ OwnPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using composited scrolling.
+ OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling.
// This layer is also added to the hierarchy by the RLB, but in a different way than
// the layers above. It's added to m_graphicsLayer as its mask layer (naturally) if
// we have a mask, and isn't part of the typical hierarchy (it has no children).
- std::unique_ptr<GraphicsLayer> m_maskLayer; // Only used if we have a mask.
- std::unique_ptr<GraphicsLayer> m_childClippingMaskLayer; // Only used if we have to clip child layers or accelerated contents with border radius or clip-path.
+ OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask.
+ OwnPtr<GraphicsLayer> m_childClippingMaskLayer; // Only used if we have to clip child layers or accelerated contents with border radius or clip-path.
// There are two other (optional) layers whose painting is managed by the CompositedLayerMapping,
// but whose position in the hierarchy is maintained by the PaintLayerCompositor. These
@@ -399,17 +398,17 @@ private:
//
// With the hierarchy set up like this, the root content layer is able to scroll without affecting
// the background layer (or paint invalidation).
- std::unique_ptr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately.
- std::unique_ptr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately.
+ OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately.
+ OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately.
- std::unique_ptr<GraphicsLayer> m_layerForHorizontalScrollbar;
- std::unique_ptr<GraphicsLayer> m_layerForVerticalScrollbar;
- std::unique_ptr<GraphicsLayer> m_layerForScrollCorner;
+ OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
+ OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
+ OwnPtr<GraphicsLayer> m_layerForScrollCorner;
// This layer contains the scrollbar and scroll corner layers and clips them to the border box
// bounds of our LayoutObject. It is usually added to m_graphicsLayer, but may be reparented by
// GraphicsLayerTreeBuilder to ensure that scrollbars appear above scrolling content.
- std::unique_ptr<GraphicsLayer> m_overflowControlsHostLayer;
+ OwnPtr<GraphicsLayer> m_overflowControlsHostLayer;
// The reparented overflow controls sometimes need to be clipped by a non-ancestor. In just the same
// way we need an ancestor clipping layer to clip this CLM's internal hierarchy, we add another layer
@@ -417,7 +416,7 @@ private:
// would require manually intersecting their clips, and shifting the overflow controls to compensate
// for this clip's offset. By using a separate layer, the overflow controls can remain ignorant of
// ancestor clipping.
- std::unique_ptr<GraphicsLayer> m_overflowControlsAncestorClippingLayer;
+ OwnPtr<GraphicsLayer> m_overflowControlsAncestorClippingLayer;
// A squashing CLM has two possible squashing-related structures.
//
@@ -435,8 +434,8 @@ private:
//
// Stacking children of a squashed layer receive graphics layers that are parented to the compositd ancestor of the
// squashed layer (i.e. nearest enclosing composited layer that is not squashed).
- std::unique_ptr<GraphicsLayer> m_squashingContainmentLayer; // Only used if any squashed layers exist and m_squashingContainmentLayer is not present, to contain the squashed layers as siblings to the rest of the GraphicsLayer tree chunk.
- std::unique_ptr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers exist, this is the backing that squashed layers paint into.
+ OwnPtr<GraphicsLayer> m_squashingContainmentLayer; // Only used if any squashed layers exist and m_squashingContainmentLayer is not present, to contain the squashed layers as siblings to the rest of the GraphicsLayer tree chunk.
+ OwnPtr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers exist, this is the backing that squashed layers paint into.
Vector<GraphicsLayerPaintInfo> m_squashedLayers;
LayoutPoint m_squashingLayerOffsetFromTransformedAncestor;

Powered by Google App Engine
This is Rietveld 408576698