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

Unified Diff: src/codec/SkSwizzler.cpp

Issue 1571923002: Might as well inline these premultiplies. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkSwizzler.cpp
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp
index d783380294ab81f18a5c67e2d66bf8e5a33db2d4..aa58120451e135b76ad8d109ff78c4f337c01e2b 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -395,7 +395,7 @@ static SkSwizzler::ResultAlpha swizzle_bgra_to_n32_premul(
for (int x = 0; x < dstWidth; x++) {
uint8_t alpha = src[3];
UPDATE_RESULT_ALPHA(alpha);
- dst[x] = SkPreMultiplyARGB(alpha, src[2], src[1], src[0]);
+ dst[x] = SkPremultiplyARGBInline(alpha, src[2], src[1], src[0]);
src += deltaSrc;
}
return COMPUTE_RESULT_ALPHA;
@@ -440,7 +440,7 @@ static SkSwizzler::ResultAlpha swizzle_rgba_to_n32_premul(
for (int x = 0; x < dstWidth; x++) {
unsigned alpha = src[3];
UPDATE_RESULT_ALPHA(alpha);
- dst[x] = SkPreMultiplyARGB(alpha, src[0], src[1], src[2]);
+ dst[x] = SkPremultiplyARGBInline(alpha, src[0], src[1], src[2]);
src += deltaSrc;
}
return COMPUTE_RESULT_ALPHA;
@@ -473,7 +473,7 @@ static SkSwizzler::ResultAlpha swizzle_rgba_to_n32_premul_skipZ(
unsigned alpha = src[3];
UPDATE_RESULT_ALPHA(alpha);
if (0 != alpha) {
- dst[x] = SkPreMultiplyARGB(alpha, src[0], src[1], src[2]);
+ dst[x] = SkPremultiplyARGBInline(alpha, src[0], src[1], src[2]);
}
src += deltaSrc;
}
@@ -779,7 +779,7 @@ SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc,
// Store bpp in bytes if it is an even multiple, otherwise use bits
int srcBPP = SkIsAlign8(BitsPerPixel(sc)) ? BytesPerPixel(sc) : BitsPerPixel(sc);
int dstBPP = SkColorTypeBytesPerPixel(dstInfo.colorType());
-
+
int srcOffset = 0;
int srcWidth = dstInfo.width();
int dstOffset = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698