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