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

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: Use a single switch with string values 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::IsGpuRasterizationEnabled())
Vangelis Kokkevis 2014/03/05 19:52:08 Should we also check if impl-side-painting is enab
ajuma 2014/03/05 20:37:03 Good idea. I've added this check to IsGpuRasteriza
131 settings.rasterization_site = cc::LayerTreeSettings::GpuRasterization;
132 else if (cc::switches::IsHybridRasterizationEnabled())
133 settings.rasterization_site = cc::LayerTreeSettings::HybridRasterization;
134 else
135 settings.rasterization_site = cc::LayerTreeSettings::CpuRasterization;
131 136
132 settings.calculate_top_controls_position = 137 settings.calculate_top_controls_position =
133 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); 138 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation);
134 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) { 139 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) {
135 std::string controls_height_str = 140 std::string controls_height_str =
136 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight); 141 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight);
137 double controls_height; 142 double controls_height;
138 if (base::StringToDouble(controls_height_str, &controls_height) && 143 if (base::StringToDouble(controls_height_str, &controls_height) &&
139 controls_height > 0) 144 controls_height > 0)
140 settings.top_controls_height = controls_height; 145 settings.top_controls_height = controls_height;
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 widget_->OnSwapBuffersAborted(); 637 widget_->OnSwapBuffersAborted();
633 } 638 }
634 639
635 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { 640 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() {
636 cc::ContextProvider* provider = 641 cc::ContextProvider* provider =
637 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 642 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
638 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 643 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
639 } 644 }
640 645
641 } // namespace content 646 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/test/gpu/gpu_tests/gpu_rasterization.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698