| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 widget_->OnSwapBuffersAborted(); | 627 widget_->OnSwapBuffersAborted(); |
| 638 } | 628 } |
| 639 | 629 |
| 640 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 630 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 641 cc::ContextProvider* provider = | 631 cc::ContextProvider* provider = |
| 642 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 632 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 643 provider->Context3d()->rateLimitOffscreenContextCHROMIUM(); | 633 provider->Context3d()->rateLimitOffscreenContextCHROMIUM(); |
| 644 } | 634 } |
| 645 | 635 |
| 646 } // namespace content | 636 } // namespace content |
| OLD | NEW |