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

Unified Diff: src/codec/SkPngCodec.cpp

Issue 2294993002: Add color xform support to SkWebpCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Try v6 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
« no previous file with comments | « src/codec/SkCodecPriv.h ('k') | src/codec/SkWebpCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkPngCodec.cpp
diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp
index 1b8cadbf5ee00835b9b7783e5d10250739693d8f..ac7238d3e904f284ac182fc769a90c1166946b6f 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 = select_alpha_xform(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 = select_alpha_xform(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 = select_alpha_xform(dstInfo.alphaType(),
+ this->getInfo().alphaType());
int width = fSwizzler ? fSwizzler->swizzleWidth() : dstInfo.width();
srcRow = storage.get();
for (int y = 0; y < count; y++) {
« no previous file with comments | « src/codec/SkCodecPriv.h ('k') | src/codec/SkWebpCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698