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

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

Issue 73923003: Shared Raster Worker Threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Number of raster threads API comments 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
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 const int kMinSlowDownScaleFactor = 0; 209 const int kMinSlowDownScaleFactor = 0;
210 const int kMaxSlowDownScaleFactor = INT_MAX; 210 const int kMaxSlowDownScaleFactor = INT_MAX;
211 GetSwitchValueAsInt( 211 GetSwitchValueAsInt(
212 *cmd, 212 *cmd,
213 cc::switches::kSlowDownRasterScaleFactor, 213 cc::switches::kSlowDownRasterScaleFactor,
214 kMinSlowDownScaleFactor, 214 kMinSlowDownScaleFactor,
215 kMaxSlowDownScaleFactor, 215 kMaxSlowDownScaleFactor,
216 &settings.initial_debug_state.slow_down_raster_scale_factor); 216 &settings.initial_debug_state.slow_down_raster_scale_factor);
217 } 217 }
218 218
219 if (cmd->HasSwitch(cc::switches::kNumRasterThreads)) {
220 const int kMinRasterThreads = 1;
221 const int kMaxRasterThreads = 64;
222 int num_raster_threads;
223 if (GetSwitchValueAsInt(*cmd, cc::switches::kNumRasterThreads,
224 kMinRasterThreads, kMaxRasterThreads,
225 &num_raster_threads))
226 settings.num_raster_threads = num_raster_threads;
227 }
228
229 if (cmd->HasSwitch(cc::switches::kMaxTilesForInterestArea)) { 219 if (cmd->HasSwitch(cc::switches::kMaxTilesForInterestArea)) {
230 int max_tiles_for_interest_area; 220 int max_tiles_for_interest_area;
231 if (GetSwitchValueAsInt(*cmd, 221 if (GetSwitchValueAsInt(*cmd,
232 cc::switches::kMaxTilesForInterestArea, 222 cc::switches::kMaxTilesForInterestArea,
233 1, std::numeric_limits<int>::max(), 223 1, std::numeric_limits<int>::max(),
234 &max_tiles_for_interest_area)) 224 &max_tiles_for_interest_area))
235 settings.max_tiles_for_interest_area = max_tiles_for_interest_area; 225 settings.max_tiles_for_interest_area = max_tiles_for_interest_area;
236 } 226 }
237 227
238 if (cmd->HasSwitch(cc::switches::kMaxUnusedResourceMemoryUsagePercentage)) { 228 if (cmd->HasSwitch(cc::switches::kMaxUnusedResourceMemoryUsagePercentage)) {
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 widget_->OnSwapBuffersAborted(); 626 widget_->OnSwapBuffersAborted();
637 } 627 }
638 628
639 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { 629 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() {
640 cc::ContextProvider* provider = 630 cc::ContextProvider* provider =
641 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 631 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
642 provider->Context3d()->rateLimitOffscreenContextCHROMIUM(); 632 provider->Context3d()->rateLimitOffscreenContextCHROMIUM();
643 } 633 }
644 634
645 } // namespace content 635 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698