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

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

Issue 11414308: Add vsync notification command line switch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move setting to content. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »
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 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 RenderWidget* widget) { 82 RenderWidget* widget) {
83 scoped_ptr<RenderWidgetCompositor> compositor( 83 scoped_ptr<RenderWidgetCompositor> compositor(
84 new RenderWidgetCompositor(widget)); 84 new RenderWidgetCompositor(widget));
85 85
86 CommandLine* cmd = CommandLine::ForCurrentProcess(); 86 CommandLine* cmd = CommandLine::ForCurrentProcess();
87 87
88 cc::LayerTreeSettings settings; 88 cc::LayerTreeSettings settings;
89 settings.accelerate_painting = 89 settings.accelerate_painting =
90 cmd->HasSwitch(switches::kEnableAcceleratedPainting); 90 cmd->HasSwitch(switches::kEnableAcceleratedPainting);
91 settings.render_vsync_enabled = !cmd->HasSwitch(switches::kDisableGpuVsync); 91 settings.render_vsync_enabled = !cmd->HasSwitch(switches::kDisableGpuVsync);
92 settings.render_vsync_notification_enabled =
93 cmd->HasSwitch(switches::kEnableVsyncNotification);
92 settings.per_tile_painting_enabled = 94 settings.per_tile_painting_enabled =
93 cmd->HasSwitch(cc::switches::kEnablePerTilePainting); 95 cmd->HasSwitch(cc::switches::kEnablePerTilePainting);
94 settings.accelerated_animation_enabled = 96 settings.accelerated_animation_enabled =
95 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); 97 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation);
96 98
97 int default_tile_width = settings.default_tile_size.width(); 99 int default_tile_width = settings.default_tile_size.width();
98 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { 100 if (cmd->HasSwitch(switches::kDefaultTileWidth)) {
99 GetSwitchValueAsInt(*cmd, switches::kDefaultTileWidth, 1, 101 GetSwitchValueAsInt(*cmd, switches::kDefaultTileWidth, 1,
100 std::numeric_limits<int>::max(), &default_tile_width); 102 std::numeric_limits<int>::max(), &default_tile_width);
101 } 103 }
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); 512 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread();
511 } 513 }
512 514
513 scoped_refptr<cc::ContextProvider> 515 scoped_refptr<cc::ContextProvider>
514 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { 516 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() {
515 return RenderThreadImpl::current()-> 517 return RenderThreadImpl::current()->
516 OffscreenContextProviderForCompositorThread(); 518 OffscreenContextProviderForCompositorThread();
517 } 519 }
518 520
519 } // namespace content 521 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698