Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
| index 0b017b04664f39301d876849fb16377bc756bc75..1b3e6ca9a1977dc8d1e33aebd97185f15517d935 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
| @@ -163,6 +163,7 @@ void PaintController::AddCachedSubsequence(const DisplayItemClient& client, |
| new_cached_subsequences_.end()); |
| new_cached_subsequences_.insert(&client, SubsequenceMarkers(start, end)); |
| + last_cached_subsequence_end_ = end; |
| } |
| bool PaintController::LastDisplayItemIsNoopBegin() const { |
| @@ -173,6 +174,10 @@ bool PaintController::LastDisplayItemIsNoopBegin() const { |
| return last_display_item.IsBegin() && !last_display_item.DrawsContent(); |
| } |
| +bool PaintController::LastDisplayItemIsSubsequenceEnd() const { |
| + return last_cached_subsequence_end_ == new_display_item_list_.size() - 1; |
|
wkorman
2017/04/11 20:52:25
We initialize last_cached_subsequence_end_ to 0, a
chrishtr
2017/04/11 21:09:10
Fixed.
|
| +} |
| + |
| void PaintController::RemoveLastDisplayItem() { |
| if (new_display_item_list_.IsEmpty()) |
| return; |
| @@ -536,6 +541,7 @@ void PaintController::CommitNewDisplayItems( |
| new_cached_subsequences_.Swap(current_cached_subsequences_); |
| new_cached_subsequences_.Clear(); |
| + last_cached_subsequence_end_ = 0; |
| for (auto& item : current_cached_subsequences_) { |
| item.key->SetDisplayItemsCached(current_cache_generation_); |
| #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |