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 "cc/resources/rasterizer.h" | 8 #include "cc/resources/rasterizer.h" |
| 9 #include "ui/gfx/geometry/size.h" |
9 | 10 |
10 namespace base { | 11 namespace base { |
11 class SequencedTaskRunner; | 12 class SequencedTaskRunner; |
12 } | 13 } |
13 | 14 |
14 namespace cc { | 15 namespace cc { |
15 | 16 |
16 class CC_EXPORT RasterWorkerPool { | 17 class CC_EXPORT RasterWorkerPool { |
17 public: | 18 public: |
18 static unsigned kOnDemandRasterTaskPriority; | 19 static unsigned kOnDemandRasterTaskPriority; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 size_t dependencies); | 55 size_t dependencies); |
55 | 56 |
56 // Utility function that can be used to build a task graph. Inserts nodes that | 57 // Utility function that can be used to build a task graph. Inserts nodes that |
57 // represent |task| and all its image decode dependencies in |graph|. | 58 // represent |task| and all its image decode dependencies in |graph|. |
58 static void InsertNodesForRasterTask( | 59 static void InsertNodesForRasterTask( |
59 TaskGraph* graph, | 60 TaskGraph* graph, |
60 RasterTask* task, | 61 RasterTask* task, |
61 const ImageDecodeTask::Vector& decode_tasks, | 62 const ImageDecodeTask::Vector& decode_tasks, |
62 unsigned priority); | 63 unsigned priority); |
63 | 64 |
| 65 // Utility functions that transparently create a temporary bitmap and copy |
| 66 // pixels to buffer when necessary. |
| 67 static void AcquireBitmapForBuffer(SkBitmap* bitmap, |
| 68 uint8_t* buffer, |
| 69 ResourceFormat format, |
| 70 const gfx::Size& size, |
| 71 int stride); |
| 72 static void ReleaseBitmapForBuffer(SkBitmap* bitmap, |
| 73 uint8_t* buffer, |
| 74 ResourceFormat format); |
| 75 |
64 // Type-checking downcast routine. | 76 // Type-checking downcast routine. |
65 virtual Rasterizer* AsRasterizer() = 0; | 77 virtual Rasterizer* AsRasterizer() = 0; |
66 }; | 78 }; |
67 | 79 |
68 } // namespace cc | 80 } // namespace cc |
69 | 81 |
70 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ | 82 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ |
OLD | NEW |