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/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 DCHECK(Proxy::IsMainThread()); | 151 DCHECK(Proxy::IsMainThread()); |
152 return main().started; | 152 return main().started; |
153 } | 153 } |
154 | 154 |
155 bool ThreadProxy::CommitToActiveTree() const { | 155 bool ThreadProxy::CommitToActiveTree() const { |
156 // With ThreadProxy, we use a pending tree and activate it once it's ready to | 156 // With ThreadProxy, we use a pending tree and activate it once it's ready to |
157 // draw to allow input to modify the active tree and draw during raster. | 157 // draw to allow input to modify the active tree and draw during raster. |
158 return false; | 158 return false; |
159 } | 159 } |
160 | 160 |
161 void ThreadProxy::SetLayerTreeHostClientReady() { | |
162 TRACE_EVENT0("cc", "ThreadProxy::SetLayerTreeHostClientReady"); | |
163 main().channel_main->SetLayerTreeHostClientReadyOnImpl(); | |
164 } | |
165 | |
166 void ThreadProxy::SetLayerTreeHostClientReadyOnImpl() { | |
167 TRACE_EVENT0("cc", "ThreadProxy::SetLayerTreeHostClientReadyOnImplThread"); | |
168 impl().scheduler->SetCanStart(); | |
169 } | |
170 | |
171 void ThreadProxy::SetVisible(bool visible) { | 161 void ThreadProxy::SetVisible(bool visible) { |
172 TRACE_EVENT1("cc", "ThreadProxy::SetVisible", "visible", visible); | 162 TRACE_EVENT1("cc", "ThreadProxy::SetVisible", "visible", visible); |
173 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 163 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
174 | 164 |
175 CompletionEvent completion; | 165 CompletionEvent completion; |
176 Proxy::ImplThreadTaskRunner()->PostTask( | 166 Proxy::ImplThreadTaskRunner()->PostTask( |
177 FROM_HERE, | 167 FROM_HERE, |
178 base::Bind(&ThreadProxy::SetVisibleOnImplThread, | 168 base::Bind(&ThreadProxy::SetVisibleOnImplThread, |
179 impl_thread_weak_ptr_, | 169 impl_thread_weak_ptr_, |
180 &completion, | 170 &completion, |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 | 1247 |
1258 base::WeakPtr<ProxyMain> ThreadProxy::GetMainWeakPtr() { | 1248 base::WeakPtr<ProxyMain> ThreadProxy::GetMainWeakPtr() { |
1259 return main_thread_weak_ptr_; | 1249 return main_thread_weak_ptr_; |
1260 } | 1250 } |
1261 | 1251 |
1262 base::WeakPtr<ProxyImpl> ThreadProxy::GetImplWeakPtr() { | 1252 base::WeakPtr<ProxyImpl> ThreadProxy::GetImplWeakPtr() { |
1263 return impl_thread_weak_ptr_; | 1253 return impl_thread_weak_ptr_; |
1264 } | 1254 } |
1265 | 1255 |
1266 } // namespace cc | 1256 } // namespace cc |
OLD | NEW |