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

Unified Diff: cc/output/overlay_strategy_underlay.cc

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: added CC_EXPORT Created 4 years 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: cc/output/overlay_strategy_underlay.cc
diff --git a/cc/output/overlay_strategy_underlay.cc b/cc/output/overlay_strategy_underlay.cc
index 2a6709235658cff3908a6616f509cbc19ff223a5..e50918967c5872025f285573a796e457052370af 100644
--- a/cc/output/overlay_strategy_underlay.cc
+++ b/cc/output/overlay_strategy_underlay.cc
@@ -47,7 +47,19 @@ bool OverlayStrategyUnderlay::Attempt(ResourceProvider* resource_provider,
replacement->SetAll(shared_quad_state, rect, rect, rect, false,
SK_ColorTRANSPARENT, true);
candidate_list->swap(new_candidate_list);
+
+ // This quad will be promoted. We clear the promotable hints here, since
+ // we can only promote a single quad. Otherwise, somebody might try to
+ // back one of the promotable quads with a SurfaceView, and either it or
+ // |candidate| would have to fall back to a texture.
+ candidate_list->promotable_resource_hints_.clear();
+ candidate_list->promotable_resource_hints_.insert(candidate.resource_id);
return true;
+ } else {
+ // If |candidate| should get a promotion hint, then rememeber that now.
+ candidate_list->promotable_resource_hints_.insert(
+ new_candidate_list.promotable_resource_hints_.begin(),
+ new_candidate_list.promotable_resource_hints_.end());
}
}

Powered by Google App Engine
This is Rietveld 408576698