| 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/tile_priority.h" | 14 #include "cc/resources/tile_priority.h" |
| 15 #include "cc/resources/worker_pool.h" | 15 #include "cc/resources/worker_pool.h" |
| 16 #include "third_party/khronos/GLES2/gl2.h" | 16 #include "third_party/khronos/GLES2/gl2.h" |
| 17 | 17 // TODO(robertphillips): change this to "class SkBaseDevice;" |
| 18 class SkDevice; | 18 #include "third_party/skia/include/core/SkDevice.h" |
| 19 | 19 |
| 20 namespace skia { | 20 namespace skia { |
| 21 class LazyPixelRef; | 21 class LazyPixelRef; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace cc { | 24 namespace cc { |
| 25 class PicturePileImpl; | 25 class PicturePileImpl; |
| 26 class PixelBufferRasterWorkerPool; | 26 class PixelBufferRasterWorkerPool; |
| 27 class Resource; | 27 class Resource; |
| 28 class ResourceProvider; | 28 class ResourceProvider; |
| 29 | 29 |
| 30 namespace internal { | 30 namespace internal { |
| 31 | 31 |
| 32 class CC_EXPORT RasterWorkerPoolTask | 32 class CC_EXPORT RasterWorkerPoolTask |
| 33 : public base::RefCounted<RasterWorkerPoolTask> { | 33 : public base::RefCounted<RasterWorkerPoolTask> { |
| 34 public: | 34 public: |
| 35 typedef std::vector<scoped_refptr<WorkerPoolTask> > TaskVector; | 35 typedef std::vector<scoped_refptr<WorkerPoolTask> > TaskVector; |
| 36 | 36 |
| 37 // Returns true if |device| was written to. False indicate that | 37 // Returns true if |device| was written to. False indicate that |
| 38 // the content of |device| is undefined and the resource doesn't | 38 // the content of |device| is undefined and the resource doesn't |
| 39 // need to be initialized. | 39 // need to be initialized. |
| 40 virtual bool RunOnWorkerThread(SkDevice* device, unsigned thread_index) = 0; | 40 virtual bool RunOnWorkerThread(SkBaseDevice* device, |
| 41 unsigned thread_index) = 0; |
| 41 virtual void CompleteOnOriginThread() = 0; | 42 virtual void CompleteOnOriginThread() = 0; |
| 42 | 43 |
| 43 void DidRun(bool was_canceled); | 44 void DidRun(bool was_canceled); |
| 44 bool HasFinishedRunning() const; | 45 bool HasFinishedRunning() const; |
| 45 bool WasCanceled() const; | 46 bool WasCanceled() const; |
| 46 void WillComplete(); | 47 void WillComplete(); |
| 47 void DidComplete(); | 48 void DidComplete(); |
| 48 bool HasCompleted() const; | 49 bool HasCompleted() const; |
| 49 | 50 |
| 50 const Resource* resource() const { return resource_; } | 51 const Resource* resource() const { return resource_; } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 274 |
| 274 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; | 275 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; |
| 275 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; | 276 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; |
| 276 scoped_refptr<internal::WorkerPoolTask> | 277 scoped_refptr<internal::WorkerPoolTask> |
| 277 raster_required_for_activation_finished_task_; | 278 raster_required_for_activation_finished_task_; |
| 278 }; | 279 }; |
| 279 | 280 |
| 280 } // namespace cc | 281 } // namespace cc |
| 281 | 282 |
| 282 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ | 283 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ |
| OLD | NEW |