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

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: Fixed Android build break. 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
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/raster/tile_task_worker_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2d2524b25adc16ae7ed12d70b1f4ceddbbd14abd 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<size_t>(
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<size_t>(
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<size_t>(
raster_task->resource()->size(), raster_task->resource()->format());
raster_tasks_with_pending_upload_.push_back(raster_task);
state.type = RasterTaskState::UPLOADING;
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/raster/tile_task_worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698