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

Unified Diff: components/display_compositor/compositor_overlay_candidate_validator_android.cc

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: promotable_resources_ => promotable_resource_hints_ 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: components/display_compositor/compositor_overlay_candidate_validator_android.cc
diff --git a/components/display_compositor/compositor_overlay_candidate_validator_android.cc b/components/display_compositor/compositor_overlay_candidate_validator_android.cc
index 805dae3b917d7147b70e749309e068ab3518483e..a6663f48e2425bc0815fd2f046becd6e63e4bba1 100644
--- a/components/display_compositor/compositor_overlay_candidate_validator_android.cc
+++ b/components/display_compositor/compositor_overlay_candidate_validator_android.cc
@@ -34,6 +34,24 @@ void CompositorOverlayCandidateValidatorAndroid::CheckOverlaySupport(
if (!candidates->empty()) {
cc::OverlayCandidate& candidate = candidates->front();
+
+ if (candidate.is_backed_by_surface_texture) {
+ // This quad would be promoted if it were backed by a SurfaceView. Since
+ // it isn't, we can't promote it. We do want to mark it as promotable,
+ // since the whole point of signalling this is to help whoever creates
+ // the resource to decide whether a SurfaceTexture or SurfaceView is more
+ // appropriate to use.
+ candidates->promotable_resource_hints_.insert(candidate.resource_id);
+ return;
+ }
+
+ // 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 |quad|
+ // would have to fall back to a texture.
+ candidates->promotable_resource_hints_.clear();
+ candidates->promotable_resource_hints_.insert(candidate.resource_id);
+
candidate.display_rect =
gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect));
candidate.overlay_handled = true;

Powered by Google App Engine
This is Rietveld 408576698