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 78 matching lines...) Loading... |
89 StitchData& stitchData, const SkPoint& point) const; | 89 StitchData& stitchData, const SkPoint& point) const; |
90 SkScalar noise2D(int channel, | 90 SkScalar noise2D(int channel, |
91 const StitchData& stitchData, const SkPoint& noiseVecto
r) const; | 91 const StitchData& stitchData, const SkPoint& noiseVecto
r) const; |
92 | 92 |
93 SkMatrix fMatrix; | 93 SkMatrix fMatrix; |
94 PaintingData* fPaintingData; | 94 PaintingData* fPaintingData; |
95 | 95 |
96 typedef SkShader::Context INHERITED; | 96 typedef SkShader::Context INHERITED; |
97 }; | 97 }; |
98 | 98 |
99 virtual bool asFragmentProcessor(GrContext* context, const SkPaint&, const S
kMatrix& viewM, | 99 #if SK_SUPPORT_GPU |
100 const SkMatrix*, GrColor*, GrProcessorDataM
anager*, | 100 const GrFragmentProcessor* asFragmentProcessor(GrContext* context, const SkM
atrix& viewM, |
101 GrFragmentProcessor**) const override; | 101 const SkMatrix*, SkFilterQual
ity, |
| 102 GrProcessorDataManager*) cons
t override; |
| 103 #endif |
102 | 104 |
103 SK_TO_STRING_OVERRIDE() | 105 SK_TO_STRING_OVERRIDE() |
104 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPerlinNoiseShader) | 106 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPerlinNoiseShader) |
105 | 107 |
106 protected: | 108 protected: |
107 void flatten(SkWriteBuffer&) const override; | 109 void flatten(SkWriteBuffer&) const override; |
108 Context* onCreateContext(const ContextRec&, void* storage) const override; | 110 Context* onCreateContext(const ContextRec&, void* storage) const override; |
109 | 111 |
110 private: | 112 private: |
111 SkPerlinNoiseShader(SkPerlinNoiseShader::Type type, SkScalar baseFrequencyX, | 113 SkPerlinNoiseShader(SkPerlinNoiseShader::Type type, SkScalar baseFrequencyX, |
112 SkScalar baseFrequencyY, int numOctaves, SkScalar seed, | 114 SkScalar baseFrequencyY, int numOctaves, SkScalar seed, |
113 const SkISize* tileSize); | 115 const SkISize* tileSize); |
114 virtual ~SkPerlinNoiseShader(); | 116 virtual ~SkPerlinNoiseShader(); |
115 | 117 |
116 const SkPerlinNoiseShader::Type fType; | 118 const SkPerlinNoiseShader::Type fType; |
117 const SkScalar fBaseFrequencyX; | 119 const SkScalar fBaseFrequencyX; |
118 const SkScalar fBaseFrequencyY; | 120 const SkScalar fBaseFrequencyY; |
119 const int fNumOctaves; | 121 const int fNumOctaves; |
120 const SkScalar fSeed; | 122 const SkScalar fSeed; |
121 const SkISize fTileSize; | 123 const SkISize fTileSize; |
122 const bool fStitchTiles; | 124 const bool fStitchTiles; |
123 | 125 |
124 typedef SkShader INHERITED; | 126 typedef SkShader INHERITED; |
125 }; | 127 }; |
126 | 128 |
127 #endif | 129 #endif |
OLD | NEW |