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

Unified Diff: src/effects/SkArithmeticMode.cpp

Issue 15917010: Fix alpha computation in SkArithmeticMode. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add testcase to arithmode GM Created 7 years, 7 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 | « gm/arithmode.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkArithmeticMode.cpp
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp
index 7492cce5ec089bacdba84a67efafa8b56dbee3ed..5bc48f1ce92068af42ee7bf5d0db4b0ad5a71d90 100644
--- a/src/effects/SkArithmeticMode.cpp
+++ b/src/effects/SkArithmeticMode.cpp
@@ -73,12 +73,12 @@ void SkArithmeticMode_scalar::xfer32(SkPMColor dst[], const SkPMColor src[],
int da = SkGetPackedA32(dc);
int srcNeedsUnpremul = needsUnpremul(sa);
- int dstNeedsUnpremul = needsUnpremul(sa);
+ int dstNeedsUnpremul = needsUnpremul(da);
int a, r, g, b;
if (!srcNeedsUnpremul && !dstNeedsUnpremul) {
- a = arith(k1, k2, k3, k4, sa, sa);
+ a = arith(k1, k2, k3, k4, sa, da);
r = arith(k1, k2, k3, k4, SkGetPackedR32(sc), SkGetPackedR32(dc));
g = arith(k1, k2, k3, k4, SkGetPackedG32(sc), SkGetPackedG32(dc));
b = arith(k1, k2, k3, k4, SkGetPackedB32(sc), SkGetPackedB32(dc));
@@ -103,7 +103,7 @@ void SkArithmeticMode_scalar::xfer32(SkPMColor dst[], const SkPMColor src[],
db = SkUnPreMultiply::ApplyScale(scale, db);
}
- a = arith(k1, k2, k3, k4, sa, sa);
+ a = arith(k1, k2, k3, k4, sa, da);
r = arith(k1, k2, k3, k4, sr, dr);
g = arith(k1, k2, k3, k4, sg, dg);
b = arith(k1, k2, k3, k4, sb, db);
« no previous file with comments | « gm/arithmode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698