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 "ui/aura/root_window.h" |
| 9 #include "ui/compositor/compositor.h" |
| 10 |
| 11 namespace ash { |
| 12 namespace debug { |
| 13 |
| 14 void ToggleShowPaintRects() { |
| 15 Shell::RootWindowList root_windows = |
| 16 Shell::GetInstance()->GetAllRootWindows(); |
| 17 scoped_ptr<bool> value; |
| 18 for (Shell::RootWindowList::iterator it = root_windows.begin(); |
| 19 it != root_windows.end(); ++it) { |
| 20 ui::Compositor* compositor = (*it)->compositor(); |
| 21 if (!value.get()) |
| 22 value.reset(new bool(!compositor->IsShowPaintRectsEnabled())); |
| 23 compositor->SetShowPaintRectsEnabled(*value.get()); |
| 24 } |
| 25 } |
| 26 |
| 27 } // debug |
| 28 } // ash |
OLD | NEW |