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_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ | 5 #ifndef CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ |
6 #define CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ | 6 #define CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... |
29 static scoped_refptr<DisplayListRasterSource> | 29 static scoped_refptr<DisplayListRasterSource> |
30 CreateFromDisplayListRecordingSource(const DisplayListRecordingSource* other, | 30 CreateFromDisplayListRecordingSource(const DisplayListRecordingSource* other, |
31 bool can_use_lcd_text); | 31 bool can_use_lcd_text); |
32 | 32 |
33 // Raster a subrect of this RasterSource into the given canvas. It is | 33 // Raster a subrect of this RasterSource into the given canvas. It is |
34 // assumed that contents_scale has already been applied to this canvas. | 34 // assumed that contents_scale has already been applied to this canvas. |
35 // Writes the total number of pixels rasterized and the time spent | 35 // Writes the total number of pixels rasterized and the time spent |
36 // rasterizing to the stats if the respective pointer is not nullptr. | 36 // rasterizing to the stats if the respective pointer is not nullptr. |
37 // It is assumed that the canvas passed here will only be rasterized by | 37 // It is assumed that the canvas passed here will only be rasterized by |
38 // this raster source via this call. | 38 // this raster source via this call. |
39 // virtual for testing. | 39 // |
| 40 // Virtual for testing. |
| 41 // |
| 42 // Note that this should only be called after the image decode controller has |
| 43 // been set, which happens during commit. |
40 virtual void PlaybackToCanvas(SkCanvas* canvas, | 44 virtual void PlaybackToCanvas(SkCanvas* canvas, |
41 const gfx::Rect& canvas_bitmap_rect, | 45 const gfx::Rect& canvas_bitmap_rect, |
42 const gfx::Rect& canvas_playback_rect, | 46 const gfx::Rect& canvas_playback_rect, |
43 float contents_scale) const; | 47 float contents_scale) const; |
44 | 48 |
45 // Similar to above, except that the canvas passed here can (or was already) | 49 // Similar to above, except that the canvas passed here can (or was already) |
46 // rasterized into by another raster source. That is, it is not safe to clear | 50 // rasterized into by another raster source. That is, it is not safe to clear |
47 // the canvas or discard its underlying memory. | 51 // the canvas or discard its underlying memory. |
48 void PlaybackToSharedCanvas(SkCanvas* canvas, | 52 void PlaybackToSharedCanvas(SkCanvas* canvas, |
49 const gfx::Rect& canvas_rect, | 53 const gfx::Rect& canvas_rect, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 const gfx::Rect& canvas_bitmap_rect, | 158 const gfx::Rect& canvas_bitmap_rect, |
155 const gfx::Rect& canvas_playback_rect, | 159 const gfx::Rect& canvas_playback_rect, |
156 float contents_scale) const; | 160 float contents_scale) const; |
157 | 161 |
158 DISALLOW_COPY_AND_ASSIGN(DisplayListRasterSource); | 162 DISALLOW_COPY_AND_ASSIGN(DisplayListRasterSource); |
159 }; | 163 }; |
160 | 164 |
161 } // namespace cc | 165 } // namespace cc |
162 | 166 |
163 #endif // CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ | 167 #endif // CC_PLAYBACK_DISPLAY_LIST_RASTER_SOURCE_H_ |
OLD | NEW |