Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: cc/trees/thread_proxy.cc

Issue 23907006: cc: Allow sending BeginMainFrame before draw or activation (Closed) Base URL: http://git.chromium.org/chromium/src.git@schedDeadline3
Patch Set: Make commit waiting states explicit Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 7 #include <string>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 } 959 }
960 960
961 layer_tree_host()->CommitComplete(); 961 layer_tree_host()->CommitComplete();
962 layer_tree_host()->DidBeginMainFrame(); 962 layer_tree_host()->DidBeginMainFrame();
963 } 963 }
964 964
965 void ThreadProxy::StartCommitOnImplThread( 965 void ThreadProxy::StartCommitOnImplThread(
966 CompletionEvent* completion, 966 CompletionEvent* completion,
967 ResourceUpdateQueue* raw_queue, 967 ResourceUpdateQueue* raw_queue,
968 scoped_refptr<ContextProvider> offscreen_context_provider) { 968 scoped_refptr<ContextProvider> offscreen_context_provider) {
969 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
970
971 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); 969 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread");
972 DCHECK(!impl().commit_completion_event); 970 DCHECK(!impl().commit_completion_event);
973 DCHECK(IsImplThread() && IsMainThreadBlocked()); 971 DCHECK(IsImplThread() && IsMainThreadBlocked());
974 DCHECK(impl().scheduler); 972 DCHECK(impl().scheduler);
975 DCHECK(impl().scheduler->CommitPending()); 973 DCHECK(impl().scheduler->CommitPending());
976 974
977 if (!impl().layer_tree_host_impl) { 975 if (!impl().layer_tree_host_impl) {
978 TRACE_EVENT0("cc", "EarlyOut_NoLayerTree"); 976 TRACE_EVENT0("cc", "EarlyOut_NoLayerTree");
979 completion->Signal(); 977 completion->Signal();
980 return; 978 return;
981 } 979 }
982 980
981 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
982
983 if (offscreen_context_provider.get()) 983 if (offscreen_context_provider.get())
984 offscreen_context_provider->BindToCurrentThread(); 984 offscreen_context_provider->BindToCurrentThread();
985 impl().layer_tree_host_impl->SetOffscreenContextProvider( 985 impl().layer_tree_host_impl->SetOffscreenContextProvider(
986 offscreen_context_provider); 986 offscreen_context_provider);
987 987
988 if (impl().contents_texture_manager) { 988 if (impl().contents_texture_manager) {
989 DCHECK_EQ(impl().contents_texture_manager, 989 DCHECK_EQ(impl().contents_texture_manager,
990 blocked_main().contents_texture_manager()); 990 blocked_main().contents_texture_manager());
991 } else { 991 } else {
992 // Cache this pointer that was created on the main thread side to avoid a 992 // Cache this pointer that was created on the main thread side to avoid a
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion, 1409 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion,
1410 int layer_tree_host_id) { 1410 int layer_tree_host_id) {
1411 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); 1411 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread");
1412 DCHECK(IsImplThread()); 1412 DCHECK(IsImplThread());
1413 impl().layer_tree_host_impl = 1413 impl().layer_tree_host_impl =
1414 layer_tree_host()->CreateLayerTreeHostImpl(this); 1414 layer_tree_host()->CreateLayerTreeHostImpl(this);
1415 const LayerTreeSettings& settings = layer_tree_host()->settings(); 1415 const LayerTreeSettings& settings = layer_tree_host()->settings();
1416 SchedulerSettings scheduler_settings; 1416 SchedulerSettings scheduler_settings;
1417 scheduler_settings.deadline_scheduling_enabled = 1417 scheduler_settings.deadline_scheduling_enabled =
1418 settings.deadline_scheduling_enabled; 1418 settings.deadline_scheduling_enabled;
1419 scheduler_settings.start_commit_before_draw_enabled =
1420 settings.start_commit_before_draw_enabled;
1421 scheduler_settings.start_commit_before_activate_enabled =
1422 settings.start_commit_before_activate_enabled;
1419 scheduler_settings.impl_side_painting = settings.impl_side_painting; 1423 scheduler_settings.impl_side_painting = settings.impl_side_painting;
1420 scheduler_settings.timeout_and_draw_when_animation_checkerboards = 1424 scheduler_settings.timeout_and_draw_when_animation_checkerboards =
1421 settings.timeout_and_draw_when_animation_checkerboards; 1425 settings.timeout_and_draw_when_animation_checkerboards;
1422 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = 1426 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ =
1423 settings.maximum_number_of_failed_draws_before_draw_is_forced_; 1427 settings.maximum_number_of_failed_draws_before_draw_is_forced_;
1424 scheduler_settings.using_synchronous_renderer_compositor = 1428 scheduler_settings.using_synchronous_renderer_compositor =
1425 settings.using_synchronous_renderer_compositor; 1429 settings.using_synchronous_renderer_compositor;
1426 scheduler_settings.throttle_frame_production = 1430 scheduler_settings.throttle_frame_production =
1427 settings.throttle_frame_production; 1431 settings.throttle_frame_production;
1428 impl().scheduler = 1432 impl().scheduler =
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 impl().commit_to_activate_duration_history.InsertSample( 1679 impl().commit_to_activate_duration_history.InsertSample(
1676 base::TimeTicks::HighResNow() - impl().commit_complete_time); 1680 base::TimeTicks::HighResNow() - impl().commit_complete_time);
1677 } 1681 }
1678 1682
1679 void ThreadProxy::DidManageTiles() { 1683 void ThreadProxy::DidManageTiles() {
1680 DCHECK(IsImplThread()); 1684 DCHECK(IsImplThread());
1681 impl().scheduler->DidManageTiles(); 1685 impl().scheduler->DidManageTiles();
1682 } 1686 }
1683 1687
1684 } // namespace cc 1688 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698