Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 961023002: (Reland) Always create top controls manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed calculate_top_controls_position flag from Android flags Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 cc::ContextProvider* provider = 909 cc::ContextProvider* provider =
912 compositor_deps_->GetSharedMainThreadContextProvider(); 910 compositor_deps_->GetSharedMainThreadContextProvider();
913 // provider can be NULL after the GPU process crashed enough times and we 911 // provider can be NULL after the GPU process crashed enough times and we
914 // don't want to restart it any more (falling back to software). 912 // don't want to restart it any more (falling back to software).
915 if (!provider) 913 if (!provider)
916 return; 914 return;
917 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 915 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
918 } 916 }
919 917
920 } // namespace content 918 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698