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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // Virtual for testing. | 71 // Virtual for testing. |
72 // | 72 // |
73 // Note that this should only be called after the image decode controller has | 73 // Note that this should only be called after the image decode controller has |
74 // been set, which happens during commit. | 74 // been set, which happens during commit. |
75 virtual void PlaybackToCanvas(SkCanvas* canvas, | 75 virtual void PlaybackToCanvas(SkCanvas* canvas, |
76 const PlaybackSettings& settings) const; | 76 const PlaybackSettings& settings) const; |
77 | 77 |
78 // Returns whether the given rect at given scale is of solid color in | 78 // Returns whether the given rect at given scale is of solid color in |
79 // this raster source, as well as the solid color value. | 79 // this raster source, as well as the solid color value. |
80 bool PerformSolidColorAnalysis(const gfx::Rect& content_rect, | 80 bool PerformSolidColorAnalysis(const gfx::Rect& content_rect, |
81 const gfx::SizeF& raster_scales, | 81 float raster_scale, |
82 SkColor* color) const; | 82 SkColor* color) const; |
83 | 83 |
84 // Returns true iff the whole raster source is of solid color. | 84 // Returns true iff the whole raster source is of solid color. |
85 bool IsSolidColor() const; | 85 bool IsSolidColor() const; |
86 | 86 |
87 // Returns the color of the raster source if it is solid color. The results | 87 // Returns the color of the raster source if it is solid color. The results |
88 // are unspecified if IsSolidColor returns false. | 88 // are unspecified if IsSolidColor returns false. |
89 SkColor GetSolidColor() const; | 89 SkColor GetSolidColor() const; |
90 | 90 |
91 // Returns the size of this raster source. | 91 // Returns the size of this raster source. |
92 gfx::Size GetSize() const; | 92 gfx::Size GetSize() const; |
93 | 93 |
94 // Returns whether or not there was a color space implied by the raster source | 94 // Returns whether or not there was a color space implied by the raster source |
95 // when it was created. If this returns true then no color correction is | 95 // when it was created. If this returns true then no color correction is |
96 // to be applied at rasterization time, and the result of rasterization is to | 96 // to be applied at rasterization time, and the result of rasterization is to |
97 // be interpreted as being in this color space. If this returns falce, then | 97 // be interpreted as being in this color space. If this returns falce, then |
98 // then a destination color space must be specified at raster time. | 98 // then a destination color space must be specified at raster time. |
99 bool HasImpliedColorSpace() const; | 99 bool HasImpliedColorSpace() const; |
100 const gfx::ColorSpace& GetImpliedColorSpace() const; | 100 const gfx::ColorSpace& GetImpliedColorSpace() const; |
101 | 101 |
102 // Populate the given list with all images that may overlap the given | 102 // Populate the given list with all images that may overlap the given |
103 // rect in layer space. The returned draw images' matrices are modified as if | 103 // rect in layer space. The returned draw images' matrices are modified as if |
104 // they were being using during raster at scale |raster_scale|. | 104 // they were being using during raster at scale |raster_scale|. |
105 void GetDiscardableImagesInRect(const gfx::Rect& layer_rect, | 105 void GetDiscardableImagesInRect(const gfx::Rect& layer_rect, |
106 const gfx::SizeF& raster_scales, | 106 float raster_scale, |
107 std::vector<DrawImage>* images) const; | 107 std::vector<DrawImage>* images) const; |
108 | 108 |
109 // Return true iff this raster source can raster the given rect in layer | 109 // Return true iff this raster source can raster the given rect in layer |
110 // space. | 110 // space. |
111 bool CoversRect(const gfx::Rect& layer_rect) const; | 111 bool CoversRect(const gfx::Rect& layer_rect) const; |
112 | 112 |
113 // Returns true if this raster source has anything to rasterize. | 113 // Returns true if this raster source has anything to rasterize. |
114 virtual bool HasRecordings() const; | 114 virtual bool HasRecordings() const; |
115 | 115 |
116 // Valid rectangle in which everything is recorded and can be rastered from. | 116 // Valid rectangle in which everything is recorded and can be rastered from. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | 183 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; |
184 | 184 |
185 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; | 185 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; |
186 | 186 |
187 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 187 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
188 }; | 188 }; |
189 | 189 |
190 } // namespace cc | 190 } // namespace cc |
191 | 191 |
192 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 192 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
OLD | NEW |