Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1390)

Unified Diff: cc/output/overlay_strategy_all_or_nothing.h

Issue 1373373003: Mac Overlays: Add AllOrNothing strategy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@OverlayTest
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/output/overlay_strategy_all_or_nothing.h
diff --git a/cc/output/overlay_strategy_all_or_nothing.h b/cc/output/overlay_strategy_all_or_nothing.h
new file mode 100644
index 0000000000000000000000000000000000000000..546f1b514daaecf33538389a96b5a9ff1f0e1376
--- /dev/null
+++ b/cc/output/overlay_strategy_all_or_nothing.h
@@ -0,0 +1,35 @@
+// 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_ALL_OR_NOTHING_H_
+#define CC_OUTPUT_OVERLAY_STRATEGY_ALL_OR_NOTHING_H_
+
+#include "cc/output/overlay_processor.h"
+
+namespace cc {
+
+class OverlayCandidateValidator;
+
+// This strategy attempts to promote all quads into overlays.
+// If any quad can't be promoted, it returns false and no quads are promoted.
+class CC_EXPORT OverlayStrategyAllOrNothing
+ : public OverlayProcessor::Strategy {
+ public:
+ explicit OverlayStrategyAllOrNothing(
+ OverlayCandidateValidator* capability_checker);
+ ~OverlayStrategyAllOrNothing() override;
+
+ bool Attempt(RenderPassList* render_passes_in_draw_order,
+ OverlayCandidateList* candidate_list,
+ float device_scale_factor) override;
+
+ private:
+ OverlayCandidateValidator* capability_checker_; // Weak.
+
+ DISALLOW_COPY_AND_ASSIGN(OverlayStrategyAllOrNothing);
+};
+
+} // namespace cc
+
+#endif // CC_OUTPUT_OVERLAY_STRATEGY_ALL_OR_NOTHING_H_

Powered by Google App Engine
This is Rietveld 408576698