Add ICU message format support
[chromium-blink-merge.git] / cc / output / overlay_strategy_common.h
blob2b81b90ee40b3808e535d0ca15e226a5e3524c5e
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"
12 namespace cc {
13 class OverlayCandidateValidator;
14 class StreamVideoDrawQuad;
15 class TextureDrawQuad;
16 class OverlayCandidate;
18 class CC_EXPORT OverlayStrategyCommon : public OverlayProcessor::Strategy {
19 public:
20 explicit OverlayStrategyCommon(OverlayCandidateValidator* capability_checker);
21 ~OverlayStrategyCommon() override;
23 bool Attempt(RenderPassList* render_passes_in_draw_order,
24 OverlayCandidateList* candidate_list) override;
26 protected:
27 bool GetCandidateQuadInfo(const DrawQuad& draw_quad,
28 OverlayCandidate* quad_info);
30 // Returns true if |draw_quad| will not block quads underneath from becoming
31 // an overlay.
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;
49 private:
50 OverlayCandidateValidator* capability_checker_;
52 DISALLOW_COPY_AND_ASSIGN(OverlayStrategyCommon);
54 } // namespace cc
56 #endif // CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_