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

Side by Side Diff: src/core/SkImageGenerator.cpp

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 | « include/core/SkImageGenerator.h ('k') | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 #include "SkImageGenerator.h" 8 #include "SkImageGenerator.h"
9 #include "SkNextID.h" 9 #include "SkNextID.h"
10 10
11 SkImageGenerator::SkImageGenerator(const SkImageInfo& info) 11 SkImageGenerator::SkImageGenerator(const SkImageInfo& info, uint32_t uniqueID)
12 : fInfo(info) 12 : fInfo(info)
13 , fUniqueID(SkNextID::ImageID()) 13 , fUniqueID(kNeedNewImageUniqueID == uniqueID ? SkNextID::ImageID() : unique ID)
14 {} 14 {}
15 15
16 bool SkImageGenerator::getPixels(const SkImageInfo& info, void* pixels, size_t r owBytes, 16 bool SkImageGenerator::getPixels(const SkImageInfo& info, void* pixels, size_t r owBytes,
17 SkPMColor ctable[], int* ctableCount) { 17 SkPMColor ctable[], int* ctableCount) {
18 if (kUnknown_SkColorType == info.colorType()) { 18 if (kUnknown_SkColorType == info.colorType()) {
19 return false; 19 return false;
20 } 20 }
21 if (nullptr == pixels) { 21 if (nullptr == pixels) {
22 return false; 22 return false;
23 } 23 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (nullptr == data) { 210 if (nullptr == data) {
211 return nullptr; 211 return nullptr;
212 } 212 }
213 if (gFactory) { 213 if (gFactory) {
214 if (SkImageGenerator* generator = gFactory(data)) { 214 if (SkImageGenerator* generator = gFactory(data)) {
215 return generator; 215 return generator;
216 } 216 }
217 } 217 }
218 return SkImageGenerator::NewFromEncodedImpl(data); 218 return SkImageGenerator::NewFromEncodedImpl(data);
219 } 219 }
OLDNEW
« no previous file with comments | « include/core/SkImageGenerator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698