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); |
278 if (cmd->HasSwitch(cc::switches::kTopControlsShowThreshold)) { | 280 if (cmd->HasSwitch(cc::switches::kTopControlsShowThreshold)) { |
279 std::string top_threshold_str = | 281 std::string top_threshold_str = |
280 cmd->GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold); | 282 cmd->GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold); |
281 double show_threshold; | 283 double show_threshold; |
282 if (base::StringToDouble(top_threshold_str, &show_threshold) && | 284 if (base::StringToDouble(top_threshold_str, &show_threshold) && |
283 show_threshold >= 0.f && show_threshold <= 1.f) | 285 show_threshold >= 0.f && show_threshold <= 1.f) |
284 settings.top_controls_show_threshold = show_threshold; | 286 settings.top_controls_show_threshold = show_threshold; |
285 } | 287 } |
286 | 288 |
287 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { | 289 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 cc::ContextProvider* provider = | 911 cc::ContextProvider* provider = |
910 compositor_deps_->GetSharedMainThreadContextProvider(); | 912 compositor_deps_->GetSharedMainThreadContextProvider(); |
911 // provider can be NULL after the GPU process crashed enough times and we | 913 // provider can be NULL after the GPU process crashed enough times and we |
912 // don't want to restart it any more (falling back to software). | 914 // don't want to restart it any more (falling back to software). |
913 if (!provider) | 915 if (!provider) |
914 return; | 916 return; |
915 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 917 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
916 } | 918 } |
917 | 919 |
918 } // namespace content | 920 } // namespace content |
OLD | NEW |