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

Unified Diff: src/core/SkLinearBitmapPipeline_sample.h

Issue 2486523002: Change code to not store Sk4* in data structures. (Closed)
Patch Set: Address comments 2 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
« no previous file with comments | « src/core/SkLinearBitmapPipeline_matrix.h ('k') | src/core/SkLinearBitmapPipeline_tile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLinearBitmapPipeline_sample.h
diff --git a/src/core/SkLinearBitmapPipeline_sample.h b/src/core/SkLinearBitmapPipeline_sample.h
index 5f9948c644c7923a6150a4471f7db801994db90b..8e53136fea4bb6622ef2e9a6bd3b7baacec51164 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>
« no previous file with comments | « src/core/SkLinearBitmapPipeline_matrix.h ('k') | src/core/SkLinearBitmapPipeline_tile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698