OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DisplayItemClient_h | 5 #ifndef DisplayItemClient_h |
6 #define DisplayItemClient_h | 6 #define DisplayItemClient_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/geometry/LayoutRect.h" | 9 #include "platform/geometry/LayoutRect.h" |
10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 class PLATFORM_EXPORT DisplayItemClient { | 58 class PLATFORM_EXPORT DisplayItemClient { |
59 public: | 59 public: |
60 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 60 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
61 DisplayItemClient(); | 61 DisplayItemClient(); |
62 virtual ~DisplayItemClient(); | 62 virtual ~DisplayItemClient(); |
63 | 63 |
64 // Tests if this DisplayItemClient object has been created and has not been
deleted yet. | 64 // Tests if this DisplayItemClient object has been created and has not been
deleted yet. |
65 bool isAlive() const; | 65 bool isAlive() const; |
66 // Called when any DisplayItem of this DisplayItemClient is added into Paint
Controller | 66 // Called when any DisplayItem of this DisplayItemClient is added into Paint
Controller |
67 // using PaintController::createAndAppend(). | 67 // using PaintController::createAndAppend(). |
68 void beginShouldKeepAlive() const; | 68 void beginShouldKeepAlive(const void* owner) const; |
69 // Clears all should-keep-alive DisplayItemClients. Called after PaintContro
ller commits | 69 // Clears all should-keep-alive DisplayItemClients. Called after PaintContro
ller commits |
70 // new display items. | 70 // new display items. |
71 static void endShouldKeepAliveAllClients(); | 71 static void endShouldKeepAliveAllClients(const void* owner); |
72 #else | 72 #else |
73 virtual ~DisplayItemClient() { } | 73 virtual ~DisplayItemClient() { } |
74 #endif | 74 #endif |
75 | 75 |
76 virtual String debugName() const = 0; | 76 virtual String debugName() const = 0; |
77 | 77 |
78 // The visual rect of this DisplayItemClient, in object space of the object
that owns the GraphicsLayer, i.e. | 78 // The visual rect of this DisplayItemClient, in object space of the object
that owns the GraphicsLayer, i.e. |
79 // offset by offsetFromLayoutObjectWithSubpixelAccumulation(). | 79 // offset by offsetFromLayoutObjectWithSubpixelAccumulation(). |
80 virtual LayoutRect visualRect() const = 0; | 80 virtual LayoutRect visualRect() const = 0; |
81 | 81 |
(...skipping 12 matching lines...) Expand all Loading... |
94 bool displayItemsAreCached(DisplayItemCacheGeneration) const final { return
false; } \ | 94 bool displayItemsAreCached(DisplayItemCacheGeneration) const final { return
false; } \ |
95 void setDisplayItemsCached(DisplayItemCacheGeneration) const final { } \ | 95 void setDisplayItemsCached(DisplayItemCacheGeneration) const final { } \ |
96 void setDisplayItemsUncached() const final { } | 96 void setDisplayItemsUncached() const final { } |
97 | 97 |
98 inline bool operator==(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 == &client2; } | 98 inline bool operator==(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 == &client2; } |
99 inline bool operator!=(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 != &client2; } | 99 inline bool operator!=(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 != &client2; } |
100 | 100 |
101 } // namespace blink | 101 } // namespace blink |
102 | 102 |
103 #endif // DisplayItemClient_h | 103 #endif // DisplayItemClient_h |
OLD | NEW |