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

Unified Diff: src/codec/SkPngCodec.cpp

Issue 2353363008: Add BGRA as input format to SkColorSpaceXform (Closed)
Patch Set: More cleanup Created 4 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
Index: src/codec/SkPngCodec.cpp
diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp
index 3fdb8586d5ae6f875bc5a29b9723e501ba828f78..db41e085d61f7696f00f54cea962d6486402a24a 100644
--- a/src/codec/SkPngCodec.cpp
+++ b/src/codec/SkPngCodec.cpp
@@ -272,7 +272,8 @@ bool SkPngCodec::createColorTable(const SkImageInfo& dstInfo, int* ctableCount)
SkColorSpaceXform::kBGRA_8888_ColorFormat;
SkAlphaType xformAlphaType = select_xform_alpha(dstInfo.alphaType(),
this->getInfo().alphaType());
- fColorXform->apply(colorTable, colorTable, numColors, xformColorFormat, xformAlphaType);
+ fColorXform->apply(colorTable, colorTable, numColors, xformColorFormat,
+ SkColorSpaceXform::kRGBA_8888_ColorFormat, xformAlphaType);
}
// Pad the color table with the last color in the table (or black) in the case that
@@ -493,18 +494,20 @@ void SkPngCodec::allocateStorage(const SkImageInfo& dstInfo) {
}
void SkPngCodec::applyXformRow(void* dst, const void* src) {
+ static constexpr SkColorSpaceXform::ColorFormat srcColorFormat =
mtklein 2016/09/22 13:57:00 Usually this sort of thing is fine spelled "const"
msarett 2016/09/22 17:06:54 Done.
+ SkColorSpaceXform::kRGBA_8888_ColorFormat;
switch (fXformMode) {
case kSwizzleOnly_XformMode:
fSwizzler->swizzle(dst, (const uint8_t*) src);
break;
case kColorOnly_XformMode:
fColorXform->apply(dst, (const uint32_t*) src, fXformWidth, fXformColorFormat,
- fXformAlphaType);
+ srcColorFormat, fXformAlphaType);
break;
case kSwizzleColor_XformMode:
fSwizzler->swizzle(fColorXformSrcRow, (const uint8_t*) src);
fColorXform->apply(dst, fColorXformSrcRow, fXformWidth, fXformColorFormat,
- fXformAlphaType);
+ srcColorFormat, fXformAlphaType);
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698