OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SKPBench.h" | 8 #include "SKPBench.h" |
9 #include "SkCommandLineFlags.h" | 9 #include "SkCommandLineFlags.h" |
10 | 10 |
11 DECLARE_int32(benchTile); | 11 DEFINE_int32(benchTile, 256, "Tile dimension used for SKP playback."); |
12 | 12 |
13 SKPBench::SKPBench(const char* name, const SkPicture* pic, const SkIRect& clip,
SkScalar scale) | 13 SKPBench::SKPBench(const char* name, const SkPicture* pic, const SkIRect& clip,
SkScalar scale) |
14 : fPic(SkRef(pic)) | 14 : fPic(SkRef(pic)) |
15 , fClip(clip) | 15 , fClip(clip) |
16 , fScale(scale) | 16 , fScale(scale) |
17 , fName(name) { | 17 , fName(name) { |
18 fUniqueName.printf("%s_%.2g", name, scale); // Scale makes this unqiue for
skiaperf.com traces. | 18 fUniqueName.printf("%s_%.2g", name, scale); // Scale makes this unqiue for
skiaperf.com traces. |
19 } | 19 } |
20 | 20 |
21 const char* SKPBench::onGetName() { | 21 const char* SKPBench::onGetName() { |
(...skipping 24 matching lines...) Expand all Loading... |
46 for (int x = bounds.fLeft; x < bounds.fRight; x += FLAGS_benchTile)
{ | 46 for (int x = bounds.fLeft; x < bounds.fRight; x += FLAGS_benchTile)
{ |
47 SkAutoCanvasRestore perTile(canvas, true/*save now*/); | 47 SkAutoCanvasRestore perTile(canvas, true/*save now*/); |
48 canvas->clipRect(SkRect::Make( | 48 canvas->clipRect(SkRect::Make( |
49 SkIRect::MakeXYWH(x, y, FLAGS_benchTile, FLAGS_bench
Tile))); | 49 SkIRect::MakeXYWH(x, y, FLAGS_benchTile, FLAGS_bench
Tile))); |
50 fPic->playback(canvas); | 50 fPic->playback(canvas); |
51 } | 51 } |
52 } | 52 } |
53 canvas->flush(); | 53 canvas->flush(); |
54 } | 54 } |
55 } | 55 } |
OLD | NEW |