Chromium Code Reviews| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 if (cmd->HasSwitch(switches::kMaxUntiledLayerHeight)) { | 120 if (cmd->HasSwitch(switches::kMaxUntiledLayerHeight)) { |
| 121 GetSwitchValueAsInt(*cmd, switches::kMaxUntiledLayerHeight, 1, | 121 GetSwitchValueAsInt(*cmd, switches::kMaxUntiledLayerHeight, 1, |
| 122 std::numeric_limits<int>::max(), | 122 std::numeric_limits<int>::max(), |
| 123 &max_untiled_layer_height); | 123 &max_untiled_layer_height); |
| 124 } | 124 } |
| 125 | 125 |
| 126 settings.max_untiled_layer_size = gfx::Size(max_untiled_layer_width, | 126 settings.max_untiled_layer_size = gfx::Size(max_untiled_layer_width, |
| 127 max_untiled_layer_height); | 127 max_untiled_layer_height); |
| 128 | 128 |
| 129 settings.impl_side_painting = cc::switches::IsImplSidePaintingEnabled(); | 129 settings.impl_side_painting = cc::switches::IsImplSidePaintingEnabled(); |
| 130 settings.gpu_rasterization = | 130 if (cc::switches::IsGpuRasterizationEnabled() || |
| 131 cc::switches::IsGpuRasterizationEnabled() || | 131 cmd->HasSwitch(switches::kEnableBleedingEdgeRenderingFastPaths)) |
|
ernstm
2014/03/06 22:57:51
--enable-bleeding-edge-rendering-fast-paths should
| |
| 132 cmd->HasSwitch(switches::kEnableBleedingEdgeRenderingFastPaths); | 132 settings.rasterization_site = cc::LayerTreeSettings::GpuRasterization; |
| 133 else if (cc::switches::IsHybridRasterizationEnabled()) | |
| 134 settings.rasterization_site = cc::LayerTreeSettings::HybridRasterization; | |
| 135 else | |
| 136 settings.rasterization_site = cc::LayerTreeSettings::CpuRasterization; | |
| 133 | 137 |
| 134 settings.calculate_top_controls_position = | 138 settings.calculate_top_controls_position = |
| 135 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); | 139 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); |
| 136 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) { | 140 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) { |
| 137 std::string controls_height_str = | 141 std::string controls_height_str = |
| 138 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight); | 142 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight); |
| 139 double controls_height; | 143 double controls_height; |
| 140 if (base::StringToDouble(controls_height_str, &controls_height) && | 144 if (base::StringToDouble(controls_height_str, &controls_height) && |
| 141 controls_height > 0) | 145 controls_height > 0) |
| 142 settings.top_controls_height = controls_height; | 146 settings.top_controls_height = controls_height; |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 634 widget_->OnSwapBuffersAborted(); | 638 widget_->OnSwapBuffersAborted(); |
| 635 } | 639 } |
| 636 | 640 |
| 637 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 641 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 638 cc::ContextProvider* provider = | 642 cc::ContextProvider* provider = |
| 639 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 643 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 640 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 644 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 641 } | 645 } |
| 642 | 646 |
| 643 } // namespace content | 647 } // namespace content |
| OLD | NEW |