| 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_RASTER_RASTER_SOURCE_H_ | 5 #ifndef CC_RASTER_RASTER_SOURCE_H_ |
| 6 #define CC_RASTER_RASTER_SOURCE_H_ | 6 #define CC_RASTER_RASTER_SOURCE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 bool skip_images; | 44 bool skip_images; |
| 45 | 45 |
| 46 // If set to true, we will use an image hijack canvas, which enables | 46 // If set to true, we will use an image hijack canvas, which enables |
| 47 // compositor image caching. | 47 // compositor image caching. |
| 48 bool use_image_hijack_canvas; | 48 bool use_image_hijack_canvas; |
| 49 | 49 |
| 50 // If non-empty, an image hijack canvas will be used to skip these images | 50 // If non-empty, an image hijack canvas will be used to skip these images |
| 51 // during raster. | 51 // during raster. |
| 52 // TODO(khushalsagar): Consolidate more settings for playback here? See | 52 // TODO(khushalsagar): Consolidate more settings for playback here? See |
| 53 // crbug.com/691076. | 53 // crbug.com/691076. |
| 54 ImageIdFlatSet images_to_skip; | 54 SkImageIdFlatSet images_to_skip; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 static scoped_refptr<RasterSource> CreateFromRecordingSource( | 57 static scoped_refptr<RasterSource> CreateFromRecordingSource( |
| 58 const RecordingSource* other, | 58 const RecordingSource* other, |
| 59 bool can_use_lcd_text); | 59 bool can_use_lcd_text); |
| 60 | 60 |
| 61 // Helper function to apply a few common operations before passing the canvas | 61 // Helper function to apply a few common operations before passing the canvas |
| 62 // to the shorter version. This is useful for rastering into tiles. | 62 // to the shorter version. This is useful for rastering into tiles. |
| 63 // canvas is expected to be backed by a tile, with a default state. | 63 // canvas is expected to be backed by a tile, with a default state. |
| 64 // raster_transform will be applied to the display list, rastering the list | 64 // raster_transform will be applied to the display list, rastering the list |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Return true iff this raster source can raster the given rect in layer | 114 // Return true iff this raster source can raster the given rect in layer |
| 115 // space. | 115 // space. |
| 116 bool CoversRect(const gfx::Rect& layer_rect) const; | 116 bool CoversRect(const gfx::Rect& layer_rect) const; |
| 117 | 117 |
| 118 // Returns true if this raster source has anything to rasterize. | 118 // Returns true if this raster source has anything to rasterize. |
| 119 virtual bool HasRecordings() const; | 119 virtual bool HasRecordings() const; |
| 120 | 120 |
| 121 // Valid rectangle in which everything is recorded and can be rastered from. | 121 // Valid rectangle in which everything is recorded and can be rastered from. |
| 122 virtual gfx::Rect RecordedViewport() const; | 122 virtual gfx::Rect RecordedViewport() const; |
| 123 | 123 |
| 124 gfx::Rect GetRectForImage(ImageId image_id) const; | 124 gfx::Rect GetRectForImage(PaintImage::Id image_id) const; |
| 125 | 125 |
| 126 // Tracing functionality. | 126 // Tracing functionality. |
| 127 virtual void DidBeginTracing(); | 127 virtual void DidBeginTracing(); |
| 128 virtual void AsValueInto(base::trace_event::TracedValue* array) const; | 128 virtual void AsValueInto(base::trace_event::TracedValue* array) const; |
| 129 virtual sk_sp<SkPicture> GetFlattenedPicture(); | 129 virtual sk_sp<SkPicture> GetFlattenedPicture(); |
| 130 virtual size_t GetMemoryUsage() const; | 130 virtual size_t GetMemoryUsage() const; |
| 131 | 131 |
| 132 // Return true if LCD anti-aliasing may be used when rastering text. | 132 // Return true if LCD anti-aliasing may be used when rastering text. |
| 133 virtual bool CanUseLCDText() const; | 133 virtual bool CanUseLCDText() const; |
| 134 | 134 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 SkPicture::AbortCallback* callback = nullptr) const; | 171 SkPicture::AbortCallback* callback = nullptr) const; |
| 172 | 172 |
| 173 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; | 173 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; |
| 174 | 174 |
| 175 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 175 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
| 176 }; | 176 }; |
| 177 | 177 |
| 178 } // namespace cc | 178 } // namespace cc |
| 179 | 179 |
| 180 #endif // CC_RASTER_RASTER_SOURCE_H_ | 180 #endif // CC_RASTER_RASTER_SOURCE_H_ |
| OLD | NEW |