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

Side by Side Diff: include/core/SkImageGenerator.h

Issue 1229933003: add runtime option to provide data->imagegenerator factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkImageGenerator_DEFINED 8 #ifndef SkImageGenerator_DEFINED
9 #define SkImageGenerator_DEFINED 9 #define SkImageGenerator_DEFINED
10 10
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 * that the sizes match what it expected. If the sizes do not match, it sho uld return false. 192 * that the sizes match what it expected. If the sizes do not match, it sho uld return false.
193 */ 193 */
194 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], 194 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3],
195 SkYUVColorSpace* colorSpace); 195 SkYUVColorSpace* colorSpace);
196 196
197 /** 197 /**
198 * If the default image decoder system can interpret the specified (encoded ) data, then 198 * If the default image decoder system can interpret the specified (encoded ) data, then
199 * this returns a new ImageGenerator for it. Otherwise this returns NULL. E ither way 199 * this returns a new ImageGenerator for it. Otherwise this returns NULL. E ither way
200 * the caller is still responsible for managing their ownership of the data . 200 * the caller is still responsible for managing their ownership of the data .
201 */ 201 */
202 static SkImageGenerator* NewFromData(SkData*); 202 static SkImageGenerator* NewFromEncoded(SkData*);
203 203
204 protected: 204 protected:
205 SkImageGenerator(const SkImageInfo& info) : fInfo(info) {} 205 SkImageGenerator(const SkImageInfo& info) : fInfo(info) {}
206 206
207 virtual SkData* onRefEncodedData(); 207 virtual SkData* onRefEncodedData();
208 208
209 #ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS 209 #ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
210 virtual Result onGetPixels(const SkImageInfo& info, 210 virtual Result onGetPixels(const SkImageInfo& info,
211 void* pixels, size_t rowBytes, const Options&, 211 void* pixels, size_t rowBytes, const Options&,
212 SkPMColor ctable[], int* ctableCount); 212 SkPMColor ctable[], int* ctableCount);
213 #else 213 #else
214 virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBy tes, 214 virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBy tes,
215 SkPMColor ctable[], int* ctableCount); 215 SkPMColor ctable[], int* ctableCount);
216 #endif 216 #endif
217 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3]); 217 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3]);
218 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3], 218 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3],
219 SkYUVColorSpace* colorSpace); 219 SkYUVColorSpace* colorSpace);
220 220
221 private: 221 private:
222 const SkImageInfo fInfo; 222 const SkImageInfo fInfo;
223
224 static SkImageGenerator* NewFromEncodedImpl(SkData*);
scroggo 2015/07/09 19:01:15 Maybe add a comment that the implementation does n
reed1 2015/07/09 19:05:45 Will do
223 }; 225 };
224 226
225 #endif // SkImageGenerator_DEFINED 227 #endif // SkImageGenerator_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698