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...) Expand 10 before | Expand all | Expand 10 after 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 #if SK_SUPPORT_GPU | 99 virtual bool asFragmentProcessor(GrContext* context, const SkPaint&, const S
kMatrix& viewM, |
100 const GrFragmentProcessor* asFragmentProcessor(GrContext* context, const SkM
atrix& viewM, | 100 const SkMatrix*, GrColor*, GrProcessorDataM
anager*, |
101 const SkMatrix*, SkFilterQual
ity, | 101 GrFragmentProcessor**) const override; |
102 GrProcessorDataManager*) cons
t override; | |
103 #endif | |
104 | 102 |
105 SK_TO_STRING_OVERRIDE() | 103 SK_TO_STRING_OVERRIDE() |
106 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPerlinNoiseShader) | 104 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPerlinNoiseShader) |
107 | 105 |
108 protected: | 106 protected: |
109 void flatten(SkWriteBuffer&) const override; | 107 void flatten(SkWriteBuffer&) const override; |
110 Context* onCreateContext(const ContextRec&, void* storage) const override; | 108 Context* onCreateContext(const ContextRec&, void* storage) const override; |
111 | 109 |
112 private: | 110 private: |
113 SkPerlinNoiseShader(SkPerlinNoiseShader::Type type, SkScalar baseFrequencyX, | 111 SkPerlinNoiseShader(SkPerlinNoiseShader::Type type, SkScalar baseFrequencyX, |
114 SkScalar baseFrequencyY, int numOctaves, SkScalar seed, | 112 SkScalar baseFrequencyY, int numOctaves, SkScalar seed, |
115 const SkISize* tileSize); | 113 const SkISize* tileSize); |
116 virtual ~SkPerlinNoiseShader(); | 114 virtual ~SkPerlinNoiseShader(); |
117 | 115 |
118 const SkPerlinNoiseShader::Type fType; | 116 const SkPerlinNoiseShader::Type fType; |
119 const SkScalar fBaseFrequencyX; | 117 const SkScalar fBaseFrequencyX; |
120 const SkScalar fBaseFrequencyY; | 118 const SkScalar fBaseFrequencyY; |
121 const int fNumOctaves; | 119 const int fNumOctaves; |
122 const SkScalar fSeed; | 120 const SkScalar fSeed; |
123 const SkISize fTileSize; | 121 const SkISize fTileSize; |
124 const bool fStitchTiles; | 122 const bool fStitchTiles; |
125 | 123 |
126 typedef SkShader INHERITED; | 124 typedef SkShader INHERITED; |
127 }; | 125 }; |
128 | 126 |
129 #endif | 127 #endif |
OLD | NEW |