OLD | NEW |
(Empty) | |
| 1 // Copyright 2011 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. |
| 4 |
| 5 #include "cc/layer_tree_debug_state.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace cc { |
| 10 |
| 11 LayerTreeDebugState::LayerTreeDebugState() |
| 12 : showFPSCounter(false) |
| 13 , showPlatformLayerTree(false) |
| 14 , showDebugBorders(false) |
| 15 , showPaintRects(false) |
| 16 , showPropertyChangedRects(false) |
| 17 , showSurfaceDamageRects(false) |
| 18 , showScreenSpaceRects(false) |
| 19 , showReplicaScreenSpaceRects(false) |
| 20 , showOccludingRects(false) |
| 21 , showNonOccludingRects(false) { } |
| 22 |
| 23 LayerTreeDebugState::~LayerTreeDebugState() { |
| 24 } |
| 25 |
| 26 bool LayerTreeDebugState::showHudInfo() const { |
| 27 return showFPSCounter || showPlatformLayerTree || showHudRects(); |
| 28 } |
| 29 |
| 30 bool LayerTreeDebugState::showHudRects() const { |
| 31 return showPaintRects || showPropertyChangedRects || showSurfaceDamageRects
|| showScreenSpaceRects || showReplicaScreenSpaceRects || showOccludingRects ||
showNonOccludingRects; |
| 32 } |
| 33 |
| 34 bool LayerTreeDebugState::hudNeedsFont() const { |
| 35 return showFPSCounter || showPlatformLayerTree; |
| 36 } |
| 37 |
| 38 bool LayerTreeDebugState::equal(const LayerTreeDebugState& a, const LayerTreeDeb
ugState& b) { |
| 39 return memcmp(&a, &b, sizeof(LayerTreeDebugState)) == 0; |
| 40 } |
| 41 |
| 42 LayerTreeDebugState LayerTreeDebugState::unite(const LayerTreeDebugState& a, con
st LayerTreeDebugState& b) { |
| 43 LayerTreeDebugState r(a); |
| 44 |
| 45 r.showFPSCounter |= b.showFPSCounter; |
| 46 r.showPlatformLayerTree |= b.showPlatformLayerTree; |
| 47 r.showDebugBorders |= b.showDebugBorders; |
| 48 |
| 49 r.showPaintRects |= b.showPaintRects; |
| 50 r.showPropertyChangedRects |= b.showPropertyChangedRects; |
| 51 r.showSurfaceDamageRects |= b.showSurfaceDamageRects; |
| 52 r.showScreenSpaceRects |= b.showScreenSpaceRects; |
| 53 r.showReplicaScreenSpaceRects |= b.showReplicaScreenSpaceRects; |
| 54 r.showOccludingRects |= b.showOccludingRects; |
| 55 r.showNonOccludingRects |= b.showNonOccludingRects; |
| 56 |
| 57 return r; |
| 58 } |
| 59 |
| 60 } // namespace cc |
OLD | NEW |