| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 void ThreadProxy::DidLoseOutputSurface() { | 196 void ThreadProxy::DidLoseOutputSurface() { |
| 197 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurface"); | 197 TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurface"); |
| 198 DCHECK(IsMainThread()); | 198 DCHECK(IsMainThread()); |
| 199 layer_tree_host()->DidLoseOutputSurface(); | 199 layer_tree_host()->DidLoseOutputSurface(); |
| 200 | 200 |
| 201 { | 201 { |
| 202 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 202 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
| 203 | 203 |
| 204 // Return lost resources to their owners immediately. | 204 // Return lost resources to their owners immediately. |
| 205 BlockingTaskRunner::CapturePostTasks blocked; | 205 BlockingTaskRunner::CapturePostTasks blocked( |
| 206 blocking_main_thread_task_runner()); |
| 206 | 207 |
| 207 CompletionEvent completion; | 208 CompletionEvent completion; |
| 208 Proxy::ImplThreadTaskRunner()->PostTask( | 209 Proxy::ImplThreadTaskRunner()->PostTask( |
| 209 FROM_HERE, | 210 FROM_HERE, |
| 210 base::Bind(&ThreadProxy::DeleteContentsTexturesOnImplThread, | 211 base::Bind(&ThreadProxy::DeleteContentsTexturesOnImplThread, |
| 211 impl_thread_weak_ptr_, | 212 impl_thread_weak_ptr_, |
| 212 &completion)); | 213 &completion)); |
| 213 completion.Wait(); | 214 completion.Wait(); |
| 214 } | 215 } |
| 215 } | 216 } |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 // point of view, but asynchronously performed on the impl thread, | 847 // point of view, but asynchronously performed on the impl thread, |
| 847 // coordinated by the Scheduler. | 848 // coordinated by the Scheduler. |
| 848 { | 849 { |
| 849 TRACE_EVENT0("cc", "ThreadProxy::BeginMainFrame::commit"); | 850 TRACE_EVENT0("cc", "ThreadProxy::BeginMainFrame::commit"); |
| 850 | 851 |
| 851 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 852 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
| 852 | 853 |
| 853 // This CapturePostTasks should be destroyed before CommitComplete() is | 854 // This CapturePostTasks should be destroyed before CommitComplete() is |
| 854 // called since that goes out to the embedder, and we want the embedder | 855 // called since that goes out to the embedder, and we want the embedder |
| 855 // to receive its callbacks before that. | 856 // to receive its callbacks before that. |
| 856 BlockingTaskRunner::CapturePostTasks blocked; | 857 BlockingTaskRunner::CapturePostTasks blocked( |
| 858 blocking_main_thread_task_runner()); |
| 857 | 859 |
| 858 CompletionEvent completion; | 860 CompletionEvent completion; |
| 859 Proxy::ImplThreadTaskRunner()->PostTask( | 861 Proxy::ImplThreadTaskRunner()->PostTask( |
| 860 FROM_HERE, | 862 FROM_HERE, |
| 861 base::Bind(&ThreadProxy::StartCommitOnImplThread, | 863 base::Bind(&ThreadProxy::StartCommitOnImplThread, |
| 862 impl_thread_weak_ptr_, | 864 impl_thread_weak_ptr_, |
| 863 &completion, | 865 &completion, |
| 864 queue.release())); | 866 queue.release())); |
| 865 completion.Wait(); | 867 completion.Wait(); |
| 866 | 868 |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1390 | 1392 |
| 1391 impl().timing_history.DidActivateSyncTree(); | 1393 impl().timing_history.DidActivateSyncTree(); |
| 1392 } | 1394 } |
| 1393 | 1395 |
| 1394 void ThreadProxy::DidManageTiles() { | 1396 void ThreadProxy::DidManageTiles() { |
| 1395 DCHECK(IsImplThread()); | 1397 DCHECK(IsImplThread()); |
| 1396 impl().scheduler->DidManageTiles(); | 1398 impl().scheduler->DidManageTiles(); |
| 1397 } | 1399 } |
| 1398 | 1400 |
| 1399 } // namespace cc | 1401 } // namespace cc |
| OLD | NEW |