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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 SkScalar noise2D(int channel, | 95 SkScalar noise2D(int channel, |
96 const StitchData& stitchData, const SkPoint& noiseVecto
r) const; | 96 const StitchData& stitchData, const SkPoint& noiseVecto
r) const; |
97 | 97 |
98 SkMatrix fMatrix; | 98 SkMatrix fMatrix; |
99 PaintingData* fPaintingData; | 99 PaintingData* fPaintingData; |
100 | 100 |
101 typedef SkShader::Context INHERITED; | 101 typedef SkShader::Context INHERITED; |
102 }; | 102 }; |
103 | 103 |
104 #if SK_SUPPORT_GPU | 104 #if SK_SUPPORT_GPU |
105 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext* context, const SkM
atrix& viewM, | 105 sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const overri
de; |
106 const SkMatrix*, SkFilterQual
ity, | |
107 SkSourceGammaTreatment) const
override; | |
108 #endif | 106 #endif |
109 | 107 |
110 SK_TO_STRING_OVERRIDE() | 108 SK_TO_STRING_OVERRIDE() |
111 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPerlinNoiseShader) | 109 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPerlinNoiseShader) |
112 | 110 |
113 protected: | 111 protected: |
114 void flatten(SkWriteBuffer&) const override; | 112 void flatten(SkWriteBuffer&) const override; |
115 Context* onCreateContext(const ContextRec&, void* storage) const override; | 113 Context* onCreateContext(const ContextRec&, void* storage) const override; |
116 size_t onContextSize(const ContextRec&) const override; | 114 size_t onContextSize(const ContextRec&) const override; |
117 | 115 |
118 private: | 116 private: |
119 SkPerlinNoiseShader(SkPerlinNoiseShader::Type type, SkScalar baseFrequencyX, | 117 SkPerlinNoiseShader(SkPerlinNoiseShader::Type type, SkScalar baseFrequencyX, |
120 SkScalar baseFrequencyY, int numOctaves, SkScalar seed, | 118 SkScalar baseFrequencyY, int numOctaves, SkScalar seed, |
121 const SkISize* tileSize); | 119 const SkISize* tileSize); |
122 virtual ~SkPerlinNoiseShader(); | 120 virtual ~SkPerlinNoiseShader(); |
123 | 121 |
124 const SkPerlinNoiseShader::Type fType; | 122 const SkPerlinNoiseShader::Type fType; |
125 const SkScalar fBaseFrequencyX; | 123 const SkScalar fBaseFrequencyX; |
126 const SkScalar fBaseFrequencyY; | 124 const SkScalar fBaseFrequencyY; |
127 const int fNumOctaves; | 125 const int fNumOctaves; |
128 const SkScalar fSeed; | 126 const SkScalar fSeed; |
129 const SkISize fTileSize; | 127 const SkISize fTileSize; |
130 const bool fStitchTiles; | 128 const bool fStitchTiles; |
131 | 129 |
132 typedef SkShader INHERITED; | 130 typedef SkShader INHERITED; |
133 }; | 131 }; |
134 | 132 |
135 #endif | 133 #endif |
OLD | NEW |