| 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 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 void ThreadProxy::CommitPendingOnImplThreadForTesting( | 1523 void ThreadProxy::CommitPendingOnImplThreadForTesting( |
| 1524 CommitPendingRequest* request) { | 1524 CommitPendingRequest* request) { |
| 1525 DCHECK(IsImplThread()); | 1525 DCHECK(IsImplThread()); |
| 1526 if (impl().layer_tree_host_impl->output_surface()) | 1526 if (impl().layer_tree_host_impl->output_surface()) |
| 1527 request->commit_pending = impl().scheduler->CommitPending(); | 1527 request->commit_pending = impl().scheduler->CommitPending(); |
| 1528 else | 1528 else |
| 1529 request->commit_pending = false; | 1529 request->commit_pending = false; |
| 1530 request->completion.Signal(); | 1530 request->completion.Signal(); |
| 1531 } | 1531 } |
| 1532 | 1532 |
| 1533 scoped_ptr<base::Value> ThreadProxy::SchedulerStateAsValueForTesting() { | 1533 scoped_ptr<base::Value> ThreadProxy::SchedulerAsValueForTesting() { |
| 1534 if (IsImplThread()) | 1534 if (IsImplThread()) |
| 1535 return impl().scheduler->StateAsValue().Pass(); | 1535 return impl().scheduler->AsValue().Pass(); |
| 1536 | 1536 |
| 1537 SchedulerStateRequest scheduler_state_request; | 1537 SchedulerStateRequest scheduler_state_request; |
| 1538 { | 1538 { |
| 1539 DebugScopedSetMainThreadBlocked main_thread_blocked(this); | 1539 DebugScopedSetMainThreadBlocked main_thread_blocked(this); |
| 1540 Proxy::ImplThreadTaskRunner()->PostTask( | 1540 Proxy::ImplThreadTaskRunner()->PostTask( |
| 1541 FROM_HERE, | 1541 FROM_HERE, |
| 1542 base::Bind(&ThreadProxy::SchedulerStateAsValueOnImplThreadForTesting, | 1542 base::Bind(&ThreadProxy::SchedulerAsValueOnImplThreadForTesting, |
| 1543 impl_thread_weak_ptr_, | 1543 impl_thread_weak_ptr_, |
| 1544 &scheduler_state_request)); | 1544 &scheduler_state_request)); |
| 1545 scheduler_state_request.completion.Wait(); | 1545 scheduler_state_request.completion.Wait(); |
| 1546 } | 1546 } |
| 1547 return scheduler_state_request.state.Pass(); | 1547 return scheduler_state_request.state.Pass(); |
| 1548 } | 1548 } |
| 1549 | 1549 |
| 1550 void ThreadProxy::SchedulerStateAsValueOnImplThreadForTesting( | 1550 void ThreadProxy::SchedulerAsValueOnImplThreadForTesting( |
| 1551 SchedulerStateRequest* request) { | 1551 SchedulerStateRequest* request) { |
| 1552 DCHECK(IsImplThread()); | 1552 DCHECK(IsImplThread()); |
| 1553 request->state = impl().scheduler->StateAsValue(); | 1553 request->state = impl().scheduler->AsValue(); |
| 1554 request->completion.Signal(); | 1554 request->completion.Signal(); |
| 1555 } | 1555 } |
| 1556 | 1556 |
| 1557 void ThreadProxy::RenewTreePriority() { | 1557 void ThreadProxy::RenewTreePriority() { |
| 1558 DCHECK(IsImplThread()); | 1558 DCHECK(IsImplThread()); |
| 1559 bool smoothness_takes_priority = | 1559 bool smoothness_takes_priority = |
| 1560 impl().layer_tree_host_impl->pinch_gesture_active() || | 1560 impl().layer_tree_host_impl->pinch_gesture_active() || |
| 1561 impl().layer_tree_host_impl->page_scale_animation_active() || | 1561 impl().layer_tree_host_impl->page_scale_animation_active() || |
| 1562 (impl().layer_tree_host_impl->IsCurrentlyScrolling() && | 1562 (impl().layer_tree_host_impl->IsCurrentlyScrolling() && |
| 1563 !impl().layer_tree_host_impl->scroll_affects_scroll_handler()); | 1563 !impl().layer_tree_host_impl->scroll_affects_scroll_handler()); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 | 1653 |
| 1654 impl().timing_history.DidActivatePendingTree(); | 1654 impl().timing_history.DidActivatePendingTree(); |
| 1655 } | 1655 } |
| 1656 | 1656 |
| 1657 void ThreadProxy::DidManageTiles() { | 1657 void ThreadProxy::DidManageTiles() { |
| 1658 DCHECK(IsImplThread()); | 1658 DCHECK(IsImplThread()); |
| 1659 impl().scheduler->DidManageTiles(); | 1659 impl().scheduler->DidManageTiles(); |
| 1660 } | 1660 } |
| 1661 | 1661 |
| 1662 } // namespace cc | 1662 } // namespace cc |
| OLD | NEW |