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

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: Fix smoothness mode Created 6 years, 11 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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 } 933 }
934 934
935 layer_tree_host()->CommitComplete(); 935 layer_tree_host()->CommitComplete();
936 layer_tree_host()->DidBeginMainFrame(); 936 layer_tree_host()->DidBeginMainFrame();
937 } 937 }
938 938
939 void ThreadProxy::StartCommitOnImplThread( 939 void ThreadProxy::StartCommitOnImplThread(
940 CompletionEvent* completion, 940 CompletionEvent* completion,
941 ResourceUpdateQueue* raw_queue, 941 ResourceUpdateQueue* raw_queue,
942 scoped_refptr<ContextProvider> offscreen_context_provider) { 942 scoped_refptr<ContextProvider> offscreen_context_provider) {
943 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
944
945 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); 943 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread");
946 DCHECK(!commit_completion_event_on_impl_thread_); 944 DCHECK(!commit_completion_event_on_impl_thread_);
947 DCHECK(IsImplThread() && IsMainThreadBlocked()); 945 DCHECK(IsImplThread() && IsMainThreadBlocked());
948 DCHECK(scheduler_on_impl_thread_); 946 DCHECK(scheduler_on_impl_thread_);
949 DCHECK(scheduler_on_impl_thread_->CommitPending()); 947 DCHECK(scheduler_on_impl_thread_->CommitPending());
950 948
951 if (!layer_tree_host_impl_) { 949 if (!layer_tree_host_impl_) {
952 TRACE_EVENT0("cc", "EarlyOut_NoLayerTree"); 950 TRACE_EVENT0("cc", "EarlyOut_NoLayerTree");
953 completion->Signal(); 951 completion->Signal();
954 return; 952 return;
955 } 953 }
956 954
955 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
956
957 if (offscreen_context_provider.get()) 957 if (offscreen_context_provider.get())
958 offscreen_context_provider->BindToCurrentThread(); 958 offscreen_context_provider->BindToCurrentThread();
959 layer_tree_host_impl_->SetOffscreenContextProvider( 959 layer_tree_host_impl_->SetOffscreenContextProvider(
960 offscreen_context_provider); 960 offscreen_context_provider);
961 961
962 if (contents_texture_manager_unsafe_) { 962 if (contents_texture_manager_unsafe_) {
963 DCHECK_EQ(contents_texture_manager_unsafe_, 963 DCHECK_EQ(contents_texture_manager_unsafe_,
964 contents_texture_manager_on_main_thread()); 964 contents_texture_manager_on_main_thread());
965 } else { 965 } else {
966 // Cache this pointer that was created on the main thread side to avoid a 966 // Cache this pointer that was created on the main thread side to avoid a
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 } 1388 }
1389 1389
1390 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) { 1390 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) {
1391 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); 1391 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread");
1392 DCHECK(IsImplThread()); 1392 DCHECK(IsImplThread());
1393 layer_tree_host_impl_ = layer_tree_host()->CreateLayerTreeHostImpl(this); 1393 layer_tree_host_impl_ = layer_tree_host()->CreateLayerTreeHostImpl(this);
1394 const LayerTreeSettings& settings = layer_tree_host()->settings(); 1394 const LayerTreeSettings& settings = layer_tree_host()->settings();
1395 SchedulerSettings scheduler_settings; 1395 SchedulerSettings scheduler_settings;
1396 scheduler_settings.deadline_scheduling_enabled = 1396 scheduler_settings.deadline_scheduling_enabled =
1397 settings.deadline_scheduling_enabled; 1397 settings.deadline_scheduling_enabled;
1398 scheduler_settings.start_commit_before_draw_enabled =
1399 settings.start_commit_before_draw_enabled;
1400 scheduler_settings.start_commit_before_activate_enabled =
1401 settings.start_commit_before_activate_enabled;
1398 scheduler_settings.impl_side_painting = settings.impl_side_painting; 1402 scheduler_settings.impl_side_painting = settings.impl_side_painting;
1399 scheduler_settings.timeout_and_draw_when_animation_checkerboards = 1403 scheduler_settings.timeout_and_draw_when_animation_checkerboards =
1400 settings.timeout_and_draw_when_animation_checkerboards; 1404 settings.timeout_and_draw_when_animation_checkerboards;
1401 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = 1405 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ =
1402 settings.maximum_number_of_failed_draws_before_draw_is_forced_; 1406 settings.maximum_number_of_failed_draws_before_draw_is_forced_;
1403 scheduler_settings.using_synchronous_renderer_compositor = 1407 scheduler_settings.using_synchronous_renderer_compositor =
1404 settings.using_synchronous_renderer_compositor; 1408 settings.using_synchronous_renderer_compositor;
1405 scheduler_settings.throttle_frame_production = 1409 scheduler_settings.throttle_frame_production =
1406 settings.throttle_frame_production; 1410 settings.throttle_frame_production;
1407 scheduler_on_impl_thread_ = Scheduler::Create(this, scheduler_settings, 1411 scheduler_on_impl_thread_ = Scheduler::Create(this, scheduler_settings,
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 commit_to_activate_duration_history_.InsertSample( 1653 commit_to_activate_duration_history_.InsertSample(
1650 base::TimeTicks::HighResNow() - commit_complete_time_); 1654 base::TimeTicks::HighResNow() - commit_complete_time_);
1651 } 1655 }
1652 1656
1653 void ThreadProxy::DidManageTiles() { 1657 void ThreadProxy::DidManageTiles() {
1654 DCHECK(IsImplThread()); 1658 DCHECK(IsImplThread());
1655 scheduler_on_impl_thread_->DidManageTiles(); 1659 scheduler_on_impl_thread_->DidManageTiles();
1656 } 1660 }
1657 1661
1658 } // namespace cc 1662 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698