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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 } | 980 } |
981 | 981 |
982 layer_tree_host()->CommitComplete(); | 982 layer_tree_host()->CommitComplete(); |
983 layer_tree_host()->DidBeginMainFrame(); | 983 layer_tree_host()->DidBeginMainFrame(); |
984 } | 984 } |
985 | 985 |
986 void ThreadProxy::StartCommitOnImplThread( | 986 void ThreadProxy::StartCommitOnImplThread( |
987 CompletionEvent* completion, | 987 CompletionEvent* completion, |
988 ResourceUpdateQueue* raw_queue, | 988 ResourceUpdateQueue* raw_queue, |
989 scoped_refptr<ContextProvider> offscreen_context_provider) { | 989 scoped_refptr<ContextProvider> offscreen_context_provider) { |
990 scoped_ptr<ResourceUpdateQueue> queue(raw_queue); | |
991 | |
992 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); | 990 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); |
993 DCHECK(!impl().commit_completion_event); | 991 DCHECK(!impl().commit_completion_event); |
994 DCHECK(IsImplThread() && IsMainThreadBlocked()); | 992 DCHECK(IsImplThread() && IsMainThreadBlocked()); |
995 DCHECK(impl().scheduler); | 993 DCHECK(impl().scheduler); |
996 DCHECK(impl().scheduler->CommitPending()); | 994 DCHECK(impl().scheduler->CommitPending()); |
997 | 995 |
998 if (!impl().layer_tree_host_impl) { | 996 if (!impl().layer_tree_host_impl) { |
999 TRACE_EVENT_INSTANT0( | 997 TRACE_EVENT_INSTANT0( |
1000 "cc", "EarlyOut_NoLayerTree", TRACE_EVENT_SCOPE_THREAD); | 998 "cc", "EarlyOut_NoLayerTree", TRACE_EVENT_SCOPE_THREAD); |
1001 completion->Signal(); | 999 completion->Signal(); |
1002 return; | 1000 return; |
1003 } | 1001 } |
1004 | 1002 |
| 1003 scoped_ptr<ResourceUpdateQueue> queue(raw_queue); |
| 1004 |
1005 if (offscreen_context_provider.get()) | 1005 if (offscreen_context_provider.get()) |
1006 offscreen_context_provider->BindToCurrentThread(); | 1006 offscreen_context_provider->BindToCurrentThread(); |
1007 impl().layer_tree_host_impl->SetOffscreenContextProvider( | 1007 impl().layer_tree_host_impl->SetOffscreenContextProvider( |
1008 offscreen_context_provider); | 1008 offscreen_context_provider); |
1009 | 1009 |
1010 if (impl().contents_texture_manager) { | 1010 if (impl().contents_texture_manager) { |
1011 DCHECK_EQ(impl().contents_texture_manager, | 1011 DCHECK_EQ(impl().contents_texture_manager, |
1012 blocked_main().contents_texture_manager()); | 1012 blocked_main().contents_texture_manager()); |
1013 } else { | 1013 } else { |
1014 // Cache this pointer that was created on the main thread side to avoid a | 1014 // Cache this pointer that was created on the main thread side to avoid a |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 completion->Signal(); | 1462 completion->Signal(); |
1463 } | 1463 } |
1464 | 1464 |
1465 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) { | 1465 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) { |
1466 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); | 1466 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); |
1467 DCHECK(IsImplThread()); | 1467 DCHECK(IsImplThread()); |
1468 impl().layer_tree_host_impl = | 1468 impl().layer_tree_host_impl = |
1469 layer_tree_host()->CreateLayerTreeHostImpl(this); | 1469 layer_tree_host()->CreateLayerTreeHostImpl(this); |
1470 const LayerTreeSettings& settings = layer_tree_host()->settings(); | 1470 const LayerTreeSettings& settings = layer_tree_host()->settings(); |
1471 SchedulerSettings scheduler_settings; | 1471 SchedulerSettings scheduler_settings; |
| 1472 scheduler_settings.start_commit_before_draw_enabled = |
| 1473 settings.start_commit_before_draw_enabled; |
| 1474 scheduler_settings.start_commit_before_activate_enabled = |
| 1475 settings.start_commit_before_activate_enabled; |
1472 scheduler_settings.impl_side_painting = settings.impl_side_painting; | 1476 scheduler_settings.impl_side_painting = settings.impl_side_painting; |
1473 scheduler_settings.timeout_and_draw_when_animation_checkerboards = | 1477 scheduler_settings.timeout_and_draw_when_animation_checkerboards = |
1474 settings.timeout_and_draw_when_animation_checkerboards; | 1478 settings.timeout_and_draw_when_animation_checkerboards; |
1475 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = | 1479 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = |
1476 settings.maximum_number_of_failed_draws_before_draw_is_forced_; | 1480 settings.maximum_number_of_failed_draws_before_draw_is_forced_; |
1477 scheduler_settings.using_synchronous_renderer_compositor = | 1481 scheduler_settings.using_synchronous_renderer_compositor = |
1478 settings.using_synchronous_renderer_compositor; | 1482 settings.using_synchronous_renderer_compositor; |
1479 scheduler_settings.throttle_frame_production = | 1483 scheduler_settings.throttle_frame_production = |
1480 settings.throttle_frame_production; | 1484 settings.throttle_frame_production; |
1481 impl().scheduler = | 1485 impl().scheduler = |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 | 1736 |
1733 impl().timing_history.DidActivatePendingTree(); | 1737 impl().timing_history.DidActivatePendingTree(); |
1734 } | 1738 } |
1735 | 1739 |
1736 void ThreadProxy::DidManageTiles() { | 1740 void ThreadProxy::DidManageTiles() { |
1737 DCHECK(IsImplThread()); | 1741 DCHECK(IsImplThread()); |
1738 impl().scheduler->DidManageTiles(); | 1742 impl().scheduler->DidManageTiles(); |
1739 } | 1743 } |
1740 | 1744 |
1741 } // namespace cc | 1745 } // namespace cc |
OLD | NEW |