Chromium Code Reviews| 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; | 14 class SkCanvas; |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 class ImageDecodeTask; | 17 class ImageDecodeTask; |
| 18 class RasterTask; | 18 class RasterTask; |
| 19 class Resource; | 19 class Resource; |
| 20 class ResourceProvider; | |
| 21 | |
| 22 class RasterCanvas { | |
|
reveman
2014/08/11 11:46:20
I think this interface deserves it's own file.
auygun
2014/08/11 15:45:43
Done.
| |
| 23 public: | |
| 24 virtual ~RasterCanvas(); | |
|
reveman
2014/08/11 11:46:21
can this be protected?
auygun
2014/08/11 15:45:43
Done.
| |
| 25 | |
| 26 SkCanvas* GetSkCanvas() { return locked_canvas_; } | |
|
reveman
2014/08/11 11:46:21
Can we make this interface completely abstract? On
auygun
2014/08/11 15:45:43
Done.
| |
| 27 virtual void Flush() = 0; | |
| 28 | |
| 29 protected: | |
| 30 RasterCanvas(); | |
| 31 | |
| 32 SkCanvas* locked_canvas_; | |
| 33 }; | |
| 20 | 34 |
| 21 class CC_EXPORT RasterizerTaskClient { | 35 class CC_EXPORT RasterizerTaskClient { |
| 22 public: | 36 public: |
| 23 virtual SkCanvas* AcquireCanvasForRaster(RasterTask* task) = 0; | 37 virtual RasterCanvas* AcquireCanvasForRaster(RasterTask* task) = 0; |
| 24 virtual void ReleaseCanvasForRaster(RasterTask* task) = 0; | 38 virtual void ReleaseCanvasForRaster(RasterTask* task) = 0; |
| 25 | 39 |
| 26 protected: | 40 protected: |
| 27 virtual ~RasterizerTaskClient() {} | 41 virtual ~RasterizerTaskClient() {} |
| 28 }; | 42 }; |
| 29 | 43 |
| 30 class CC_EXPORT RasterizerTask : public Task { | 44 class CC_EXPORT RasterizerTask : public Task { |
| 31 public: | 45 public: |
| 32 typedef std::vector<scoped_refptr<RasterizerTask> > Vector; | 46 typedef std::vector<scoped_refptr<RasterizerTask> > Vector; |
| 33 | 47 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 // Check for completed tasks and dispatch reply callbacks. | 170 // Check for completed tasks and dispatch reply callbacks. |
| 157 virtual void CheckForCompletedTasks() = 0; | 171 virtual void CheckForCompletedTasks() = 0; |
| 158 | 172 |
| 159 protected: | 173 protected: |
| 160 virtual ~Rasterizer() {} | 174 virtual ~Rasterizer() {} |
| 161 }; | 175 }; |
| 162 | 176 |
| 163 } // namespace cc | 177 } // namespace cc |
| 164 | 178 |
| 165 #endif // CC_RESOURCES_RASTERIZER_H_ | 179 #endif // CC_RESOURCES_RASTERIZER_H_ |
| OLD | NEW |