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

Side by Side Diff: ui/compositor/compositor.cc

Issue 14386024: Add debug shortcuts that toggles options to shows debug borders and fps counters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/compositor/compositor.h" 5 #include "ui/compositor/compositor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 Compositor::OffscreenContextProviderForMainThread() { 752 Compositor::OffscreenContextProviderForMainThread() {
753 return ContextFactory::GetInstance()->OffscreenContextProviderForMainThread(); 753 return ContextFactory::GetInstance()->OffscreenContextProviderForMainThread();
754 } 754 }
755 755
756 scoped_refptr<cc::ContextProvider> 756 scoped_refptr<cc::ContextProvider>
757 Compositor::OffscreenContextProviderForCompositorThread() { 757 Compositor::OffscreenContextProviderForCompositorThread() {
758 return ContextFactory::GetInstance()-> 758 return ContextFactory::GetInstance()->
759 OffscreenContextProviderForCompositorThread(); 759 OffscreenContextProviderForCompositorThread();
760 } 760 }
761 761
762 bool Compositor::IsShowPaintRectsEnabled() const { 762 const cc::LayerTreeDebugState& Compositor::GetLayerTreeDebugState() const {
763 return host_->debug_state().show_paint_rects; 763 return host_->debug_state();
764 } 764 }
765 765
766 void Compositor::SetShowPaintRectsEnabled(bool enabled) { 766 void Compositor::SetLayerTreeDebugState(
767 cc::LayerTreeDebugState debug_state = host_->debug_state(); 767 const cc::LayerTreeDebugState& debug_state) {
768 debug_state.show_paint_rects = enabled;
769 host_->SetDebugState(debug_state); 768 host_->SetDebugState(debug_state);
770 } 769 }
771 770
772 scoped_refptr<CompositorLock> Compositor::GetCompositorLock() { 771 scoped_refptr<CompositorLock> Compositor::GetCompositorLock() {
773 if (!compositor_lock_) { 772 if (!compositor_lock_) {
774 compositor_lock_ = new CompositorLock(this); 773 compositor_lock_ = new CompositorLock(this);
775 if (g_compositor_thread) 774 if (g_compositor_thread)
776 host_->SetDeferCommits(true); 775 host_->SetDeferCommits(true);
777 FOR_EACH_OBSERVER(CompositorObserver, 776 FOR_EACH_OBSERVER(CompositorObserver,
778 observer_list_, 777 observer_list_,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 COMPOSITOR_EXPORT void DisableTestCompositor() { 819 COMPOSITOR_EXPORT void DisableTestCompositor() {
821 ResetImplicitFactory(); 820 ResetImplicitFactory();
822 g_test_compositor_enabled = false; 821 g_test_compositor_enabled = false;
823 } 822 }
824 823
825 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { 824 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() {
826 return g_test_compositor_enabled; 825 return g_test_compositor_enabled;
827 } 826 }
828 827
829 } // namespace ui 828 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698