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

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

Issue 811523002: Added ability to dynamically toggle frame throttling in the scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests for SetThrottleFrameProduction Created 6 years 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/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 background_color_(SK_ColorWHITE), 130 background_color_(SK_ColorWHITE),
131 has_transparent_background_(false), 131 has_transparent_background_(false),
132 partial_texture_update_requests_(0), 132 partial_texture_update_requests_(0),
133 in_paint_layer_contents_(false), 133 in_paint_layer_contents_(false),
134 total_frames_used_for_lcd_text_metrics_(0), 134 total_frames_used_for_lcd_text_metrics_(0),
135 id_(s_layer_tree_host_sequence_number.GetNext() + 1), 135 id_(s_layer_tree_host_sequence_number.GetNext() + 1),
136 next_commit_forces_redraw_(false), 136 next_commit_forces_redraw_(false),
137 shared_bitmap_manager_(shared_bitmap_manager), 137 shared_bitmap_manager_(shared_bitmap_manager),
138 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), 138 gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
139 surface_id_namespace_(0u), 139 surface_id_namespace_(0u),
140 next_surface_sequence_(1u) { 140 next_surface_sequence_(1u),
141 swap_interval_(1) {
141 if (settings_.accelerated_animation_enabled) 142 if (settings_.accelerated_animation_enabled)
142 animation_registrar_ = AnimationRegistrar::Create(); 143 animation_registrar_ = AnimationRegistrar::Create();
143 rendering_stats_instrumentation_->set_record_rendering_stats( 144 rendering_stats_instrumentation_->set_record_rendering_stats(
144 debug_state_.RecordRenderingStats()); 145 debug_state_.RecordRenderingStats());
145 } 146 }
146 147
147 void LayerTreeHost::InitializeThreaded( 148 void LayerTreeHost::InitializeThreaded(
148 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 149 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
149 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 150 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
150 scoped_ptr<BeginFrameSource> external_begin_frame_source) { 151 scoped_ptr<BeginFrameSource> external_begin_frame_source) {
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 735
735 void LayerTreeHost::SetVisible(bool visible) { 736 void LayerTreeHost::SetVisible(bool visible) {
736 if (visible_ == visible) 737 if (visible_ == visible)
737 return; 738 return;
738 visible_ = visible; 739 visible_ = visible;
739 if (!visible) 740 if (!visible)
740 ReduceMemoryUsage(); 741 ReduceMemoryUsage();
741 proxy_->SetVisible(visible); 742 proxy_->SetVisible(visible);
742 } 743 }
743 744
745 void LayerTreeHost::SetThrottleFrameProduction(bool throttle) {
746 proxy_->SetThrottleFrameProduction(throttle);
747 }
748
744 void LayerTreeHost::StartPageScaleAnimation(const gfx::Vector2d& target_offset, 749 void LayerTreeHost::StartPageScaleAnimation(const gfx::Vector2d& target_offset,
745 bool use_anchor, 750 bool use_anchor,
746 float scale, 751 float scale,
747 base::TimeDelta duration) { 752 base::TimeDelta duration) {
748 pending_page_scale_animation_.reset( 753 pending_page_scale_animation_.reset(
749 new PendingPageScaleAnimation( 754 new PendingPageScaleAnimation(
750 target_offset, 755 target_offset,
751 use_anchor, 756 use_anchor,
752 scale, 757 scale,
753 duration)); 758 duration));
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 bool children_need_begin_frames) const { 1388 bool children_need_begin_frames) const {
1384 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames); 1389 proxy_->SetChildrenNeedBeginFrames(children_need_begin_frames);
1385 } 1390 }
1386 1391
1387 void LayerTreeHost::SendBeginFramesToChildren( 1392 void LayerTreeHost::SendBeginFramesToChildren(
1388 const BeginFrameArgs& args) const { 1393 const BeginFrameArgs& args) const {
1389 client_->SendBeginFramesToChildren(args); 1394 client_->SendBeginFramesToChildren(args);
1390 } 1395 }
1391 1396
1392 } // namespace cc 1397 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host.h ('K') | « cc/trees/layer_tree_host.h ('k') | cc/trees/proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698