OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CC_OUTPUT_OVERLAY_STRATEGY_SINGLE_ON_TOP_H_ | 5 #ifndef CC_OUTPUT_OVERLAY_STRATEGY_SINGLE_ON_TOP_H_ |
6 #define CC_OUTPUT_OVERLAY_STRATEGY_SINGLE_ON_TOP_H_ | 6 #define CC_OUTPUT_OVERLAY_STRATEGY_SINGLE_ON_TOP_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | |
11 #include "cc/output/overlay_candidate.h" | 10 #include "cc/output/overlay_candidate.h" |
12 #include "cc/output/overlay_processor.h" | 11 #include "cc/output/overlay_processor.h" |
13 #include "cc/quads/render_pass.h" | 12 #include "cc/quads/render_pass.h" |
14 | 13 |
15 namespace cc { | 14 namespace cc { |
16 class OverlayCandidateValidator; | 15 class OverlayCandidateValidator; |
17 class StreamVideoDrawQuad; | 16 class StreamVideoDrawQuad; |
18 class TextureDrawQuad; | 17 class TextureDrawQuad; |
19 | 18 |
20 class CC_EXPORT OverlayStrategySingleOnTop : public OverlayProcessor::Strategy { | 19 class OverlayStrategySingleOnTop : public OverlayProcessor::Strategy { |
21 public: | 20 public: |
22 OverlayStrategySingleOnTop(OverlayCandidateValidator* capability_checker, | 21 OverlayStrategySingleOnTop(OverlayCandidateValidator* capability_checker, |
23 ResourceProvider* resource_provider); | 22 ResourceProvider* resource_provider); |
24 bool Attempt(RenderPassList* render_passes_in_draw_order, | 23 bool Attempt(RenderPassList* render_passes_in_draw_order, |
25 OverlayCandidateList* candidate_list) override; | 24 OverlayCandidateList* candidate_list) override; |
26 | 25 |
27 private: | 26 private: |
28 bool IsOverlayQuad(const DrawQuad* draw_quad); | 27 bool IsOverlayQuad(const DrawQuad* draw_quad); |
29 bool GetCandidateQuadInfo(const DrawQuad& draw_quad, | 28 bool GetCandidateQuadInfo(const DrawQuad& draw_quad, |
30 OverlayCandidate* quad_info); | 29 OverlayCandidate* quad_info); |
31 | 30 |
32 // Returns true if |draw_quad| will not block quads underneath from becoming | 31 // Returns true if |draw_quad| will not block quads underneath from becoming |
33 // an overlay. | 32 // an overlay. |
34 bool IsInvisibleQuad(const DrawQuad* draw_quad); | 33 bool IsInvisibleQuad(const DrawQuad* draw_quad); |
35 | 34 |
36 bool GetTextureQuadInfo(const TextureDrawQuad& quad, | 35 bool GetTextureQuadInfo(const TextureDrawQuad& quad, |
37 OverlayCandidate* quad_info); | 36 OverlayCandidate* quad_info); |
38 bool GetVideoQuadInfo(const StreamVideoDrawQuad& quad, | 37 bool GetVideoQuadInfo(const StreamVideoDrawQuad& quad, |
39 OverlayCandidate* quad_info); | 38 OverlayCandidate* quad_info); |
40 | 39 |
41 OverlayCandidateValidator* capability_checker_; | 40 OverlayCandidateValidator* capability_checker_; |
42 ResourceProvider* resource_provider_; | 41 ResourceProvider* resource_provider_; |
43 DISALLOW_COPY_AND_ASSIGN(OverlayStrategySingleOnTop); | 42 DISALLOW_COPY_AND_ASSIGN(OverlayStrategySingleOnTop); |
44 }; | 43 }; |
45 | 44 |
46 } // namespace cc | 45 } // namespace cc |
47 | 46 |
48 #endif // CC_OUTPUT_OVERLAY_STRATEGY_SINGLE_ON_TOP_H_ | 47 #endif // CC_OUTPUT_OVERLAY_STRATEGY_SINGLE_ON_TOP_H_ |
OLD | NEW |