| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 virtual bool IsSolidColor() const = 0; | 64 virtual bool IsSolidColor() const = 0; |
| 65 | 65 |
| 66 // Returns the color of the raster source if it is solid color. The results | 66 // Returns the color of the raster source if it is solid color. The results |
| 67 // are unspecified if IsSolidColor returns false. | 67 // are unspecified if IsSolidColor returns false. |
| 68 virtual SkColor GetSolidColor() const = 0; | 68 virtual SkColor GetSolidColor() const = 0; |
| 69 | 69 |
| 70 // Returns the size of this raster source. | 70 // Returns the size of this raster source. |
| 71 virtual gfx::Size GetSize() const = 0; | 71 virtual gfx::Size GetSize() const = 0; |
| 72 | 72 |
| 73 // Populate the given list with all SkPixelRefs that may overlap the given | 73 // Populate the given list with all SkPixelRefs that may overlap the given |
| 74 // rect at given scale. | 74 // rect in layer space. |
| 75 virtual void GatherPixelRefs( | 75 virtual void GatherPixelRefs( |
| 76 const gfx::Rect& content_rect, | 76 const gfx::Rect& layer_rect, |
| 77 float contents_scale, | |
| 78 std::vector<skia::PositionPixelRef>* pixel_refs) const = 0; | 77 std::vector<skia::PositionPixelRef>* pixel_refs) const = 0; |
| 79 | 78 |
| 80 // Return true iff this raster source can raster the given rect at given | 79 // Return true iff this raster source can raster the given rect in layer |
| 81 // scale. | 80 // space. |
| 82 virtual bool CoversRect(const gfx::Rect& content_rect, | 81 virtual bool CoversRect(const gfx::Rect& layer_rect) const = 0; |
| 83 float contents_scale) const = 0; | |
| 84 | 82 |
| 85 // Returns true if this raster source has anything to rasterize. | 83 // Returns true if this raster source has anything to rasterize. |
| 86 virtual bool HasRecordings() const = 0; | 84 virtual bool HasRecordings() const = 0; |
| 87 | 85 |
| 88 // Informs the raster source that it should attempt to use distance field text | 86 // Informs the raster source that it should attempt to use distance field text |
| 89 // during rasterization. | 87 // during rasterization. |
| 90 virtual void SetShouldAttemptToUseDistanceFieldText() = 0; | 88 virtual void SetShouldAttemptToUseDistanceFieldText() = 0; |
| 91 | 89 |
| 92 // Return true iff this raster source would benefit from using distance | 90 // Return true iff this raster source would benefit from using distance |
| 93 // field text. | 91 // field text. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 110 RasterSource() {} | 108 RasterSource() {} |
| 111 virtual ~RasterSource() {} | 109 virtual ~RasterSource() {} |
| 112 | 110 |
| 113 private: | 111 private: |
| 114 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 112 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
| 115 }; | 113 }; |
| 116 | 114 |
| 117 } // namespace cc | 115 } // namespace cc |
| 118 | 116 |
| 119 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 117 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
| OLD | NEW |