Index: src/core/SkLinearBitmapPipeline_sample.h |
diff --git a/src/core/SkLinearBitmapPipeline_sample.h b/src/core/SkLinearBitmapPipeline_sample.h |
index 86ad6e146f0062ed779d493538f8f366ece46a00..759075b3e5ab3f2481e1f0af8d999448770bbd7d 100644 |
--- a/src/core/SkLinearBitmapPipeline_sample.h |
+++ b/src/core/SkLinearBitmapPipeline_sample.h |
@@ -170,11 +170,10 @@ public: |
PixelConverter(const SkPixmap& srcPixmap) { } |
Sk4f toSk4f(Element pixel) const { |
- float gray = pixel * (1.0f/255.0f); |
- Sk4f result = Sk4f{gray, gray, gray, 1.0f}; |
- return gammaType == kSRGB_SkGammaType |
- ? srgb_to_linear(result) |
- : result; |
+ float gray = (gammaType == kSRGB_SkGammaType) |
+ ? sk_linear_from_srgb[pixel] |
+ : pixel * (1/255.0f); |
+ return {gray, gray, gray, 1.0f}; |
} |
}; |