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

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

Issue 176403002: Revert of cc: Cleanup internal::WorkerPoolTaskClient interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/pixel_buffer_raster_worker_pool.cc ('k') | cc/resources/raster_worker_pool.cc » ('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 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
11 #include "cc/debug/rendering_stats_instrumentation.h" 11 #include "cc/debug/rendering_stats_instrumentation.h"
12 #include "cc/resources/picture_pile_impl.h" 12 #include "cc/resources/picture_pile_impl.h"
13 #include "cc/resources/raster_mode.h" 13 #include "cc/resources/raster_mode.h"
14 #include "cc/resources/resource_format.h" 14 #include "cc/resources/resource_format.h"
15 #include "cc/resources/task_graph_runner.h" 15 #include "cc/resources/task_graph_runner.h"
16 #include "cc/resources/tile_priority.h" 16 #include "cc/resources/tile_priority.h"
17 17
18 class SkPixelRef; 18 class SkPixelRef;
19 19
20 namespace cc { 20 namespace cc {
21 21
22 class ContextProvider; 22 class ContextProvider;
23 class Resource; 23 class Resource;
24 class ResourceProvider; 24 class ResourceProvider;
25 25
26 namespace internal { 26 namespace internal {
27 27
28 class WorkerPoolTask; 28 class WorkerPoolTask;
29 class RasterWorkerPoolTask;
29 30
30 class CC_EXPORT WorkerPoolTaskClient { 31 class CC_EXPORT WorkerPoolTaskClient {
31 public: 32 public:
32 virtual SkCanvas* AcquireCanvasForRaster(WorkerPoolTask* task, 33 virtual SkCanvas* AcquireCanvasForRaster(RasterWorkerPoolTask* task) = 0;
33 const Resource* resource) = 0; 34 virtual void OnRasterCompleted(RasterWorkerPoolTask* task,
34 virtual void ReleaseCanvasForRaster(WorkerPoolTask* task, 35 const PicturePileImpl::Analysis& analysis) = 0;
35 const Resource* resource) = 0; 36 virtual void OnImageDecodeCompleted(WorkerPoolTask* task) = 0;
36 37
37 protected: 38 protected:
38 virtual ~WorkerPoolTaskClient() {} 39 virtual ~WorkerPoolTaskClient() {}
39 }; 40 };
40 41
41 class CC_EXPORT WorkerPoolTask : public Task { 42 class CC_EXPORT WorkerPoolTask : public Task {
42 public: 43 public:
43 typedef std::vector<scoped_refptr<WorkerPoolTask> > Vector; 44 typedef std::vector<scoped_refptr<WorkerPoolTask> > Vector;
44 45
45 virtual void ScheduleOnOriginThread(WorkerPoolTaskClient* client) = 0; 46 virtual void ScheduleOnOriginThread(WorkerPoolTaskClient* client) = 0;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 virtual void DidFinishRunningTasksRequiredForActivation() = 0; 90 virtual void DidFinishRunningTasksRequiredForActivation() = 0;
90 91
91 protected: 92 protected:
92 virtual ~RasterWorkerPoolClient() {} 93 virtual ~RasterWorkerPoolClient() {}
93 }; 94 };
94 95
95 struct CC_EXPORT RasterTaskQueue { 96 struct CC_EXPORT RasterTaskQueue {
96 struct CC_EXPORT Item { 97 struct CC_EXPORT Item {
97 class TaskComparator { 98 class TaskComparator {
98 public: 99 public:
99 explicit TaskComparator(const internal::WorkerPoolTask* task) 100 explicit TaskComparator(const internal::RasterWorkerPoolTask* task)
100 : task_(task) {} 101 : task_(task) {}
101 102
102 bool operator()(const Item& item) const { return item.task == task_; } 103 bool operator()(const Item& item) const { return item.task == task_; }
103 104
104 private: 105 private:
105 const internal::WorkerPoolTask* task_; 106 const internal::RasterWorkerPoolTask* task_;
106 }; 107 };
107 108
108 typedef std::vector<Item> Vector; 109 typedef std::vector<Item> Vector;
109 110
110 Item(internal::RasterWorkerPoolTask* task, bool required_for_activation); 111 Item(internal::RasterWorkerPoolTask* task, bool required_for_activation);
111 ~Item(); 112 ~Item();
112 113
113 static bool IsRequiredForActivation(const Item& item) { 114 static bool IsRequiredForActivation(const Item& item) {
114 return item.required_for_activation; 115 return item.required_for_activation;
115 } 116 }
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 253
253 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; 254 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_;
254 scoped_refptr<internal::WorkerPoolTask> 255 scoped_refptr<internal::WorkerPoolTask>
255 raster_required_for_activation_finished_task_; 256 raster_required_for_activation_finished_task_;
256 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; 257 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_;
257 }; 258 };
258 259
259 } // namespace cc 260 } // namespace cc
260 261
261 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ 262 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_
OLDNEW
« no previous file with comments | « cc/resources/pixel_buffer_raster_worker_pool.cc ('k') | cc/resources/raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698