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 #include "SkMultiPictureDraw.h" | 10 #include "SkMultiPictureDraw.h" |
11 #include "SkSurface.h" | 11 #include "SkSurface.h" |
12 | 12 |
13 DEFINE_int32(benchTileW, 1600, "Tile width used for SKP playback."); | 13 DEFINE_int32(benchTileW, 256, "Tile width used for SKP playback."); |
14 DEFINE_int32(benchTileH, 512, "Tile height used for SKP playback."); | 14 DEFINE_int32(benchTileH, 256, "Tile height used for SKP playback."); |
15 | 15 |
16 SKPBench::SKPBench(const char* name, const SkPicture* pic, const SkIRect& clip,
SkScalar scale, | 16 SKPBench::SKPBench(const char* name, const SkPicture* pic, const SkIRect& clip,
SkScalar scale, |
17 bool useMultiPictureDraw) | 17 bool useMultiPictureDraw) |
18 : fPic(SkRef(pic)) | 18 : fPic(SkRef(pic)) |
19 , fClip(clip) | 19 , fClip(clip) |
20 , fScale(scale) | 20 , fScale(scale) |
21 , fName(name) | 21 , fName(name) |
22 , fUseMultiPictureDraw(useMultiPictureDraw) { | 22 , fUseMultiPictureDraw(useMultiPictureDraw) { |
23 fUniqueName.printf("%s_%.2g", name, scale); // Scale makes this unqiue for
perf.skia.org traces. | 23 fUniqueName.printf("%s_%.2g", name, scale); // Scale makes this unqiue for
perf.skia.org traces. |
24 if (useMultiPictureDraw) { | 24 if (useMultiPictureDraw) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 -fTileRects[j].fTop / fScale); | 121 -fTileRects[j].fTop / fScale); |
122 fSurfaces[j]->getCanvas()->drawPicture(fPic, &trans, NULL); | 122 fSurfaces[j]->getCanvas()->drawPicture(fPic, &trans, NULL); |
123 } | 123 } |
124 | 124 |
125 for (int j = 0; j < fTileRects.count(); ++j) { | 125 for (int j = 0; j < fTileRects.count(); ++j) { |
126 fSurfaces[j]->getCanvas()->flush(); | 126 fSurfaces[j]->getCanvas()->flush(); |
127 } | 127 } |
128 } | 128 } |
129 } | 129 } |
130 } | 130 } |
OLD | NEW |