| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #include "SkBenchmark.h" | 8 #include "SkBenchmark.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
| 11 #include "SkRandom.h" | 11 #include "SkRandom.h" |
| 12 #include "SkShader.h" | 12 #include "SkShader.h" |
| 13 #include "SkString.h" | 13 #include "SkString.h" |
| 14 #include "SkMorphologyImageFilter.h" | 14 #include "SkMorphologyImageFilter.h" |
| 15 | 15 |
| 16 #define SMALL SkIntToScalar(2) | 16 #define SMALL SkIntToScalar(2) |
| 17 #define REAL SkFloatToScalar(1.5f) | 17 #define REAL 1.5f |
| 18 #define BIG SkIntToScalar(10) | 18 #define BIG SkIntToScalar(10) |
| 19 | 19 |
| 20 enum MorphologyType { | 20 enum MorphologyType { |
| 21 kErode_MT, | 21 kErode_MT, |
| 22 kDilate_MT | 22 kDilate_MT |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 static const char* gStyleName[] = { | 25 static const char* gStyleName[] = { |
| 26 "erode", | 26 "erode", |
| 27 "dilate" | 27 "dilate" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 DEF_BENCH( return new MorphologyBench(SMALL, kDilate_MT); ) | 91 DEF_BENCH( return new MorphologyBench(SMALL, kDilate_MT); ) |
| 92 | 92 |
| 93 DEF_BENCH( return new MorphologyBench(BIG, kErode_MT); ) | 93 DEF_BENCH( return new MorphologyBench(BIG, kErode_MT); ) |
| 94 DEF_BENCH( return new MorphologyBench(BIG, kDilate_MT); ) | 94 DEF_BENCH( return new MorphologyBench(BIG, kDilate_MT); ) |
| 95 | 95 |
| 96 DEF_BENCH( return new MorphologyBench(REAL, kErode_MT); ) | 96 DEF_BENCH( return new MorphologyBench(REAL, kErode_MT); ) |
| 97 DEF_BENCH( return new MorphologyBench(REAL, kDilate_MT); ) | 97 DEF_BENCH( return new MorphologyBench(REAL, kDilate_MT); ) |
| 98 | 98 |
| 99 DEF_BENCH( return new MorphologyBench(0, kErode_MT); ) | 99 DEF_BENCH( return new MorphologyBench(0, kErode_MT); ) |
| 100 #endif | 100 #endif |
| OLD | NEW |