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
3 // found in the LICENSE file.
5 #ifndef CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_
6 #define CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_
8 #include "cc/base/cc_export.h"
9 #include "cc/output/overlay_candidate.h"
10 #include "cc/output/overlay_processor.h"
13 class OverlayCandidateValidator
;
14 class StreamVideoDrawQuad
;
15 class TextureDrawQuad
;
16 class OverlayCandidate
;
18 class CC_EXPORT OverlayStrategyCommon
: public OverlayProcessor::Strategy
{
20 explicit OverlayStrategyCommon(OverlayCandidateValidator
* capability_checker
);
21 ~OverlayStrategyCommon() override
;
23 bool Attempt(RenderPassList
* render_passes_in_draw_order
,
24 OverlayCandidateList
* candidate_list
) override
;
27 bool GetCandidateQuadInfo(const DrawQuad
& draw_quad
,
28 OverlayCandidate
* quad_info
);
30 // Returns true if |draw_quad| will not block quads underneath from becoming
32 bool IsInvisibleQuad(const DrawQuad
* draw_quad
);
34 // Returns true if |draw_quad| is of a known quad type and contains an
35 // overlayable resource.
36 bool IsOverlayQuad(const DrawQuad
* draw_quad
);
38 bool GetTextureQuadInfo(const TextureDrawQuad
& quad
,
39 OverlayCandidate
* quad_info
);
40 bool GetVideoQuadInfo(const StreamVideoDrawQuad
& quad
,
41 OverlayCandidate
* quad_info
);
43 virtual bool TryOverlay(OverlayCandidateValidator
* capability_checker
,
44 RenderPassList
* render_passes_in_draw_order
,
45 OverlayCandidateList
* candidate_list
,
46 const OverlayCandidate
& candidate
,
47 QuadList::Iterator iter
) = 0;
50 OverlayCandidateValidator
* capability_checker_
;
52 DISALLOW_COPY_AND_ASSIGN(OverlayStrategyCommon
);
56 #endif // CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_