| OLD | NEW |
| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| 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.h" | 14 #include "cc/resources/resource.h" |
| 15 #include "cc/resources/resource_provider.h" | 15 #include "cc/resources/resource_provider.h" |
| 16 #include "cc/resources/tile_priority.h" | 16 #include "cc/resources/tile_priority.h" |
| 17 #include "cc/resources/worker_pool.h" | 17 #include "cc/resources/worker_pool.h" |
| 18 #include "third_party/khronos/GLES2/gl2.h" | 18 #include "third_party/khronos/GLES2/gl2.h" |
| 19 | 19 |
| 20 namespace skia { | 20 class SkPixelRef; |
| 21 class LazyPixelRef; | |
| 22 } | |
| 23 | 21 |
| 24 namespace cc { | 22 namespace cc { |
| 25 namespace internal { | 23 namespace internal { |
| 26 | 24 |
| 27 class CC_EXPORT RasterWorkerPoolTask | 25 class CC_EXPORT RasterWorkerPoolTask |
| 28 : public base::RefCounted<RasterWorkerPoolTask> { | 26 : public base::RefCounted<RasterWorkerPoolTask> { |
| 29 public: | 27 public: |
| 30 typedef std::vector<scoped_refptr<WorkerPoolTask> > TaskVector; | 28 typedef std::vector<scoped_refptr<WorkerPoolTask> > TaskVector; |
| 31 | 29 |
| 32 // Returns true if |buffer| was written to. False indicate that | 30 // Returns true if |buffer| was written to. False indicate that |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 RasterMode raster_mode, | 195 RasterMode raster_mode, |
| 198 TileResolution tile_resolution, | 196 TileResolution tile_resolution, |
| 199 int layer_id, | 197 int layer_id, |
| 200 const void* tile_id, | 198 const void* tile_id, |
| 201 int source_frame_number, | 199 int source_frame_number, |
| 202 RenderingStatsInstrumentation* rendering_stats, | 200 RenderingStatsInstrumentation* rendering_stats, |
| 203 const RasterTask::Reply& reply, | 201 const RasterTask::Reply& reply, |
| 204 Task::Set* dependencies); | 202 Task::Set* dependencies); |
| 205 | 203 |
| 206 static Task CreateImageDecodeTask( | 204 static Task CreateImageDecodeTask( |
| 207 skia::LazyPixelRef* pixel_ref, | 205 SkPixelRef* pixel_ref, |
| 208 int layer_id, | 206 int layer_id, |
| 209 RenderingStatsInstrumentation* stats_instrumentation, | 207 RenderingStatsInstrumentation* stats_instrumentation, |
| 210 const Task::Reply& reply); | 208 const Task::Reply& reply); |
| 211 | 209 |
| 212 protected: | 210 protected: |
| 213 typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector; | 211 typedef std::vector<scoped_refptr<internal::WorkerPoolTask> > TaskVector; |
| 214 typedef std::vector<scoped_refptr<internal::RasterWorkerPoolTask> > | 212 typedef std::vector<scoped_refptr<internal::RasterWorkerPoolTask> > |
| 215 RasterTaskVector; | 213 RasterTaskVector; |
| 216 typedef base::hash_set<internal::RasterWorkerPoolTask*> RasterTaskSet; | 214 typedef base::hash_set<internal::RasterWorkerPoolTask*> RasterTaskSet; |
| 217 typedef internal::RasterWorkerPoolTask* TaskMapKey; | 215 typedef internal::RasterWorkerPoolTask* TaskMapKey; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 271 |
| 274 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; | 272 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; |
| 275 scoped_refptr<internal::WorkerPoolTask> | 273 scoped_refptr<internal::WorkerPoolTask> |
| 276 raster_required_for_activation_finished_task_; | 274 raster_required_for_activation_finished_task_; |
| 277 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; | 275 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; |
| 278 }; | 276 }; |
| 279 | 277 |
| 280 } // namespace cc | 278 } // namespace cc |
| 281 | 279 |
| 282 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ | 280 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ |
| OLD | NEW |