Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: include/effects/SkPerlinNoiseShader.h

Issue 1829303002: move setshader to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: addressing comments from #8 Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPaint.h ('k') | samplecode/SampleCamera.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkPerlinNoiseShader.h
diff --git a/include/effects/SkPerlinNoiseShader.h b/include/effects/SkPerlinNoiseShader.h
index d9b0277f92609c5616e399c0d8ba734a5a1b6575..d652e5dcad2e57e9b2a09035990f1a7c11d68265 100644
--- a/include/effects/SkPerlinNoiseShader.h
+++ b/include/effects/SkPerlinNoiseShader.h
@@ -55,21 +55,30 @@ public:
* the frequencies so that the noise will be tileable for the given tile size. If tileSize
* is NULL or an empty size, the frequencies will be used as is without modification.
*/
+ static sk_sp<SkShader> MakeFractalNoise(SkScalar baseFrequencyX, SkScalar baseFrequencyY,
+ int numOctaves, SkScalar seed,
+ const SkISize* tileSize = nullptr);
+ static sk_sp<SkShader> MakeTurbulence(SkScalar baseFrequencyX, SkScalar baseFrequencyY,
+ int numOctaves, SkScalar seed,
+ const SkISize* tileSize = nullptr);
+
+#ifdef SK_SUPPORT_LEGACY_CREATESHADER_PTR
static SkShader* CreateFractalNoise(SkScalar baseFrequencyX, SkScalar baseFrequencyY,
int numOctaves, SkScalar seed,
- const SkISize* tileSize = NULL);
+ const SkISize* tileSize = NULL) {
+ return MakeFractalNoise(baseFrequencyX, baseFrequencyY, numOctaves, seed, tileSize).release();
+ }
static SkShader* CreateTurbulence(SkScalar baseFrequencyX, SkScalar baseFrequencyY,
- int numOctaves, SkScalar seed,
- const SkISize* tileSize = NULL);
- /**
- * Create alias for CreateTurbulunce until all Skia users changed
- * its code to use the new naming
- */
+ int numOctaves, SkScalar seed,
+ const SkISize* tileSize = NULL) {
+ return MakeTurbulence(baseFrequencyX, baseFrequencyY, numOctaves, seed, tileSize).release();
+ }
static SkShader* CreateTubulence(SkScalar baseFrequencyX, SkScalar baseFrequencyY,
int numOctaves, SkScalar seed,
const SkISize* tileSize = NULL) {
return CreateTurbulence(baseFrequencyX, baseFrequencyY, numOctaves, seed, tileSize);
}
+#endif
class PerlinNoiseShaderContext : public SkShader::Context {
public:
« no previous file with comments | « include/core/SkPaint.h ('k') | samplecode/SampleCamera.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698