| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = | 92 settings.render_vsync_notification_enabled = |
| 93 cmd->HasSwitch(switches::kEnableVsyncNotification); | 93 cmd->HasSwitch(switches::kEnableVsyncNotification); |
| 94 settings.synchronously_disable_vsync = widget->SynchronouslyDisableVSync(); |
| 94 settings.per_tile_painting_enabled = | 95 settings.per_tile_painting_enabled = |
| 95 cmd->HasSwitch(cc::switches::kEnablePerTilePainting); | 96 cmd->HasSwitch(cc::switches::kEnablePerTilePainting); |
| 96 settings.accelerated_animation_enabled = | 97 settings.accelerated_animation_enabled = |
| 97 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 98 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
| 98 | 99 |
| 99 int default_tile_width = settings.default_tile_size.width(); | 100 int default_tile_width = settings.default_tile_size.width(); |
| 100 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { | 101 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { |
| 101 GetSwitchValueAsInt(*cmd, switches::kDefaultTileWidth, 1, | 102 GetSwitchValueAsInt(*cmd, switches::kDefaultTileWidth, 1, |
| 102 std::numeric_limits<int>::max(), &default_tile_width); | 103 std::numeric_limits<int>::max(), &default_tile_width); |
| 103 } | 104 } |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 559 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 559 } | 560 } |
| 560 | 561 |
| 561 scoped_refptr<cc::ContextProvider> | 562 scoped_refptr<cc::ContextProvider> |
| 562 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 563 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
| 563 return RenderThreadImpl::current()-> | 564 return RenderThreadImpl::current()-> |
| 564 OffscreenContextProviderForCompositorThread(); | 565 OffscreenContextProviderForCompositorThread(); |
| 565 } | 566 } |
| 566 | 567 |
| 567 } // namespace content | 568 } // namespace content |
| OLD | NEW |