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

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: 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 unified diff | Download patch
« no previous file with comments | « components/display_compositor/DEPS ('k') | media/base/video_frame_metadata.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This quad either will be promoted, or would be if it were backed by a
39 // SurfaceView. Record that it should get a promotion hint.
40 candidates->promotable_resource_hints_.insert(candidate.resource_id);
41
42 if (candidate.is_backed_by_surface_texture) {
43 // This quad would be promoted if it were backed by a SurfaceView. Since
44 // it isn't, we can't promote it.
45 return;
46 }
47
37 candidate.display_rect = 48 candidate.display_rect =
38 gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect)); 49 gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect));
39 candidate.overlay_handled = true; 50 candidate.overlay_handled = true;
40 candidate.plane_z_order = -1; 51 candidate.plane_z_order = -1;
41 } 52 }
42 } 53 }
43 54
44 bool CompositorOverlayCandidateValidatorAndroid::AllowCALayerOverlays() { 55 bool CompositorOverlayCandidateValidatorAndroid::AllowCALayerOverlays() {
45 return false; 56 return false;
46 } 57 }
47 58
48 // Overlays will still be allowed when software mirroring is enabled, even 59 // Overlays will still be allowed when software mirroring is enabled, even
49 // though they won't appear in the mirror. 60 // though they won't appear in the mirror.
50 void CompositorOverlayCandidateValidatorAndroid::SetSoftwareMirrorMode( 61 void CompositorOverlayCandidateValidatorAndroid::SetSoftwareMirrorMode(
51 bool enabled) {} 62 bool enabled) {}
52 63
53 } // namespace display_compositor 64 } // namespace display_compositor
OLDNEW
« 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