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

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 typo 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 <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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 } 973 }
974 974
975 layer_tree_host()->CommitComplete(); 975 layer_tree_host()->CommitComplete();
976 layer_tree_host()->DidBeginMainFrame(); 976 layer_tree_host()->DidBeginMainFrame();
977 } 977 }
978 978
979 void ThreadProxy::StartCommitOnImplThread( 979 void ThreadProxy::StartCommitOnImplThread(
980 CompletionEvent* completion, 980 CompletionEvent* completion,
981 ResourceUpdateQueue* raw_queue, 981 ResourceUpdateQueue* raw_queue,
982 scoped_refptr<ContextProvider> offscreen_context_provider) { 982 scoped_refptr<ContextProvider> offscreen_context_provider) {
983 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
984
985 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); 983 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread");
986 DCHECK(!impl().commit_completion_event); 984 DCHECK(!impl().commit_completion_event);
987 DCHECK(IsImplThread() && IsMainThreadBlocked()); 985 DCHECK(IsImplThread() && IsMainThreadBlocked());
988 DCHECK(impl().scheduler); 986 DCHECK(impl().scheduler);
989 DCHECK(impl().scheduler->CommitPending()); 987 DCHECK(impl().scheduler->CommitPending());
990 988
991 if (!impl().layer_tree_host_impl) { 989 if (!impl().layer_tree_host_impl) {
992 TRACE_EVENT_INSTANT0( 990 TRACE_EVENT_INSTANT0(
993 "cc", "EarlyOut_NoLayerTree", TRACE_EVENT_SCOPE_THREAD); 991 "cc", "EarlyOut_NoLayerTree", TRACE_EVENT_SCOPE_THREAD);
994 completion->Signal(); 992 completion->Signal();
995 return; 993 return;
996 } 994 }
997 995
996 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
997
998 if (offscreen_context_provider.get()) 998 if (offscreen_context_provider.get())
999 offscreen_context_provider->BindToCurrentThread(); 999 offscreen_context_provider->BindToCurrentThread();
1000 impl().layer_tree_host_impl->SetOffscreenContextProvider( 1000 impl().layer_tree_host_impl->SetOffscreenContextProvider(
1001 offscreen_context_provider); 1001 offscreen_context_provider);
1002 1002
1003 if (impl().contents_texture_manager) { 1003 if (impl().contents_texture_manager) {
1004 DCHECK_EQ(impl().contents_texture_manager, 1004 DCHECK_EQ(impl().contents_texture_manager,
1005 blocked_main().contents_texture_manager()); 1005 blocked_main().contents_texture_manager());
1006 } else { 1006 } else {
1007 // Cache this pointer that was created on the main thread side to avoid a 1007 // Cache this pointer that was created on the main thread side to avoid a
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 1448
1449 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) { 1449 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) {
1450 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); 1450 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread");
1451 DCHECK(IsImplThread()); 1451 DCHECK(IsImplThread());
1452 impl().layer_tree_host_impl = 1452 impl().layer_tree_host_impl =
1453 layer_tree_host()->CreateLayerTreeHostImpl(this); 1453 layer_tree_host()->CreateLayerTreeHostImpl(this);
1454 const LayerTreeSettings& settings = layer_tree_host()->settings(); 1454 const LayerTreeSettings& settings = layer_tree_host()->settings();
1455 SchedulerSettings scheduler_settings; 1455 SchedulerSettings scheduler_settings;
1456 scheduler_settings.deadline_scheduling_enabled = 1456 scheduler_settings.deadline_scheduling_enabled =
1457 settings.deadline_scheduling_enabled; 1457 settings.deadline_scheduling_enabled;
1458 scheduler_settings.start_commit_before_draw_enabled =
1459 settings.start_commit_before_draw_enabled;
1460 scheduler_settings.start_commit_before_activate_enabled =
1461 settings.start_commit_before_activate_enabled;
1458 scheduler_settings.impl_side_painting = settings.impl_side_painting; 1462 scheduler_settings.impl_side_painting = settings.impl_side_painting;
1459 scheduler_settings.timeout_and_draw_when_animation_checkerboards = 1463 scheduler_settings.timeout_and_draw_when_animation_checkerboards =
1460 settings.timeout_and_draw_when_animation_checkerboards; 1464 settings.timeout_and_draw_when_animation_checkerboards;
1461 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = 1465 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ =
1462 settings.maximum_number_of_failed_draws_before_draw_is_forced_; 1466 settings.maximum_number_of_failed_draws_before_draw_is_forced_;
1463 scheduler_settings.using_synchronous_renderer_compositor = 1467 scheduler_settings.using_synchronous_renderer_compositor =
1464 settings.using_synchronous_renderer_compositor; 1468 settings.using_synchronous_renderer_compositor;
1465 scheduler_settings.throttle_frame_production = 1469 scheduler_settings.throttle_frame_production =
1466 settings.throttle_frame_production; 1470 settings.throttle_frame_production;
1467 impl().scheduler = 1471 impl().scheduler =
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 impl().commit_to_activate_duration_history.InsertSample( 1718 impl().commit_to_activate_duration_history.InsertSample(
1715 base::TimeTicks::HighResNow() - impl().commit_complete_time); 1719 base::TimeTicks::HighResNow() - impl().commit_complete_time);
1716 } 1720 }
1717 1721
1718 void ThreadProxy::DidManageTiles() { 1722 void ThreadProxy::DidManageTiles() {
1719 DCHECK(IsImplThread()); 1723 DCHECK(IsImplThread());
1720 impl().scheduler->DidManageTiles(); 1724 impl().scheduler->DidManageTiles();
1721 } 1725 }
1722 1726
1723 } // namespace cc 1727 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698