| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { | 159 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { |
| 160 std::string top_threshold_str = | 160 std::string top_threshold_str = |
| 161 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); | 161 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); |
| 162 double hide_threshold; | 162 double hide_threshold; |
| 163 if (base::StringToDouble(top_threshold_str, &hide_threshold) && | 163 if (base::StringToDouble(top_threshold_str, &hide_threshold) && |
| 164 hide_threshold >= 0.f && hide_threshold <= 1.f) | 164 hide_threshold >= 0.f && hide_threshold <= 1.f) |
| 165 settings.top_controls_hide_threshold = hide_threshold; | 165 settings.top_controls_hide_threshold = hide_threshold; |
| 166 } | 166 } |
| 167 | 167 |
| 168 settings.background_color_instead_of_checkerboard = | |
| 169 cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); | |
| 170 settings.show_overdraw_in_tracing = | 168 settings.show_overdraw_in_tracing = |
| 171 cmd->HasSwitch(cc::switches::kTraceOverdraw); | 169 cmd->HasSwitch(cc::switches::kTraceOverdraw); |
| 172 settings.can_use_lcd_text = cc::switches::IsLCDTextEnabled(); | 170 settings.can_use_lcd_text = cc::switches::IsLCDTextEnabled(); |
| 173 settings.use_pinch_virtual_viewport = | 171 settings.use_pinch_virtual_viewport = |
| 174 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); | 172 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); |
| 175 settings.allow_antialiasing &= | 173 settings.allow_antialiasing &= |
| 176 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); | 174 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); |
| 177 | 175 |
| 178 // These flags should be mirrored by UI versions in ui/compositor/. | 176 // These flags should be mirrored by UI versions in ui/compositor/. |
| 179 settings.initial_debug_state.show_debug_borders = | 177 settings.initial_debug_state.show_debug_borders = |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 max_unused_resource_memory_percentage; | 229 max_unused_resource_memory_percentage; |
| 232 } | 230 } |
| 233 } | 231 } |
| 234 | 232 |
| 235 settings.strict_layer_property_change_checking = | 233 settings.strict_layer_property_change_checking = |
| 236 cmd->HasSwitch(cc::switches::kStrictLayerPropertyChangeChecking); | 234 cmd->HasSwitch(cc::switches::kStrictLayerPropertyChangeChecking); |
| 237 | 235 |
| 238 settings.use_map_image = cc::switches::IsMapImageEnabled(); | 236 settings.use_map_image = cc::switches::IsMapImageEnabled(); |
| 239 | 237 |
| 240 #if defined(OS_ANDROID) | 238 #if defined(OS_ANDROID) |
| 241 // TODO(danakj): Move these to the android code. | |
| 242 settings.max_partial_texture_updates = 0; | 239 settings.max_partial_texture_updates = 0; |
| 243 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; | 240 settings.scrollbar_animator = cc::LayerTreeSettings::LinearFade; |
| 244 settings.solid_color_scrollbar_color = | 241 settings.solid_color_scrollbar_color = |
| 245 cmd->HasSwitch(switches::kHideScrollbars) | 242 cmd->HasSwitch(switches::kHideScrollbars) |
| 246 ? SK_ColorTRANSPARENT | 243 ? SK_ColorTRANSPARENT |
| 247 : SkColorSetARGB(128, 128, 128, 128); | 244 : SkColorSetARGB(128, 128, 128, 128); |
| 248 settings.highp_threshold_min = 2048; | 245 settings.highp_threshold_min = 2048; |
| 249 // Android WebView handles root layer flings itself. | 246 // Android WebView handles root layer flings itself. |
| 250 settings.ignore_root_layer_flings = | 247 settings.ignore_root_layer_flings = |
| 251 widget->UsingSynchronousRendererCompositor(); | 248 widget->UsingSynchronousRendererCompositor(); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 widget_->OnSwapBuffersAborted(); | 629 widget_->OnSwapBuffersAborted(); |
| 633 } | 630 } |
| 634 | 631 |
| 635 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 632 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 636 cc::ContextProvider* provider = | 633 cc::ContextProvider* provider = |
| 637 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 634 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 638 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 635 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 639 } | 636 } |
| 640 | 637 |
| 641 } // namespace content | 638 } // namespace content |
| OLD | NEW |