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

Unified Diff: src/core/Sk4pxXfermode.h

Issue 1221683002: Revert of SoftLight with SkPMFloat (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | src/opts/SkXfermode_opts_SSE2.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/Sk4pxXfermode.h
diff --git a/src/core/Sk4pxXfermode.h b/src/core/Sk4pxXfermode.h
index 28fd9f1e7b478758106878715c2442bed4e8be75..b58718304610d7ff2decfa08de4db2e291660887 100644
--- a/src/core/Sk4pxXfermode.h
+++ b/src/core/Sk4pxXfermode.h
@@ -140,31 +140,6 @@
(s == Sk4f(0)).thenElse(srcover,
otherwise));
return srcover * SkPMFloat(1,0,0,0) + colors * SkPMFloat(0,1,1,1);
-}
-XFERMODE(SoftLight) {
- auto sa = s.alphas(),
- da = d.alphas(),
- isa = Sk4f(1)-sa,
- ida = Sk4f(1)-da;
-
- // Some common terms.
- auto m = (da > Sk4f(0)).thenElse(d / da, Sk4f(0)),
- s2 = Sk4f(2)*s,
- m4 = Sk4f(4)*m;
-
- // The logic forks three ways:
- // 1. dark src?
- // 2. light src, dark dst?
- // 3. light src, light dst?
- auto darkSrc = d*(sa + (s2 - sa)*(Sk4f(1) - m)), // Used in case 1.
- darkDst = (m4*m4 + m4)*(m - Sk4f(1)) + Sk4f(7)*m, // Used in case 2.
- liteDst = m.sqrt() - m, // Used in case 3.
- liteSrc = d*sa + da*(s2-sa)*(Sk4f(4)*d < da).thenElse(darkDst, liteDst); // Case 2 or 3?
-
- auto alpha = s + d*isa;
- auto colors = s*ida + d*isa + (s2 < sa).thenElse(darkSrc, liteSrc); // Case 1 or 2/3?
-
- return alpha * SkPMFloat(1,0,0,0) + colors * SkPMFloat(0,1,1,1);
}
#undef XFERMODE
@@ -269,7 +244,6 @@
case SkXfermode::kColorDodge_Mode: return SkTPMFloatXfermode<ColorDodge>::Create(rec);
case SkXfermode::kColorBurn_Mode: return SkTPMFloatXfermode<ColorBurn>::Create(rec);
- case SkXfermode::kSoftLight_Mode: return SkTPMFloatXfermode<SoftLight>::Create(rec);
#endif
default: break;
}
« no previous file with comments | « no previous file | src/opts/SkXfermode_opts_SSE2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698