| 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 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 settings.begin_frame_scheduling_enabled = | 171 settings.begin_frame_scheduling_enabled = |
| 172 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); | 172 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); |
| 173 settings.main_frame_before_activation_enabled = | 173 settings.main_frame_before_activation_enabled = |
| 174 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 174 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
| 175 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 175 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
| 176 settings.main_frame_before_draw_enabled = | 176 settings.main_frame_before_draw_enabled = |
| 177 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeDraw); | 177 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeDraw); |
| 178 settings.report_overscroll_only_for_scrollable_axes = true; | 178 settings.report_overscroll_only_for_scrollable_axes = true; |
| 179 settings.accelerated_animation_enabled = | 179 settings.accelerated_animation_enabled = |
| 180 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 180 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
| 181 settings.touch_hit_testing = | |
| 182 !cmd->HasSwitch(cc::switches::kDisableCompositorTouchHitTesting); | |
| 183 | 181 |
| 184 settings.default_tile_size = CalculateDefaultTileSize(); | 182 settings.default_tile_size = CalculateDefaultTileSize(); |
| 185 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { | 183 if (cmd->HasSwitch(switches::kDefaultTileWidth)) { |
| 186 int tile_width = 0; | 184 int tile_width = 0; |
| 187 GetSwitchValueAsInt(*cmd, | 185 GetSwitchValueAsInt(*cmd, |
| 188 switches::kDefaultTileWidth, | 186 switches::kDefaultTileWidth, |
| 189 1, | 187 1, |
| 190 std::numeric_limits<int>::max(), | 188 std::numeric_limits<int>::max(), |
| 191 &tile_width); | 189 &tile_width); |
| 192 settings.default_tile_size.set_width(tile_width); | 190 settings.default_tile_size.set_width(tile_width); |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 widget_->OnSwapBuffersAborted(); | 808 widget_->OnSwapBuffersAborted(); |
| 811 } | 809 } |
| 812 | 810 |
| 813 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 811 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 814 cc::ContextProvider* provider = | 812 cc::ContextProvider* provider = |
| 815 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 813 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 816 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 814 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 817 } | 815 } |
| 818 | 816 |
| 819 } // namespace content | 817 } // namespace content |
| OLD | NEW |