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 #ifndef COMPONENTS_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_AND
ROID_H_ | 5 #ifndef COMPONENTS_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_AND
ROID_H_ |
6 #define COMPONENTS_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_AND
ROID_H_ | 6 #define COMPONENTS_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_AND
ROID_H_ |
7 | 7 |
| 8 #include <set> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "components/display_compositor/compositor_overlay_candidate_validator.h
" | 11 #include "components/display_compositor/compositor_overlay_candidate_validator.h
" |
10 #include "components/display_compositor/display_compositor_export.h" | 12 #include "components/display_compositor/display_compositor_export.h" |
11 | 13 |
| 14 namespace cc { |
| 15 class DrawQuad; |
| 16 class OverlayPromotabilityCallback; |
| 17 class ResourceProvider; |
| 18 class RenderPass; |
| 19 } |
| 20 |
12 namespace display_compositor { | 21 namespace display_compositor { |
13 | 22 |
14 // An overlay validator for supporting fullscreen video underlays on Android. | 23 // An overlay validator for supporting fullscreen video underlays on Android. |
15 // Things are a bit different on Android compared with other platforms. By the | 24 // Things are a bit different on Android compared with other platforms. By the |
16 // time a video frame is marked as overlayable it means the video decoder was | 25 // time a video frame is marked as overlayable it means the video decoder was |
17 // outputting to a Surface that we can't read back from. As a result, the | 26 // outputting to a Surface that we can't read back from. As a result, the |
18 // overlay must always succeed, or the video won't be visible. This is one of of | 27 // overlay must always succeed, or the video won't be visible. This is one of of |
19 // the reasons that only fullscreen is supported: we have to be sure that | 28 // the reasons that only fullscreen is supported: we have to be sure that |
20 // nothing will cause the overlay to be rejected, because there's no fallback to | 29 // nothing will cause the overlay to be rejected, because there's no fallback to |
21 // gl compositing. | 30 // gl compositing. |
22 class DISPLAY_COMPOSITOR_EXPORT CompositorOverlayCandidateValidatorAndroid | 31 class DISPLAY_COMPOSITOR_EXPORT CompositorOverlayCandidateValidatorAndroid |
23 : public CompositorOverlayCandidateValidator { | 32 : public CompositorOverlayCandidateValidator { |
24 public: | 33 public: |
25 CompositorOverlayCandidateValidatorAndroid(); | 34 CompositorOverlayCandidateValidatorAndroid(); |
26 ~CompositorOverlayCandidateValidatorAndroid() override; | 35 ~CompositorOverlayCandidateValidatorAndroid() override; |
27 | 36 |
28 void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; | 37 void GetStrategies(cc::OverlayProcessor::StrategyList* strategies) override; |
29 void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; | 38 void CheckOverlaySupport(cc::OverlayCandidateList* surfaces) override; |
30 bool AllowCALayerOverlays() override; | 39 bool AllowCALayerOverlays() override; |
31 | 40 |
32 void SetSoftwareMirrorMode(bool enabled) override; | 41 void SetSoftwareMirrorMode(bool enabled) override; |
33 | 42 |
| 43 void ClearPromotableResources() override; |
| 44 |
| 45 bool IsResourcePromotable(cc::ResourceId resource_id) override; |
| 46 |
34 private: | 47 private: |
| 48 std::set<cc::ResourceId> promotable_resources_; |
| 49 |
35 DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorAndroid); | 50 DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorAndroid); |
36 }; | 51 }; |
37 | 52 |
38 } // namespace display_compositor | 53 } // namespace display_compositor |
39 | 54 |
40 #endif // COMPONENTS_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_
ANDROID_H_ | 55 #endif // COMPONENTS_DISPLAY_COMPOSITOR_COMPOSITOR_OVERLAY_CANDIDATE_VALIDATOR_
ANDROID_H_ |
OLD | NEW |