OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkPerlinNoiseShader_DEFINED | 8 #ifndef SkPerlinNoiseShader_DEFINED |
9 #define SkPerlinNoiseShader_DEFINED | 9 #define SkPerlinNoiseShader_DEFINED |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 | 74 |
75 size_t contextSize() const override; | 75 size_t contextSize() const override; |
76 | 76 |
77 class PerlinNoiseShaderContext : public SkShader::Context { | 77 class PerlinNoiseShaderContext : public SkShader::Context { |
78 public: | 78 public: |
79 PerlinNoiseShaderContext(const SkPerlinNoiseShader& shader, const Contex
tRec&); | 79 PerlinNoiseShaderContext(const SkPerlinNoiseShader& shader, const Contex
tRec&); |
80 virtual ~PerlinNoiseShaderContext(); | 80 virtual ~PerlinNoiseShaderContext(); |
81 | 81 |
82 void shadeSpan(int x, int y, SkPMColor[], int count) override; | 82 void shadeSpan(int x, int y, SkPMColor[], int count) override; |
83 void shadeSpan16(int x, int y, uint16_t[], int count) override; | |
84 | 83 |
85 private: | 84 private: |
86 SkPMColor shade(const SkPoint& point, StitchData& stitchData) const; | 85 SkPMColor shade(const SkPoint& point, StitchData& stitchData) const; |
87 SkScalar calculateTurbulenceValueForPoint( | 86 SkScalar calculateTurbulenceValueForPoint( |
88 int channel, | 87 int channel, |
89 StitchData& stitchData, const SkPoint& point) const; | 88 StitchData& stitchData, const SkPoint& point) const; |
90 SkScalar noise2D(int channel, | 89 SkScalar noise2D(int channel, |
91 const StitchData& stitchData, const SkPoint& noiseVecto
r) const; | 90 const StitchData& stitchData, const SkPoint& noiseVecto
r) const; |
92 | 91 |
93 SkMatrix fMatrix; | 92 SkMatrix fMatrix; |
(...skipping 25 matching lines...) Expand all Loading... |
119 const SkScalar fBaseFrequencyY; | 118 const SkScalar fBaseFrequencyY; |
120 const int fNumOctaves; | 119 const int fNumOctaves; |
121 const SkScalar fSeed; | 120 const SkScalar fSeed; |
122 const SkISize fTileSize; | 121 const SkISize fTileSize; |
123 const bool fStitchTiles; | 122 const bool fStitchTiles; |
124 | 123 |
125 typedef SkShader INHERITED; | 124 typedef SkShader INHERITED; |
126 }; | 125 }; |
127 | 126 |
128 #endif | 127 #endif |
OLD | NEW |