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

Side by Side Diff: cc/trees/single_thread_proxy.cc

Issue 1239843002: cc: Call PrepareTiles when becoming visible in browser only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 5 years, 5 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
OLDNEW
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/trees/single_thread_proxy.h" 5 #include "cc/trees/single_thread_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/profiler/scoped_tracker.h" 8 #include "base/profiler/scoped_tracker.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/debug/benchmark_instrumentation.h" 10 #include "cc/debug/benchmark_instrumentation.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 DebugScopedSetImplThread impl(this); 115 DebugScopedSetImplThread impl(this);
116 if (scheduler_on_impl_thread_) { 116 if (scheduler_on_impl_thread_) {
117 scheduler_on_impl_thread_->SetCanStart(); 117 scheduler_on_impl_thread_->SetCanStart();
118 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); 118 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible());
119 } 119 }
120 } 120 }
121 121
122 void SingleThreadProxy::SetVisible(bool visible) { 122 void SingleThreadProxy::SetVisible(bool visible) {
123 TRACE_EVENT1("cc", "SingleThreadProxy::SetVisible", "visible", visible); 123 TRACE_EVENT1("cc", "SingleThreadProxy::SetVisible", "visible", visible);
124 DebugScopedSetImplThread impl(this); 124 DebugScopedSetImplThread impl(this);
125
126 bool was_visible = layer_tree_host_impl_->visible();
125 layer_tree_host_impl_->SetVisible(visible); 127 layer_tree_host_impl_->SetVisible(visible);
128
129 // Call PrepareTiles in case we're waiting for ready to draw.
130 if (!was_visible && visible)
131 layer_tree_host_impl_->PrepareTiles();
132
126 if (scheduler_on_impl_thread_) 133 if (scheduler_on_impl_thread_)
127 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); 134 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible());
128 // Changing visibility could change ShouldComposite(). 135 // Changing visibility could change ShouldComposite().
129 } 136 }
130 137
131 void SingleThreadProxy::SetThrottleFrameProduction(bool throttle) { 138 void SingleThreadProxy::SetThrottleFrameProduction(bool throttle) {
132 TRACE_EVENT1("cc", "SingleThreadProxy::SetThrottleFrameProduction", 139 TRACE_EVENT1("cc", "SingleThreadProxy::SetThrottleFrameProduction",
133 "throttle", throttle); 140 "throttle", throttle);
134 DebugScopedSetImplThread impl(this); 141 DebugScopedSetImplThread impl(this);
135 if (scheduler_on_impl_thread_) 142 if (scheduler_on_impl_thread_)
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 << "DidFinishImplFrame called while not inside an impl frame!"; 929 << "DidFinishImplFrame called while not inside an impl frame!";
923 inside_impl_frame_ = false; 930 inside_impl_frame_ = false;
924 #endif 931 #endif
925 } 932 }
926 933
927 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { 934 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) {
928 layer_tree_host_->SendBeginFramesToChildren(args); 935 layer_tree_host_->SendBeginFramesToChildren(args);
929 } 936 }
930 937
931 } // namespace cc 938 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_unittest.cc ('K') | « cc/trees/layer_tree_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698