| 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 DCHECK_IS_ON() | 13 #define CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 1 |
| 14 // TODO(wangxianzhu): Restore the following line after we fix crbug.com/609218. |
| 15 // #define CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS DCHECK_IS_ON() |
| 14 | 16 |
| 15 namespace blink { | 17 namespace blink { |
| 16 | 18 |
| 17 // Holds a unique cache generation id of display items and paint controllers. | 19 // Holds a unique cache generation id of display items and paint controllers. |
| 18 // | 20 // |
| 19 // A paint controller sets its cache generation to DisplayItemCacheGeneration::n
ext() | 21 // A paint controller sets its cache generation to DisplayItemCacheGeneration::n
ext() |
| 20 // at the end of each commitNewDisplayItems, and updates the cache generation of
each | 22 // at the end of each commitNewDisplayItems, and updates the cache generation of
each |
| 21 // client with cached drawings by calling DisplayItemClient::setDisplayItemsCach
ed(). | 23 // client with cached drawings by calling DisplayItemClient::setDisplayItemsCach
ed(). |
| 22 // A display item is treated as validly cached in a paint controller if its cach
e generation | 24 // A display item is treated as validly cached in a paint controller if its cach
e generation |
| 23 // matches the paint controller's cache generation. | 25 // matches the paint controller's cache generation. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 bool displayItemsAreCached(DisplayItemCacheGeneration) const final { return
false; } \ | 93 bool displayItemsAreCached(DisplayItemCacheGeneration) const final { return
false; } \ |
| 92 void setDisplayItemsCached(DisplayItemCacheGeneration) const final { } \ | 94 void setDisplayItemsCached(DisplayItemCacheGeneration) const final { } \ |
| 93 void setDisplayItemsUncached() const final { } | 95 void setDisplayItemsUncached() const final { } |
| 94 | 96 |
| 95 inline bool operator==(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 == &client2; } | 97 inline bool operator==(const DisplayItemClient& client1, const DisplayItemClient
& client2) { return &client1 == &client2; } |
| 96 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; } |
| 97 | 99 |
| 98 } // namespace blink | 100 } // namespace blink |
| 99 | 101 |
| 100 #endif // DisplayItemClient_h | 102 #endif // DisplayItemClient_h |
| OLD | NEW |