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; |