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

Unified Diff: src/core/SkPM4fPriv.h

Issue 2046063002: linear -> sRGB: use fast approximate sqrt() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: found another 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
« no previous file with comments | « no previous file | src/core/SkXfermode4f.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPM4fPriv.h
diff --git a/src/core/SkPM4fPriv.h b/src/core/SkPM4fPriv.h
index 9650646d95d3bcfa012fede18fd38bb7fd477e65..bf5ff5a1ad44b4914caf36d005653dad4e20c5da 100644
--- a/src/core/SkPM4fPriv.h
+++ b/src/core/SkPM4fPriv.h
@@ -41,7 +41,7 @@ static inline Sk4f srgb_to_linear(const Sk4f& s4) {
}
static inline Sk4f linear_to_srgb(const Sk4f& l4) {
- return set_alpha(l4.sqrt(), get_alpha(l4));
+ return set_alpha(l4.rsqrt().invert(), get_alpha(l4));
}
static inline float srgb_to_linear(float x) {
« no previous file with comments | « no previous file | src/core/SkXfermode4f.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698