| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 size_t dependencies); | 64 size_t dependencies); |
| 64 | 65 |
| 65 // Utility function that can be used to build a task graph. Inserts nodes that | 66 // Utility function that can be used to build a task graph. Inserts nodes that |
| 66 // represent |task| and all its image decode dependencies in |graph|. | 67 // represent |task| and all its image decode dependencies in |graph|. |
| 67 static void InsertNodesForRasterTask( | 68 static void InsertNodesForRasterTask( |
| 68 TaskGraph* graph, | 69 TaskGraph* graph, |
| 69 RasterTask* task, | 70 RasterTask* task, |
| 70 const ImageDecodeTask::Vector& decode_tasks, | 71 const ImageDecodeTask::Vector& decode_tasks, |
| 71 unsigned priority); | 72 unsigned priority); |
| 72 | 73 |
| 74 // Utility functions that transparently create a temporary bitmap and copy |
| 75 // pixels to buffer when necessary. |
| 76 static void AcquireBitmapForBuffer(SkBitmap* bitmap, |
| 77 uint8_t* buffer, |
| 78 ResourceFormat format, |
| 79 const gfx::Size& size, |
| 80 int stride); |
| 81 static void ReleaseBitmapForBuffer(SkBitmap* bitmap, |
| 82 uint8_t* buffer, |
| 83 ResourceFormat format); |
| 84 |
| 73 // Type-checking downcast routine. | 85 // Type-checking downcast routine. |
| 74 virtual Rasterizer* AsRasterizer() = 0; | 86 virtual Rasterizer* AsRasterizer() = 0; |
| 75 }; | 87 }; |
| 76 | 88 |
| 77 } // namespace cc | 89 } // namespace cc |
| 78 | 90 |
| 79 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ | 91 #endif // CC_RESOURCES_RASTER_WORKER_POOL_H_ |
| OLD | NEW |