| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RASTERIZER_H_ | 5 #ifndef CC_RESOURCES_RASTERIZER_H_ |
| 6 #define CC_RESOURCES_RASTERIZER_H_ | 6 #define CC_RESOURCES_RASTERIZER_H_ |
| 7 | 7 |
| 8 #include <bitset> | 8 #include <bitset> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 RasterTask(const Resource* resource, ImageDecodeTask::Vector* dependencies); | 82 RasterTask(const Resource* resource, ImageDecodeTask::Vector* dependencies); |
| 83 ~RasterTask() override; | 83 ~RasterTask() override; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 const Resource* resource_; | 86 const Resource* resource_; |
| 87 ImageDecodeTask::Vector dependencies_; | 87 ImageDecodeTask::Vector dependencies_; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 static const size_t kNumberOfTaskSets = 2; | 90 // kNumberOfTaskSets must be greater or equal to the number of values in |
| 91 // TileManager::NamedTaskSet. |
| 92 // TODO(reveman): Use template specialization to make it easy for client code to |
| 93 // check at compile time that the number of supported task sets is correct. |
| 94 static const size_t kNumberOfTaskSets = 3; |
| 91 typedef size_t TaskSet; | 95 typedef size_t TaskSet; |
| 92 typedef std::bitset<kNumberOfTaskSets> TaskSetCollection; | 96 typedef std::bitset<kNumberOfTaskSets> TaskSetCollection; |
| 93 | 97 |
| 94 class CC_EXPORT RasterizerClient { | 98 class CC_EXPORT RasterizerClient { |
| 95 public: | 99 public: |
| 96 virtual void DidFinishRunningTasks(TaskSet task_set) = 0; | 100 virtual void DidFinishRunningTasks(TaskSet task_set) = 0; |
| 97 virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const = 0; | 101 virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const = 0; |
| 98 | 102 |
| 99 protected: | 103 protected: |
| 100 virtual ~RasterizerClient() {} | 104 virtual ~RasterizerClient() {} |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // Check for completed tasks and dispatch reply callbacks. | 159 // Check for completed tasks and dispatch reply callbacks. |
| 156 virtual void CheckForCompletedTasks() = 0; | 160 virtual void CheckForCompletedTasks() = 0; |
| 157 | 161 |
| 158 protected: | 162 protected: |
| 159 virtual ~Rasterizer() {} | 163 virtual ~Rasterizer() {} |
| 160 }; | 164 }; |
| 161 | 165 |
| 162 } // namespace cc | 166 } // namespace cc |
| 163 | 167 |
| 164 #endif // CC_RESOURCES_RASTERIZER_H_ | 168 #endif // CC_RESOURCES_RASTERIZER_H_ |
| OLD | NEW |