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 "platform/graphics/PaintInvalidationReason.h" | 10 #include "platform/graphics/PaintInvalidationReason.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 virtual ~DisplayItemClient() {} | 48 virtual ~DisplayItemClient() {} |
49 #endif | 49 #endif |
50 | 50 |
51 virtual String debugName() const = 0; | 51 virtual String debugName() const = 0; |
52 | 52 |
53 // The visual rect of this DisplayItemClient, in the object space of the | 53 // The visual rect of this DisplayItemClient, in the object space of the |
54 // object that owns the GraphicsLayer, i.e. offset by | 54 // object that owns the GraphicsLayer, i.e. offset by |
55 // offsetFromLayoutObjectWithSubpixelAccumulation(). | 55 // offsetFromLayoutObjectWithSubpixelAccumulation(). |
56 virtual LayoutRect visualRect() const = 0; | 56 virtual LayoutRect visualRect() const = 0; |
57 | 57 |
58 // This is declared here instead of in LayoutObject for verifying the | |
59 // condition in DrawingRecorder. | |
60 // Returns true if the object itself will not generate any effective painted | |
61 // output no matter what size the object is. For example, this function can | |
62 // return false for an object whose size is currently 0x0 but would have | |
63 // effective painted output if it was set a non-empty size. It's used to skip | |
64 // unforced paint invalidation of LayoutObjects (which is when | |
65 // shouldDoFullPaintInvalidation is false, but mayNeedPaintInvalidation or | |
66 // childShouldCheckForPaintInvalidation is true) to avoid unnecessary paint | |
67 // invalidations of empty areas covered by such objects. | |
68 virtual bool paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { | |
69 return false; | |
70 } | |
71 | |
72 void setDisplayItemsUncached( | 58 void setDisplayItemsUncached( |
73 PaintInvalidationReason reason = PaintInvalidationFull) const { | 59 PaintInvalidationReason reason = PaintInvalidationFull) const { |
74 m_cacheGenerationOrInvalidationReason.invalidate(reason); | 60 m_cacheGenerationOrInvalidationReason.invalidate(reason); |
75 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 61 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
76 // Clear should-keep-alive of DisplayItemClients in a subsequence if this | 62 // Clear should-keep-alive of DisplayItemClients in a subsequence if this |
77 // object is a subsequence. | 63 // object is a subsequence. |
78 endShouldKeepAliveAllClients(this); | 64 endShouldKeepAliveAllClients(this); |
79 #endif | 65 #endif |
80 } | 66 } |
81 | 67 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return &client1 == &client2; | 164 return &client1 == &client2; |
179 } | 165 } |
180 inline bool operator!=(const DisplayItemClient& client1, | 166 inline bool operator!=(const DisplayItemClient& client1, |
181 const DisplayItemClient& client2) { | 167 const DisplayItemClient& client2) { |
182 return &client1 != &client2; | 168 return &client1 != &client2; |
183 } | 169 } |
184 | 170 |
185 } // namespace blink | 171 } // namespace blink |
186 | 172 |
187 #endif // DisplayItemClient_h | 173 #endif // DisplayItemClient_h |
OLD | NEW |