| 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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 impl().scheduler->NotifyReadyToActivate(); | 474 impl().scheduler->NotifyReadyToActivate(); |
| 475 } | 475 } |
| 476 | 476 |
| 477 void ThreadProxy::SetNeedsCommitOnImplThread() { | 477 void ThreadProxy::SetNeedsCommitOnImplThread() { |
| 478 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommitOnImplThread"); | 478 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommitOnImplThread"); |
| 479 DCHECK(IsImplThread()); | 479 DCHECK(IsImplThread()); |
| 480 impl().scheduler->SetNeedsCommit(); | 480 impl().scheduler->SetNeedsCommit(); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void ThreadProxy::PostAnimationEventsToMainThreadOnImplThread( | 483 void ThreadProxy::PostAnimationEventsToMainThreadOnImplThread( |
| 484 scoped_ptr<AnimationEventsVector> events, | 484 scoped_ptr<AnimationEventsVector> events) { |
| 485 base::Time wall_clock_time) { | |
| 486 TRACE_EVENT0("cc", | 485 TRACE_EVENT0("cc", |
| 487 "ThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); | 486 "ThreadProxy::PostAnimationEventsToMainThreadOnImplThread"); |
| 488 DCHECK(IsImplThread()); | 487 DCHECK(IsImplThread()); |
| 489 Proxy::MainThreadTaskRunner()->PostTask( | 488 Proxy::MainThreadTaskRunner()->PostTask( |
| 490 FROM_HERE, | 489 FROM_HERE, |
| 491 base::Bind(&ThreadProxy::SetAnimationEvents, | 490 base::Bind(&ThreadProxy::SetAnimationEvents, |
| 492 main_thread_weak_ptr_, | 491 main_thread_weak_ptr_, |
| 493 base::Passed(&events), | 492 base::Passed(&events))); |
| 494 wall_clock_time)); | |
| 495 } | 493 } |
| 496 | 494 |
| 497 bool ThreadProxy::ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, | 495 bool ThreadProxy::ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, |
| 498 int priority_cutoff) { | 496 int priority_cutoff) { |
| 499 DCHECK(IsImplThread()); | 497 DCHECK(IsImplThread()); |
| 500 | 498 |
| 501 if (!impl().contents_texture_manager) | 499 if (!impl().contents_texture_manager) |
| 502 return false; | 500 return false; |
| 503 if (!impl().layer_tree_host_impl->resource_provider()) | 501 if (!impl().layer_tree_host_impl->resource_provider()) |
| 504 return false; | 502 return false; |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1413 layer_tree_host()->DidCommitAndDrawFrame(); | 1411 layer_tree_host()->DidCommitAndDrawFrame(); |
| 1414 } | 1412 } |
| 1415 | 1413 |
| 1416 void ThreadProxy::DidCompleteSwapBuffers() { | 1414 void ThreadProxy::DidCompleteSwapBuffers() { |
| 1417 DCHECK(IsMainThread()); | 1415 DCHECK(IsMainThread()); |
| 1418 if (!layer_tree_host()) | 1416 if (!layer_tree_host()) |
| 1419 return; | 1417 return; |
| 1420 layer_tree_host()->DidCompleteSwapBuffers(); | 1418 layer_tree_host()->DidCompleteSwapBuffers(); |
| 1421 } | 1419 } |
| 1422 | 1420 |
| 1423 void ThreadProxy::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events, | 1421 void ThreadProxy::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events) { |
| 1424 base::Time wall_clock_time) { | |
| 1425 TRACE_EVENT0("cc", "ThreadProxy::SetAnimationEvents"); | 1422 TRACE_EVENT0("cc", "ThreadProxy::SetAnimationEvents"); |
| 1426 DCHECK(IsMainThread()); | 1423 DCHECK(IsMainThread()); |
| 1427 if (!layer_tree_host()) | 1424 if (!layer_tree_host()) |
| 1428 return; | 1425 return; |
| 1429 layer_tree_host()->SetAnimationEvents(events.Pass(), wall_clock_time); | 1426 layer_tree_host()->SetAnimationEvents(events.Pass()); |
| 1430 } | 1427 } |
| 1431 | 1428 |
| 1432 void ThreadProxy::CreateAndInitializeOutputSurface() { | 1429 void ThreadProxy::CreateAndInitializeOutputSurface() { |
| 1433 TRACE_EVENT0("cc", "ThreadProxy::CreateAndInitializeOutputSurface"); | 1430 TRACE_EVENT0("cc", "ThreadProxy::CreateAndInitializeOutputSurface"); |
| 1434 DCHECK(IsMainThread()); | 1431 DCHECK(IsMainThread()); |
| 1435 | 1432 |
| 1436 // Check that output surface has not been recreated by CompositeAndReadback | 1433 // Check that output surface has not been recreated by CompositeAndReadback |
| 1437 // after this task is posted but before it is run. | 1434 // after this task is posted but before it is run. |
| 1438 bool has_initialized_output_surface = true; | 1435 bool has_initialized_output_surface = true; |
| 1439 { | 1436 { |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1735 | 1732 |
| 1736 impl().timing_history.DidActivatePendingTree(); | 1733 impl().timing_history.DidActivatePendingTree(); |
| 1737 } | 1734 } |
| 1738 | 1735 |
| 1739 void ThreadProxy::DidManageTiles() { | 1736 void ThreadProxy::DidManageTiles() { |
| 1740 DCHECK(IsImplThread()); | 1737 DCHECK(IsImplThread()); |
| 1741 impl().scheduler->DidManageTiles(); | 1738 impl().scheduler->DidManageTiles(); |
| 1742 } | 1739 } |
| 1743 | 1740 |
| 1744 } // namespace cc | 1741 } // namespace cc |
| OLD | NEW |