| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 std::string top_threshold_str = | 266 std::string top_threshold_str = |
| 267 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); | 267 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); |
| 268 double hide_threshold; | 268 double hide_threshold; |
| 269 if (base::StringToDouble(top_threshold_str, &hide_threshold) && | 269 if (base::StringToDouble(top_threshold_str, &hide_threshold) && |
| 270 hide_threshold >= 0.f && hide_threshold <= 1.f) | 270 hide_threshold >= 0.f && hide_threshold <= 1.f) |
| 271 settings.top_controls_hide_threshold = hide_threshold; | 271 settings.top_controls_hide_threshold = hide_threshold; |
| 272 } | 272 } |
| 273 | 273 |
| 274 settings.use_pinch_virtual_viewport = | 274 settings.use_pinch_virtual_viewport = |
| 275 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); | 275 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); |
| 276 settings.verify_property_trees = |
| 277 cmd->HasSwitch(cc::switches::kEnablePropertyTreeVerification); |
| 276 settings.renderer_settings.allow_antialiasing &= | 278 settings.renderer_settings.allow_antialiasing &= |
| 277 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); | 279 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); |
| 278 settings.single_thread_proxy_scheduler = | 280 settings.single_thread_proxy_scheduler = |
| 279 compositor_deps_->UseSingleThreadScheduler(); | 281 compositor_deps_->UseSingleThreadScheduler(); |
| 280 | 282 |
| 281 // These flags should be mirrored by UI versions in ui/compositor/. | 283 // These flags should be mirrored by UI versions in ui/compositor/. |
| 282 settings.initial_debug_state.show_debug_borders = | 284 settings.initial_debug_state.show_debug_borders = |
| 283 cmd->HasSwitch(cc::switches::kShowCompositedLayerBorders); | 285 cmd->HasSwitch(cc::switches::kShowCompositedLayerBorders); |
| 284 settings.initial_debug_state.show_fps_counter = | 286 settings.initial_debug_state.show_fps_counter = |
| 285 cmd->HasSwitch(cc::switches::kShowFPSCounter); | 287 cmd->HasSwitch(cc::switches::kShowFPSCounter); |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 widget_->OnSwapBuffersAborted(); | 885 widget_->OnSwapBuffersAborted(); |
| 884 } | 886 } |
| 885 | 887 |
| 886 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 888 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 887 cc::ContextProvider* provider = | 889 cc::ContextProvider* provider = |
| 888 compositor_deps_->GetSharedMainThreadContextProvider(); | 890 compositor_deps_->GetSharedMainThreadContextProvider(); |
| 889 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 891 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 890 } | 892 } |
| 891 | 893 |
| 892 } // namespace content | 894 } // namespace content |
| OLD | NEW |