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

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: sami's suggestions Created 6 years, 9 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 } 981 }
982 982
983 layer_tree_host()->CommitComplete(); 983 layer_tree_host()->CommitComplete();
984 layer_tree_host()->DidBeginMainFrame(); 984 layer_tree_host()->DidBeginMainFrame();
985 } 985 }
986 986
987 void ThreadProxy::StartCommitOnImplThread( 987 void ThreadProxy::StartCommitOnImplThread(
988 CompletionEvent* completion, 988 CompletionEvent* completion,
989 ResourceUpdateQueue* raw_queue, 989 ResourceUpdateQueue* raw_queue,
990 scoped_refptr<ContextProvider> offscreen_context_provider) { 990 scoped_refptr<ContextProvider> offscreen_context_provider) {
991 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
992
993 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread"); 991 TRACE_EVENT0("cc", "ThreadProxy::StartCommitOnImplThread");
994 DCHECK(!impl().commit_completion_event); 992 DCHECK(!impl().commit_completion_event);
995 DCHECK(IsImplThread() && IsMainThreadBlocked()); 993 DCHECK(IsImplThread() && IsMainThreadBlocked());
996 DCHECK(impl().scheduler); 994 DCHECK(impl().scheduler);
997 DCHECK(impl().scheduler->CommitPending()); 995 DCHECK(impl().scheduler->CommitPending());
998 996
999 if (!impl().layer_tree_host_impl) { 997 if (!impl().layer_tree_host_impl) {
1000 TRACE_EVENT_INSTANT0( 998 TRACE_EVENT_INSTANT0(
1001 "cc", "EarlyOut_NoLayerTree", TRACE_EVENT_SCOPE_THREAD); 999 "cc", "EarlyOut_NoLayerTree", TRACE_EVENT_SCOPE_THREAD);
1002 completion->Signal(); 1000 completion->Signal();
1003 return; 1001 return;
1004 } 1002 }
1005 1003
1004 scoped_ptr<ResourceUpdateQueue> queue(raw_queue);
1005
1006 if (offscreen_context_provider.get()) 1006 if (offscreen_context_provider.get())
1007 offscreen_context_provider->BindToCurrentThread(); 1007 offscreen_context_provider->BindToCurrentThread();
1008 impl().layer_tree_host_impl->SetOffscreenContextProvider( 1008 impl().layer_tree_host_impl->SetOffscreenContextProvider(
1009 offscreen_context_provider); 1009 offscreen_context_provider);
1010 1010
1011 if (impl().contents_texture_manager) { 1011 if (impl().contents_texture_manager) {
1012 DCHECK_EQ(impl().contents_texture_manager, 1012 DCHECK_EQ(impl().contents_texture_manager,
1013 blocked_main().contents_texture_manager()); 1013 blocked_main().contents_texture_manager());
1014 } else { 1014 } else {
1015 // Cache this pointer that was created on the main thread side to avoid a 1015 // Cache this pointer that was created on the main thread side to avoid a
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 completion->Signal(); 1463 completion->Signal();
1464 } 1464 }
1465 1465
1466 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) { 1466 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) {
1467 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); 1467 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread");
1468 DCHECK(IsImplThread()); 1468 DCHECK(IsImplThread());
1469 impl().layer_tree_host_impl = 1469 impl().layer_tree_host_impl =
1470 layer_tree_host()->CreateLayerTreeHostImpl(this); 1470 layer_tree_host()->CreateLayerTreeHostImpl(this);
1471 const LayerTreeSettings& settings = layer_tree_host()->settings(); 1471 const LayerTreeSettings& settings = layer_tree_host()->settings();
1472 SchedulerSettings scheduler_settings; 1472 SchedulerSettings scheduler_settings;
1473 scheduler_settings.start_commit_before_draw_enabled =
1474 settings.start_commit_before_draw_enabled;
1475 scheduler_settings.start_commit_before_activate_enabled =
1476 settings.start_commit_before_activate_enabled;
1473 scheduler_settings.impl_side_painting = settings.impl_side_painting; 1477 scheduler_settings.impl_side_painting = settings.impl_side_painting;
1474 scheduler_settings.timeout_and_draw_when_animation_checkerboards = 1478 scheduler_settings.timeout_and_draw_when_animation_checkerboards =
1475 settings.timeout_and_draw_when_animation_checkerboards; 1479 settings.timeout_and_draw_when_animation_checkerboards;
1476 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ = 1480 scheduler_settings.maximum_number_of_failed_draws_before_draw_is_forced_ =
1477 settings.maximum_number_of_failed_draws_before_draw_is_forced_; 1481 settings.maximum_number_of_failed_draws_before_draw_is_forced_;
1478 scheduler_settings.using_synchronous_renderer_compositor = 1482 scheduler_settings.using_synchronous_renderer_compositor =
1479 settings.using_synchronous_renderer_compositor; 1483 settings.using_synchronous_renderer_compositor;
1480 scheduler_settings.throttle_frame_production = 1484 scheduler_settings.throttle_frame_production =
1481 settings.throttle_frame_production; 1485 settings.throttle_frame_production;
1482 impl().scheduler = 1486 impl().scheduler =
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 1737
1734 impl().timing_history.DidActivatePendingTree(); 1738 impl().timing_history.DidActivatePendingTree();
1735 } 1739 }
1736 1740
1737 void ThreadProxy::DidManageTiles() { 1741 void ThreadProxy::DidManageTiles() {
1738 DCHECK(IsImplThread()); 1742 DCHECK(IsImplThread());
1739 impl().scheduler->DidManageTiles(); 1743 impl().scheduler->DidManageTiles();
1740 } 1744 }
1741 1745
1742 } // namespace cc 1746 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698