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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 impl_thread_weak_ptr_, | 146 impl_thread_weak_ptr_, |
147 &completion)); | 147 &completion)); |
148 completion.Wait(); | 148 completion.Wait(); |
149 } | 149 } |
150 | 150 |
151 bool ThreadProxy::IsStarted() const { | 151 bool ThreadProxy::IsStarted() const { |
152 DCHECK(Proxy::IsMainThread()); | 152 DCHECK(Proxy::IsMainThread()); |
153 return main().started; | 153 return main().started; |
154 } | 154 } |
155 | 155 |
| 156 bool ThreadProxy::CommitToActiveTree() const { |
| 157 // With ThreadProxy we use a pending tree and activate it once it's ready to |
| 158 // draw. |
| 159 return false; |
| 160 } |
| 161 |
156 void ThreadProxy::SetLayerTreeHostClientReady() { | 162 void ThreadProxy::SetLayerTreeHostClientReady() { |
157 TRACE_EVENT0("cc", "ThreadProxy::SetLayerTreeHostClientReady"); | 163 TRACE_EVENT0("cc", "ThreadProxy::SetLayerTreeHostClientReady"); |
158 Proxy::ImplThreadTaskRunner()->PostTask( | 164 Proxy::ImplThreadTaskRunner()->PostTask( |
159 FROM_HERE, | 165 FROM_HERE, |
160 base::Bind(&ThreadProxy::SetLayerTreeHostClientReadyOnImplThread, | 166 base::Bind(&ThreadProxy::SetLayerTreeHostClientReadyOnImplThread, |
161 impl_thread_weak_ptr_)); | 167 impl_thread_weak_ptr_)); |
162 } | 168 } |
163 | 169 |
164 void ThreadProxy::SetLayerTreeHostClientReadyOnImplThread() { | 170 void ThreadProxy::SetLayerTreeHostClientReadyOnImplThread() { |
165 TRACE_EVENT0("cc", "ThreadProxy::SetLayerTreeHostClientReadyOnImplThread"); | 171 TRACE_EVENT0("cc", "ThreadProxy::SetLayerTreeHostClientReadyOnImplThread"); |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 return ResourceUpdateController::MaxPartialTextureUpdates(); | 1231 return ResourceUpdateController::MaxPartialTextureUpdates(); |
1226 } | 1232 } |
1227 | 1233 |
1228 ThreadProxy::BeginMainFrameAndCommitState::BeginMainFrameAndCommitState() | 1234 ThreadProxy::BeginMainFrameAndCommitState::BeginMainFrameAndCommitState() |
1229 : memory_allocation_limit_bytes(0), | 1235 : memory_allocation_limit_bytes(0), |
1230 memory_allocation_priority_cutoff(0), | 1236 memory_allocation_priority_cutoff(0), |
1231 evicted_ui_resources(false) {} | 1237 evicted_ui_resources(false) {} |
1232 | 1238 |
1233 ThreadProxy::BeginMainFrameAndCommitState::~BeginMainFrameAndCommitState() {} | 1239 ThreadProxy::BeginMainFrameAndCommitState::~BeginMainFrameAndCommitState() {} |
1234 | 1240 |
1235 void ThreadProxy::AsValueInto(base::debug::TracedValue* state) const { | 1241 void ThreadProxy::AsValueInto(base::trace_event::TracedValue* state) const { |
1236 CompletionEvent completion; | 1242 CompletionEvent completion; |
1237 { | 1243 { |
1238 DebugScopedSetMainThreadBlocked main_thread_blocked( | 1244 DebugScopedSetMainThreadBlocked main_thread_blocked( |
1239 const_cast<ThreadProxy*>(this)); | 1245 const_cast<ThreadProxy*>(this)); |
1240 scoped_refptr<base::debug::TracedValue> state_refptr(state); | 1246 scoped_refptr<base::trace_event::TracedValue> state_refptr(state); |
1241 Proxy::ImplThreadTaskRunner()->PostTask( | 1247 Proxy::ImplThreadTaskRunner()->PostTask( |
1242 FROM_HERE, | 1248 FROM_HERE, |
1243 base::Bind(&ThreadProxy::AsValueOnImplThread, | 1249 base::Bind(&ThreadProxy::AsValueOnImplThread, |
1244 impl_thread_weak_ptr_, | 1250 impl_thread_weak_ptr_, |
1245 &completion, | 1251 &completion, |
1246 state_refptr)); | 1252 state_refptr)); |
1247 completion.Wait(); | 1253 completion.Wait(); |
1248 } | 1254 } |
1249 } | 1255 } |
1250 | 1256 |
1251 void ThreadProxy::AsValueOnImplThread(CompletionEvent* completion, | 1257 void ThreadProxy::AsValueOnImplThread( |
1252 base::debug::TracedValue* state) const { | 1258 CompletionEvent* completion, |
| 1259 base::trace_event::TracedValue* state) const { |
1253 state->BeginDictionary("layer_tree_host_impl"); | 1260 state->BeginDictionary("layer_tree_host_impl"); |
1254 impl().layer_tree_host_impl->AsValueInto(state); | 1261 impl().layer_tree_host_impl->AsValueInto(state); |
1255 state->EndDictionary(); | 1262 state->EndDictionary(); |
1256 completion->Signal(); | 1263 completion->Signal(); |
1257 } | 1264 } |
1258 | 1265 |
1259 bool ThreadProxy::MainFrameWillHappenForTesting() { | 1266 bool ThreadProxy::MainFrameWillHappenForTesting() { |
1260 DCHECK(IsMainThread()); | 1267 DCHECK(IsMainThread()); |
1261 CompletionEvent completion; | 1268 CompletionEvent completion; |
1262 bool main_frame_will_happen = false; | 1269 bool main_frame_will_happen = false; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1367 } | 1374 } |
1368 | 1375 |
1369 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 1376 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
1370 DCHECK(IsImplThread()); | 1377 DCHECK(IsImplThread()); |
1371 Proxy::MainThreadTaskRunner()->PostTask( | 1378 Proxy::MainThreadTaskRunner()->PostTask( |
1372 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1379 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
1373 main_thread_weak_ptr_)); | 1380 main_thread_weak_ptr_)); |
1374 } | 1381 } |
1375 | 1382 |
1376 } // namespace cc | 1383 } // namespace cc |
OLD | NEW |