OLD | NEW |
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 "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor_android.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" |
11 #include "cc/output/overlay_strategy_underlay.h" | 11 #include "cc/output/overlay_strategy_underlay.h" |
12 #include "ui/gfx/geometry/rect_conversions.h" | 12 #include "ui/gfx/geometry/rect_conversions.h" |
13 | 13 |
14 namespace content { | 14 namespace display_compositor { |
15 | 15 |
16 BrowserCompositorOverlayCandidateValidatorAndroid:: | 16 CompositorOverlayCandidateValidatorAndroid:: |
17 BrowserCompositorOverlayCandidateValidatorAndroid() {} | 17 CompositorOverlayCandidateValidatorAndroid() {} |
18 | 18 |
19 BrowserCompositorOverlayCandidateValidatorAndroid:: | 19 CompositorOverlayCandidateValidatorAndroid:: |
20 ~BrowserCompositorOverlayCandidateValidatorAndroid() {} | 20 ~CompositorOverlayCandidateValidatorAndroid() {} |
21 | 21 |
22 void BrowserCompositorOverlayCandidateValidatorAndroid::GetStrategies( | 22 void CompositorOverlayCandidateValidatorAndroid::GetStrategies( |
23 cc::OverlayProcessor::StrategyList* strategies) { | 23 cc::OverlayProcessor::StrategyList* strategies) { |
24 strategies->push_back( | 24 strategies->push_back( |
25 base::WrapUnique(new cc::OverlayStrategyUnderlay(this))); | 25 base::WrapUnique(new cc::OverlayStrategyUnderlay(this))); |
26 } | 26 } |
27 | 27 |
28 void BrowserCompositorOverlayCandidateValidatorAndroid::CheckOverlaySupport( | 28 void CompositorOverlayCandidateValidatorAndroid::CheckOverlaySupport( |
29 cc::OverlayCandidateList* candidates) { | 29 cc::OverlayCandidateList* candidates) { |
30 // There should only be at most a single overlay candidate: the video quad. | 30 // There should only be at most a single overlay candidate: the video quad. |
31 // There's no check that the presented candidate is really a video frame for | 31 // There's no check that the presented candidate is really a video frame for |
32 // a fullscreen video. Instead it's assumed that if a quad is marked as | 32 // a fullscreen video. Instead it's assumed that if a quad is marked as |
33 // overlayable, it's a fullscreen video quad. | 33 // overlayable, it's a fullscreen video quad. |
34 DCHECK_LE(candidates->size(), 1u); | 34 DCHECK_LE(candidates->size(), 1u); |
35 | 35 |
36 if (!candidates->empty()) { | 36 if (!candidates->empty()) { |
37 cc::OverlayCandidate& candidate = candidates->front(); | 37 cc::OverlayCandidate& candidate = candidates->front(); |
38 candidate.display_rect = | 38 candidate.display_rect = |
39 gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect)); | 39 gfx::RectF(gfx::ToEnclosingRect(candidate.display_rect)); |
40 candidate.overlay_handled = true; | 40 candidate.overlay_handled = true; |
41 candidate.plane_z_order = -1; | 41 candidate.plane_z_order = -1; |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 bool BrowserCompositorOverlayCandidateValidatorAndroid::AllowCALayerOverlays() { | 45 bool CompositorOverlayCandidateValidatorAndroid::AllowCALayerOverlays() { |
46 return false; | 46 return false; |
47 } | 47 } |
48 | 48 |
49 // Overlays will still be allowed when software mirroring is enabled, even | 49 // Overlays will still be allowed when software mirroring is enabled, even |
50 // though they won't appear in the mirror. | 50 // though they won't appear in the mirror. |
51 void BrowserCompositorOverlayCandidateValidatorAndroid::SetSoftwareMirrorMode( | 51 void CompositorOverlayCandidateValidatorAndroid::SetSoftwareMirrorMode( |
52 bool enabled) {} | 52 bool enabled) {} |
53 | 53 |
54 } // namespace content | 54 } // namespace display_compositor |
OLD | NEW |