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

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

Issue 170783007: Re-land: cc: Cleanup internal::WorkerPoolTaskClient interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad DCHECK Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/direct_raster_worker_pool.h ('k') | cc/resources/image_raster_worker_pool.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/direct_raster_worker_pool.h" 5 #include "cc/resources/direct_raster_worker_pool.h"
6 6
7 #include "cc/output/context_provider.h" 7 #include "cc/output/context_provider.h"
8 #include "cc/resources/resource.h" 8 #include "cc/resources/resource.h"
9 #include "cc/resources/resource_provider.h" 9 #include "cc/resources/resource_provider.h"
10 #include "gpu/command_buffer/client/gles2_interface.h" 10 #include "gpu/command_buffer/client/gles2_interface.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 it != completed_tasks_.end(); 97 it != completed_tasks_.end();
98 ++it) { 98 ++it) {
99 internal::WorkerPoolTask* task = it->get(); 99 internal::WorkerPoolTask* task = it->get();
100 100
101 task->RunReplyOnOriginThread(); 101 task->RunReplyOnOriginThread();
102 } 102 }
103 completed_tasks_.clear(); 103 completed_tasks_.clear();
104 } 104 }
105 105
106 SkCanvas* DirectRasterWorkerPool::AcquireCanvasForRaster( 106 SkCanvas* DirectRasterWorkerPool::AcquireCanvasForRaster(
107 internal::RasterWorkerPoolTask* task) { 107 internal::WorkerPoolTask* task,
108 return resource_provider()->MapDirectRasterBuffer(task->resource()->id()); 108 const Resource* resource) {
109 return resource_provider()->MapDirectRasterBuffer(resource->id());
109 } 110 }
110 111
111 void DirectRasterWorkerPool::OnRasterCompleted( 112 void DirectRasterWorkerPool::ReleaseCanvasForRaster(
112 internal::RasterWorkerPoolTask* task, 113 internal::WorkerPoolTask* task,
113 const PicturePileImpl::Analysis& analysis) { 114 const Resource* resource) {
114 resource_provider()->UnmapDirectRasterBuffer(task->resource()->id()); 115 resource_provider()->UnmapDirectRasterBuffer(resource->id());
115 } 116 }
116 117
117 void DirectRasterWorkerPool::OnRasterTasksFinished() { 118 void DirectRasterWorkerPool::OnRasterTasksFinished() {
118 DCHECK(raster_tasks_pending_); 119 DCHECK(raster_tasks_pending_);
119 raster_tasks_pending_ = false; 120 raster_tasks_pending_ = false;
120 client()->DidFinishRunningTasks(); 121 client()->DidFinishRunningTasks();
121 } 122 }
122 123
123 void DirectRasterWorkerPool::OnRasterTasksRequiredForActivationFinished() { 124 void DirectRasterWorkerPool::OnRasterTasksRequiredForActivationFinished() {
124 DCHECK(raster_tasks_required_for_activation_pending_); 125 DCHECK(raster_tasks_required_for_activation_pending_);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // TODO(alokp): Implement TestContextProvider::GrContext(). 178 // TODO(alokp): Implement TestContextProvider::GrContext().
178 if (gr_context) 179 if (gr_context)
179 gr_context->flush(); 180 gr_context->flush();
180 } 181 }
181 182
182 RunTaskOnOriginThread(raster_required_for_activation_finished_task()); 183 RunTaskOnOriginThread(raster_required_for_activation_finished_task());
183 RunTaskOnOriginThread(raster_finished_task()); 184 RunTaskOnOriginThread(raster_finished_task());
184 } 185 }
185 186
186 } // namespace cc 187 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/direct_raster_worker_pool.h ('k') | cc/resources/image_raster_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698