Index: cc/output/overlay_strategy_common.h |
diff --git a/cc/output/overlay_strategy_single_on_top.h b/cc/output/overlay_strategy_common.h |
similarity index 57% |
copy from cc/output/overlay_strategy_single_on_top.h |
copy to cc/output/overlay_strategy_common.h |
index a3fec0a66e38a4d9019ab193c7eb445bcee7170f..515a106e78201199660a22f3ac40fd04dc80027c 100644 |
--- a/cc/output/overlay_strategy_single_on_top.h |
+++ b/cc/output/overlay_strategy_common.h |
@@ -1,31 +1,27 @@ |
-// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CC_OUTPUT_OVERLAY_STRATEGY_SINGLE_ON_TOP_H_ |
-#define CC_OUTPUT_OVERLAY_STRATEGY_SINGLE_ON_TOP_H_ |
+#ifndef CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_ |
+#define CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_ |
-#include "base/basictypes.h" |
-#include "base/memory/scoped_ptr.h" |
#include "cc/base/cc_export.h" |
#include "cc/output/overlay_candidate.h" |
#include "cc/output/overlay_processor.h" |
-#include "cc/quads/render_pass.h" |
namespace cc { |
class OverlayCandidateValidator; |
class StreamVideoDrawQuad; |
class TextureDrawQuad; |
+class OverlayCandidate; |
-class CC_EXPORT OverlayStrategySingleOnTop : public OverlayProcessor::Strategy { |
+class CC_EXPORT OverlayStrategyCommon : public OverlayProcessor::Strategy { |
public: |
- OverlayStrategySingleOnTop(OverlayCandidateValidator* capability_checker, |
- ResourceProvider* resource_provider); |
- bool Attempt(RenderPassList* render_passes_in_draw_order, |
- OverlayCandidateList* candidate_list) override; |
+ OverlayStrategyCommon(OverlayCandidateValidator* capability_checker, |
+ ResourceProvider* resource_provider); |
+ ~OverlayStrategyCommon() override; |
- private: |
- bool IsOverlayQuad(const DrawQuad* draw_quad); |
+ protected: |
bool GetCandidateQuadInfo(const DrawQuad& draw_quad, |
OverlayCandidate* quad_info); |
@@ -33,6 +29,10 @@ class CC_EXPORT OverlayStrategySingleOnTop : public OverlayProcessor::Strategy { |
// an overlay. |
bool IsInvisibleQuad(const DrawQuad* draw_quad); |
+ // Returns true if |draw_quad| is of a known quad type and contains an |
+ // overlayable resource. |
+ bool IsOverlayQuad(const DrawQuad* draw_quad); |
+ |
bool GetTextureQuadInfo(const TextureDrawQuad& quad, |
OverlayCandidate* quad_info); |
bool GetVideoQuadInfo(const StreamVideoDrawQuad& quad, |
@@ -40,9 +40,10 @@ class CC_EXPORT OverlayStrategySingleOnTop : public OverlayProcessor::Strategy { |
OverlayCandidateValidator* capability_checker_; |
ResourceProvider* resource_provider_; |
- DISALLOW_COPY_AND_ASSIGN(OverlayStrategySingleOnTop); |
-}; |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(OverlayStrategyCommon); |
+}; |
} // namespace cc |
-#endif // CC_OUTPUT_OVERLAY_STRATEGY_SINGLE_ON_TOP_H_ |
+#endif // CC_OUTPUT_OVERLAY_STRATEGY_COMMON_H_ |