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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.h

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "platform/graphics/filters/FilterOperations.h" 43 #include "platform/graphics/filters/FilterOperations.h"
44 #include "platform/graphics/paint/CachedDisplayItem.h" 44 #include "platform/graphics/paint/CachedDisplayItem.h"
45 #include "platform/graphics/paint/DisplayItemClient.h" 45 #include "platform/graphics/paint/DisplayItemClient.h"
46 #include "platform/graphics/paint/PaintController.h" 46 #include "platform/graphics/paint/PaintController.h"
47 #include "platform/heap/Handle.h" 47 #include "platform/heap/Handle.h"
48 #include "platform/transforms/TransformationMatrix.h" 48 #include "platform/transforms/TransformationMatrix.h"
49 #include "public/platform/WebContentLayer.h" 49 #include "public/platform/WebContentLayer.h"
50 #include "public/platform/WebImageLayer.h" 50 #include "public/platform/WebImageLayer.h"
51 #include "public/platform/WebLayerScrollClient.h" 51 #include "public/platform/WebLayerScrollClient.h"
52 #include "third_party/skia/include/core/SkFilterQuality.h" 52 #include "third_party/skia/include/core/SkFilterQuality.h"
53 #include "wtf/OwnPtr.h"
54 #include "wtf/PassOwnPtr.h"
55 #include "wtf/Vector.h" 53 #include "wtf/Vector.h"
54 #include <memory>
56 55
57 namespace blink { 56 namespace blink {
58 57
59 class FloatRect; 58 class FloatRect;
60 class Image; 59 class Image;
61 class LinkHighlight; 60 class LinkHighlight;
62 class JSONObject; 61 class JSONObject;
63 class PaintController; 62 class PaintController;
64 class ScrollableArea; 63 class ScrollableArea;
65 class WebLayer; 64 class WebLayer;
66 65
67 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; 66 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector;
68 67
69 // GraphicsLayer is an abstraction for a rendering surface with backing store, 68 // GraphicsLayer is an abstraction for a rendering surface with backing store,
70 // which may have associated transformation and animations. 69 // which may have associated transformation and animations.
71 70
72 class PLATFORM_EXPORT GraphicsLayer : public WebLayerScrollClient, public cc::La yerClient, public DisplayItemClient { 71 class PLATFORM_EXPORT GraphicsLayer : public WebLayerScrollClient, public cc::La yerClient, public DisplayItemClient {
73 WTF_MAKE_NONCOPYABLE(GraphicsLayer); USING_FAST_MALLOC(GraphicsLayer); 72 WTF_MAKE_NONCOPYABLE(GraphicsLayer); USING_FAST_MALLOC(GraphicsLayer);
74 public: 73 public:
75 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerClient*); 74 static std::unique_ptr<GraphicsLayer> create(GraphicsLayerClient*);
76 75
77 ~GraphicsLayer() override; 76 ~GraphicsLayer() override;
78 77
79 GraphicsLayerClient* client() const { return m_client; } 78 GraphicsLayerClient* client() const { return m_client; }
80 79
81 GraphicsLayerDebugInfo& debugInfo(); 80 GraphicsLayerDebugInfo& debugInfo();
82 81
83 void setCompositingReasons(CompositingReasons); 82 void setCompositingReasons(CompositingReasons);
84 CompositingReasons getCompositingReasons() const { return m_debugInfo.getCom positingReasons(); } 83 CompositingReasons getCompositingReasons() const { return m_debugInfo.getCom positingReasons(); }
85 void setSquashingDisallowedReasons(SquashingDisallowedReasons); 84 void setSquashingDisallowedReasons(SquashingDisallowedReasons);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // A layer that replicates this layer. We only allow one, for now. 349 // A layer that replicates this layer. We only allow one, for now.
351 // The replica is not parented; this is the primary reference to it. 350 // The replica is not parented; this is the primary reference to it.
352 GraphicsLayer* m_replicaLayer; 351 GraphicsLayer* m_replicaLayer;
353 GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer. 352 GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer.
354 FloatPoint m_replicatedLayerPosition; // For a replica layer, the position o f the replica. 353 FloatPoint m_replicatedLayerPosition; // For a replica layer, the position o f the replica.
355 354
356 IntRect m_contentsRect; 355 IntRect m_contentsRect;
357 356
358 int m_paintCount; 357 int m_paintCount;
359 358
360 OwnPtr<WebContentLayer> m_layer; 359 std::unique_ptr<WebContentLayer> m_layer;
361 OwnPtr<WebImageLayer> m_imageLayer; 360 std::unique_ptr<WebImageLayer> m_imageLayer;
362 WebLayer* m_contentsLayer; 361 WebLayer* m_contentsLayer;
363 // We don't have ownership of m_contentsLayer, but we do want to know if a g iven layer is the 362 // We don't have ownership of m_contentsLayer, but we do want to know if a g iven layer is the
364 // same as our current layer in setContentsTo(). Since m_contentsLayer may b e deleted at this point, 363 // same as our current layer in setContentsTo(). Since m_contentsLayer may b e deleted at this point,
365 // we stash an ID away when we know m_contentsLayer is alive and use that fo r comparisons from that point 364 // we stash an ID away when we know m_contentsLayer is alive and use that fo r comparisons from that point
366 // on. 365 // on.
367 int m_contentsLayerId; 366 int m_contentsLayerId;
368 367
369 Vector<LinkHighlight*> m_linkHighlights; 368 Vector<LinkHighlight*> m_linkHighlights;
370 369
371 OwnPtr<ContentLayerDelegate> m_contentLayerDelegate; 370 std::unique_ptr<ContentLayerDelegate> m_contentLayerDelegate;
372 371
373 WeakPersistent<ScrollableArea> m_scrollableArea; 372 WeakPersistent<ScrollableArea> m_scrollableArea;
374 GraphicsLayerDebugInfo m_debugInfo; 373 GraphicsLayerDebugInfo m_debugInfo;
375 int m_3dRenderingContext; 374 int m_3dRenderingContext;
376 375
377 OwnPtr<PaintController> m_paintController; 376 std::unique_ptr<PaintController> m_paintController;
378 377
379 IntRect m_previousInterestRect; 378 IntRect m_previousInterestRect;
380 379
381 DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION 380 DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION
382 }; 381 };
383 382
384 } // namespace blink 383 } // namespace blink
385 384
386 #ifndef NDEBUG 385 #ifndef NDEBUG
387 // Outside the blink namespace for ease of invocation from gdb. 386 // Outside the blink namespace for ease of invocation from gdb.
388 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); 387 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*);
389 #endif 388 #endif
390 389
391 #endif // GraphicsLayer_h 390 #endif // GraphicsLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698