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_RASTER_SOURCE_H_ | 5 #ifndef CC_PLAYBACK_RASTER_SOURCE_H_ |
6 #define CC_PLAYBACK_RASTER_SOURCE_H_ | 6 #define CC_PLAYBACK_RASTER_SOURCE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace cc { | 25 namespace cc { |
26 class DisplayItemList; | 26 class DisplayItemList; |
27 class DrawImage; | 27 class DrawImage; |
28 class ImageDecodeCache; | 28 class ImageDecodeCache; |
29 | 29 |
30 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { | 30 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { |
31 public: | 31 public: |
32 struct CC_EXPORT PlaybackSettings { | 32 struct CC_EXPORT PlaybackSettings { |
33 PlaybackSettings(); | 33 PlaybackSettings(); |
| 34 PlaybackSettings(const PlaybackSettings&); |
| 35 PlaybackSettings(PlaybackSettings&&); |
| 36 ~PlaybackSettings(); |
34 | 37 |
35 // If set to true, this indicates that the canvas has already been | 38 // If set to true, this indicates that the canvas has already been |
36 // rasterized into. This means that the canvas cannot be cleared safely. | 39 // rasterized into. This means that the canvas cannot be cleared safely. |
37 bool playback_to_shared_canvas; | 40 bool playback_to_shared_canvas; |
38 | 41 |
39 // If set to true, none of the images will be rasterized. | 42 // If set to true, none of the images will be rasterized. |
40 bool skip_images; | 43 bool skip_images; |
41 | 44 |
42 // If set to true, we will use an image hijack canvas, which enables | 45 // If set to true, we will use an image hijack canvas, which enables |
43 // compositor image caching. | 46 // compositor image caching. |
44 bool use_image_hijack_canvas; | 47 bool use_image_hijack_canvas; |
| 48 |
| 49 // If non-empty, an image hijack canvas will be used to skip these images |
| 50 // during raster. |
| 51 // TODO(khushalsagar): Consolidate more settings for playback here? See |
| 52 // crbug.com/691076. |
| 53 ImageIdFlatSet images_to_skip; |
45 }; | 54 }; |
46 | 55 |
47 static scoped_refptr<RasterSource> CreateFromRecordingSource( | 56 static scoped_refptr<RasterSource> CreateFromRecordingSource( |
48 const RecordingSource* other, | 57 const RecordingSource* other, |
49 bool can_use_lcd_text); | 58 bool can_use_lcd_text); |
50 | 59 |
51 // TODO(trchen): Deprecated. | 60 // TODO(trchen): Deprecated. |
52 void PlaybackToCanvas(SkCanvas* canvas, | 61 void PlaybackToCanvas(SkCanvas* canvas, |
53 const gfx::Rect& canvas_bitmap_rect, | 62 const gfx::Rect& canvas_bitmap_rect, |
54 const gfx::Rect& canvas_playback_rect, | 63 const gfx::Rect& canvas_playback_rect, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | 166 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; |
158 | 167 |
159 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; | 168 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; |
160 | 169 |
161 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 170 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
162 }; | 171 }; |
163 | 172 |
164 } // namespace cc | 173 } // namespace cc |
165 | 174 |
166 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 175 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
OLD | NEW |