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

Side by Side Diff: bench/PerlinNoiseBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bench/PathUtilsBench.cpp ('k') | bench/PicturePlaybackBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "SkBenchmark.h" 7 #include "SkBenchmark.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPerlinNoiseShader.h" 9 #include "SkPerlinNoiseShader.h"
10 10
(...skipping 30 matching lines...) Expand all
41 void test(SkCanvas* canvas, int x, int y, SkPerlinNoiseShader::Type type, 41 void test(SkCanvas* canvas, int x, int y, SkPerlinNoiseShader::Type type,
42 float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, 42 float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed,
43 bool stitchTiles) { 43 bool stitchTiles) {
44 SkShader* shader = (type == SkPerlinNoiseShader::kFractalNoise_Type) ? 44 SkShader* shader = (type == SkPerlinNoiseShader::kFractalNoise_Type) ?
45 SkPerlinNoiseShader::CreateFractalNoise(baseFrequencyX, baseFrequenc yY, numOctaves, 45 SkPerlinNoiseShader::CreateFractalNoise(baseFrequencyX, baseFrequenc yY, numOctaves,
46 seed, stitchTiles ? &fSize : NULL) : 46 seed, stitchTiles ? &fSize : NULL) :
47 SkPerlinNoiseShader::CreateTubulence(baseFrequencyX, baseFrequencyY, numOctaves, 47 SkPerlinNoiseShader::CreateTubulence(baseFrequencyX, baseFrequencyY, numOctaves,
48 seed, stitchTiles ? &fSize : NU LL); 48 seed, stitchTiles ? &fSize : NU LL);
49 SkPaint paint; 49 SkPaint paint;
50 paint.setShader(shader)->unref(); 50 paint.setShader(shader)->unref();
51 this->drawClippedRect(canvas, x, y, paint); 51
52 for (int i = 0; i < this->getLoops(); i++) {
53 this->drawClippedRect(canvas, x, y, paint);
54 }
52 } 55 }
53 56
54 typedef SkBenchmark INHERITED; 57 typedef SkBenchmark INHERITED;
55 }; 58 };
56 59
57 /////////////////////////////////////////////////////////////////////////////// 60 ///////////////////////////////////////////////////////////////////////////////
58 61
59 DEF_BENCH( return new PerlinNoiseBench(p); ) 62 DEF_BENCH( return new PerlinNoiseBench(p); )
OLDNEW
« no previous file with comments | « bench/PathUtilsBench.cpp ('k') | bench/PicturePlaybackBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698