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 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 const int kMinSlowDownScaleFactor = 0; | 342 const int kMinSlowDownScaleFactor = 0; |
343 const int kMaxSlowDownScaleFactor = INT_MAX; | 343 const int kMaxSlowDownScaleFactor = INT_MAX; |
344 GetSwitchValueAsInt( | 344 GetSwitchValueAsInt( |
345 *cmd, | 345 *cmd, |
346 cc::switches::kSlowDownRasterScaleFactor, | 346 cc::switches::kSlowDownRasterScaleFactor, |
347 kMinSlowDownScaleFactor, | 347 kMinSlowDownScaleFactor, |
348 kMaxSlowDownScaleFactor, | 348 kMaxSlowDownScaleFactor, |
349 &settings.initial_debug_state.slow_down_raster_scale_factor); | 349 &settings.initial_debug_state.slow_down_raster_scale_factor); |
350 } | 350 } |
351 | 351 |
352 if (cmd->HasSwitch(cc::switches::kMaxTilesForInterestArea)) { | |
353 int max_tiles_for_interest_area; | |
354 if (GetSwitchValueAsInt(*cmd, | |
355 cc::switches::kMaxTilesForInterestArea, | |
356 1, std::numeric_limits<int>::max(), | |
357 &max_tiles_for_interest_area)) | |
358 settings.max_tiles_for_interest_area = max_tiles_for_interest_area; | |
359 } | |
360 | |
361 if (cmd->HasSwitch(cc::switches::kMaxUnusedResourceMemoryUsagePercentage)) { | 352 if (cmd->HasSwitch(cc::switches::kMaxUnusedResourceMemoryUsagePercentage)) { |
362 int max_unused_resource_memory_percentage; | 353 int max_unused_resource_memory_percentage; |
363 if (GetSwitchValueAsInt( | 354 if (GetSwitchValueAsInt( |
364 *cmd, | 355 *cmd, |
365 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, | 356 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, |
366 0, 100, | 357 0, 100, |
367 &max_unused_resource_memory_percentage)) { | 358 &max_unused_resource_memory_percentage)) { |
368 settings.max_unused_resource_memory_percentage = | 359 settings.max_unused_resource_memory_percentage = |
369 max_unused_resource_memory_percentage; | 360 max_unused_resource_memory_percentage; |
370 } | 361 } |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 cc::ContextProvider* provider = | 958 cc::ContextProvider* provider = |
968 compositor_deps_->GetSharedMainThreadContextProvider(); | 959 compositor_deps_->GetSharedMainThreadContextProvider(); |
969 // provider can be NULL after the GPU process crashed enough times and we | 960 // provider can be NULL after the GPU process crashed enough times and we |
970 // don't want to restart it any more (falling back to software). | 961 // don't want to restart it any more (falling back to software). |
971 if (!provider) | 962 if (!provider) |
972 return; | 963 return; |
973 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 964 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
974 } | 965 } |
975 | 966 |
976 } // namespace content | 967 } // namespace content |
OLD | NEW |