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

Unified Diff: src/core/SkBlitRow_D16.cpp

Issue 2097883002: revise row blits to keep intermediate precision so that color is preserved when blended against its… (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Fix overflow in destination scale calculation Created 4 years, 6 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
Index: src/core/SkBlitRow_D16.cpp
diff --git a/src/core/SkBlitRow_D16.cpp b/src/core/SkBlitRow_D16.cpp
index 9ac84c672df13f80c28b4855ad0afd1eac7d8f0e..648e0ea8bb16a439d4a51f99b969c589b69edd1a 100644
--- a/src/core/SkBlitRow_D16.cpp
+++ b/src/core/SkBlitRow_D16.cpp
@@ -180,7 +180,7 @@ static void S32A_D565_Blend_Dither(uint16_t* SK_RESTRICT dst,
{
unsigned d = *dst;
int sa = SkGetPackedA32(c);
- int dst_scale = SkAlpha255To256(255 - SkAlphaMul(sa, src_scale));
+ int dst_scale = SkAlphaMulInv256(sa, src_scale);
int dither = DITHER_VALUE(x);
int sr = SkGetPackedR32(c);

Powered by Google App Engine
This is Rietveld 408576698