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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { | 164 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { |
165 std::string top_threshold_str = | 165 std::string top_threshold_str = |
166 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); | 166 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); |
167 double hide_threshold; | 167 double hide_threshold; |
168 if (base::StringToDouble(top_threshold_str, &hide_threshold) && | 168 if (base::StringToDouble(top_threshold_str, &hide_threshold) && |
169 hide_threshold >= 0.f && hide_threshold <= 1.f) | 169 hide_threshold >= 0.f && hide_threshold <= 1.f) |
170 settings.top_controls_hide_threshold = hide_threshold; | 170 settings.top_controls_hide_threshold = hide_threshold; |
171 } | 171 } |
172 | 172 |
173 settings.partial_swap_enabled = widget->AllowPartialSwap(); | 173 settings.partial_swap_enabled = widget->AllowPartialSwap() && |
| 174 cmd->HasSwitch(cc::switches::kEnablePartialSwap); |
174 settings.background_color_instead_of_checkerboard = | 175 settings.background_color_instead_of_checkerboard = |
175 cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); | 176 cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); |
176 settings.show_overdraw_in_tracing = | 177 settings.show_overdraw_in_tracing = |
177 cmd->HasSwitch(cc::switches::kTraceOverdraw); | 178 cmd->HasSwitch(cc::switches::kTraceOverdraw); |
178 settings.can_use_lcd_text = cc::switches::IsLCDTextEnabled(); | 179 settings.can_use_lcd_text = cc::switches::IsLCDTextEnabled(); |
179 settings.use_pinch_virtual_viewport = | 180 settings.use_pinch_virtual_viewport = |
180 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); | 181 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); |
181 settings.allow_antialiasing &= | 182 settings.allow_antialiasing &= |
182 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); | 183 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); |
183 | 184 |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 widget_->OnSwapBuffersAborted(); | 625 widget_->OnSwapBuffersAborted(); |
625 } | 626 } |
626 | 627 |
627 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 628 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
628 cc::ContextProvider* provider = | 629 cc::ContextProvider* provider = |
629 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 630 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
630 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 631 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
631 } | 632 } |
632 | 633 |
633 } // namespace content | 634 } // namespace content |
OLD | NEW |