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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.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 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"
53 #include "wtf/Vector.h" 55 #include "wtf/Vector.h"
54 #include <memory>
55 56
56 namespace blink { 57 namespace blink {
57 58
58 class FloatRect; 59 class FloatRect;
59 class Image; 60 class Image;
60 class LinkHighlight; 61 class LinkHighlight;
61 class JSONObject; 62 class JSONObject;
62 class PaintController; 63 class PaintController;
63 class ScrollableArea; 64 class ScrollableArea;
64 class WebLayer; 65 class WebLayer;
65 66
66 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; 67 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector;
67 68
68 // GraphicsLayer is an abstraction for a rendering surface with backing store, 69 // GraphicsLayer is an abstraction for a rendering surface with backing store,
69 // which may have associated transformation and animations. 70 // which may have associated transformation and animations.
70 71
71 class PLATFORM_EXPORT GraphicsLayer : public WebLayerScrollClient, public cc::La yerClient, public DisplayItemClient { 72 class PLATFORM_EXPORT GraphicsLayer : public WebLayerScrollClient, public cc::La yerClient, public DisplayItemClient {
72 WTF_MAKE_NONCOPYABLE(GraphicsLayer); USING_FAST_MALLOC(GraphicsLayer); 73 WTF_MAKE_NONCOPYABLE(GraphicsLayer); USING_FAST_MALLOC(GraphicsLayer);
73 public: 74 public:
74 static std::unique_ptr<GraphicsLayer> create(GraphicsLayerClient*); 75 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerClient*);
75 76
76 ~GraphicsLayer() override; 77 ~GraphicsLayer() override;
77 78
78 GraphicsLayerClient* client() const { return m_client; } 79 GraphicsLayerClient* client() const { return m_client; }
79 80
80 GraphicsLayerDebugInfo& debugInfo(); 81 GraphicsLayerDebugInfo& debugInfo();
81 82
82 void setCompositingReasons(CompositingReasons); 83 void setCompositingReasons(CompositingReasons);
83 CompositingReasons getCompositingReasons() const { return m_debugInfo.getCom positingReasons(); } 84 CompositingReasons getCompositingReasons() const { return m_debugInfo.getCom positingReasons(); }
84 void setSquashingDisallowedReasons(SquashingDisallowedReasons); 85 void setSquashingDisallowedReasons(SquashingDisallowedReasons);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 // A layer that replicates this layer. We only allow one, for now. 350 // A layer that replicates this layer. We only allow one, for now.
350 // The replica is not parented; this is the primary reference to it. 351 // The replica is not parented; this is the primary reference to it.
351 GraphicsLayer* m_replicaLayer; 352 GraphicsLayer* m_replicaLayer;
352 GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer. 353 GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer.
353 FloatPoint m_replicatedLayerPosition; // For a replica layer, the position o f the replica. 354 FloatPoint m_replicatedLayerPosition; // For a replica layer, the position o f the replica.
354 355
355 IntRect m_contentsRect; 356 IntRect m_contentsRect;
356 357
357 int m_paintCount; 358 int m_paintCount;
358 359
359 std::unique_ptr<WebContentLayer> m_layer; 360 OwnPtr<WebContentLayer> m_layer;
360 std::unique_ptr<WebImageLayer> m_imageLayer; 361 OwnPtr<WebImageLayer> m_imageLayer;
361 WebLayer* m_contentsLayer; 362 WebLayer* m_contentsLayer;
362 // We don't have ownership of m_contentsLayer, but we do want to know if a g iven layer is the 363 // We don't have ownership of m_contentsLayer, but we do want to know if a g iven layer is the
363 // same as our current layer in setContentsTo(). Since m_contentsLayer may b e deleted at this point, 364 // same as our current layer in setContentsTo(). Since m_contentsLayer may b e deleted at this point,
364 // we stash an ID away when we know m_contentsLayer is alive and use that fo r comparisons from that point 365 // we stash an ID away when we know m_contentsLayer is alive and use that fo r comparisons from that point
365 // on. 366 // on.
366 int m_contentsLayerId; 367 int m_contentsLayerId;
367 368
368 Vector<LinkHighlight*> m_linkHighlights; 369 Vector<LinkHighlight*> m_linkHighlights;
369 370
370 std::unique_ptr<ContentLayerDelegate> m_contentLayerDelegate; 371 OwnPtr<ContentLayerDelegate> m_contentLayerDelegate;
371 372
372 WeakPersistent<ScrollableArea> m_scrollableArea; 373 WeakPersistent<ScrollableArea> m_scrollableArea;
373 GraphicsLayerDebugInfo m_debugInfo; 374 GraphicsLayerDebugInfo m_debugInfo;
374 int m_3dRenderingContext; 375 int m_3dRenderingContext;
375 376
376 std::unique_ptr<PaintController> m_paintController; 377 OwnPtr<PaintController> m_paintController;
377 378
378 IntRect m_previousInterestRect; 379 IntRect m_previousInterestRect;
379 380
380 DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION 381 DISPLAY_ITEM_CACHE_STATUS_IMPLEMENTATION
381 }; 382 };
382 383
383 } // namespace blink 384 } // namespace blink
384 385
385 #ifndef NDEBUG 386 #ifndef NDEBUG
386 // Outside the blink namespace for ease of invocation from gdb. 387 // Outside the blink namespace for ease of invocation from gdb.
387 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); 388 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*);
388 #endif 389 #endif
389 390
390 #endif // GraphicsLayer_h 391 #endif // GraphicsLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698