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

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

Issue 122063002: cc: Remove racy initialization code in cc/base/switches.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix dynamic linking problem by adding dynamic_annotations dependency to compositor_bindings Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « cc/base/switches.cc ('k') | webkit/renderer/compositor_bindings/compositor_bindings.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #if defined(OS_ANDROID) 10 #if defined(OS_ANDROID)
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if (cmd->HasSwitch(switches::kMaxUntiledLayerHeight)) { 123 if (cmd->HasSwitch(switches::kMaxUntiledLayerHeight)) {
124 GetSwitchValueAsInt(*cmd, switches::kMaxUntiledLayerHeight, 1, 124 GetSwitchValueAsInt(*cmd, switches::kMaxUntiledLayerHeight, 1,
125 std::numeric_limits<int>::max(), 125 std::numeric_limits<int>::max(),
126 &max_untiled_layer_height); 126 &max_untiled_layer_height);
127 } 127 }
128 128
129 settings.max_untiled_layer_size = gfx::Size(max_untiled_layer_width, 129 settings.max_untiled_layer_size = gfx::Size(max_untiled_layer_width,
130 max_untiled_layer_height); 130 max_untiled_layer_height);
131 131
132 settings.impl_side_painting = cc::switches::IsImplSidePaintingEnabled(); 132 settings.impl_side_painting = cc::switches::IsImplSidePaintingEnabled();
133 settings.gpu_rasterization = cc::switches::IsGPURasterizationEnabled(); 133 settings.gpu_rasterization =
134 cmd->HasSwitch(cc::switches::kEnableGPURasterization);
134 135
135 settings.calculate_top_controls_position = 136 settings.calculate_top_controls_position =
136 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); 137 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation);
137 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) { 138 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) {
138 std::string controls_height_str = 139 std::string controls_height_str =
139 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight); 140 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight);
140 double controls_height; 141 double controls_height;
141 if (base::StringToDouble(controls_height_str, &controls_height) && 142 if (base::StringToDouble(controls_height_str, &controls_height) &&
142 controls_height > 0) 143 controls_height > 0)
143 settings.top_controls_height = controls_height; 144 settings.top_controls_height = controls_height;
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 widget_->OnSwapBuffersAborted(); 637 widget_->OnSwapBuffersAborted();
637 } 638 }
638 639
639 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { 640 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() {
640 cc::ContextProvider* provider = 641 cc::ContextProvider* provider =
641 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 642 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
642 provider->Context3d()->rateLimitOffscreenContextCHROMIUM(); 643 provider->Context3d()->rateLimitOffscreenContextCHROMIUM();
643 } 644 }
644 645
645 } // namespace content 646 } // namespace content
OLDNEW
« no previous file with comments | « cc/base/switches.cc ('k') | webkit/renderer/compositor_bindings/compositor_bindings.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698