| 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_RASTER_TILE_TASK_WORKER_POOL_H_ | 5 #ifndef CC_RASTER_TILE_TASK_WORKER_POOL_H_ |
| 6 #define CC_RASTER_TILE_TASK_WORKER_POOL_H_ | 6 #define CC_RASTER_TILE_TASK_WORKER_POOL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "cc/raster/tile_task_runner.h" | 10 #include "cc/raster/tile_task_runner.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class SequencedTaskRunner; | 15 class SequencedTaskRunner; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace cc { | 18 namespace cc { |
| 19 class DisplayListRasterSource; | 19 class DisplayListRasterSource; |
| 20 class RenderingStatsInstrumentation; | 20 class RenderingStatsInstrumentation; |
| 21 | 21 |
| 22 class CC_EXPORT TileTaskWorkerPool { | 22 class CC_EXPORT TileTaskWorkerPool { |
| 23 public: | 23 public: |
| 24 TileTaskWorkerPool(); | 24 TileTaskWorkerPool(); |
| 25 virtual ~TileTaskWorkerPool(); | 25 virtual ~TileTaskWorkerPool(); |
| 26 | 26 |
| 27 // Utility function that can be used to call ::ScheduleOnOriginThread() for | 27 // Utility function that can be used to call ::ScheduleOnOriginThread() for |
| 28 // each task in |graph|. | 28 // each task in |graph|. |
| 29 static void ScheduleTasksOnOriginThread(TileTaskClient* client, | 29 static void ScheduleTasksOnOriginThread(DependencyTaskClient* client, |
| 30 TaskGraph* graph); | 30 TaskGraph* graph); |
| 31 | 31 |
| 32 // Utility function that will create a temporary bitmap and copy pixels to | 32 // Utility function that will create a temporary bitmap and copy pixels to |
| 33 // |memory| when necessary. The |canvas_bitmap_rect| is the rect of the bitmap | 33 // |memory| when necessary. The |canvas_bitmap_rect| is the rect of the bitmap |
| 34 // being played back in the pixel space of the source, ie a rect in the source | 34 // being played back in the pixel space of the source, ie a rect in the source |
| 35 // that will cover the resulting |memory|. The |canvas_playback_rect| can be a | 35 // that will cover the resulting |memory|. The |canvas_playback_rect| can be a |
| 36 // smaller contained rect inside the |canvas_bitmap_rect| if the |memory| is | 36 // smaller contained rect inside the |canvas_bitmap_rect| if the |memory| is |
| 37 // already partially complete, and only the subrect needs to be played back. | 37 // already partially complete, and only the subrect needs to be played back. |
| 38 static void PlaybackToMemory(void* memory, | 38 static void PlaybackToMemory(void* memory, |
| 39 ResourceFormat format, | 39 ResourceFormat format, |
| 40 const gfx::Size& size, | 40 const gfx::Size& size, |
| 41 size_t stride, | 41 size_t stride, |
| 42 const DisplayListRasterSource* raster_source, | 42 const DisplayListRasterSource* raster_source, |
| 43 const gfx::Rect& canvas_bitmap_rect, | 43 const gfx::Rect& canvas_bitmap_rect, |
| 44 const gfx::Rect& canvas_playback_rect, | 44 const gfx::Rect& canvas_playback_rect, |
| 45 float scale, | 45 float scale, |
| 46 bool include_images); | 46 bool include_images); |
| 47 | 47 |
| 48 // Type-checking downcast routine. | 48 // Type-checking downcast routine. |
| 49 virtual TileTaskRunner* AsTileTaskRunner() = 0; | 49 virtual TileTaskRunner* AsTileTaskRunner() = 0; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace cc | 52 } // namespace cc |
| 53 | 53 |
| 54 #endif // CC_RASTER_TILE_TASK_WORKER_POOL_H_ | 54 #endif // CC_RASTER_TILE_TASK_WORKER_POOL_H_ |
| OLD | NEW |