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

Unified Diff: cc/raster/one_copy_tile_task_worker_pool.cc

Issue 1148413007: cc: Use max_bytes_per_copy_operation setting to determine one-copy flush interval. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: int Created 5 years, 6 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
« no previous file with comments | « cc/raster/one_copy_tile_task_worker_pool.h ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/one_copy_tile_task_worker_pool.cc
diff --git a/cc/raster/one_copy_tile_task_worker_pool.cc b/cc/raster/one_copy_tile_task_worker_pool.cc
index ebc230142984f75f40592adb50af92664a4267f5..dd8937c483d2cb6b778c6dd03e6b674cbb0b64ec 100644
--- a/cc/raster/one_copy_tile_task_worker_pool.cc
+++ b/cc/raster/one_copy_tile_task_worker_pool.cc
@@ -99,9 +99,6 @@ class RasterBufferImpl : public RasterBuffer {
DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
};
-// Flush interval when performing copy operations.
-const int kCopyFlushPeriod = 4;
-
// Number of in-flight copy operations to allow.
const int kMaxCopyOperations = 32;
@@ -160,6 +157,7 @@ OneCopyTileTaskWorkerPool::OneCopyTileTaskWorkerPool(
last_flushed_copy_operation_(0),
lock_(),
copy_operation_count_cv_(&lock_),
+ bytes_scheduled_since_last_flush_(0),
issued_copy_operation_count_(0),
next_copy_operation_sequence_(1),
check_for_completed_copy_operations_pending_(false),
@@ -401,13 +399,19 @@ OneCopyTileTaskWorkerPool::PlaybackAndScheduleCopyOnWorkerThread(
// Acquire a sequence number for this copy operation.
sequence = next_copy_operation_sequence_++;
+ // Increment |bytes_scheduled_since_last_flush_| by the amount of memory
+ // used for this copy operation.
+ bytes_scheduled_since_last_flush_ += rows_to_copy * bytes_per_row;
+
// Post task that will advance last flushed copy operation to |sequence|
- // if we have reached the flush period.
- if ((sequence % kCopyFlushPeriod) == 0) {
+ // when |bytes_scheduled_since_last_flush_| has reached
+ // |max_bytes_per_copy_operation_|.
+ if (bytes_scheduled_since_last_flush_ >= max_bytes_per_copy_operation_) {
task_runner_->PostTask(
FROM_HERE,
base::Bind(&OneCopyTileTaskWorkerPool::AdvanceLastFlushedCopyTo,
weak_ptr_factory_.GetWeakPtr(), sequence));
+ bytes_scheduled_since_last_flush_ = 0;
}
}
« no previous file with comments | « cc/raster/one_copy_tile_task_worker_pool.h ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698