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 OverlayStrategyCommon(OverlayCandidateValidator
* capability_checker
,
21 ResourceProvider
* resource_provider
);
22 ~OverlayStrategyCommon() override
;
25 bool GetCandidateQuadInfo(const DrawQuad
& draw_quad
,
26 OverlayCandidate
* quad_info
);
28 // Returns true if |draw_quad| will not block quads underneath from becoming
30 bool IsInvisibleQuad(const DrawQuad
* draw_quad
);
32 // Returns true if |draw_quad| is of a known quad type and contains an
33 // overlayable resource.
34 bool IsOverlayQuad(const DrawQuad
* draw_quad
);
36 bool GetTextureQuadInfo(const TextureDrawQuad
& quad
,
37 OverlayCandidate
* quad_info
);
38 bool GetVideoQuadInfo(const StreamVideoDrawQuad
& quad
,
39 OverlayCandidate
* quad_info
);
41 OverlayCandidateValidator
* capability_checker_
;
42 ResourceProvider
* resource_provider_
;
45 DISALLOW_COPY_AND_ASSIGN(OverlayStrategyCommon
);
49 #endif // CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_