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

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: Block main thread from state machine; remove completion event; Created 7 years, 3 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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 } 877 }
878 878
879 layer_tree_host_->CommitComplete(); 879 layer_tree_host_->CommitComplete();
880 layer_tree_host_->DidBeginFrame(); 880 layer_tree_host_->DidBeginFrame();
881 } 881 }
882 882
883 void ThreadProxy::StartCommitOnImplThread( 883 void ThreadProxy::StartCommitOnImplThread(
884 CompletionEvent* completion, 884 CompletionEvent* completion,
885 ResourceUpdateQueue* raw_queue, 885 ResourceUpdateQueue* raw_queue,
886 scoped_refptr<cc::ContextProvider> offscreen_context_provider) { 886 scoped_refptr<cc::ContextProvider> offscreen_context_provider) {
887 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
888
889 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); 887 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread");
890 DCHECK(!commit_completion_event_on_impl_thread_); 888 DCHECK(!commit_completion_event_on_impl_thread_);
891 DCHECK(IsImplThread() && IsMainThreadBlocked()); 889 DCHECK(IsImplThread() && IsMainThreadBlocked());
892 DCHECK(scheduler_on_impl_thread_); 890 DCHECK(scheduler_on_impl_thread_);
893 DCHECK(scheduler_on_impl_thread_->CommitPending()); 891 DCHECK(scheduler_on_impl_thread_->CommitPending());
894 892
895 if (!layer_tree_host_impl_) { 893 if (!layer_tree_host_impl_) {
896 TRACE_EVENT0("cc", "EarlyOut_NoLayerTree"); 894 TRACE_EVENT0("cc", "EarlyOut_NoLayerTree");
897 completion->Signal(); 895 completion->Signal();
898 return; 896 return;
899 } 897 }
900 898
899 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
900
901 if (offscreen_context_provider.get()) 901 if (offscreen_context_provider.get())
902 offscreen_context_provider->BindToCurrentThread(); 902 offscreen_context_provider->BindToCurrentThread();
903 layer_tree_host_impl_->SetOffscreenContextProvider( 903 layer_tree_host_impl_->SetOffscreenContextProvider(
904 offscreen_context_provider); 904 offscreen_context_provider);
905 905
906 if (layer_tree_host_->contents_texture_manager()) { 906 if (layer_tree_host_->contents_texture_manager()) {
907 if (layer_tree_host_->contents_texture_manager()-> 907 if (layer_tree_host_->contents_texture_manager()->
908 LinkedEvictedBackingsExist()) { 908 LinkedEvictedBackingsExist()) {
909 // Clear any uploads we were making to textures linked to evicted 909 // Clear any uploads we were making to textures linked to evicted
910 // resources 910 // resources
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 } 1311 }
1312 1312
1313 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) { 1313 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) {
1314 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); 1314 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread");
1315 DCHECK(IsImplThread()); 1315 DCHECK(IsImplThread());
1316 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); 1316 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this);
1317 const LayerTreeSettings& settings = layer_tree_host_->settings(); 1317 const LayerTreeSettings& settings = layer_tree_host_->settings();
1318 SchedulerSettings scheduler_settings; 1318 SchedulerSettings scheduler_settings;
1319 scheduler_settings.deadline_scheduling_enabled = 1319 scheduler_settings.deadline_scheduling_enabled =
1320 settings.deadline_scheduling_enabled; 1320 settings.deadline_scheduling_enabled;
1321 scheduler_settings.start_commit_before_draw_enabled =
1322 settings.start_commit_before_draw_enabled;
1323 scheduler_settings.start_commit_before_activate_enabled =
1324 settings.start_commit_before_activate_enabled;
1321 scheduler_settings.impl_side_painting = settings.impl_side_painting; 1325 scheduler_settings.impl_side_painting = settings.impl_side_painting;
1322 scheduler_settings.timeout_and_draw_when_animation_checkerboards = 1326 scheduler_settings.timeout_and_draw_when_animation_checkerboards =
1323 settings.timeout_and_draw_when_animation_checkerboards; 1327 settings.timeout_and_draw_when_animation_checkerboards;
1324 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = 1328 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ =
1325 settings.maximum_number_of_failed_draws_before_draw_is_forced_; 1329 settings.maximum_number_of_failed_draws_before_draw_is_forced_;
1326 scheduler_settings.using_synchronous_renderer_compositor = 1330 scheduler_settings.using_synchronous_renderer_compositor =
1327 settings.using_synchronous_renderer_compositor; 1331 settings.using_synchronous_renderer_compositor;
1328 scheduler_settings.throttle_frame_production = 1332 scheduler_settings.throttle_frame_production =
1329 settings.throttle_frame_production; 1333 settings.throttle_frame_production;
1330 scheduler_settings.use_begin_frame_workaround_for_crbug_249806 = true; 1334 scheduler_settings.use_begin_frame_workaround_for_crbug_249806 = true;
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 completion_event_for_commit_held_on_tree_activation_ = NULL; 1564 completion_event_for_commit_held_on_tree_activation_ = NULL;
1561 } 1565 }
1562 1566
1563 UpdateBackgroundAnimateTicking(); 1567 UpdateBackgroundAnimateTicking();
1564 1568
1565 commit_to_activate_duration_history_.InsertSample( 1569 commit_to_activate_duration_history_.InsertSample(
1566 base::TimeTicks::HighResNow() - commit_complete_time_); 1570 base::TimeTicks::HighResNow() - commit_complete_time_);
1567 } 1571 }
1568 1572
1569 } // namespace cc 1573 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698