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

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: Created 5 years, 7 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/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 f4db3993fd723d0f04c1f613ae564cb71f1721d1..ee513a117f43b4207699699c557f7699033d93f7 100644
--- a/cc/raster/one_copy_tile_task_worker_pool.cc
+++ b/cc/raster/one_copy_tile_task_worker_pool.cc
@@ -74,9 +74,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;
@@ -135,6 +132,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),
@@ -354,13 +352,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;
vmpstr 2015/06/01 18:35:52 So for big tiles (that are split up into several c
reveman 2015/06/04 01:19:51 Yup, that's the behavior we want.
+
// 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_) {
vmpstr 2015/06/02 23:23:27 I think you need to DCHECK that max_bytes_per_copy
reveman 2015/06/04 01:19:51 A flush here is not required for correct behavior.
task_runner_->PostTask(
FROM_HERE,
base::Bind(&OneCopyTileTaskWorkerPool::AdvanceLastFlushedCopyTo,
weak_ptr_factory_.GetWeakPtr(), sequence));
+ bytes_scheduled_since_last_flush_ = 0;
}
}

Powered by Google App Engine
This is Rietveld 408576698