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

Side by Side Diff: bench/GameBench.cpp

Issue 347823004: Remove Sk prefix from some bench classes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkGMBench -> GMBench Created 6 years, 6 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
« no previous file with comments | « bench/GMBench.cpp ('k') | bench/GrMemoryPoolBench.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 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 "Benchmark.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 14
15 // This bench simulates the calls Skia sees from various HTML5 canvas 15 // This bench simulates the calls Skia sees from various HTML5 canvas
16 // game bench marks 16 // game bench marks
17 class GameBench : public SkBenchmark { 17 class GameBench : public Benchmark {
18 public: 18 public:
19 enum Type { 19 enum Type {
20 kScale_Type, 20 kScale_Type,
21 kTranslate_Type, 21 kTranslate_Type,
22 kRotate_Type 22 kRotate_Type
23 }; 23 };
24 24
25 enum Clear { 25 enum Clear {
26 kFull_Clear, 26 kFull_Clear,
27 kPartial_Clear 27 kPartial_Clear
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 if (inColorX && inColorY) { 297 if (inColorX && inColorY) {
298 SkASSERT(colorX < kNumAtlasedX && colorY < kNumAtlasedY); 298 SkASSERT(colorX < kNumAtlasedX && colorY < kNumAtlasedY);
299 *scanline = colors[colorX][colorY]; 299 *scanline = colors[colorX][colorY];
300 } else { 300 } else {
301 *scanline = 0x00000000; 301 *scanline = 0x00000000;
302 } 302 }
303 } 303 }
304 } 304 }
305 } 305 }
306 306
307 typedef SkBenchmark INHERITED; 307 typedef Benchmark INHERITED;
308 }; 308 };
309 309
310 // Partial clear 310 // Partial clear
311 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kScale_Type, 311 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kScale_Type,
312 GameBench::kPartial_Clear)); ) 312 GameBench::kPartial_Clear)); )
313 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, 313 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
314 GameBench::kPartial_Clear)); ) 314 GameBench::kPartial_Clear)); )
315 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, 315 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
316 GameBench::kPartial_Clear, true)); ) 316 GameBench::kPartial_Clear, true)); )
317 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kRotate_Type, 317 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kRotate_Type,
318 GameBench::kPartial_Clear)); ) 318 GameBench::kPartial_Clear)); )
319 319
320 // Full clear 320 // Full clear
321 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kScale_Type, 321 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kScale_Type,
322 GameBench::kFull_Clear)); ) 322 GameBench::kFull_Clear)); )
323 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, 323 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
324 GameBench::kFull_Clear)); ) 324 GameBench::kFull_Clear)); )
325 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, 325 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
326 GameBench::kFull_Clear, true)); ) 326 GameBench::kFull_Clear, true)); )
327 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kRotate_Type, 327 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kRotate_Type,
328 GameBench::kFull_Clear)); ) 328 GameBench::kFull_Clear)); )
329 329
330 // Atlased 330 // Atlased
331 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, 331 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
332 GameBench::kFull_Clear, false, true) ); ) 332 GameBench::kFull_Clear, false, true) ); )
333 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, 333 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type,
334 GameBench::kFull_Clear, false, true, true)); ) 334 GameBench::kFull_Clear, false, true, true)); )
OLDNEW
« no previous file with comments | « bench/GMBench.cpp ('k') | bench/GrMemoryPoolBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698