GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / cc / output / overlay_strategy_common.h
blob515a106e78201199660a22f3ac40fd04dc80027c
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 OverlayStrategyCommon(OverlayCandidateValidator* capability_checker,
21 ResourceProvider* resource_provider);
22 ~OverlayStrategyCommon() override;
24 protected:
25 bool GetCandidateQuadInfo(const DrawQuad& draw_quad,
26 OverlayCandidate* quad_info);
28 // Returns true if |draw_quad| will not block quads underneath from becoming
29 // an overlay.
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_;
44 private:
45 DISALLOW_COPY_AND_ASSIGN(OverlayStrategyCommon);
47 } // namespace cc
49 #endif // CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_