| 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 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { | 162 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { |
| 163 std::string top_threshold_str = | 163 std::string top_threshold_str = |
| 164 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); | 164 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); |
| 165 double hide_threshold; | 165 double hide_threshold; |
| 166 if (base::StringToDouble(top_threshold_str, &hide_threshold) && | 166 if (base::StringToDouble(top_threshold_str, &hide_threshold) && |
| 167 hide_threshold >= 0.f && hide_threshold <= 1.f) | 167 hide_threshold >= 0.f && hide_threshold <= 1.f) |
| 168 settings.top_controls_hide_threshold = hide_threshold; | 168 settings.top_controls_hide_threshold = hide_threshold; |
| 169 } | 169 } |
| 170 | 170 |
| 171 settings.partial_swap_enabled = widget->AllowPartialSwap() && | |
| 172 cmd->HasSwitch(cc::switches::kEnablePartialSwap); | |
| 173 settings.background_color_instead_of_checkerboard = | 171 settings.background_color_instead_of_checkerboard = |
| 174 cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); | 172 cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); |
| 175 settings.show_overdraw_in_tracing = | 173 settings.show_overdraw_in_tracing = |
| 176 cmd->HasSwitch(cc::switches::kTraceOverdraw); | 174 cmd->HasSwitch(cc::switches::kTraceOverdraw); |
| 177 settings.can_use_lcd_text = cc::switches::IsLCDTextEnabled(); | 175 settings.can_use_lcd_text = cc::switches::IsLCDTextEnabled(); |
| 178 settings.use_pinch_virtual_viewport = | 176 settings.use_pinch_virtual_viewport = |
| 179 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); | 177 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); |
| 180 settings.allow_antialiasing &= | 178 settings.allow_antialiasing &= |
| 181 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); | 179 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); |
| 182 | 180 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 widget_->OnSwapBuffersAborted(); | 635 widget_->OnSwapBuffersAborted(); |
| 638 } | 636 } |
| 639 | 637 |
| 640 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 638 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 641 cc::ContextProvider* provider = | 639 cc::ContextProvider* provider = |
| 642 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 640 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 643 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 641 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 644 } | 642 } |
| 645 | 643 |
| 646 } // namespace content | 644 } // namespace content |
| OLD | NEW |