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

Unified Diff: src/core/SkLinearBitmapPipeline_core.h

Issue 1886233006: Add 8888 fast SrcOver mode. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean CL Created 4 years, 8 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/SkLinearBitmapPipeline_core.h
diff --git a/src/core/SkLinearBitmapPipeline_core.h b/src/core/SkLinearBitmapPipeline_core.h
index 2759f0bb8ccc728472bb68a23d72c8bedf073007..0ced1a70b9815160d82ba2014260382f80c0deca 100644
--- a/src/core/SkLinearBitmapPipeline_core.h
+++ b/src/core/SkLinearBitmapPipeline_core.h
@@ -185,6 +185,19 @@ void span_fallback(Span span, Stage* stage) {
stage->pointListFew(count, xs, ys);
}
}
+
+class sRGBFast {
+public:
+ static Sk4f VECTORCALL sRGBToLinear(Sk4f pixel) {
+ Sk4f l = pixel * pixel;
+ return Sk4f{l[0], l[1], l[2], pixel[3]};
+ }
+ static Sk4f VECTORCALL LinearTosRGB(Sk4f pixel) {
+ Sk4f s = pixel.sqrt();
+ return Sk4f{s[0], s[1], s[2], pixel[3]};
+ }
+};
+
} // namespace
#endif // SkLinearBitmapPipeline_core_DEFINED

Powered by Google App Engine
This is Rietveld 408576698