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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 const int kMinSlowDownScaleFactor = 0; | 211 const int kMinSlowDownScaleFactor = 0; |
212 const int kMaxSlowDownScaleFactor = INT_MAX; | 212 const int kMaxSlowDownScaleFactor = INT_MAX; |
213 GetSwitchValueAsInt( | 213 GetSwitchValueAsInt( |
214 *cmd, | 214 *cmd, |
215 cc::switches::kSlowDownRasterScaleFactor, | 215 cc::switches::kSlowDownRasterScaleFactor, |
216 kMinSlowDownScaleFactor, | 216 kMinSlowDownScaleFactor, |
217 kMaxSlowDownScaleFactor, | 217 kMaxSlowDownScaleFactor, |
218 &settings.initial_debug_state.slow_down_raster_scale_factor); | 218 &settings.initial_debug_state.slow_down_raster_scale_factor); |
219 } | 219 } |
220 | 220 |
221 if (cmd->HasSwitch(cc::switches::kNumRasterThreads)) { | |
222 const int kMinRasterThreads = 1; | |
223 const int kMaxRasterThreads = 64; | |
224 int num_raster_threads; | |
225 if (GetSwitchValueAsInt(*cmd, cc::switches::kNumRasterThreads, | |
226 kMinRasterThreads, kMaxRasterThreads, | |
227 &num_raster_threads)) | |
228 settings.num_raster_threads = num_raster_threads; | |
229 } | |
230 | |
231 if (cmd->HasSwitch(cc::switches::kMaxTilesForInterestArea)) { | 221 if (cmd->HasSwitch(cc::switches::kMaxTilesForInterestArea)) { |
232 int max_tiles_for_interest_area; | 222 int max_tiles_for_interest_area; |
233 if (GetSwitchValueAsInt(*cmd, | 223 if (GetSwitchValueAsInt(*cmd, |
234 cc::switches::kMaxTilesForInterestArea, | 224 cc::switches::kMaxTilesForInterestArea, |
235 1, std::numeric_limits<int>::max(), | 225 1, std::numeric_limits<int>::max(), |
236 &max_tiles_for_interest_area)) | 226 &max_tiles_for_interest_area)) |
237 settings.max_tiles_for_interest_area = max_tiles_for_interest_area; | 227 settings.max_tiles_for_interest_area = max_tiles_for_interest_area; |
238 } | 228 } |
239 | 229 |
240 if (cmd->HasSwitch(cc::switches::kMaxUnusedResourceMemoryUsagePercentage)) { | 230 if (cmd->HasSwitch(cc::switches::kMaxUnusedResourceMemoryUsagePercentage)) { |
(...skipping 396 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->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 633 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
644 } | 634 } |
645 | 635 |
646 } // namespace content | 636 } // namespace content |
OLD | NEW |