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

Unified Diff: components/display_compositor/compositor_overlay_candidate_validator_android.cc

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: rebased 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
« no previous file with comments | « components/display_compositor/DEPS ('k') | media/base/video_frame_metadata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b5b1c13019bd63b5c2627cc4affa57348e7332d4 100644
--- a/components/display_compositor/compositor_overlay_candidate_validator_android.cc
+++ b/components/display_compositor/compositor_overlay_candidate_validator_android.cc
@@ -34,6 +34,17 @@ void CompositorOverlayCandidateValidatorAndroid::CheckOverlaySupport(
if (!candidates->empty()) {
cc::OverlayCandidate& candidate = candidates->front();
+
+ // This quad either will be promoted, or would be if it were backed by a
+ // SurfaceView. Record that it should get a promotion hint.
+ candidates->promotable_resource_hints_.insert(candidate.resource_id);
+
+ 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.
+ return;
+ }
+
candidate.display_rect =
gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect));
candidate.overlay_handled = true;
« no previous file with comments | « components/display_compositor/DEPS ('k') | media/base/video_frame_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698