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

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

Issue 181063022: cc: Trigger GPU rasterization based on a per-layer hint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = cc::switches::IsGpuRasterizationEnabled(); 130 if (cc::switches::IsUniversalGpuRasterizationEnabled()) {
131 settings.gpu_rasterization_state =
132 cc::LayerTreeSettings::UniversalGpuRasterization;
133 } else if (cc::switches::IsHybridGpuRasterizationEnabled()) {
134 settings.gpu_rasterization_state =
135 cc::LayerTreeSettings::HybridGpuRasterization;
136 }
131 137
132 settings.calculate_top_controls_position = 138 settings.calculate_top_controls_position =
133 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); 139 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation);
134 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) { 140 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) {
135 std::string controls_height_str = 141 std::string controls_height_str =
136 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight); 142 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight);
137 double controls_height; 143 double controls_height;
138 if (base::StringToDouble(controls_height_str, &controls_height) && 144 if (base::StringToDouble(controls_height_str, &controls_height) &&
139 controls_height > 0) 145 controls_height > 0)
140 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
632 widget_->OnSwapBuffersAborted(); 638 widget_->OnSwapBuffersAborted();
633 } 639 }
634 640
635 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { 641 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() {
636 cc::ContextProvider* provider = 642 cc::ContextProvider* provider =
637 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 643 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
638 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 644 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
639 } 645 }
640 646
641 } // namespace content 647 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698