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

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

Issue 1928403002: Enable generating SkImage with the same uniqueID in SkImageGenerator subclass (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: CL description Created 4 years, 7 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 | « no previous file | src/core/SkImageGenerator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 sk_throw(); 244 sk_throw();
245 } 245 }
246 } 246 }
247 void generateBitmap(SkBitmap* bm, const SkImageInfo& info) { 247 void generateBitmap(SkBitmap* bm, const SkImageInfo& info) {
248 if (!this->tryGenerateBitmap(bm, &info, nullptr)) { 248 if (!this->tryGenerateBitmap(bm, &info, nullptr)) {
249 sk_throw(); 249 sk_throw();
250 } 250 }
251 } 251 }
252 252
253 protected: 253 protected:
254 SkImageGenerator(const SkImageInfo& info); 254 enum {
255 kNeedNewImageUniqueID = 0
256 };
257
258 SkImageGenerator(const SkImageInfo& info, uint32_t uniqueId = kNeedNewImageU niqueID);
255 259
256 virtual SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM); 260 virtual SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM);
257 261
258 virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBy tes, 262 virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBy tes,
259 SkPMColor ctable[], int* ctableCount); 263 SkPMColor ctable[], int* ctableCount);
260 264
261 virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const { 265 virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const {
262 return false; 266 return false;
263 } 267 }
264 virtual bool onGetYUV8Planes(const SkYUVSizeInfo&, void*[3] /*planes*/) { 268 virtual bool onGetYUV8Planes(const SkYUVSizeInfo&, void*[3] /*planes*/) {
(...skipping 17 matching lines...) Expand all
282 const SkImageInfo fInfo; 286 const SkImageInfo fInfo;
283 const uint32_t fUniqueID; 287 const uint32_t fUniqueID;
284 288
285 // This is our default impl, which may be different on different platforms. 289 // This is our default impl, which may be different on different platforms.
286 // It is called from NewFromEncoded() after it has checked for any runtime f actory. 290 // It is called from NewFromEncoded() after it has checked for any runtime f actory.
287 // The SkData will never be NULL, as that will have been checked by NewFromE ncoded. 291 // The SkData will never be NULL, as that will have been checked by NewFromE ncoded.
288 static SkImageGenerator* NewFromEncodedImpl(SkData*); 292 static SkImageGenerator* NewFromEncodedImpl(SkData*);
289 }; 293 };
290 294
291 #endif // SkImageGenerator_DEFINED 295 #endif // SkImageGenerator_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/core/SkImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698