aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDraw.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-09-19 21:21:45 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-09-19 21:21:45 +0000
commit6a87fafc5ce0d7fdf1decf8bb9dd6942f2433add (patch)
treef28c9e6b0b632bcaf8891a0220e8b3e8af5724a1 /src/core/SkDraw.cpp
parent567283876109f25f5f253b1b6806f35bb6103f94 (diff)
revert match for newAlpha to exactly match old math, so we don't drive
dumprendertree crazy git-svn-id: http://skia.googlecode.com/svn/trunk@2287 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkDraw.cpp')
-rw-r--r--src/core/SkDraw.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 45f7bb2de9..e5027d4a55 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -862,7 +862,15 @@ bool SkDrawTreatAsHairline(const SkPaint& paint, const SkMatrix& matrix,
SkScalar len1 = fast_len(dst[1]);
if (len0 <= SK_Scalar1 && len1 <= SK_Scalar1) {
SkScalar modulate = SkScalarAve(len0, len1);
+#if 0
*newAlpha = SkToU8(SkScalarRoundToInt(modulate * paint.getAlpha()));
+#else
+ // this is the old technique, which we preserve for now so we don't
+ // change previous results (testing)
+ // the new way seems fine, its just (a tiny bit) different
+ int scale = (int)SkScalarMul(modulate, 256);
+ *newAlpha = paint.getAlpha() * scale >> 8;
+#endif
return true;
}
return false;