Chromium Code Reviews| Index: src/core/SkLinearBitmapPipeline_sample.h |
| diff --git a/src/core/SkLinearBitmapPipeline_sample.h b/src/core/SkLinearBitmapPipeline_sample.h |
| index 5f9948c644c7923a6150a4471f7db801994db90b..0a5b00f371be758d77c9de3ae98e9db37f001ed1 100644 |
| --- a/src/core/SkLinearBitmapPipeline_sample.h |
| +++ b/src/core/SkLinearBitmapPipeline_sample.h |
| @@ -65,15 +65,16 @@ template <> |
| class PixelConverter<kAlpha_8_SkColorType, kLinear_SkGammaType> { |
| public: |
| using Element = uint8_t; |
| - PixelConverter(const SkPixmap& srcPixmap, SkColor tintColor) |
| - : fTintColor{set_alpha(Sk4f_from_SkColor(tintColor), 1.0f)} { } |
| + PixelConverter(const SkPixmap& srcPixmap, SkColor tintColor) { |
| + set_alpha(Sk4f_from_SkColor(tintColor), 1.0f).store(&fTintColor); |
| + } |
| Sk4f toSk4f(const Element pixel) const { |
| - return fTintColor * (pixel * (1.0f/255.0f)); |
| + return Sk4f::Load(&fTintColor) * (pixel * (1.0f/255.0f)); |
| } |
| private: |
| - const Sk4f fTintColor; |
| + float fTintColor[4]; |
|
mtklein_C
2016/11/07 21:48:15
This may be a good place to use SkColor4f.
herb_g
2016/11/08 14:59:34
Done.
|
| }; |
| template <SkGammaType gammaType> |