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 IOSurfaceDrawQuad
;
14 class OverlayCandidate
;
15 class OverlayCandidateValidator
;
16 class StreamVideoDrawQuad
;
17 class TextureDrawQuad
;
19 class CC_EXPORT OverlayStrategyCommon
: public OverlayProcessor::Strategy
{
21 explicit OverlayStrategyCommon(OverlayCandidateValidator
* capability_checker
);
22 ~OverlayStrategyCommon() override
;
24 bool Attempt(RenderPassList
* render_passes_in_draw_order
,
25 OverlayCandidateList
* candidate_list
) override
;
28 bool GetCandidateQuadInfo(const DrawQuad
& draw_quad
,
29 OverlayCandidate
* quad_info
);
31 // Returns true if |draw_quad| will not block quads underneath from becoming
33 bool IsInvisibleQuad(const DrawQuad
* draw_quad
);
35 // Returns true if |draw_quad| is of a known quad type and contains an
36 // overlayable resource.
37 bool IsOverlayQuad(const DrawQuad
* draw_quad
);
39 bool GetTextureQuadInfo(const TextureDrawQuad
& quad
,
40 OverlayCandidate
* quad_info
);
41 bool GetVideoQuadInfo(const StreamVideoDrawQuad
& quad
,
42 OverlayCandidate
* quad_info
);
43 bool GetIOSurfaceQuadInfo(const IOSurfaceDrawQuad
& quad
,
44 OverlayCandidate
* quad_info
);
46 virtual bool TryOverlay(OverlayCandidateValidator
* capability_checker
,
47 RenderPassList
* render_passes_in_draw_order
,
48 OverlayCandidateList
* candidate_list
,
49 const OverlayCandidate
& candidate
,
50 QuadList::Iterator iter
) = 0;
53 OverlayCandidateValidator
* capability_checker_
;
55 DISALLOW_COPY_AND_ASSIGN(OverlayStrategyCommon
);
59 #endif // CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_