| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // may be uninitialized and will be cleared before playback. | 80 // may be uninitialized and will be cleared before playback. |
| 81 // | 81 // |
| 82 // Virtual for testing. | 82 // Virtual for testing. |
| 83 // | 83 // |
| 84 // Note that this should only be called after the image decode controller has | 84 // Note that this should only be called after the image decode controller has |
| 85 // been set, which happens during commit. | 85 // been set, which happens during commit. |
| 86 virtual void PlaybackToCanvas(SkCanvas* canvas, | 86 virtual void PlaybackToCanvas(SkCanvas* canvas, |
| 87 const gfx::ColorSpace& target_color_space, | 87 const gfx::ColorSpace& target_color_space, |
| 88 const PlaybackSettings& settings) const; | 88 const PlaybackSettings& settings) const; |
| 89 | 89 |
| 90 // Returns whether the given rect at given scale is of solid color in | 90 // Returns whether the given rect with |raster_transform| is of solid color in |
| 91 // this raster source, as well as the solid color value. | 91 // this raster source, as well as the solid color value. |
| 92 bool PerformSolidColorAnalysis(const gfx::Rect& content_rect, | 92 bool PerformSolidColorAnalysis(gfx::Rect content_rect, |
| 93 float contents_scale, | 93 const gfx::AxisTransform2d& raster_transform, |
| 94 SkColor* color) const; | 94 SkColor* color) const; |
| 95 | 95 |
| 96 // Returns true iff the whole raster source is of solid color. | 96 // Returns true iff the whole raster source is of solid color. |
| 97 bool IsSolidColor() const; | 97 bool IsSolidColor() const; |
| 98 | 98 |
| 99 // Returns the color of the raster source if it is solid color. The results | 99 // Returns the color of the raster source if it is solid color. The results |
| 100 // are unspecified if IsSolidColor returns false. | 100 // are unspecified if IsSolidColor returns false. |
| 101 SkColor GetSolidColor() const; | 101 SkColor GetSolidColor() const; |
| 102 | 102 |
| 103 // Returns the size of this raster source. | 103 // Returns the size of this raster source. |
| (...skipping 67 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 |