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

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

Issue 14050009: Add debug shortcuts that toggles options to shows paint rects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added missing debug.cc|h (happened when I created new CL from patch) 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 {
763 return host_->debug_state().show_paint_rects;
764 }
765
766 void Compositor::SetShowPaintRectsEnabled(bool enabled) {
767 cc::LayerTreeDebugState debug_state = host_->debug_state();
768 debug_state.show_paint_rects = enabled;
769 host_->SetDebugState(debug_state);
770 }
771
762 scoped_refptr<CompositorLock> Compositor::GetCompositorLock() { 772 scoped_refptr<CompositorLock> Compositor::GetCompositorLock() {
763 if (!compositor_lock_) { 773 if (!compositor_lock_) {
764 compositor_lock_ = new CompositorLock(this); 774 compositor_lock_ = new CompositorLock(this);
765 if (g_compositor_thread) 775 if (g_compositor_thread)
766 host_->SetDeferCommits(true); 776 host_->SetDeferCommits(true);
767 FOR_EACH_OBSERVER(CompositorObserver, 777 FOR_EACH_OBSERVER(CompositorObserver,
768 observer_list_, 778 observer_list_,
769 OnCompositingLockStateChanged(this)); 779 OnCompositingLockStateChanged(this));
770 } 780 }
771 return compositor_lock_; 781 return compositor_lock_;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 COMPOSITOR_EXPORT void DisableTestCompositor() { 820 COMPOSITOR_EXPORT void DisableTestCompositor() {
811 ResetImplicitFactory(); 821 ResetImplicitFactory();
812 g_test_compositor_enabled = false; 822 g_test_compositor_enabled = false;
813 } 823 }
814 824
815 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { 825 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() {
816 return g_test_compositor_enabled; 826 return g_test_compositor_enabled;
817 } 827 }
818 828
819 } // namespace ui 829 } // 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