Index: src/core/SkXfermode4f.cpp |
diff --git a/src/core/SkXfermode4f.cpp b/src/core/SkXfermode4f.cpp |
index 4d224ac0ad788d59af06b219f716555eae01b0dd..8671df7b2fcf102a43f2d6f16ac7006d89310d54 100644 |
--- a/src/core/SkXfermode4f.cpp |
+++ b/src/core/SkXfermode4f.cpp |
@@ -68,10 +68,10 @@ static Sk4x4f load_4_srgb(const void* ptr) { |
// Store an Sk4x4f back to 4 interlaced 8888 sRGB pixels. |
static void store_4_srgb(void* ptr, const Sk4x4f& p) { |
// Convert back to sRGB and [0,255], again approximating sRGB as gamma == 2. |
- auto r = p.r.sqrt() * 255.0f + 0.5f, |
- g = p.g.sqrt() * 255.0f + 0.5f, |
- b = p.b.sqrt() * 255.0f + 0.5f, |
- a = p.a * 255.0f + 0.5f; |
+ auto r = p.r.rsqrt().invert() * 255.0f + 0.5f, |
+ g = p.g.rsqrt().invert() * 255.0f + 0.5f, |
+ b = p.b.rsqrt().invert() * 255.0f + 0.5f, |
+ a = p.a * 255.0f + 0.5f; |
Sk4x4f{r,g,b,a}.transpose((uint8_t*)ptr); |
} |