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..6a15e6c40e299c6f435403c4a7096eadb6035dbd 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_resources_.insert(candidate.resource_id); |
+ return; |
+ } |
+ |
+ // This quad will be promoted. We clear the promotable set 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_resources_.clear(); |
+ candidates->promotable_resources_.insert(candidate.resource_id); |
+ |
candidate.display_rect = |
gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect)); |
candidate.overlay_handled = true; |