diff options
author | 2012-12-13 22:09:28 +0000 | |
---|---|---|
committer | 2012-12-13 22:09:28 +0000 | |
commit | cbcef708914f3b5e9bb63ad3d87261378026e29b (patch) | |
tree | b446390666b9b11652f997a6e83fc95bbeb66420 /tools/PictureBenchmark.h | |
parent | c4013c199cae88684846b0f798c4d80fbcf19d63 (diff) |
Provide an option to bench drawing individual tiles in bench_pictures.
Provides output like the following:
running bench [1236 12045] androidpolice.skp
tile_256x256: tile [0,0] out of [5,48]: msecs = 1.00
tile_256x256: tile [1,0] out of [5,48]: msecs = 1.50
tile_256x256: tile [2,0] out of [5,48]: msecs = 1.00
tile_256x256: tile [3,0] out of [5,48]: msecs = 1.50
tile_256x256: tile [4,0] out of [5,48]: msecs = 2.50
tile_256x256: tile [0,1] out of [5,48]: msecs = 2.00
tile_256x256: tile [1,1] out of [5,48]: msecs = 3.50
tile_256x256: tile [2,1] out of [5,48]: msecs = 3.50
tile_256x256: tile [3,1] out of [5,48]: msecs = 6.00
tile_256x256: tile [4,1] out of [5,48]: msecs = 2.50
tile_256x256: tile [0,2] out of [5,48]: msecs = 2.00
BUG=https://code.google.com/p/skia/issues/detail?id=1016
Review URL: https://codereview.appspot.com/6937047
git-svn-id: http://skia.googlecode.com/svn/trunk@6805 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools/PictureBenchmark.h')
-rw-r--r-- | tools/PictureBenchmark.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/PictureBenchmark.h b/tools/PictureBenchmark.h index 0ab5ff9bf1..af81f69717 100644 --- a/tools/PictureBenchmark.h +++ b/tools/PictureBenchmark.h @@ -24,12 +24,25 @@ public: ~PictureBenchmark(); + /** + * Draw the provided SkPicture fRepeats times while collecting timing data, and log the output + * via fLogger. + */ void run(SkPicture* pict); void setRepeats(int repeats) { fRepeats = repeats; } + /** + * If true, tells run to log separate timing data for each individual tile. Each tile will be + * drawn fRepeats times. Requires the PictureRenderer set by setRenderer to be a + * TiledPictureRenderer. + */ + void setTimeIndividualTiles(bool indiv) { fTimeIndividualTiles = true; } + + bool timeIndividualTiles() { return fTimeIndividualTiles; } + PictureRenderer* setRenderer(PictureRenderer*); void setDeviceType(PictureRenderer::SkDeviceTypes deviceType) { @@ -63,6 +76,7 @@ private: bool fShowCpuTime; bool fShowTruncatedCpuTime; bool fShowGpuTime; + bool fTimeIndividualTiles; void logProgress(const char msg[]); |