| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 virtual sk_sp<SkPicture> GetFlattenedPicture(); | 107 virtual sk_sp<SkPicture> GetFlattenedPicture(); |
| 108 virtual size_t GetPictureMemoryUsage() const; | 108 virtual size_t GetPictureMemoryUsage() const; |
| 109 | 109 |
| 110 // Return true if LCD anti-aliasing may be used when rastering text. | 110 // Return true if LCD anti-aliasing may be used when rastering text. |
| 111 virtual bool CanUseLCDText() const; | 111 virtual bool CanUseLCDText() const; |
| 112 | 112 |
| 113 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const; | 113 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const; |
| 114 | 114 |
| 115 // Image decode controller should be set once. Its lifetime has to exceed that | 115 // Image decode controller should be set once. Its lifetime has to exceed that |
| 116 // of the raster source, since the raster source will access it during raster. | 116 // of the raster source, since the raster source will access it during raster. |
| 117 void SetImageDecodeController(ImageDecodeController* image_decode_controller); | 117 void set_image_decode_controller( |
| 118 ImageDecodeController* image_decode_controller) { |
| 119 DCHECK(image_decode_controller); |
| 120 image_decode_controller_ = image_decode_controller; |
| 121 } |
| 122 |
| 123 // Returns the ImageDecodeController, currently only used by |
| 124 // GpuRasterBufferProvider in order to create its own ImageHijackCanvas. |
| 125 // Because of the MultiPictureDraw approach used by GPU raster, it does not |
| 126 // integrate well with the use of the ImageHijackCanvas internal to this |
| 127 // class. See gpu_raster_buffer_provider.cc for more information. |
| 128 // TODO(crbug.com/628394): Redesign this to avoid exposing |
| 129 // ImageDecodeController from the raster source. |
| 130 ImageDecodeController* image_decode_controller() const { |
| 131 return image_decode_controller_; |
| 132 } |
| 118 | 133 |
| 119 protected: | 134 protected: |
| 120 friend class base::RefCountedThreadSafe<RasterSource>; | 135 friend class base::RefCountedThreadSafe<RasterSource>; |
| 121 | 136 |
| 122 RasterSource(const RecordingSource* other, bool can_use_lcd_text); | 137 RasterSource(const RecordingSource* other, bool can_use_lcd_text); |
| 123 RasterSource(const RasterSource* other, bool can_use_lcd_text); | 138 RasterSource(const RasterSource* other, bool can_use_lcd_text); |
| 124 virtual ~RasterSource(); | 139 virtual ~RasterSource(); |
| 125 | 140 |
| 126 // These members are const as this raster source may be in use on another | 141 // These members are const as this raster source may be in use on another |
| 127 // thread and so should not be touched after construction. | 142 // thread and so should not be touched after construction. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 155 const gfx::Rect& canvas_bitmap_rect, | 170 const gfx::Rect& canvas_bitmap_rect, |
| 156 const gfx::Rect& canvas_playback_rect, | 171 const gfx::Rect& canvas_playback_rect, |
| 157 float contents_scale) const; | 172 float contents_scale) const; |
| 158 | 173 |
| 159 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 174 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
| 160 }; | 175 }; |
| 161 | 176 |
| 162 } // namespace cc | 177 } // namespace cc |
| 163 | 178 |
| 164 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ | 179 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ |
| OLD | NEW |