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

Side by Side Diff: cc/resources/raster_worker_pool.h

Issue 157293002: cc: Refactor WorkerPoolTaskClient::AcquireBufferForRaster (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: implement acquire/release/map/unmap 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
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 #ifndef CC_RESOURCES_RASTER_WORKER_POOL_H_ 5 #ifndef CC_RESOURCES_RASTER_WORKER_POOL_H_
6 #define CC_RESOURCES_RASTER_WORKER_POOL_H_ 6 #define CC_RESOURCES_RASTER_WORKER_POOL_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 13 matching lines...) Expand all
24 class Resource; 24 class Resource;
25 class ResourceProvider; 25 class ResourceProvider;
26 26
27 namespace internal { 27 namespace internal {
28 28
29 class WorkerPoolTask; 29 class WorkerPoolTask;
30 class RasterWorkerPoolTask; 30 class RasterWorkerPoolTask;
31 31
32 class CC_EXPORT WorkerPoolTaskClient { 32 class CC_EXPORT WorkerPoolTaskClient {
33 public: 33 public:
34 virtual void* AcquireBufferForRaster(RasterWorkerPoolTask* task, 34 virtual SkCanvas* AcquireCanvasForRaster(RasterWorkerPoolTask* task) = 0;
reveman 2014/02/11 02:00:44 I'd like to see this take a basic WorkerPoolTask*
alokp 2014/02/11 07:05:21 Sure. This can be easily done when you decide to a
35 int* stride) = 0;
36 virtual void OnRasterCompleted(RasterWorkerPoolTask* task, 35 virtual void OnRasterCompleted(RasterWorkerPoolTask* task,
37 const PicturePileImpl::Analysis& analysis) = 0; 36 const PicturePileImpl::Analysis& analysis) = 0;
38 virtual void OnImageDecodeCompleted(WorkerPoolTask* task) = 0; 37 virtual void OnImageDecodeCompleted(WorkerPoolTask* task) = 0;
39 38
40 protected: 39 protected:
41 virtual ~WorkerPoolTaskClient() {} 40 virtual ~WorkerPoolTaskClient() {}
42 }; 41 };
43 42
44 class CC_EXPORT WorkerPoolTask : public Task { 43 class CC_EXPORT WorkerPoolTask : public Task {
45 public: 44 public:
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 RenderingStatsInstrumentation* rendering_stats, 210 RenderingStatsInstrumentation* rendering_stats,
212 const RasterTask::Reply& reply, 211 const RasterTask::Reply& reply,
213 Task::Set* dependencies); 212 Task::Set* dependencies);
214 213
215 static Task CreateImageDecodeTask( 214 static Task CreateImageDecodeTask(
216 SkPixelRef* pixel_ref, 215 SkPixelRef* pixel_ref,
217 int layer_id, 216 int layer_id,
218 RenderingStatsInstrumentation* rendering_stats, 217 RenderingStatsInstrumentation* rendering_stats,
219 const Task::Reply& reply); 218 const Task::Reply& reply);
220 219
220 // Overridden from internal::WorkerPoolTaskClient:
221 virtual SkCanvas* AcquireCanvasForRaster(internal::RasterWorkerPoolTask* task)
222 OVERRIDE;
223 virtual void OnRasterCompleted(internal::RasterWorkerPoolTask* task,
224 const PicturePileImpl::Analysis& analysis)
225 OVERRIDE;
226
221 void SetClient(RasterWorkerPoolClient* client); 227 void SetClient(RasterWorkerPoolClient* client);
222 228
223 // Tells the worker pool to shutdown after canceling all previously 229 // Tells the worker pool to shutdown after canceling all previously
224 // scheduled tasks. Reply callbacks are still guaranteed to run. 230 // scheduled tasks. Reply callbacks are still guaranteed to run.
225 virtual void Shutdown(); 231 virtual void Shutdown();
226 232
227 // Schedule running of raster tasks in |queue| and all dependencies. 233 // Schedule running of raster tasks in |queue| and all dependencies.
228 // Previously scheduled tasks that are no longer needed to run 234 // Previously scheduled tasks that are no longer needed to run
229 // raster tasks in |queue| will be canceled unless already running. 235 // raster tasks in |queue| will be canceled unless already running.
230 // Once scheduled, reply callbacks are guaranteed to run for all tasks 236 // Once scheduled, reply callbacks are guaranteed to run for all tasks
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 323
318 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; 324 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_;
319 scoped_refptr<internal::WorkerPoolTask> 325 scoped_refptr<internal::WorkerPoolTask>
320 raster_required_for_activation_finished_task_; 326 raster_required_for_activation_finished_task_;
321 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; 327 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_;
322 }; 328 };
323 329
324 } // namespace cc 330 } // namespace cc
325 331
326 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ 332 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698