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

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

Issue 2160683003: Fix MultiPictureDraw issues with GpuImageDecodeController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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.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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 virtual sk_sp<SkPicture> GetFlattenedPicture(); 109 virtual sk_sp<SkPicture> GetFlattenedPicture();
110 virtual size_t GetPictureMemoryUsage() const; 110 virtual size_t GetPictureMemoryUsage() const;
111 111
112 // Return true if LCD anti-aliasing may be used when rastering text. 112 // Return true if LCD anti-aliasing may be used when rastering text.
113 virtual bool CanUseLCDText() const; 113 virtual bool CanUseLCDText() const;
114 114
115 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const; 115 scoped_refptr<RasterSource> CreateCloneWithoutLCDText() const;
116 116
117 // Image decode controller should be set once. Its lifetime has to exceed that 117 // Image decode controller should be set once. Its lifetime has to exceed that
118 // of the raster source, since the raster source will access it during raster. 118 // of the raster source, since the raster source will access it during raster.
119 void SetImageDecodeController(ImageDecodeController* image_decode_controller); 119 void set_image_decode_controller(
120 ImageDecodeController* image_decode_controller) {
121 DCHECK(image_decode_controller);
122 image_decode_controller_ = image_decode_controller;
123 }
124
125 // Returns the ImageDecodeController, currently only used by
126 // GpuRasterBufferProvider in order to create its own ImageHijackCanvas.
127 // Because of the MultiPictureDraw approach used by GPU raster, it does not
128 // integrate well with the use of the ImageHijackCanvas internal to this
129 // class. See gpu_raster_buffer_provider.cc for more information.
130 // TODO(crbug.com/628394): Redesign this to avoid exposing
131 // ImageDecodeController from the raster source.
132 ImageDecodeController* image_decode_controller() const {
133 return image_decode_controller_;
134 }
120 135
121 protected: 136 protected:
122 friend class base::RefCountedThreadSafe<RasterSource>; 137 friend class base::RefCountedThreadSafe<RasterSource>;
123 138
124 RasterSource(const RecordingSource* other, bool can_use_lcd_text); 139 RasterSource(const RecordingSource* other, bool can_use_lcd_text);
125 RasterSource(const RasterSource* other, bool can_use_lcd_text); 140 RasterSource(const RasterSource* other, bool can_use_lcd_text);
126 virtual ~RasterSource(); 141 virtual ~RasterSource();
127 142
128 // These members are const as this raster source may be in use on another 143 // These members are const as this raster source may be in use on another
129 // thread and so should not be touched after construction. 144 // thread and so should not be touched after construction.
(...skipping 20 matching lines...) Expand all
150 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const; 165 void RasterCommon(SkCanvas* canvas, SkPicture::AbortCallback* callback) const;
151 166
152 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const; 167 void PrepareForPlaybackToCanvas(SkCanvas* canvas) const;
153 168
154 DISALLOW_COPY_AND_ASSIGN(RasterSource); 169 DISALLOW_COPY_AND_ASSIGN(RasterSource);
155 }; 170 };
156 171
157 } // namespace cc 172 } // namespace cc
158 173
159 #endif // CC_PLAYBACK_RASTER_SOURCE_H_ 174 #endif // CC_PLAYBACK_RASTER_SOURCE_H_
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/playback/raster_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698