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

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

Issue 1764183002: Relocate the specialized linear gradient interval builder (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
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 Sk4fLinearGradient_DEFINED 8 #ifndef Sk4fLinearGradient_DEFINED
9 #define Sk4fLinearGradient_DEFINED 9 #define Sk4fLinearGradient_DEFINED
10 10
11 #include "Sk4fGradientBase.h" 11 #include "Sk4fGradientBase.h"
12 #include "SkLinearGradient.h" 12 #include "SkLinearGradient.h"
13 13
14 class SkLinearGradient:: 14 class SkLinearGradient::
15 LinearGradient4fContext : public GradientShaderBase4fContext { 15 LinearGradient4fContext : public GradientShaderBase4fContext {
16 public: 16 public:
17 LinearGradient4fContext(const SkLinearGradient&, const ContextRec&); 17 LinearGradient4fContext(const SkLinearGradient&, const ContextRec&);
18 18
19 void shadeSpan(int x, int y, SkPMColor dst[], int count) override; 19 void shadeSpan(int x, int y, SkPMColor dst[], int count) override;
20 void shadeSpan4f(int x, int y, SkPM4f dst[], int count) override; 20 void shadeSpan4f(int x, int y, SkPM4f dst[], int count) override;
21 21
22 private: 22 private:
23 using INHERITED = GradientShaderBase4fContext; 23 using INHERITED = GradientShaderBase4fContext;
24 24
25 void addMirrorIntervals(const SkLinearGradient&, const Sk4f& componentScale,
26 bool dx_is_pos);
27
25 template<typename DstType, TileMode> 28 template<typename DstType, TileMode>
26 class LinearIntervalProcessor; 29 class LinearIntervalProcessor;
27 30
28 template <typename DstType, bool premul> 31 template <typename DstType, bool premul>
29 void shadePremulSpan(int x, int y, DstType[], int count) const; 32 void shadePremulSpan(int x, int y, DstType[], int count) const;
30 33
31 template <typename DstType, bool premul, SkShader::TileMode tileMode> 34 template <typename DstType, bool premul, SkShader::TileMode tileMode>
32 void shadePremulTileSpan(int x, int y, DstType[], int count) const; 35 void shadePremulTileSpan(int x, int y, DstType[], int count) const;
33 36
34 template <typename DstType, bool premul, SkShader::TileMode tileMode> 37 template <typename DstType, bool premul, SkShader::TileMode tileMode>
35 void shadeSpanInternal(int x, int y, DstType[], int count) const; 38 void shadeSpanInternal(int x, int y, DstType[], int count) const;
39
40 const Interval* findInterval(SkScalar fx) const;
41
42 mutable const Interval* fCachedInterval;
36 }; 43 };
37 44
38 #endif // Sk4fLinearGradient_DEFINED 45 #endif // Sk4fLinearGradient_DEFINED
OLDNEW
« no previous file with comments | « src/effects/gradients/Sk4fGradientBase.cpp ('k') | src/effects/gradients/Sk4fLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698