| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Return true iff this raster source can raster the given rect in layer | 100 // Return true iff this raster source can raster the given rect in layer |
| 101 // space. | 101 // space. |
| 102 bool CoversRect(const gfx::Rect& layer_rect) const; | 102 bool CoversRect(const gfx::Rect& layer_rect) const; |
| 103 | 103 |
| 104 // Returns true if this raster source has anything to rasterize. | 104 // Returns true if this raster source has anything to rasterize. |
| 105 virtual bool HasRecordings() const; | 105 virtual bool HasRecordings() const; |
| 106 | 106 |
| 107 // Valid rectangle in which everything is recorded and can be rastered from. | 107 // Valid rectangle in which everything is recorded and can be rastered from. |
| 108 virtual gfx::Rect RecordedViewport() const; | 108 virtual gfx::Rect RecordedViewport() const; |
| 109 | 109 |
| 110 // Informs the raster source that it should attempt to use distance field text | |
| 111 // during rasterization. | |
| 112 virtual void SetShouldAttemptToUseDistanceFieldText(); | |
| 113 | |
| 114 // Return true iff this raster source would benefit from using distance | |
| 115 // field text. | |
| 116 virtual bool ShouldAttemptToUseDistanceFieldText() const; | |
| 117 | |
| 118 // Tracing functionality. | 110 // Tracing functionality. |
| 119 virtual void DidBeginTracing(); | 111 virtual void DidBeginTracing(); |
| 120 virtual void AsValueInto(base::trace_event::TracedValue* array) const; | 112 virtual void AsValueInto(base::trace_event::TracedValue* array) const; |
| 121 virtual sk_sp<SkPicture> GetFlattenedPicture(); | 113 virtual sk_sp<SkPicture> GetFlattenedPicture(); |
| 122 virtual size_t GetPictureMemoryUsage() const; | 114 virtual size_t GetPictureMemoryUsage() const; |
| 123 | 115 |
| 124 // Return true if LCD anti-aliasing may be used when rastering text. | 116 // Return true if LCD anti-aliasing may be used when rastering text. |
| 125 virtual bool CanUseLCDText() const; | 117 virtual bool CanUseLCDText() const; |
| 126 | 118 |
| 127 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const; | 119 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 146 const size_t painter_reported_memory_usage_; | 138 const size_t painter_reported_memory_usage_; |
| 147 const SkColor background_color_; | 139 const SkColor background_color_; |
| 148 const bool requires_clear_; | 140 const bool requires_clear_; |
| 149 const bool can_use_lcd_text_; | 141 const bool can_use_lcd_text_; |
| 150 const bool is_solid_color_; | 142 const bool is_solid_color_; |
| 151 const SkColor solid_color_; | 143 const SkColor solid_color_; |
| 152 const gfx::Rect recorded_viewport_; | 144 const gfx::Rect recorded_viewport_; |
| 153 const gfx::Size size_; | 145 const gfx::Size size_; |
| 154 const bool clear_canvas_with_debug_color_; | 146 const bool clear_canvas_with_debug_color_; |
| 155 const int slow_down_raster_scale_factor_for_debug_; | 147 const int slow_down_raster_scale_factor_for_debug_; |
| 156 // TODO(enne/vmiura): this has a read/write race between raster and compositor | |
| 157 // threads with multi-threaded Ganesh. Make this const or remove it. | |
| 158 bool should_attempt_to_use_distance_field_text_; | |
| 159 | 148 |
| 160 // In practice, this is only set once before raster begins, so it's ok with | 149 // In practice, this is only set once before raster begins, so it's ok with |
| 161 // respect to threading. | 150 // respect to threading. |
| 162 ImageDecodeCache* image_decode_cache_; | 151 ImageDecodeCache* image_decode_cache_; |
| 163 | 152 |
| 164 private: | 153 private: |
| 165 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | 154 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; |
| 166 | 155 |
| 167 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; | 156 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; |
| 168 | 157 |
| 169 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 158 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
| 170 }; | 159 }; |
| 171 | 160 |
| 172 } // namespace cc | 161 } // namespace cc |
| 173 | 162 |
| 174 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 163 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
| OLD | NEW |