| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layer_tree_debug_state.h" | 5 #include "cc/layer_tree_debug_state.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace cc { | 9 namespace cc { |
| 10 | 10 |
| 11 LayerTreeDebugState::LayerTreeDebugState() | 11 LayerTreeDebugState::LayerTreeDebugState() |
| 12 : showFPSCounter(false) | 12 : showFPSCounter(false) |
| 13 , showPlatformLayerTree(false) | 13 , showPlatformLayerTree(false) |
| 14 , showDebugBorders(false) | 14 , showDebugBorders(false) |
| 15 , continuousPainting(false) | 15 , continuousPainting(false) |
| 16 , showPaintRects(false) | 16 , showPaintRects(false) |
| 17 , showPropertyChangedRects(false) | 17 , showPropertyChangedRects(false) |
| 18 , showSurfaceDamageRects(false) | 18 , showSurfaceDamageRects(false) |
| 19 , showScreenSpaceRects(false) | 19 , showScreenSpaceRects(false) |
| 20 , showReplicaScreenSpaceRects(false) | 20 , showReplicaScreenSpaceRects(false) |
| 21 , showOccludingRects(false) | 21 , showOccludingRects(false) |
| 22 , showNonOccludingRects(false) { } | 22 , showNonOccludingRects(false) { } |
| 23 | 23 |
| 24 LayerTreeDebugState::~LayerTreeDebugState() { | 24 LayerTreeDebugState::~LayerTreeDebugState() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 bool LayerTreeDebugState::showHudInfo() const { | 27 bool LayerTreeDebugState::showHudInfo() const { |
| 28 return showFPSCounter || showPlatformLayerTree || showHudRects(); | 28 return showFPSCounter || showPlatformLayerTree || continuousPainting || show
HudRects(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool LayerTreeDebugState::showHudRects() const { | 31 bool LayerTreeDebugState::showHudRects() const { |
| 32 return showPaintRects || showPropertyChangedRects || showSurfaceDamageRects
|| showScreenSpaceRects || showReplicaScreenSpaceRects || showOccludingRects ||
showNonOccludingRects; | 32 return showPaintRects || showPropertyChangedRects || showSurfaceDamageRects
|| showScreenSpaceRects || showReplicaScreenSpaceRects || showOccludingRects ||
showNonOccludingRects; |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool LayerTreeDebugState::hudNeedsFont() const { | 35 bool LayerTreeDebugState::hudNeedsFont() const { |
| 36 return showFPSCounter || showPlatformLayerTree; | 36 return showFPSCounter || showPlatformLayerTree || continuousPainting; |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool LayerTreeDebugState::equal(const LayerTreeDebugState& a, const LayerTreeDeb
ugState& b) { | 39 bool LayerTreeDebugState::equal(const LayerTreeDebugState& a, const LayerTreeDeb
ugState& b) { |
| 40 return memcmp(&a, &b, sizeof(LayerTreeDebugState)) == 0; | 40 return memcmp(&a, &b, sizeof(LayerTreeDebugState)) == 0; |
| 41 } | 41 } |
| 42 | 42 |
| 43 LayerTreeDebugState LayerTreeDebugState::unite(const LayerTreeDebugState& a, con
st LayerTreeDebugState& b) { | 43 LayerTreeDebugState LayerTreeDebugState::unite(const LayerTreeDebugState& a, con
st LayerTreeDebugState& b) { |
| 44 LayerTreeDebugState r(a); | 44 LayerTreeDebugState r(a); |
| 45 | 45 |
| 46 r.showFPSCounter |= b.showFPSCounter; | 46 r.showFPSCounter |= b.showFPSCounter; |
| 47 r.showPlatformLayerTree |= b.showPlatformLayerTree; | 47 r.showPlatformLayerTree |= b.showPlatformLayerTree; |
| 48 r.showDebugBorders |= b.showDebugBorders; | 48 r.showDebugBorders |= b.showDebugBorders; |
| 49 r.continuousPainting |= b.continuousPainting; | 49 r.continuousPainting |= b.continuousPainting; |
| 50 | 50 |
| 51 r.showPaintRects |= b.showPaintRects; | 51 r.showPaintRects |= b.showPaintRects; |
| 52 r.showPropertyChangedRects |= b.showPropertyChangedRects; | 52 r.showPropertyChangedRects |= b.showPropertyChangedRects; |
| 53 r.showSurfaceDamageRects |= b.showSurfaceDamageRects; | 53 r.showSurfaceDamageRects |= b.showSurfaceDamageRects; |
| 54 r.showScreenSpaceRects |= b.showScreenSpaceRects; | 54 r.showScreenSpaceRects |= b.showScreenSpaceRects; |
| 55 r.showReplicaScreenSpaceRects |= b.showReplicaScreenSpaceRects; | 55 r.showReplicaScreenSpaceRects |= b.showReplicaScreenSpaceRects; |
| 56 r.showOccludingRects |= b.showOccludingRects; | 56 r.showOccludingRects |= b.showOccludingRects; |
| 57 r.showNonOccludingRects |= b.showNonOccludingRects; | 57 r.showNonOccludingRects |= b.showNonOccludingRects; |
| 58 | 58 |
| 59 return r; | 59 return r; |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace cc | 62 } // namespace cc |
| OLD | NEW |