| OLD | NEW |
| 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 Loading... |
| 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.acceleratePainting = | 89 settings.acceleratePainting = |
| 90 cmd->HasSwitch(switches::kEnableAcceleratedPainting); | 90 cmd->HasSwitch(switches::kEnableAcceleratedPainting); |
| 91 settings.renderVSyncEnabled = !cmd->HasSwitch(switches::kDisableGpuVsync); | 91 settings.renderVSyncEnabled = !cmd->HasSwitch(switches::kDisableGpuVsync); |
| 92 settings.renderVSyncNotificationEnabled = |
| 93 cmd->HasSwitch(cc::switches::kEnableVsyncNotification); |
| 92 settings.perTilePaintingEnabled = | 94 settings.perTilePaintingEnabled = |
| 93 cmd->HasSwitch(cc::switches::kEnablePerTilePainting); | 95 cmd->HasSwitch(cc::switches::kEnablePerTilePainting); |
| 94 settings.acceleratedAnimationEnabled = | 96 settings.acceleratedAnimationEnabled = |
| 95 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 97 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
| 96 | 98 |
| 97 int default_tile_width = settings.defaultTileSize.width(); | 99 int default_tile_width = settings.defaultTileSize.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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 509 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 508 } | 510 } |
| 509 | 511 |
| 510 scoped_refptr<cc::ContextProvider> | 512 scoped_refptr<cc::ContextProvider> |
| 511 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 513 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
| 512 return RenderThreadImpl::current()-> | 514 return RenderThreadImpl::current()-> |
| 513 OffscreenContextProviderForCompositorThread(); | 515 OffscreenContextProviderForCompositorThread(); |
| 514 } | 516 } |
| 515 | 517 |
| 516 } // namespace content | 518 } // namespace content |
| OLD | NEW |