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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "cc/resources/resource_format.h" | 11 #include "cc/resources/resource_format.h" |
12 #include "cc/resources/task_graph_runner.h" | 12 #include "cc/resources/task_graph_runner.h" |
13 | 13 |
14 class SkCanvas; | |
15 | |
16 namespace cc { | 14 namespace cc { |
17 class ImageDecodeTask; | 15 class ImageDecodeTask; |
18 class RasterTask; | 16 class RasterTask; |
19 class Resource; | 17 class Resource; |
20 class RasterBuffer; | 18 class RasterBuffer; |
21 | 19 |
22 class CC_EXPORT RasterizerTaskClient { | 20 class CC_EXPORT RasterizerTaskClient { |
23 public: | 21 public: |
24 virtual RasterBuffer* AcquireBufferForRaster(RasterTask* task) = 0; | 22 virtual RasterBuffer* AcquireBufferForRaster(RasterTask* task) = 0; |
25 virtual void ReleaseBufferForRaster(RasterTask* task) = 0; | 23 virtual void ReleaseBufferForRaster(RasterTask* task) = 0; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 | 68 |
71 class CC_EXPORT RasterTask : public RasterizerTask { | 69 class CC_EXPORT RasterTask : public RasterizerTask { |
72 public: | 70 public: |
73 typedef std::vector<scoped_refptr<RasterTask> > Vector; | 71 typedef std::vector<scoped_refptr<RasterTask> > Vector; |
74 | 72 |
75 // Overridden from RasterizerTask: | 73 // Overridden from RasterizerTask: |
76 virtual RasterTask* AsRasterTask() OVERRIDE; | 74 virtual RasterTask* AsRasterTask() OVERRIDE; |
77 | 75 |
78 const Resource* resource() const { return resource_; } | 76 const Resource* resource() const { return resource_; } |
79 const ImageDecodeTask::Vector& dependencies() const { return dependencies_; } | 77 const ImageDecodeTask::Vector& dependencies() const { return dependencies_; } |
78 bool content_has_changed() const { return content_has_changed_; } | |
reveman
2014/08/13 19:19:49
I don't think we need to add this. See my other co
auygun
2014/08/14 10:35:42
Done.
| |
80 | 79 |
81 protected: | 80 protected: |
82 RasterTask(const Resource* resource, ImageDecodeTask::Vector* dependencies); | 81 RasterTask(const Resource* resource, ImageDecodeTask::Vector* dependencies); |
83 virtual ~RasterTask(); | 82 virtual ~RasterTask(); |
84 | 83 |
84 void set_content_has_changed(bool content_has_changed); | |
85 | |
85 private: | 86 private: |
86 const Resource* resource_; | 87 const Resource* resource_; |
87 ImageDecodeTask::Vector dependencies_; | 88 ImageDecodeTask::Vector dependencies_; |
89 bool content_has_changed_; | |
88 }; | 90 }; |
89 | 91 |
90 class CC_EXPORT RasterizerClient { | 92 class CC_EXPORT RasterizerClient { |
91 public: | 93 public: |
92 virtual bool ShouldForceTasksRequiredForActivationToComplete() const = 0; | 94 virtual bool ShouldForceTasksRequiredForActivationToComplete() const = 0; |
93 virtual void DidFinishRunningTasks() = 0; | 95 virtual void DidFinishRunningTasks() = 0; |
94 virtual void DidFinishRunningTasksRequiredForActivation() = 0; | 96 virtual void DidFinishRunningTasksRequiredForActivation() = 0; |
95 | 97 |
96 protected: | 98 protected: |
97 virtual ~RasterizerClient() {} | 99 virtual ~RasterizerClient() {} |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 // Check for completed tasks and dispatch reply callbacks. | 159 // Check for completed tasks and dispatch reply callbacks. |
158 virtual void CheckForCompletedTasks() = 0; | 160 virtual void CheckForCompletedTasks() = 0; |
159 | 161 |
160 protected: | 162 protected: |
161 virtual ~Rasterizer() {} | 163 virtual ~Rasterizer() {} |
162 }; | 164 }; |
163 | 165 |
164 } // namespace cc | 166 } // namespace cc |
165 | 167 |
166 #endif // CC_RESOURCES_RASTERIZER_H_ | 168 #endif // CC_RESOURCES_RASTERIZER_H_ |
OLD | NEW |