aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLinearBitmapPipeline_sample.h
diff options
context:
space:
mode:
authorGravatar herb <herb@google.com>2016-11-08 08:19:07 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-11-08 08:19:07 -0800
commit93b0650084285400102f2d65d5c4411185111085 (patch)
tree9153446b4650b20a6b69f0c7e47e604d880dd59e /src/core/SkLinearBitmapPipeline_sample.h
parent442fff958c911bbc354a56003e3a8d75805c45f6 (diff)
Change code to not store Sk4* in data structures.
This allows the SkLinearBitmapPipeline system to avoid problems with alignment. This allows it to naturally fit with the rest of the system, and simplifies surrounding code. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2486523002 Review-Url: https://codereview.chromium.org/2486523002
Diffstat (limited to 'src/core/SkLinearBitmapPipeline_sample.h')
-rw-r--r--src/core/SkLinearBitmapPipeline_sample.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/SkLinearBitmapPipeline_sample.h b/src/core/SkLinearBitmapPipeline_sample.h
index 5f9948c644..8e53136fea 100644
--- a/src/core/SkLinearBitmapPipeline_sample.h
+++ b/src/core/SkLinearBitmapPipeline_sample.h
@@ -65,15 +65,17 @@ 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) {
+ fTintColor = SkColor4f::FromColor(tintColor);
+ fTintColor.fA = 1.0f;
+ }
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;
+ SkColor4f fTintColor;
};
template <SkGammaType gammaType>