| 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 SkPerlinNoiseShader2_DEFINED | 8 #ifndef SkPerlinNoiseShader2_DEFINED |
| 9 #define SkPerlinNoiseShader2_DEFINED | 9 #define SkPerlinNoiseShader2_DEFINED |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 | 86 |
| 87 size_t contextSize() const override; | 87 size_t contextSize() const override; |
| 88 | 88 |
| 89 class PerlinNoiseShaderContext : public SkShader::Context { | 89 class PerlinNoiseShaderContext : public SkShader::Context { |
| 90 public: | 90 public: |
| 91 PerlinNoiseShaderContext(const SkPerlinNoiseShader2& shader, const Conte
xtRec&); | 91 PerlinNoiseShaderContext(const SkPerlinNoiseShader2& shader, const Conte
xtRec&); |
| 92 virtual ~PerlinNoiseShaderContext(); | 92 virtual ~PerlinNoiseShaderContext(); |
| 93 | 93 |
| 94 void shadeSpan(int x, int y, SkPMColor[], int count) override; | 94 void shadeSpan(int x, int y, SkPMColor[], int count) override; |
| 95 void shadeSpan16(int x, int y, uint16_t[], int count) override; | |
| 96 | 95 |
| 97 private: | 96 private: |
| 98 SkPMColor shade(const SkPoint& point, StitchData& stitchData) const; | 97 SkPMColor shade(const SkPoint& point, StitchData& stitchData) const; |
| 99 SkScalar calculateTurbulenceValueForPoint( | 98 SkScalar calculateTurbulenceValueForPoint( |
| 100 int channel, | 99 int channel, |
| 101 StitchData& stitchData, const SkPoint& point) const; | 100 StitchData& stitchData, const SkPoint& point) const; |
| 102 SkScalar calculateImprovedNoiseValueForPoint(int channel, const SkPoint&
point) const; | 101 SkScalar calculateImprovedNoiseValueForPoint(int channel, const SkPoint&
point) const; |
| 103 SkScalar noise2D(int channel, | 102 SkScalar noise2D(int channel, |
| 104 const StitchData& stitchData, const SkPoint& noiseVecto
r) const; | 103 const StitchData& stitchData, const SkPoint& noiseVecto
r) const; |
| 105 | 104 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 132 const SkScalar fBaseFrequencyY; | 131 const SkScalar fBaseFrequencyY; |
| 133 const int fNumOctaves; | 132 const int fNumOctaves; |
| 134 const SkScalar fSeed; | 133 const SkScalar fSeed; |
| 135 const SkISize fTileSize; | 134 const SkISize fTileSize; |
| 136 const bool fStitchTiles; | 135 const bool fStitchTiles; |
| 137 | 136 |
| 138 typedef SkShader INHERITED; | 137 typedef SkShader INHERITED; |
| 139 }; | 138 }; |
| 140 | 139 |
| 141 #endif | 140 #endif |
| OLD | NEW |