OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkBenchmark.h" | 8 #include "SkBenchmark.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 static const char* tilemodename(SkShader::TileMode tm) { | 131 static const char* tilemodename(SkShader::TileMode tm) { |
132 switch (tm) { | 132 switch (tm) { |
133 case SkShader::kClamp_TileMode: | 133 case SkShader::kClamp_TileMode: |
134 return "clamp"; | 134 return "clamp"; |
135 case SkShader::kRepeat_TileMode: | 135 case SkShader::kRepeat_TileMode: |
136 return "repeat"; | 136 return "repeat"; |
137 case SkShader::kMirror_TileMode: | 137 case SkShader::kMirror_TileMode: |
138 return "mirror"; | 138 return "mirror"; |
139 default: | 139 default: |
140 SkASSERT(!"unknown tilemode"); | 140 SkDEBUGFAIL("unknown tilemode"); |
141 return "error"; | 141 return "error"; |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 static const char* geomtypename(GeomType gt) { | 145 static const char* geomtypename(GeomType gt) { |
146 switch (gt) { | 146 switch (gt) { |
147 case kRect_GeomType: | 147 case kRect_GeomType: |
148 return "rectangle"; | 148 return "rectangle"; |
149 case kOval_GeomType: | 149 case kOval_GeomType: |
150 return "oval"; | 150 return "oval"; |
151 default: | 151 default: |
152 SkASSERT(!"unknown geometry type"); | 152 SkDEBUGFAIL("unknown geometry type"); |
153 return "error"; | 153 return "error"; |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 /////////////////////////////////////////////////////////////////////////////// | 157 /////////////////////////////////////////////////////////////////////////////// |
158 | 158 |
159 class GradientBench : public SkBenchmark { | 159 class GradientBench : public SkBenchmark { |
160 SkString fName; | 160 SkString fName; |
161 SkShader* fShader; | 161 SkShader* fShader; |
162 int fCount; | 162 int fCount; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 DEF_BENCH( return new GradientBench(p, kSweep_GradType); ) | 286 DEF_BENCH( return new GradientBench(p, kSweep_GradType); ) |
287 DEF_BENCH( return new GradientBench(p, kSweep_GradType, gGradData[1]); ) | 287 DEF_BENCH( return new GradientBench(p, kSweep_GradType, gGradData[1]); ) |
288 DEF_BENCH( return new GradientBench(p, kRadial2_GradType); ) | 288 DEF_BENCH( return new GradientBench(p, kRadial2_GradType); ) |
289 DEF_BENCH( return new GradientBench(p, kRadial2_GradType, gGradData[1]); ) | 289 DEF_BENCH( return new GradientBench(p, kRadial2_GradType, gGradData[1]); ) |
290 DEF_BENCH( return new GradientBench(p, kRadial2_GradType, gGradData[0], SkShader
::kMirror_TileMode); ) | 290 DEF_BENCH( return new GradientBench(p, kRadial2_GradType, gGradData[0], SkShader
::kMirror_TileMode); ) |
291 DEF_BENCH( return new GradientBench(p, kConical_GradType); ) | 291 DEF_BENCH( return new GradientBench(p, kConical_GradType); ) |
292 DEF_BENCH( return new GradientBench(p, kConical_GradType, gGradData[1]); ) | 292 DEF_BENCH( return new GradientBench(p, kConical_GradType, gGradData[1]); ) |
293 | 293 |
294 DEF_BENCH( return new Gradient2Bench(p, false); ) | 294 DEF_BENCH( return new Gradient2Bench(p, false); ) |
295 DEF_BENCH( return new Gradient2Bench(p, true); ) | 295 DEF_BENCH( return new Gradient2Bench(p, true); ) |
OLD | NEW |