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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 1107763002: Disable BeginFrame scheduling for OOPIF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO Created 5 years, 8 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
« no previous file with comments | « no previous file | content/renderer/render_widget.h » ('j') | content/renderer/render_widget.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); 214 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
215 215
216 cc::LayerTreeSettings settings; 216 cc::LayerTreeSettings settings;
217 217
218 // For web contents, layer transforms should scale up the contents of layers 218 // For web contents, layer transforms should scale up the contents of layers
219 // to keep content always crisp when possible. 219 // to keep content always crisp when possible.
220 settings.layer_transforms_should_scale_layer_contents = true; 220 settings.layer_transforms_should_scale_layer_contents = true;
221 221
222 settings.throttle_frame_production = 222 settings.throttle_frame_production =
223 !cmd->HasSwitch(switches::kDisableGpuVsync); 223 !cmd->HasSwitch(switches::kDisableGpuVsync);
224 settings.use_external_begin_frame_source =
225 cmd->HasSwitch(switches::kEnableBeginFrameScheduling);
226 settings.main_frame_before_activation_enabled = 224 settings.main_frame_before_activation_enabled =
227 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && 225 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) &&
228 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); 226 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation);
229 settings.report_overscroll_only_for_scrollable_axes = 227 settings.report_overscroll_only_for_scrollable_axes =
230 !compositor_deps_->IsElasticOverscrollEnabled(); 228 !compositor_deps_->IsElasticOverscrollEnabled();
231 settings.accelerated_animation_enabled = 229 settings.accelerated_animation_enabled =
232 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); 230 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation);
233 settings.use_display_lists = cmd->HasSwitch(switches::kEnableSlimmingPaint); 231 settings.use_display_lists = cmd->HasSwitch(switches::kEnableSlimmingPaint);
234 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) { 232 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) {
235 settings.use_compositor_animation_timelines = true; 233 settings.use_compositor_animation_timelines = true;
236 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true); 234 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true);
237 } 235 }
236 if (cmd->HasSwitch(switches::kEnableBeginFrameScheduling) &&
237 !widget_->for_subframe()) {
238 // TODO(simonhong): Apply BeginFrame scheduling for sub-frame.
Charlie Reis 2015/04/27 16:47:18 Please list a bug number here.
simonhong 2015/04/27 20:49:33 Done.
239 settings.use_external_begin_frame_source = true;
240 }
238 241
239 settings.default_tile_size = CalculateDefaultTileSize(widget_); 242 settings.default_tile_size = CalculateDefaultTileSize(widget_);
240 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { 243 if (cmd->HasSwitch(switches::kDefaultTileWidth)) {
241 int tile_width = 0; 244 int tile_width = 0;
242 GetSwitchValueAsInt(*cmd, 245 GetSwitchValueAsInt(*cmd,
243 switches::kDefaultTileWidth, 246 switches::kDefaultTileWidth,
244 1, 247 1,
245 std::numeric_limits<int>::max(), 248 std::numeric_limits<int>::max(),
246 &tile_width); 249 &tile_width);
247 settings.default_tile_size.set_width(tile_width); 250 settings.default_tile_size.set_width(tile_width);
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 cc::ContextProvider* provider = 935 cc::ContextProvider* provider =
933 compositor_deps_->GetSharedMainThreadContextProvider(); 936 compositor_deps_->GetSharedMainThreadContextProvider();
934 // provider can be NULL after the GPU process crashed enough times and we 937 // provider can be NULL after the GPU process crashed enough times and we
935 // don't want to restart it any more (falling back to software). 938 // don't want to restart it any more (falling back to software).
936 if (!provider) 939 if (!provider)
937 return; 940 return;
938 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 941 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
939 } 942 }
940 943
941 } // namespace content 944 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_widget.h » ('j') | content/renderer/render_widget.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698