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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 * baseFrequency * 1, * 2, * 4, ..., * 512, which quickly yields insignific
antly small | 51 * baseFrequency * 1, * 2, * 4, ..., * 512, which quickly yields insignific
antly small |
52 * periods and resembles regular unstructured noise rather than Perlin nois
e. | 52 * periods and resembles regular unstructured noise rather than Perlin nois
e. |
53 * | 53 * |
54 * If tileSize isn't NULL or an empty size, the tileSize parameter will be
used to modify | 54 * If tileSize isn't NULL or an empty size, the tileSize parameter will be
used to modify |
55 * the frequencies so that the noise will be tileable for the given tile si
ze. If tileSize | 55 * the frequencies so that the noise will be tileable for the given tile si
ze. If tileSize |
56 * is NULL or an empty size, the frequencies will be used as is without mod
ification. | 56 * is NULL or an empty size, the frequencies will be used as is without mod
ification. |
57 */ | 57 */ |
58 static SkShader* CreateFractalNoise(SkScalar baseFrequencyX, SkScalar baseFr
equencyY, | 58 static SkShader* CreateFractalNoise(SkScalar baseFrequencyX, SkScalar baseFr
equencyY, |
59 int numOctaves, SkScalar seed, | 59 int numOctaves, SkScalar seed, |
60 const SkISize* tileSize = NULL); | 60 const SkISize* tileSize = NULL); |
| 61 static SkShader* CreateTurbulence(SkScalar baseFrequencyX, SkScalar baseFreq
uencyY, |
| 62 int numOctaves, SkScalar seed, |
| 63 const SkISize* tileSize = NULL); |
| 64 /** |
| 65 * Create alias for CreateTurbulunce until all Skia users changed |
| 66 * its code to use the new naming |
| 67 */ |
61 static SkShader* CreateTubulence(SkScalar baseFrequencyX, SkScalar baseFrequ
encyY, | 68 static SkShader* CreateTubulence(SkScalar baseFrequencyX, SkScalar baseFrequ
encyY, |
62 int numOctaves, SkScalar seed, | 69 int numOctaves, SkScalar seed, |
63 const SkISize* tileSize = NULL); | 70 const SkISize* tileSize = NULL) { |
| 71 » return CreateTurbulence(baseFrequencyX, baseFrequencyY, numOctaves, seed
, tileSize); |
| 72 } |
| 73 |
64 | 74 |
65 virtual bool setContext(const SkBitmap& device, const SkPaint& paint, | 75 virtual bool setContext(const SkBitmap& device, const SkPaint& paint, |
66 const SkMatrix& matrix); | 76 const SkMatrix& matrix); |
67 virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE; | 77 virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE; |
68 virtual void shadeSpan16(int x, int y, uint16_t[], int count) SK_OVERRIDE; | 78 virtual void shadeSpan16(int x, int y, uint16_t[], int count) SK_OVERRIDE; |
69 | 79 |
70 virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint&) const S
K_OVERRIDE; | 80 virtual GrEffectRef* asNewEffect(GrContext* context, const SkPaint&) const S
K_OVERRIDE; |
71 | 81 |
72 SK_TO_STRING_OVERRIDE() | 82 SK_TO_STRING_OVERRIDE() |
73 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPerlinNoiseShader) | 83 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPerlinNoiseShader) |
(...skipping 28 matching lines...) Expand all Loading... |
102 /*const*/ bool fStitchTiles; | 112 /*const*/ bool fStitchTiles; |
103 // TODO (scroggo): Once setContext creates a new object, place this on that
object. | 113 // TODO (scroggo): Once setContext creates a new object, place this on that
object. |
104 SkMatrix fMatrix; | 114 SkMatrix fMatrix; |
105 | 115 |
106 PaintingData* fPaintingData; | 116 PaintingData* fPaintingData; |
107 | 117 |
108 typedef SkShader INHERITED; | 118 typedef SkShader INHERITED; |
109 }; | 119 }; |
110 | 120 |
111 #endif | 121 #endif |
OLD | NEW |