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

Unified Diff: bench/PerlinNoiseBench.cpp

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 | « bench/PDFBench.cpp ('k') | bench/ShaderMaskBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PerlinNoiseBench.cpp
diff --git a/bench/PerlinNoiseBench.cpp b/bench/PerlinNoiseBench.cpp
index 7c4894d434132a047f958231b3b1080ccb04008b..6c98374bc350c76ebc71df7ad1c1fca3d61bffbd 100644
--- a/bench/PerlinNoiseBench.cpp
+++ b/bench/PerlinNoiseBench.cpp
@@ -41,13 +41,13 @@ private:
void test(int loops, SkCanvas* canvas, int x, int y, SkPerlinNoiseShader::Type type,
float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed,
bool stitchTiles) {
- SkShader* shader = (type == SkPerlinNoiseShader::kFractalNoise_Type) ?
- SkPerlinNoiseShader::CreateFractalNoise(baseFrequencyX, baseFrequencyY, numOctaves,
- seed, stitchTiles ? &fSize : nullptr) :
- SkPerlinNoiseShader::CreateTurbulence(baseFrequencyX, baseFrequencyY, numOctaves,
- seed, stitchTiles ? &fSize : nullptr);
+ sk_sp<SkShader> shader = (type == SkPerlinNoiseShader::kFractalNoise_Type) ?
+ SkPerlinNoiseShader::MakeFractalNoise(baseFrequencyX, baseFrequencyY, numOctaves,
+ seed, stitchTiles ? &fSize : nullptr) :
+ SkPerlinNoiseShader::MakeTurbulence(baseFrequencyX, baseFrequencyY, numOctaves,
+ seed, stitchTiles ? &fSize : nullptr);
SkPaint paint;
- paint.setShader(shader)->unref();
+ paint.setShader(shader);
for (int i = 0; i < loops; i++) {
this->drawClippedRect(canvas, x, y, paint);
« no previous file with comments | « bench/PDFBench.cpp ('k') | bench/ShaderMaskBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698