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

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

Issue 17362002: cc: Remove FakeThread, use SingleThreadTaskRunner in scheduling classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-fakethread: Created 7 years, 6 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 | Annotate | Revision Log
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 "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 794
795 layer_tree_host_->contents_texture_manager()-> 795 layer_tree_host_->contents_texture_manager()->
796 PushTexturePrioritiesToBackings(); 796 PushTexturePrioritiesToBackings();
797 } 797 }
798 798
799 commit_completion_event_on_impl_thread_ = completion; 799 commit_completion_event_on_impl_thread_ = completion;
800 if (layer_tree_host_impl_->resource_provider()) { 800 if (layer_tree_host_impl_->resource_provider()) {
801 current_resource_update_controller_on_impl_thread_ = 801 current_resource_update_controller_on_impl_thread_ =
802 ResourceUpdateController::Create( 802 ResourceUpdateController::Create(
803 this, 803 this,
804 Proxy::ImplThread(), 804 Proxy::ImplThread()->TaskRunner(),
805 queue.Pass(), 805 queue.Pass(),
806 layer_tree_host_impl_->resource_provider()); 806 layer_tree_host_impl_->resource_provider());
807 current_resource_update_controller_on_impl_thread_->PerformMoreUpdates( 807 current_resource_update_controller_on_impl_thread_->PerformMoreUpdates(
808 scheduler_on_impl_thread_->AnticipatedDrawTime()); 808 scheduler_on_impl_thread_->AnticipatedDrawTime());
809 } else { 809 } else {
810 // Normally the ResourceUpdateController notifies when commit should 810 // Normally the ResourceUpdateController notifies when commit should
811 // finish, but in tile-free software rendering there is no resource 811 // finish, but in tile-free software rendering there is no resource
812 // update step so jump straight to the notification. 812 // update step so jump straight to the notification.
813 scheduler_on_impl_thread_->FinishCommit(); 813 scheduler_on_impl_thread_->FinishCommit();
814 } 814 }
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 if (begin_frame_scheduling_enabled_) { 1161 if (begin_frame_scheduling_enabled_) {
1162 frame_rate_controller.reset( 1162 frame_rate_controller.reset(
1163 new FrameRateController(VSyncTimeSource::Create( 1163 new FrameRateController(VSyncTimeSource::Create(
1164 this, 1164 this,
1165 using_synchronous_renderer_compositor_ ? 1165 using_synchronous_renderer_compositor_ ?
1166 VSyncTimeSource::DISABLE_SYNCHRONOUSLY : 1166 VSyncTimeSource::DISABLE_SYNCHRONOUSLY :
1167 VSyncTimeSource::DISABLE_ON_NEXT_TICK))); 1167 VSyncTimeSource::DISABLE_ON_NEXT_TICK)));
1168 } else { 1168 } else {
1169 frame_rate_controller.reset( 1169 frame_rate_controller.reset(
1170 new FrameRateController(DelayBasedTimeSource::Create( 1170 new FrameRateController(DelayBasedTimeSource::Create(
1171 display_refresh_interval, Proxy::ImplThread()))); 1171 display_refresh_interval, Proxy::ImplThread()->TaskRunner())));
1172 } 1172 }
1173 } else { 1173 } else {
1174 frame_rate_controller.reset(new FrameRateController(Proxy::ImplThread())); 1174 frame_rate_controller.reset(
1175 new FrameRateController(Proxy::ImplThread()->TaskRunner()));
1175 } 1176 }
1176 const LayerTreeSettings& settings = layer_tree_host_->settings(); 1177 const LayerTreeSettings& settings = layer_tree_host_->settings();
1177 SchedulerSettings scheduler_settings; 1178 SchedulerSettings scheduler_settings;
1178 scheduler_settings.impl_side_painting = settings.impl_side_painting; 1179 scheduler_settings.impl_side_painting = settings.impl_side_painting;
1179 scheduler_settings.timeout_and_draw_when_animation_checkerboards = 1180 scheduler_settings.timeout_and_draw_when_animation_checkerboards =
1180 settings.timeout_and_draw_when_animation_checkerboards; 1181 settings.timeout_and_draw_when_animation_checkerboards;
1181 scheduler_on_impl_thread_ = Scheduler::Create(this, 1182 scheduler_on_impl_thread_ = Scheduler::Create(this,
1182 frame_rate_controller.Pass(), 1183 frame_rate_controller.Pass(),
1183 scheduler_settings); 1184 scheduler_settings);
1184 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); 1185 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible());
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 !layer_tree_host_impl_->pending_tree()) { 1425 !layer_tree_host_impl_->pending_tree()) {
1425 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation", 1426 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation",
1426 TRACE_EVENT_SCOPE_THREAD); 1427 TRACE_EVENT_SCOPE_THREAD);
1427 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); 1428 DCHECK(layer_tree_host_impl_->settings().impl_side_painting);
1428 completion_event_for_commit_held_on_tree_activation_->Signal(); 1429 completion_event_for_commit_held_on_tree_activation_->Signal();
1429 completion_event_for_commit_held_on_tree_activation_ = NULL; 1430 completion_event_for_commit_held_on_tree_activation_ = NULL;
1430 } 1431 }
1431 } 1432 }
1432 1433
1433 } // namespace cc 1434 } // namespace cc
OLDNEW
« cc/resources/resource_update_controller_unittest.cc ('K') | « cc/trees/single_thread_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698