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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 if (cmd->HasSwitch(switches::kMaxUntiledLayerHeight)) { | 124 if (cmd->HasSwitch(switches::kMaxUntiledLayerHeight)) { |
125 GetSwitchValueAsInt(*cmd, switches::kMaxUntiledLayerHeight, 1, | 125 GetSwitchValueAsInt(*cmd, switches::kMaxUntiledLayerHeight, 1, |
126 std::numeric_limits<int>::max(), | 126 std::numeric_limits<int>::max(), |
127 &max_untiled_layer_height); | 127 &max_untiled_layer_height); |
128 } | 128 } |
129 | 129 |
130 settings.max_untiled_layer_size = gfx::Size(max_untiled_layer_width, | 130 settings.max_untiled_layer_size = gfx::Size(max_untiled_layer_width, |
131 max_untiled_layer_height); | 131 max_untiled_layer_height); |
132 | 132 |
133 settings.impl_side_painting = cc::switches::IsImplSidePaintingEnabled(); | 133 settings.impl_side_painting = cc::switches::IsImplSidePaintingEnabled(); |
134 settings.gpu_rasterization = | 134 settings.gpu_rasterization = cc::switches::IsGpuRasterizationEnabled(); |
135 cmd->HasSwitch(cc::switches::kEnableGPURasterization); | |
136 | 135 |
137 settings.calculate_top_controls_position = | 136 settings.calculate_top_controls_position = |
138 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); | 137 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); |
139 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) { | 138 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) { |
140 std::string controls_height_str = | 139 std::string controls_height_str = |
141 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight); | 140 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight); |
142 double controls_height; | 141 double controls_height; |
143 if (base::StringToDouble(controls_height_str, &controls_height) && | 142 if (base::StringToDouble(controls_height_str, &controls_height) && |
144 controls_height > 0) | 143 controls_height > 0) |
145 settings.top_controls_height = controls_height; | 144 settings.top_controls_height = controls_height; |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 widget_->OnSwapBuffersAborted(); | 636 widget_->OnSwapBuffersAborted(); |
638 } | 637 } |
639 | 638 |
640 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 639 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
641 cc::ContextProvider* provider = | 640 cc::ContextProvider* provider = |
642 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 641 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
643 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 642 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
644 } | 643 } |
645 | 644 |
646 } // namespace content | 645 } // namespace content |
OLD | NEW |