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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 settings.can_use_lcd_text = compositor_deps_->IsLcdTextEnabled(); | 269 settings.can_use_lcd_text = compositor_deps_->IsLcdTextEnabled(); |
270 settings.use_distance_field_text = | 270 settings.use_distance_field_text = |
271 compositor_deps_->IsDistanceFieldTextEnabled(); | 271 compositor_deps_->IsDistanceFieldTextEnabled(); |
272 settings.use_zero_copy = compositor_deps_->IsZeroCopyEnabled(); | 272 settings.use_zero_copy = compositor_deps_->IsZeroCopyEnabled(); |
273 settings.use_one_copy = compositor_deps_->IsOneCopyEnabled(); | 273 settings.use_one_copy = compositor_deps_->IsOneCopyEnabled(); |
274 settings.enable_elastic_overscroll = | 274 settings.enable_elastic_overscroll = |
275 compositor_deps_->IsElasticOverscrollEnabled(); | 275 compositor_deps_->IsElasticOverscrollEnabled(); |
276 settings.use_image_texture_target = compositor_deps_->GetImageTextureTarget(); | 276 settings.use_image_texture_target = compositor_deps_->GetImageTextureTarget(); |
277 | 277 |
278 settings.calculate_top_controls_position = | |
279 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); | |
280 if (cmd->HasSwitch(cc::switches::kTopControlsShowThreshold)) { | 278 if (cmd->HasSwitch(cc::switches::kTopControlsShowThreshold)) { |
281 std::string top_threshold_str = | 279 std::string top_threshold_str = |
282 cmd->GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold); | 280 cmd->GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold); |
283 double show_threshold; | 281 double show_threshold; |
284 if (base::StringToDouble(top_threshold_str, &show_threshold) && | 282 if (base::StringToDouble(top_threshold_str, &show_threshold) && |
285 show_threshold >= 0.f && show_threshold <= 1.f) | 283 show_threshold >= 0.f && show_threshold <= 1.f) |
286 settings.top_controls_show_threshold = show_threshold; | 284 settings.top_controls_show_threshold = show_threshold; |
287 } | 285 } |
288 | 286 |
289 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { | 287 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 cc::ContextProvider* provider = | 905 cc::ContextProvider* provider = |
908 compositor_deps_->GetSharedMainThreadContextProvider(); | 906 compositor_deps_->GetSharedMainThreadContextProvider(); |
909 // provider can be NULL after the GPU process crashed enough times and we | 907 // provider can be NULL after the GPU process crashed enough times and we |
910 // don't want to restart it any more (falling back to software). | 908 // don't want to restart it any more (falling back to software). |
911 if (!provider) | 909 if (!provider) |
912 return; | 910 return; |
913 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 911 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
914 } | 912 } |
915 | 913 |
916 } // namespace content | 914 } // namespace content |
OLD | NEW |