Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 PaintController_h | 5 #ifndef PaintController_h |
| 6 #define PaintController_h | 6 #define PaintController_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
| 10 #include "platform/geometry/IntRect.h" | 10 #include "platform/geometry/IntRect.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 // Returns the approximate memory usage, excluding memory likely to be | 116 // Returns the approximate memory usage, excluding memory likely to be |
| 117 // shared with the embedder after copying to WebPaintController. | 117 // shared with the embedder after copying to WebPaintController. |
| 118 // Should only be called right after commitNewDisplayItems. | 118 // Should only be called right after commitNewDisplayItems. |
| 119 size_t approximateUnsharedMemoryUsage() const; | 119 size_t approximateUnsharedMemoryUsage() const; |
| 120 | 120 |
| 121 // Get the artifact generated after the last commit. | 121 // Get the artifact generated after the last commit. |
| 122 const PaintArtifact& paintArtifact() const; | 122 const PaintArtifact& paintArtifact() const; |
| 123 const DisplayItemList& displayItemList() const { return paintArtifact().disp layItemList(); } | 123 const DisplayItemList& displayItemList() const { return paintArtifact().disp layItemList(); } |
| 124 const Vector<PaintChunk>& paintChunks() const { return paintArtifact().paint Chunks(); } | 124 const Vector<PaintChunk>& paintChunks() const { return paintArtifact().paint Chunks(); } |
| 125 | 125 |
| 126 typedef WTF::HashMap<DisplayItemClient, IntRect> DisplayItemRectMap; | |
|
esprehn
2015/12/08 19:58:31
Doesn't this approach the size of the layout tree
wkorman
2015/12/08 20:55:10
I believe you are correct. We obviously won't enab
Xianzhu
2015/12/09 17:09:27
FYI I have converted DisplayItemClient to an inter
| |
| 127 const DisplayItemRectMap& displayItemVisualRects() const { return m_displayI temInvalidationRects; } | |
| 128 | |
| 126 bool clientCacheIsValid(DisplayItemClient) const; | 129 bool clientCacheIsValid(DisplayItemClient) const; |
| 127 bool cacheIsEmpty() const { return m_currentPaintArtifact.isEmpty(); } | 130 bool cacheIsEmpty() const { return m_currentPaintArtifact.isEmpty(); } |
| 128 | 131 |
| 129 bool displayItemConstructionIsDisabled() const { return m_constructionDisabl ed; } | 132 bool displayItemConstructionIsDisabled() const { return m_constructionDisabl ed; } |
| 130 void setDisplayItemConstructionIsDisabled(const bool disable) { m_constructi onDisabled = disable; } | 133 void setDisplayItemConstructionIsDisabled(const bool disable) { m_constructi onDisabled = disable; } |
| 131 | 134 |
| 132 bool textPainted() const { return m_textPainted; } | 135 bool textPainted() const { return m_textPainted; } |
| 133 void setTextPainted() { m_textPainted = true; } | 136 void setTextPainted() { m_textPainted = true; } |
| 134 bool imagePainted() const { return m_imagePainted; } | 137 bool imagePainted() const { return m_imagePainted; } |
| 135 void setImagePainted() { m_imagePainted = true; } | 138 void setImagePainted() { m_imagePainted = true; } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 // are known to be valid. | 234 // are known to be valid. |
| 232 // TODO(wangxianzhu): Use client side flag to avoid const of hash table. | 235 // TODO(wangxianzhu): Use client side flag to avoid const of hash table. |
| 233 HashSet<DisplayItemClient> m_clientsCheckedPaintInvalidation; | 236 HashSet<DisplayItemClient> m_clientsCheckedPaintInvalidation; |
| 234 | 237 |
| 235 #if ENABLE(ASSERT) | 238 #if ENABLE(ASSERT) |
| 236 // Set of clients which had paint offset changes since the last commit. This is used for | 239 // Set of clients which had paint offset changes since the last commit. This is used for |
| 237 // ensuring paint offsets are only updated once and are the same in all phas es. | 240 // ensuring paint offsets are only updated once and are the same in all phas es. |
| 238 HashSet<DisplayItemClient> m_clientsWithPaintOffsetInvalidations; | 241 HashSet<DisplayItemClient> m_clientsWithPaintOffsetInvalidations; |
| 239 #endif | 242 #endif |
| 240 | 243 |
| 244 DisplayItemRectMap m_displayItemInvalidationRects; | |
| 245 | |
| 241 // Allow display item construction to be disabled to isolate the costs of co nstruction | 246 // Allow display item construction to be disabled to isolate the costs of co nstruction |
| 242 // in performance metrics. | 247 // in performance metrics. |
| 243 bool m_constructionDisabled; | 248 bool m_constructionDisabled; |
| 244 | 249 |
| 245 // Indicates this PaintController has ever had text. It is never reset to fa lse. | 250 // Indicates this PaintController has ever had text. It is never reset to fa lse. |
| 246 bool m_textPainted; | 251 bool m_textPainted; |
| 247 bool m_imagePainted; | 252 bool m_imagePainted; |
| 248 | 253 |
| 249 int m_skippingCacheCount; | 254 int m_skippingCacheCount; |
| 250 | 255 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 262 // easily find where the duplicated ids are from. | 267 // easily find where the duplicated ids are from. |
| 263 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; | 268 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; |
| 264 #endif | 269 #endif |
| 265 | 270 |
| 266 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects; | 271 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects; |
| 267 }; | 272 }; |
| 268 | 273 |
| 269 } // namespace blink | 274 } // namespace blink |
| 270 | 275 |
| 271 #endif // PaintController_h | 276 #endif // PaintController_h |
| OLD | NEW |