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

Side by Side Diff: src/effects/gradients/Sk4fGradientBase.h

Issue 1816883002: Refactor 4f gradients using trait templates (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/effects/gradients/Sk4fGradientBase.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef Sk4fGradientBase_DEFINED 8 #ifndef Sk4fGradientBase_DEFINED
9 #define Sk4fGradientBase_DEFINED 9 #define Sk4fGradientBase_DEFINED
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 uint8_t fFlags; 52 uint8_t fFlags;
53 bool fDither; 53 bool fDither;
54 bool fColorsArePremul; 54 bool fColorsArePremul;
55 55
56 private: 56 private:
57 using INHERITED = SkShader::Context; 57 using INHERITED = SkShader::Context;
58 58
59 void addMirrorIntervals(const SkGradientShaderBase&, 59 void addMirrorIntervals(const SkGradientShaderBase&,
60 const Sk4f& componentScale, bool reverse); 60 const Sk4f& componentScale, bool reverse);
61 61
62 template<typename DstType, SkShader::TileMode tileMode> 62 template<DstType, SkShader::TileMode tileMode>
63 class TSampler; 63 class TSampler;
64 64
65 template <typename DstType, ApplyPremul> 65 template <DstType dstType, ApplyPremul premul>
66 void shadePremulSpan(int x, int y, DstType[], int count) const; 66 void shadePremulSpan(int x, int y, typename DstTraits<dstType, premul>::Type [],
67 int count) const;
67 68
68 template <typename DstType, ApplyPremul, SkShader::TileMode tileMode> 69 template <DstType dstType, ApplyPremul premul, SkShader::TileMode tileMode>
69 void shadeSpanInternal(int x, int y, DstType[], int count) const; 70 void shadeSpanInternal(int x, int y, typename DstTraits<dstType, premul>::Ty pe[],
71 int count) const;
70 }; 72 };
71 73
72 #endif // Sk4fGradientBase_DEFINED 74 #endif // Sk4fGradientBase_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/effects/gradients/Sk4fGradientBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698