| 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" |
| 11 #include "wtf/text/WTFString.h" | 11 #include "wtf/text/WTFString.h" |
| 12 | 12 |
| 13 #define CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 1 | 13 #define CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS DCHECK_IS_ON() |
| 14 // TODO(wangxianzhu): Restore the following line after we fix crbug.com/609218. | |
| 15 // #define CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS DCHECK_IS_ON() | |
| 16 | 14 |
| 17 namespace blink { | 15 namespace blink { |
| 18 | 16 |
| 19 // Holds a unique cache generation id of display items and paint controllers. | 17 // Holds a unique cache generation id of display items and paint controllers. |
| 20 // | 18 // |
| 21 // A paint controller sets its cache generation to DisplayItemCacheGeneration::n
ext() | 19 // A paint controller sets its cache generation to DisplayItemCacheGeneration::n
ext() |
| 22 // at the end of each commitNewDisplayItems, and updates the cache generation of
each | 20 // at the end of each commitNewDisplayItems, and updates the cache generation of
each |
| 23 // client with cached drawings by calling DisplayItemClient::setDisplayItemsCach
ed(). | 21 // client with cached drawings by calling DisplayItemClient::setDisplayItemsCach
ed(). |
| 24 // A display item is treated as validly cached in a paint controller if its cach
e generation | 22 // A display item is treated as validly cached in a paint controller if its cach
e generation |
| 25 // matches the paint controller's cache generation. | 23 // matches the paint controller's cache generation. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 bool displayItemsAreCached(DisplayItemCacheGeneration) const final { return
false; } \ | 108 bool displayItemsAreCached(DisplayItemCacheGeneration) const final { return
false; } \ |
| 111 void setDisplayItemsCached(DisplayItemCacheGeneration) const final { } \ | 109 void setDisplayItemsCached(DisplayItemCacheGeneration) const final { } \ |
| 112 void setDisplayItemsUncached() const final { } | 110 void setDisplayItemsUncached() const final { } |
| 113 | 111 |
| 114 inline bool operator==(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 == &client2; } | 112 inline bool operator==(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 == &client2; } |
| 115 inline bool operator!=(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 != &client2; } | 113 inline bool operator!=(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 != &client2; } |
| 116 | 114 |
| 117 } // namespace blink | 115 } // namespace blink |
| 118 | 116 |
| 119 #endif // DisplayItemClient_h | 117 #endif // DisplayItemClient_h |
| OLD | NEW |