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

Side by Side Diff: cc/resources/pixel_buffer_raster_worker_pool.cc

Issue 454843002: cc: Do bitmap conversion for RasterBuffer in the worker thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/resources/pixel_buffer_raster_worker_pool.h" 5 #include "cc/resources/pixel_buffer_raster_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/containers/stack_container.h" 9 #include "base/containers/stack_container.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 DCHECK_EQ(RasterTaskState::COMPLETED, state_it->type); 254 DCHECK_EQ(RasterTaskState::COMPLETED, state_it->type);
255 255
256 std::swap(*state_it, raster_task_states_.back()); 256 std::swap(*state_it, raster_task_states_.back());
257 raster_task_states_.pop_back(); 257 raster_task_states_.pop_back();
258 258
259 task->RunReplyOnOriginThread(); 259 task->RunReplyOnOriginThread();
260 } 260 }
261 completed_raster_tasks_.clear(); 261 completed_raster_tasks_.clear();
262 } 262 }
263 263
264 SkCanvas* PixelBufferRasterWorkerPool::AcquireCanvasForRaster( 264 RasterCanvas* PixelBufferRasterWorkerPool::AcquireCanvasForRaster(
265 RasterTask* task) { 265 RasterTask* task) {
266 DCHECK(std::find_if(raster_task_states_.begin(), 266 DCHECK(std::find_if(raster_task_states_.begin(),
267 raster_task_states_.end(), 267 raster_task_states_.end(),
268 RasterTaskState::TaskComparator(task)) != 268 RasterTaskState::TaskComparator(task)) !=
269 raster_task_states_.end()); 269 raster_task_states_.end());
270 resource_provider_->AcquirePixelRasterBuffer(task->resource()->id()); 270 resource_provider_->AcquirePixelRasterBuffer(task->resource()->id());
271 return resource_provider_->MapPixelRasterBuffer(task->resource()->id()); 271 return resource_provider_->MapPixelRasterBuffer(task->resource()->id());
272 } 272 }
273 273
274 void PixelBufferRasterWorkerPool::ReleaseCanvasForRaster(RasterTask* task) { 274 void PixelBufferRasterWorkerPool::ReleaseCanvasForRaster(RasterTask* task) {
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto( 752 void PixelBufferRasterWorkerPool::ThrottleStateAsValueInto(
753 base::debug::TracedValue* throttle_state) const { 753 base::debug::TracedValue* throttle_state) const {
754 throttle_state->SetInteger("bytes_available_for_upload", 754 throttle_state->SetInteger("bytes_available_for_upload",
755 max_bytes_pending_upload_ - bytes_pending_upload_); 755 max_bytes_pending_upload_ - bytes_pending_upload_);
756 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); 756 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_);
757 throttle_state->SetInteger("scheduled_raster_task_count", 757 throttle_state->SetInteger("scheduled_raster_task_count",
758 scheduled_raster_task_count_); 758 scheduled_raster_task_count_);
759 } 759 }
760 760
761 } // namespace cc 761 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698