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

Unified Diff: src/images/SkDecodingImageGenerator.cpp

Issue 536003002: Hide fields in SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix qt Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | src/lazy/SkCachingPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkDecodingImageGenerator.cpp
diff --git a/src/images/SkDecodingImageGenerator.cpp b/src/images/SkDecodingImageGenerator.cpp
index 5c66c94a534e257d01d09d2f0a7bbe595de96bfa..1d91bcc0f98e359c95b59cac8ac73d79feacdecf 100644
--- a/src/images/SkDecodingImageGenerator.cpp
+++ b/src/images/SkDecodingImageGenerator.cpp
@@ -167,8 +167,7 @@ bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info,
}
decoder->setDitherImage(fDitherImage);
decoder->setSampleSize(fSampleSize);
- decoder->setRequireUnpremultipliedColors(
- info.fAlphaType == kUnpremul_SkAlphaType);
+ decoder->setRequireUnpremultipliedColors(info.alphaType() == kUnpremul_SkAlphaType);
SkBitmap bitmap;
TargetAllocator allocator(fInfo, pixels, rowBytes);
@@ -240,19 +239,20 @@ SkImageGenerator* CreateDecodingImageGenerator(
SkASSERT(bitmap.colorType() != opts.fRequestedColorType);
return NULL; // Can not translate to needed config.
}
- info.fColorType = opts.fRequestedColorType;
+ info = info.makeColorType(opts.fRequestedColorType);
}
- if (opts.fRequireUnpremul && info.fAlphaType != kOpaque_SkAlphaType) {
- info.fAlphaType = kUnpremul_SkAlphaType;
+ if (opts.fRequireUnpremul && info.alphaType() != kOpaque_SkAlphaType) {
+ info = info.makeAlphaType(kUnpremul_SkAlphaType);
}
- if (!SkColorTypeValidateAlphaType(info.fColorType, info.fAlphaType, &info.fAlphaType)) {
+ SkAlphaType newAlphaType = info.alphaType();
+ if (!SkColorTypeValidateAlphaType(info.colorType(), info.alphaType(), &newAlphaType)) {
return NULL;
}
return SkNEW_ARGS(DecodingImageGenerator,
- (data, autoStream.detach(), info,
+ (data, autoStream.detach(), info.makeAlphaType(newAlphaType),
opts.fSampleSize, opts.fDitherImage));
}
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | src/lazy/SkCachingPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698