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

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

Issue 1890253002: Observe gTreatSkColorAsSRGB for 4f gradients. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 12 matching lines...) Expand all
23 GradientShaderBase4fContext(const SkGradientShaderBase&, 23 GradientShaderBase4fContext(const SkGradientShaderBase&,
24 const ContextRec&); 24 const ContextRec&);
25 25
26 uint32_t getFlags() const override { return fFlags; } 26 uint32_t getFlags() const override { return fFlags; }
27 27
28 void shadeSpan(int x, int y, SkPMColor dst[], int count) override; 28 void shadeSpan(int x, int y, SkPMColor dst[], int count) override;
29 void shadeSpan4f(int x, int y, SkPM4f dst[], int count) override; 29 void shadeSpan4f(int x, int y, SkPM4f dst[], int count) override;
30 30
31 protected: 31 protected:
32 struct Interval { 32 struct Interval {
33 Interval(SkPMColor c0, SkScalar p0, 33 Interval(const Sk4f& c0, SkScalar p0,
34 SkPMColor c1, SkScalar p1, 34 const Sk4f& c1, SkScalar p1);
35 const Sk4f& componentScale);
36 35
37 bool isZeroRamp() const { return fZeroRamp; } 36 bool isZeroRamp() const { return fZeroRamp; }
38 37
39 SkPM4f fC0, fDc; 38 SkPM4f fC0, fDc;
40 SkScalar fP0, fP1; 39 SkScalar fP0, fP1;
41 bool fZeroRamp; 40 bool fZeroRamp;
42 }; 41 };
43 42
44 virtual void mapTs(int x, int y, SkScalar ts[], int count) const = 0; 43 virtual void mapTs(int x, int y, SkScalar ts[], int count) const = 0;
45 44
(...skipping 19 matching lines...) Expand all
65 template <DstType dstType, ApplyPremul premul> 64 template <DstType dstType, ApplyPremul premul>
66 void shadePremulSpan(int x, int y, typename DstTraits<dstType, premul>::Type [], 65 void shadePremulSpan(int x, int y, typename DstTraits<dstType, premul>::Type [],
67 int count) const; 66 int count) const;
68 67
69 template <DstType dstType, ApplyPremul premul, SkShader::TileMode tileMode> 68 template <DstType dstType, ApplyPremul premul, SkShader::TileMode tileMode>
70 void shadeSpanInternal(int x, int y, typename DstTraits<dstType, premul>::Ty pe[], 69 void shadeSpanInternal(int x, int y, typename DstTraits<dstType, premul>::Ty pe[],
71 int count) const; 70 int count) const;
72 }; 71 };
73 72
74 #endif // Sk4fGradientBase_DEFINED 73 #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