OLD | NEW |
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 Loading... |
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(); | |
127 layer_tree_host_impl_->SetVisible(visible); | 125 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 | |
133 if (scheduler_on_impl_thread_) | 126 if (scheduler_on_impl_thread_) |
134 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 127 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); |
135 // Changing visibility could change ShouldComposite(). | 128 // Changing visibility could change ShouldComposite(). |
136 } | 129 } |
137 | 130 |
138 void SingleThreadProxy::SetThrottleFrameProduction(bool throttle) { | 131 void SingleThreadProxy::SetThrottleFrameProduction(bool throttle) { |
139 TRACE_EVENT1("cc", "SingleThreadProxy::SetThrottleFrameProduction", | 132 TRACE_EVENT1("cc", "SingleThreadProxy::SetThrottleFrameProduction", |
140 "throttle", throttle); | 133 "throttle", throttle); |
141 DebugScopedSetImplThread impl(this); | 134 DebugScopedSetImplThread impl(this); |
142 if (scheduler_on_impl_thread_) | 135 if (scheduler_on_impl_thread_) |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 << "DidFinishImplFrame called while not inside an impl frame!"; | 922 << "DidFinishImplFrame called while not inside an impl frame!"; |
930 inside_impl_frame_ = false; | 923 inside_impl_frame_ = false; |
931 #endif | 924 #endif |
932 } | 925 } |
933 | 926 |
934 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | 927 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { |
935 layer_tree_host_->SendBeginFramesToChildren(args); | 928 layer_tree_host_->SendBeginFramesToChildren(args); |
936 } | 929 } |
937 | 930 |
938 } // namespace cc | 931 } // namespace cc |
OLD | NEW |