Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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 "ash/debug.h" | |
| 6 | |
| 7 #include "ash/shell.h" | |
| 8 #include "cc/debug/layer_tree_debug_state.h" | |
| 9 #include "ui/aura/root_window.h" | |
| 10 #include "ui/compositor/compositor.h" | |
| 11 | |
| 12 namespace ash { | |
| 13 namespace debug { | |
| 14 | |
| 15 void ToggleShowDebugBorders() { | |
| 16 Shell::RootWindowList root_windows = | |
| 17 Shell::GetInstance()->GetAllRootWindows(); | |
| 18 for (Shell::RootWindowList::iterator it = root_windows.begin(); | |
| 19 it != root_windows.end(); ++it) { | |
| 20 ui::Compositor* compositor = (*it)->compositor(); | |
| 21 cc::LayerTreeDebugState state = compositor->GetLayerTreeDebugState(); | |
| 22 state.show_debug_borders = !state.show_debug_borders; | |
|
piman
2013/04/23 00:54:30
it would be better to figure out the right value f
oshima
2013/04/23 01:18:58
ok, done.
| |
| 23 compositor->SetLayerTreeDebugState(state); | |
| 24 } | |
| 25 } | |
| 26 | |
| 27 void ToggleShowFpsCounter() { | |
| 28 Shell::RootWindowList root_windows = | |
| 29 Shell::GetInstance()->GetAllRootWindows(); | |
| 30 for (Shell::RootWindowList::iterator it = root_windows.begin(); | |
| 31 it != root_windows.end(); ++it) { | |
| 32 ui::Compositor* compositor = (*it)->compositor(); | |
| 33 cc::LayerTreeDebugState state = compositor->GetLayerTreeDebugState(); | |
| 34 state.show_fps_counter = !state.show_fps_counter; | |
| 35 compositor->SetLayerTreeDebugState(state); | |
| 36 } | |
| 37 } | |
| 38 | |
| 39 void ToggleShowPaintRects() { | |
| 40 Shell::RootWindowList root_windows = | |
| 41 Shell::GetInstance()->GetAllRootWindows(); | |
| 42 for (Shell::RootWindowList::iterator it = root_windows.begin(); | |
| 43 it != root_windows.end(); ++it) { | |
| 44 ui::Compositor* compositor = (*it)->compositor(); | |
| 45 cc::LayerTreeDebugState state = compositor->GetLayerTreeDebugState(); | |
| 46 state.show_paint_rects = !state.show_paint_rects; | |
| 47 compositor->SetLayerTreeDebugState(state); | |
| 48 } | |
| 49 } | |
| 50 | |
| 51 } // debug | |
| 52 } // ash | |
| OLD | NEW |