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

Unified 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: Code refactoring. 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 side-by-side diff with in-line comments
Download patch
Index: cc/resources/pixel_buffer_raster_worker_pool.cc
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc
index f98779ccda77966f69fe3c19b6132deab8a8acec..b5faecebb4c61a7714ef33b201490f52910285ea 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.cc
+++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
@@ -267,8 +267,7 @@ RasterBuffer* PixelBufferRasterWorkerPool::AcquireBufferForRaster(
raster_task_states_.end(),
RasterTaskState::TaskComparator(task)) !=
raster_task_states_.end());
- resource_provider_->AcquirePixelRasterBuffer(task->resource()->id());
- return resource_provider_->MapPixelRasterBuffer(task->resource()->id());
+ return resource_provider_->AcquirePixelRasterBuffer(task->resource()->id());
}
void PixelBufferRasterWorkerPool::ReleaseBufferForRaster(RasterTask* task) {
@@ -683,14 +682,10 @@ void PixelBufferRasterWorkerPool::CheckForCompletedRasterizerTasks() {
RasterTaskState& state = *state_it;
DCHECK_EQ(RasterTaskState::SCHEDULED, state.type);
- // Balanced with MapPixelRasterBuffer() call in AcquireBufferForRaster().
- bool content_has_changed = resource_provider_->UnmapPixelRasterBuffer(
- raster_task->resource()->id());
-
// |content_has_changed| can be false as result of task being canceled or
// task implementation deciding not to modify bitmap (ie. analysis of raster
// commands detected content as a solid color).
- if (!content_has_changed) {
+ if (!raster_task->content_has_changed()) {
reveman 2014/08/13 19:19:49 Let's keep things simple and remove all this condi
auygun 2014/08/14 10:35:42 Unittests assume that BeginSetPixels always upload
reveman 2014/08/14 12:26:36 Can we instead fix the unit tests and have PixelBu
auygun 2014/08/15 09:20:40 Done.
raster_task->WillComplete();
raster_task->CompleteOnOriginThread(this);
raster_task->DidComplete();

Powered by Google App Engine
This is Rietveld 408576698