Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(717)

Side by Side Diff: cc/playback/raster_source.h

Issue 2637223002: Don't use DF text during animations (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/playback/raster_source.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // Return true iff this raster source can raster the given rect in layer 88 // Return true iff this raster source can raster the given rect in layer
89 // space. 89 // space.
90 bool CoversRect(const gfx::Rect& layer_rect) const; 90 bool CoversRect(const gfx::Rect& layer_rect) const;
91 91
92 // Returns true if this raster source has anything to rasterize. 92 // Returns true if this raster source has anything to rasterize.
93 virtual bool HasRecordings() const; 93 virtual bool HasRecordings() const;
94 94
95 // Valid rectangle in which everything is recorded and can be rastered from. 95 // Valid rectangle in which everything is recorded and can be rastered from.
96 virtual gfx::Rect RecordedViewport() const; 96 virtual gfx::Rect RecordedViewport() const;
97 97
98 // Informs the raster source that it should attempt to use distance field text
99 // during rasterization.
100 virtual void SetShouldAttemptToUseDistanceFieldText();
101
102 // Return true iff this raster source would benefit from using distance
103 // field text.
104 virtual bool ShouldAttemptToUseDistanceFieldText() const;
105
106 // Tracing functionality. 98 // Tracing functionality.
107 virtual void DidBeginTracing(); 99 virtual void DidBeginTracing();
108 virtual void AsValueInto(base::trace_event::TracedValue* array) const; 100 virtual void AsValueInto(base::trace_event::TracedValue* array) const;
109 virtual sk_sp<SkPicture> GetFlattenedPicture(); 101 virtual sk_sp<SkPicture> GetFlattenedPicture();
110 virtual size_t GetPictureMemoryUsage() const; 102 virtual size_t GetPictureMemoryUsage() const;
111 103
112 // Return true if LCD anti-aliasing may be used when rastering text. 104 // Return true if LCD anti-aliasing may be used when rastering text.
113 virtual bool CanUseLCDText() const; 105 virtual bool CanUseLCDText() const;
114 106
115 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const; 107 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const;
(...skipping 30 matching lines...) Expand all
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 ImageDecodeController* image_decode_controller_; 151 ImageDecodeController* image_decode_controller_;
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_
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/playback/raster_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698