| 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/resource_provider.h" | 13 #include "cc/resources/resource_provider.h" |
| 14 #include "cc/resources/tile_priority.h" | 14 #include "cc/resources/tile_data.h" |
| 15 #include "cc/resources/worker_pool.h" | 15 #include "cc/resources/worker_pool.h" |
| 16 | 16 |
| 17 class SkDevice; | 17 class SkDevice; |
| 18 | 18 |
| 19 namespace skia { | 19 namespace skia { |
| 20 class LazyPixelRef; | 20 class LazyPixelRef; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace cc { | 23 namespace cc { |
| 24 class PicturePileImpl; | 24 class PicturePileImpl; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 template <> struct hash<cc::internal::RasterWorkerPoolTask*> { | 69 template <> struct hash<cc::internal::RasterWorkerPoolTask*> { |
| 70 size_t operator()(cc::internal::RasterWorkerPoolTask* ptr) const { | 70 size_t operator()(cc::internal::RasterWorkerPoolTask* ptr) const { |
| 71 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 71 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
| 72 } | 72 } |
| 73 }; | 73 }; |
| 74 } // namespace BASE_HASH_NAMESPACE | 74 } // namespace BASE_HASH_NAMESPACE |
| 75 #endif // COMPILER | 75 #endif // COMPILER |
| 76 | 76 |
| 77 namespace cc { | 77 namespace cc { |
| 78 | 78 |
| 79 // Low quality implies no lcd test; | |
| 80 // high quality implies lcd text. | |
| 81 // Note that the order of these matters, from "better" to "worse" in terms of | |
| 82 // quality. | |
| 83 // TODO(vmpstr): Find a better place for this. | |
| 84 enum RasterMode { | |
| 85 HIGH_QUALITY_RASTER_MODE = 0, | |
| 86 HIGH_QUALITY_NO_LCD_RASTER_MODE = 1, | |
| 87 LOW_QUALITY_RASTER_MODE = 2, | |
| 88 NUM_RASTER_MODES = 3 | |
| 89 }; | |
| 90 | |
| 91 // Data that is passed to raster tasks. | |
| 92 // TODO(vmpstr): Find a better place for this. | |
| 93 struct RasterTaskMetadata { | |
| 94 scoped_ptr<base::Value> AsValue() const; | |
| 95 bool is_tile_in_pending_tree_now_bin; | |
| 96 TileResolution tile_resolution; | |
| 97 int layer_id; | |
| 98 const void* tile_id; | |
| 99 int source_frame_number; | |
| 100 }; | |
| 101 | |
| 102 class CC_EXPORT RasterWorkerPoolClient { | 79 class CC_EXPORT RasterWorkerPoolClient { |
| 103 public: | 80 public: |
| 104 virtual bool ShouldForceTasksRequiredForActivationToComplete() const = 0; | 81 virtual bool ShouldForceTasksRequiredForActivationToComplete() const = 0; |
| 105 | 82 |
| 106 protected: | 83 protected: |
| 107 virtual ~RasterWorkerPoolClient() {} | 84 virtual ~RasterWorkerPoolClient() {} |
| 108 }; | 85 }; |
| 109 | 86 |
| 110 // A worker thread pool that runs raster tasks. | 87 // A worker thread pool that runs raster tasks. |
| 111 class CC_EXPORT RasterWorkerPool : public WorkerPool { | 88 class CC_EXPORT RasterWorkerPool : public WorkerPool { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 RasterTask::Queue::TaskSet raster_tasks_required_for_activation_; | 249 RasterTask::Queue::TaskSet raster_tasks_required_for_activation_; |
| 273 | 250 |
| 274 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; | 251 base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_; |
| 275 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; | 252 scoped_refptr<internal::WorkerPoolTask> raster_finished_task_; |
| 276 int64 schedule_raster_tasks_count_; | 253 int64 schedule_raster_tasks_count_; |
| 277 }; | 254 }; |
| 278 | 255 |
| 279 } // namespace cc | 256 } // namespace cc |
| 280 | 257 |
| 281 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ | 258 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ |
| OLD | NEW |