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

Side by Side Diff: components/display_compositor/compositor_overlay_candidate_validator_android.cc

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: cleanup 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/display_compositor/compositor_overlay_candidate_validator_a ndroid.h" 5 #include "components/display_compositor/compositor_overlay_candidate_validator_a ndroid.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "cc/output/overlay_processor.h" 10 #include "cc/output/overlay_processor.h"
(...skipping 16 matching lines...) Expand all
27 void CompositorOverlayCandidateValidatorAndroid::CheckOverlaySupport( 27 void CompositorOverlayCandidateValidatorAndroid::CheckOverlaySupport(
28 cc::OverlayCandidateList* candidates) { 28 cc::OverlayCandidateList* candidates) {
29 // There should only be at most a single overlay candidate: the video quad. 29 // There should only be at most a single overlay candidate: the video quad.
30 // There's no check that the presented candidate is really a video frame for 30 // There's no check that the presented candidate is really a video frame for
31 // a fullscreen video. Instead it's assumed that if a quad is marked as 31 // a fullscreen video. Instead it's assumed that if a quad is marked as
32 // overlayable, it's a fullscreen video quad. 32 // overlayable, it's a fullscreen video quad.
33 DCHECK_LE(candidates->size(), 1u); 33 DCHECK_LE(candidates->size(), 1u);
34 34
35 if (!candidates->empty()) { 35 if (!candidates->empty()) {
36 cc::OverlayCandidate& candidate = candidates->front(); 36 cc::OverlayCandidate& candidate = candidates->front();
37
38 if (candidate.is_backed_by_surface_texture) {
39 // This quad would be promoted if it were backed by a SurfaceView. Since
40 // it isn't, we can't promote it. We do want to mark it as promotable,
41 // since the whole point of signalling this is to help whoever creates
42 // the resource to decide whether a SurfaceTexture or SurfaceView is more
43 // appropriate to use.
44 candidates->promotable_resources_.insert(candidate.resource_id);
45 return;
46 }
47
48 // This quad will be promoted. We clear the promotable set here, since we
49 // can only promote a single quad. Otherwise, somebody might try to back
50 // one of the promotable quads with a SurfaceView, and either it or |quad|
51 // would have to fall back to a texture.
52 candidates->promotable_resources_.clear();
53 candidates->promotable_resources_.insert(candidate.resource_id);
54
37 candidate.display_rect = 55 candidate.display_rect =
38 gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect)); 56 gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect));
39 candidate.overlay_handled = true; 57 candidate.overlay_handled = true;
40 candidate.plane_z_order = -1; 58 candidate.plane_z_order = -1;
41 } 59 }
42 } 60 }
43 61
44 bool CompositorOverlayCandidateValidatorAndroid::AllowCALayerOverlays() { 62 bool CompositorOverlayCandidateValidatorAndroid::AllowCALayerOverlays() {
45 return false; 63 return false;
46 } 64 }
47 65
48 // Overlays will still be allowed when software mirroring is enabled, even 66 // Overlays will still be allowed when software mirroring is enabled, even
49 // though they won't appear in the mirror. 67 // though they won't appear in the mirror.
50 void CompositorOverlayCandidateValidatorAndroid::SetSoftwareMirrorMode( 68 void CompositorOverlayCandidateValidatorAndroid::SetSoftwareMirrorMode(
51 bool enabled) {} 69 bool enabled) {}
52 70
53 } // namespace display_compositor 71 } // namespace display_compositor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698