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

Unified Diff: cc/resources/pixel_buffer_raster_worker_pool.cc

Issue 22900018: cc: Set the mapped memory reclaim limit for the renderer compositor on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: cc/resources/pixel_buffer_raster_worker_pool.cc
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc
index b0e74c1eb2d2805c7534089489c0a5970e2e9fdd..d1379fc37a359cb5f934596c7833779ac0677ca9 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.cc
+++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
@@ -94,35 +94,18 @@ bool WasCanceled(const internal::RasterWorkerPoolTask* task) {
PixelBufferRasterWorkerPool::PixelBufferRasterWorkerPool(
ResourceProvider* resource_provider,
- size_t num_threads)
+ size_t num_threads,
+ size_t max_bytes_pending_upload)
: RasterWorkerPool(resource_provider, num_threads),
shutdown_(false),
scheduled_raster_task_count_(0),
bytes_pending_upload_(0),
+ max_bytes_pending_upload_(max_bytes_pending_upload),
has_performed_uploads_since_last_flush_(false),
check_for_completed_raster_tasks_pending_(false),
should_notify_client_if_no_tasks_are_pending_(false),
should_notify_client_if_no_tasks_required_for_activation_are_pending_(
false) {
-// If we raster too fast we become upload bound, and pending
-// uploads consume memory. For maximum upload throughput, we would
-// want to allow for upload_throughput * pipeline_time of pending
-// uploads, after which we are just wasting memory. Since we don't
-// know our upload throughput yet, this just caps our memory usage.
-#if defined(OS_ANDROID)
- size_t divider = 1;
- if (base::android::SysUtils::IsLowEndDevice())
- divider = 3;
-
- // For reference Nexus10 can upload 1MB in about 2.5ms.
- const size_t kMaxBytesUploadedPerMs = (2 * 1024 * 1024) / (5 * divider);
-#else
- // For reference Chromebook Pixel can upload 1MB in about 0.5ms.
- const size_t kMaxBytesUploadedPerMs = 1024 * 1024 * 2;
-#endif
-
- // Assuming a two frame deep pipeline.
- max_bytes_pending_upload_ = 16 * 2 * kMaxBytesUploadedPerMs;
}
PixelBufferRasterWorkerPool::~PixelBufferRasterWorkerPool() {

Powered by Google App Engine
This is Rietveld 408576698