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

Unified Diff: src/core/SkBlitter_ARGB32.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: guard more changes with SK_SUPPORT_LEGACY_BROKEN_LERP Created 4 years, 4 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/core/SkBlitter_A8.cpp ('k') | src/core/SkSpriteBlitter_RGB16.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter_ARGB32.cpp
diff --git a/src/core/SkBlitter_ARGB32.cpp b/src/core/SkBlitter_ARGB32.cpp
index 7adab5544537fd052897d4dfdcb3e4a6b20246b4..aada0586a4b2dfb0bd7e2e9ae221b613b41138d1 100644
--- a/src/core/SkBlitter_ARGB32.cpp
+++ b/src/core/SkBlitter_ARGB32.cpp
@@ -237,7 +237,11 @@ void SkARGB32_Blitter::blitV(int x, int y, int height, SkAlpha alpha) {
color = SkAlphaMulQ(color, SkAlpha255To256(alpha));
}
+#ifdef SK_SUPPORT_LEGACY_BROKEN_LERP
unsigned dst_scale = 255 - SkGetPackedA32(color);
+#else
+ unsigned dst_scale = SkAlpha255To256(255 - SkGetPackedA32(color));
+#endif
size_t rowBytes = fDevice.rowBytes();
while (--height >= 0) {
device[0] = color + SkAlphaMulQ(device[0], dst_scale);
« no previous file with comments | « src/core/SkBlitter_A8.cpp ('k') | src/core/SkSpriteBlitter_RGB16.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698