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

Unified Diff: cc/raster/pixel_buffer_tile_task_worker_pool.cc

Issue 1202843008: cc: Fix BytesPerPixel issue and refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected comments. Created 5 years, 5 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/pixel_buffer_tile_task_worker_pool.cc
diff --git a/cc/raster/pixel_buffer_tile_task_worker_pool.cc b/cc/raster/pixel_buffer_tile_task_worker_pool.cc
index df79519485d8d3ee1b1301e24b699c235467c81b..08601b70c38d48e6bd0095f89520bf75889d2d45 100644
--- a/cc/raster/pixel_buffer_tile_task_worker_pool.cc
+++ b/cc/raster/pixel_buffer_tile_task_worker_pool.cc
@@ -436,9 +436,9 @@ void PixelBufferTileTaskWorkerPool::CheckForCompletedUploads() {
DCHECK(state_it != raster_task_states_.end());
RasterTaskState& state = *state_it;
- // We can use UncheckedMemorySizeBytes here, since these tasks come from
- // tiles, the size of which is controlled by the compositor.
- bytes_pending_upload_ -= Resource::UncheckedMemorySizeBytes(
+ // We can use UncheckedSizeInBytes here, since these tasks come from tiles,
+ // the size of which is controlled by the compositor.
+ bytes_pending_upload_ -= ResourceUtil::UncheckedSizeInBytes(
task->resource()->size(), task->resource()->format());
task->WillComplete();
@@ -545,9 +545,9 @@ void PixelBufferTileTaskWorkerPool::ScheduleMoreTasks() {
// but if it's the only task allow it to complete no matter what its size,
// to prevent starvation of the task queue.
size_t new_bytes_pending_upload = bytes_pending_upload;
- // We can use UncheckedMemorySizeBytes here, since these tasks come from
- // tiles, the size of which is controlled by the compositor.
- new_bytes_pending_upload += Resource::UncheckedMemorySizeBytes(
+ // We can use UncheckedSizeInBytes here, since these tasks come from tiles,
+ // the size of which is controlled by the compositor.
+ new_bytes_pending_upload += ResourceUtil::UncheckedSizeInBytes(
task->resource()->size(), task->resource()->format());
if (new_bytes_pending_upload > max_bytes_pending_upload_ &&
bytes_pending_upload) {
@@ -712,9 +712,9 @@ void PixelBufferTileTaskWorkerPool::CheckForCompletedRasterizerTasks() {
resource_provider_->BeginSetPixels(raster_task->resource()->id());
has_performed_uploads_since_last_flush_ = true;
- // We can use UncheckedMemorySizeBytes here, since these tasks come from
- // tiles, the size of which is controlled by the compositor.
- bytes_pending_upload_ += Resource::UncheckedMemorySizeBytes(
+ // We can use UncheckedSizeInBytes here, since these tasks come from tiles,
+ // the size of which is controlled by the compositor.
+ bytes_pending_upload_ += ResourceUtil::UncheckedSizeInBytes(
raster_task->resource()->size(), raster_task->resource()->format());
raster_tasks_with_pending_upload_.push_back(raster_task);
state.type = RasterTaskState::UPLOADING;

Powered by Google App Engine
This is Rietveld 408576698