| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 TRACE_EVENT0("cc", "ThreadProxy::NotifyReadyToDraw"); | 394 TRACE_EVENT0("cc", "ThreadProxy::NotifyReadyToDraw"); |
| 395 impl().scheduler->NotifyReadyToDraw(); | 395 impl().scheduler->NotifyReadyToDraw(); |
| 396 } | 396 } |
| 397 | 397 |
| 398 void ThreadProxy::SetNeedsCommitOnImplThread() { | 398 void ThreadProxy::SetNeedsCommitOnImplThread() { |
| 399 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommitOnImplThread"); | 399 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommitOnImplThread"); |
| 400 DCHECK(IsImplThread()); | 400 DCHECK(IsImplThread()); |
| 401 impl().scheduler->SetNeedsCommit(); | 401 impl().scheduler->SetNeedsCommit(); |
| 402 } | 402 } |
| 403 | 403 |
| 404 void ThreadProxy::SetVideoNeedsBeginFrames(bool needs_begin_frames) { |
| 405 TRACE_EVENT1("cc", "ThreadProxy::SetVideoNeedsBeginFrames", |
| 406 "needs_begin_frames", needs_begin_frames); |
| 407 DCHECK(IsImplThread()); |
| 408 // In tests the layer tree is destroyed after the scheduler is. |
| 409 if (impl().scheduler) |
| 410 impl().scheduler->SetVideoNeedsBeginFrames(needs_begin_frames); |
| 411 } |
| 412 |
| 404 void ThreadProxy::PostAnimationEventsToMainThreadOnImplThread( | 413 void ThreadProxy::PostAnimationEventsToMainThreadOnImplThread( |
| 405 scoped_ptr<AnimationEventsVector> events) { | 414 scoped_ptr<AnimationEventsVector> events) { |
| 406 TRACE_EVENT0("cc", | 415 TRACE_EVENT0("cc", |
| 407 "ThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); | 416 "ThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); |
| 408 DCHECK(IsImplThread()); | 417 DCHECK(IsImplThread()); |
| 409 Proxy::MainThreadTaskRunner()->PostTask( | 418 Proxy::MainThreadTaskRunner()->PostTask( |
| 410 FROM_HERE, | 419 FROM_HERE, |
| 411 base::Bind(&ThreadProxy::SetAnimationEvents, | 420 base::Bind(&ThreadProxy::SetAnimationEvents, |
| 412 main_thread_weak_ptr_, | 421 main_thread_weak_ptr_, |
| 413 base::Passed(&events))); | 422 base::Passed(&events))); |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1399 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1408 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
| 1400 main_thread_weak_ptr_)); | 1409 main_thread_weak_ptr_)); |
| 1401 } | 1410 } |
| 1402 | 1411 |
| 1403 void ThreadProxy::OnDrawForOutputSurface() { | 1412 void ThreadProxy::OnDrawForOutputSurface() { |
| 1404 DCHECK(IsImplThread()); | 1413 DCHECK(IsImplThread()); |
| 1405 impl().scheduler->OnDrawForOutputSurface(); | 1414 impl().scheduler->OnDrawForOutputSurface(); |
| 1406 } | 1415 } |
| 1407 | 1416 |
| 1408 } // namespace cc | 1417 } // namespace cc |
| OLD | NEW |