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

Unified Diff: cc/layer_tree_debug_state.cc

Issue 11529003: [cc] Route LayerImpl::layerTreeHostImpl() calls through LayerTreeImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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
« no previous file with comments | « cc/layer_tree_debug_state.h ('k') | cc/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_debug_state.cc
diff --git a/cc/layer_tree_debug_state.cc b/cc/layer_tree_debug_state.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f2e2d668b2b391a0ba77df6d2163ef9d7d58c31a
--- /dev/null
+++ b/cc/layer_tree_debug_state.cc
@@ -0,0 +1,60 @@
+// Copyright 2011 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.
+
+#include "cc/layer_tree_debug_state.h"
+
+#include "base/logging.h"
+
+namespace cc {
+
+LayerTreeDebugState::LayerTreeDebugState()
+ : showFPSCounter(false)
+ , showPlatformLayerTree(false)
+ , showDebugBorders(false)
+ , showPaintRects(false)
+ , showPropertyChangedRects(false)
+ , showSurfaceDamageRects(false)
+ , showScreenSpaceRects(false)
+ , showReplicaScreenSpaceRects(false)
+ , showOccludingRects(false)
+ , showNonOccludingRects(false) { }
+
+LayerTreeDebugState::~LayerTreeDebugState() {
+}
+
+bool LayerTreeDebugState::showHudInfo() const {
+ return showFPSCounter || showPlatformLayerTree || showHudRects();
+}
+
+bool LayerTreeDebugState::showHudRects() const {
+ return showPaintRects || showPropertyChangedRects || showSurfaceDamageRects || showScreenSpaceRects || showReplicaScreenSpaceRects || showOccludingRects || showNonOccludingRects;
+}
+
+bool LayerTreeDebugState::hudNeedsFont() const {
+ return showFPSCounter || showPlatformLayerTree;
+}
+
+bool LayerTreeDebugState::equal(const LayerTreeDebugState& a, const LayerTreeDebugState& b) {
+ return memcmp(&a, &b, sizeof(LayerTreeDebugState)) == 0;
+}
+
+LayerTreeDebugState LayerTreeDebugState::unite(const LayerTreeDebugState& a, const LayerTreeDebugState& b) {
+ LayerTreeDebugState r(a);
+
+ r.showFPSCounter |= b.showFPSCounter;
+ r.showPlatformLayerTree |= b.showPlatformLayerTree;
+ r.showDebugBorders |= b.showDebugBorders;
+
+ r.showPaintRects |= b.showPaintRects;
+ r.showPropertyChangedRects |= b.showPropertyChangedRects;
+ r.showSurfaceDamageRects |= b.showSurfaceDamageRects;
+ r.showScreenSpaceRects |= b.showScreenSpaceRects;
+ r.showReplicaScreenSpaceRects |= b.showReplicaScreenSpaceRects;
+ r.showOccludingRects |= b.showOccludingRects;
+ r.showNonOccludingRects |= b.showNonOccludingRects;
+
+ return r;
+}
+
+} // namespace cc
« no previous file with comments | « cc/layer_tree_debug_state.h ('k') | cc/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698