| Index: src/codec/SkPngCodec.cpp
|
| diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp
|
| index 1b8cadbf5ee00835b9b7783e5d10250739693d8f..68088782998c99ef7ae7d23c367811c9cddd5f80 100644
|
| --- a/src/codec/SkPngCodec.cpp
|
| +++ b/src/codec/SkPngCodec.cpp
|
| @@ -94,10 +94,6 @@ private:
|
| };
|
| #define AutoCleanPng(...) SK_REQUIRE_LOCAL_VAR(AutoCleanPng)
|
|
|
| -static inline SkAlphaType xform_alpha_type(SkAlphaType dstAlphaType, SkAlphaType srcAlphaType) {
|
| - return (kOpaque_SkAlphaType == srcAlphaType) ? kOpaque_SkAlphaType : dstAlphaType;
|
| -}
|
| -
|
| // Note: SkColorTable claims to store SkPMColors, which is not necessarily the case here.
|
| bool SkPngCodec::createColorTable(const SkImageInfo& dstInfo, int* ctableCount) {
|
|
|
| @@ -155,8 +151,8 @@ bool SkPngCodec::createColorTable(const SkImageInfo& dstInfo, int* ctableCount)
|
| if (fColorXform && kRGBA_F16_SkColorType != dstInfo.colorType()) {
|
| SkColorType xformColorType = is_rgba(dstInfo.colorType()) ?
|
| kRGBA_8888_SkColorType : kBGRA_8888_SkColorType;
|
| - SkAlphaType xformAlphaType = xform_alpha_type(dstInfo.alphaType(),
|
| - this->getInfo().alphaType());
|
| + SkAlphaType xformAlphaType = color_xform_alpha_type(dstInfo.alphaType(),
|
| + this->getInfo().alphaType());
|
| fColorXform->apply(colorTable, colorTable, numColors, xformColorType, xformAlphaType);
|
| }
|
|
|
| @@ -447,8 +443,8 @@ public:
|
| return y;
|
| }
|
|
|
| - SkAlphaType xformAlphaType = xform_alpha_type(dstInfo.alphaType(),
|
| - this->getInfo().alphaType());
|
| + SkAlphaType xformAlphaType = color_xform_alpha_type(dstInfo.alphaType(),
|
| + this->getInfo().alphaType());
|
| int width = fSwizzler ? fSwizzler->swizzleWidth() : dstInfo.width();
|
|
|
| for (; y < count; y++) {
|
| @@ -533,8 +529,8 @@ public:
|
| }
|
| }
|
|
|
| - SkAlphaType xformAlphaType = xform_alpha_type(dstInfo.alphaType(),
|
| - this->getInfo().alphaType());
|
| + SkAlphaType xformAlphaType = color_xform_alpha_type(dstInfo.alphaType(),
|
| + this->getInfo().alphaType());
|
| int width = fSwizzler ? fSwizzler->swizzleWidth() : dstInfo.width();
|
| srcRow = storage.get();
|
| for (int y = 0; y < count; y++) {
|
|
|