Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/paint/PaintController.h |
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h |
| index 5bfc86ec8e4156d37fca6adf2b74337b78eb6f6e..b38474388930fb85fc2f5d767347bba8c90d1502 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h |
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h |
| @@ -161,12 +161,12 @@ class PLATFORM_EXPORT PaintController { |
| subsequence_caching_disabled_ = disable; |
| } |
| - bool FirstPainted() const { return first_painted_; } |
| - void SetFirstPainted() { first_painted_ = true; } |
| - bool TextPainted() const { return text_painted_; } |
| - void SetTextPainted() { text_painted_ = true; } |
| - bool ImagePainted() const { return image_painted_; } |
| - void SetImagePainted() { image_painted_ = true; } |
| + bool FirstPainted(const void* frame) const; |
| + void SetFirstPainted(); |
| + bool TextPainted(const void* frame) const; |
| + void SetTextPainted(); |
| + bool ImagePainted(const void* frame) const; |
| + void SetImagePainted(); |
| // Returns displayItemList added using createAndAppend() since beginning or |
| // the last commitNewDisplayItems(). Use with care. |
| @@ -211,14 +211,14 @@ class PLATFORM_EXPORT PaintController { |
| bool LastDisplayItemIsSubsequenceEnd() const; |
| + void BeginFrame(const void* frame); |
| + void EndFrame(const void* frame); |
| + |
| protected: |
| PaintController() |
| : new_display_item_list_(0), |
| construction_disabled_(false), |
| subsequence_caching_disabled_(false), |
| - first_painted_(false), |
| - text_painted_(false), |
| - image_painted_(false), |
| skipping_cache_count_(0), |
| num_cached_new_items_(0), |
| current_cached_subsequence_begin_index_in_new_list_(kNotFound), |
| @@ -341,12 +341,15 @@ class PLATFORM_EXPORT PaintController { |
| bool subsequence_caching_disabled_; |
| // The following fields indicate that this PaintController has ever had |
| - // first-paint, text or image painted. They are never reset to false. |
| - // First-paint is defined in https://github.com/WICG/paint-timing. It excludes |
| - // default background paint. |
| - bool first_painted_; |
| - bool text_painted_; |
| - bool image_painted_; |
| + // first-paint, text or image painted for each frame. They are never reset to |
| + // false. First-paint is defined in https://github.com/WICG/paint-timing. It |
| + // excludes default background paint. |
| + HashMap<const void*, bool> first_painted_; |
| + HashMap<const void*, bool> text_painted_; |
| + HashMap<const void*, bool> image_painted_; |
|
Xianzhu
2017/05/08 22:44:46
HashMap is much slower than direct field to access
Zhen Wang
2017/05/09 20:13:43
Done.
|
| + |
| + // A stack recording current frames. |
| + Vector<const void*> current_frames_; |
| int skipping_cache_count_; |