| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 15 #include "cc/debug/rendering_stats_instrumentation.h" | 15 #include "cc/debug/rendering_stats_instrumentation.h" |
| 16 #include "cc/playback/recording_source.h" | 16 #include "cc/playback/recording_source.h" |
| 17 #include "skia/ext/analysis_canvas.h" | 17 #include "skia/ext/analysis_canvas.h" |
| 18 #include "skia/ext/cdl_picture.h" |
| 19 #include "skia/ext/cdl_canvas.h" |
| 18 #include "third_party/skia/include/core/SkPicture.h" | 20 #include "third_party/skia/include/core/SkPicture.h" |
| 19 | 21 |
| 20 namespace gfx { | 22 namespace gfx { |
| 21 class ColorSpace; | 23 class ColorSpace; |
| 22 } | 24 } |
| 23 | 25 |
| 24 namespace cc { | 26 namespace cc { |
| 25 class DisplayItemList; | 27 class DisplayItemList; |
| 26 class DrawImage; | 28 class DrawImage; |
| 27 class ImageDecodeCache; | 29 class ImageDecodeCache; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // during rasterization. | 113 // during rasterization. |
| 112 virtual void SetShouldAttemptToUseDistanceFieldText(); | 114 virtual void SetShouldAttemptToUseDistanceFieldText(); |
| 113 | 115 |
| 114 // Return true iff this raster source would benefit from using distance | 116 // Return true iff this raster source would benefit from using distance |
| 115 // field text. | 117 // field text. |
| 116 virtual bool ShouldAttemptToUseDistanceFieldText() const; | 118 virtual bool ShouldAttemptToUseDistanceFieldText() const; |
| 117 | 119 |
| 118 // Tracing functionality. | 120 // Tracing functionality. |
| 119 virtual void DidBeginTracing(); | 121 virtual void DidBeginTracing(); |
| 120 virtual void AsValueInto(base::trace_event::TracedValue* array) const; | 122 virtual void AsValueInto(base::trace_event::TracedValue* array) const; |
| 121 virtual sk_sp<SkPicture> GetFlattenedPicture(); | 123 virtual sk_sp<CdlPicture> GetFlattenedPicture(); |
| 122 virtual size_t GetPictureMemoryUsage() const; | 124 virtual size_t GetPictureMemoryUsage() const; |
| 123 | 125 |
| 124 // Return true if LCD anti-aliasing may be used when rastering text. | 126 // Return true if LCD anti-aliasing may be used when rastering text. |
| 125 virtual bool CanUseLCDText() const; | 127 virtual bool CanUseLCDText() const; |
| 126 | 128 |
| 127 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const; | 129 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const; |
| 128 | 130 |
| 129 // Image decode controller should be set once. Its lifetime has to exceed that | 131 // Image decode controller should be set once. Its lifetime has to exceed that |
| 130 // of the raster source, since the raster source will access it during raster. | 132 // of the raster source, since the raster source will access it during raster. |
| 131 void set_image_decode_cache(ImageDecodeCache* image_decode_cache) { | 133 void set_image_decode_cache(ImageDecodeCache* image_decode_cache) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 155 const int slow_down_raster_scale_factor_for_debug_; | 157 const int slow_down_raster_scale_factor_for_debug_; |
| 156 // TODO(enne/vmiura): this has a read/write race between raster and compositor | 158 // 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. | 159 // threads with multi-threaded Ganesh. Make this const or remove it. |
| 158 bool should_attempt_to_use_distance_field_text_; | 160 bool should_attempt_to_use_distance_field_text_; |
| 159 | 161 |
| 160 // In practice, this is only set once before raster begins, so it's ok with | 162 // In practice, this is only set once before raster begins, so it's ok with |
| 161 // respect to threading. | 163 // respect to threading. |
| 162 ImageDecodeCache* image_decode_cache_; | 164 ImageDecodeCache* image_decode_cache_; |
| 163 | 165 |
| 164 private: | 166 private: |
| 165 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; | 167 void RasterCommon(CdlCanvas* canvas, |
| 168 SkPicture::AbortCallback* callback) const; |
| 166 | 169 |
| 167 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; | 170 void PrepareForPlaybackToCanvas(CdlCanvas* canvas) const; |
| 168 | 171 |
| 169 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 172 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
| 170 }; | 173 }; |
| 171 | 174 |
| 172 } // namespace cc | 175 } // namespace cc |
| 173 | 176 |
| 174 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 177 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
| OLD | NEW |