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

Side by Side Diff: cc/output/overlay_strategy_common.h

Issue 1304303002: Mac Overlays: Add sandwich strategy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@overlay_debug
Patch Set: Ready for pre-review Created 5 years, 4 months 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 #ifndef CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_ 5 #ifndef CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_
6 #define CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_ 6 #define CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/output/overlay_candidate.h" 9 #include "cc/output/overlay_candidate.h"
10 #include "cc/output/overlay_processor.h" 10 #include "cc/output/overlay_processor.h"
11 11
12 namespace cc { 12 namespace cc {
13 class IOSurfaceDrawQuad; 13 class IOSurfaceDrawQuad;
14 class OverlayCandidate; 14 class OverlayCandidate;
15 class OverlayCandidateValidator; 15 class OverlayCandidateValidator;
16 class StreamVideoDrawQuad; 16 class StreamVideoDrawQuad;
17 class TextureDrawQuad; 17 class TextureDrawQuad;
18 18
19 class CC_EXPORT OverlayStrategyCommon : public OverlayProcessor::Strategy { 19 class CC_EXPORT OverlayStrategyCommon : public OverlayProcessor::Strategy {
20 public: 20 public:
21 explicit OverlayStrategyCommon(OverlayCandidateValidator* capability_checker); 21 explicit OverlayStrategyCommon(OverlayCandidateValidator* capability_checker);
22 ~OverlayStrategyCommon() override; 22 ~OverlayStrategyCommon() override;
23 23
24 bool Attempt(RenderPassList* render_passes_in_draw_order, 24 bool Attempt(const OverlayProcessor::RendererState& renderer_state,
25 RenderPassList* render_passes_in_draw_order,
25 OverlayCandidateList* candidate_list) override; 26 OverlayCandidateList* candidate_list) override;
26 27
27 protected: 28 protected:
28 bool GetCandidateQuadInfo(const DrawQuad& draw_quad, 29 bool GetCandidateQuadInfo(const DrawQuad& draw_quad,
29 OverlayCandidate* quad_info); 30 OverlayCandidate* quad_info);
30 31
31 // Returns true if |draw_quad| will not block quads underneath from becoming 32 // Returns true if |draw_quad| will not block quads underneath from becoming
32 // an overlay. 33 // an overlay.
33 bool IsInvisibleQuad(const DrawQuad* draw_quad); 34 bool IsInvisibleQuad(const DrawQuad* draw_quad);
34 35
35 // Returns true if |draw_quad| is of a known quad type and contains an 36 // Returns true if |draw_quad| is of a known quad type and contains an
36 // overlayable resource. 37 // overlayable resource.
37 bool IsOverlayQuad(const DrawQuad* draw_quad); 38 bool IsOverlayQuad(const DrawQuad* draw_quad);
38 39
39 bool GetTextureQuadInfo(const TextureDrawQuad& quad, 40 bool GetTextureQuadInfo(const TextureDrawQuad& quad,
40 OverlayCandidate* quad_info); 41 OverlayCandidate* quad_info);
41 bool GetVideoQuadInfo(const StreamVideoDrawQuad& quad, 42 bool GetVideoQuadInfo(const StreamVideoDrawQuad& quad,
42 OverlayCandidate* quad_info); 43 OverlayCandidate* quad_info);
43 bool GetIOSurfaceQuadInfo(const IOSurfaceDrawQuad& quad, 44 bool GetIOSurfaceQuadInfo(const IOSurfaceDrawQuad& quad,
44 OverlayCandidate* quad_info); 45 OverlayCandidate* quad_info);
45 46
46 virtual bool TryOverlay(OverlayCandidateValidator* capability_checker, 47 virtual bool TryOverlay(const OverlayProcessor::RendererState& renderer_state,
48 OverlayCandidateValidator* capability_checker,
47 RenderPassList* render_passes_in_draw_order, 49 RenderPassList* render_passes_in_draw_order,
48 OverlayCandidateList* candidate_list, 50 OverlayCandidateList* candidate_list,
49 const OverlayCandidate& candidate, 51 const OverlayCandidate& candidate,
50 QuadList::Iterator iter) = 0; 52 QuadList::Iterator iter) = 0;
51 53
52 private: 54 private:
53 OverlayCandidateValidator* capability_checker_; 55 OverlayCandidateValidator* capability_checker_;
54 56
55 DISALLOW_COPY_AND_ASSIGN(OverlayStrategyCommon); 57 DISALLOW_COPY_AND_ASSIGN(OverlayStrategyCommon);
56 }; 58 };
57 } // namespace cc 59 } // namespace cc
58 60
59 #endif // CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_ 61 #endif // CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698