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