Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3230)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp

Issue 2812103002: Don't allow the composited-alpha folding optimization to cross subsequences (Closed)
Patch Set: none Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..aa0b0378feb0fd04b0e561c378f6e5d6b7cb978f 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,11 @@ bool PaintController::LastDisplayItemIsNoopBegin() const {
return last_display_item.IsBegin() && !last_display_item.DrawsContent();
}
+bool PaintController::LastDisplayItemIsSubsequenceEnd() const {
+ return !new_cached_subsequences_.IsEmpty() &&
+ last_cached_subsequence_end_ == new_display_item_list_.size() - 1;
+}
+
void PaintController::RemoveLastDisplayItem() {
if (new_display_item_list_.IsEmpty())
return;
@@ -536,6 +542,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

Powered by Google App Engine
This is Rietveld 408576698