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

Unified Diff: src/core/SkLinearBitmapPipeline_sample.h

Issue 2486523002: Change code to not store Sk4* in data structures. (Closed)
Patch Set: Created 4 years, 1 month 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
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>

Powered by Google App Engine
This is Rietveld 408576698