Share common code between bench_ and render_ to set up the PictureRenderer.
Fix an include error in SkPictureRenderer.h.
Simplified parameter passing in render_pictures_main.
Switch to using an SkAutoTUnref for the PictureRenderer.
I also changed the input format somewhat, so the buildbots need to be updated as well: https://codereview.appspot.com/7441044/
Fixed a bug in PictureBenchmark where calling setTimeIndividualTiles(false) sets the member variable to true.
Removed setDeviceType from PictureBenchmark, since only the PictureRenderer needs to know which device type to use.
Some changes to the input format:
'--logPerIter' no longer takes a 1 or 0. Instead, '--logPerIter'
turns it on and '--nologPerIter' turns it off (with off as the
default). (Note that this is for bench_pictures; bench still uses the old format)
Change '--device' to '--config' and 'bitmap' to '8888' to be
the same as gm.
Requires '--r' before inputs (to match gm), though there can be multiple inputs following it.
Changed --enable-deferred-image-decoding (which no one uses but me yet anyway) to --deferImageDecoding, since the former is incompatible with the flag parser.
Changes to behavior:
Show a short error message on failure (rather than the explanation of all
flags).
BUG=https://code.google.com/p/skia/issues/detail?id=1094
Review URL: https://codereview.appspot.com/7230053
git-svn-id: http://skia.googlecode.com/svn/trunk@7961 2bbb7eff-a529-9590-31e7-b0007b416f81
This patch changes the semantics of tileWidth/Height to include the border region, and
uses an offset to take into account the fact that there is no outer border for outer
tiles. This patch also fixes a previous bug where the right column and bottom row were
considered to be included in bounds that are expressed as an SkIRect.
Companion Chromium CL required for roll: https://codereview.chromium.org/12221077/
TEST=TileGrid unit test
Review URL: https://codereview.appspot.com/7350050
git-svn-id: http://skia.googlecode.com/svn/trunk@7885 2bbb7eff-a529-9590-31e7-b0007b416f81
When timing individual tiles in bench_pictures, keep a timer running
across all repeats, and then take the average. The former method of
timing each iteration separately runs into precision errors on some
platforms.
Running on my Mac Pro with OSX 10.8, the cmsecs for the new method
and the old method are roughly the same when checking the CPU time.
When checking the wall time, the old method often gives me 0ms,
while the new method gives me a larger value. I don't think this
can be entirely attributed to rounding though, since on occasion I
see the old method showing a short time period (.05 - .15ms) while
the new method shows .15ms higher (which is in range for the
difference I'm seeing for other tiles where the old method reports
0ms).
Some other changes:
PictureRenderer::resetState now takes a boolean parameter. If called
with false, it will only do a flush, while if called with true, it
will also call finish.
resetState is now called with true everywhere except in between
iterations of drawing the same tile (when timing individual tiles).
render_pictures_main no longer calls resetState directly, since it
already calls end, which calls resetState.
BUG=http://code.google.com/p/skia/issues/detail?id=1066
Review URL: https://codereview.appspot.com/7101060
git-svn-id: http://skia.googlecode.com/svn/trunk@7424 2bbb7eff-a529-9590-31e7-b0007b416f81
1) flag to verify PNGs produced by render_picture that produce the same pixels
as simple renderer.
2) flag to write one single image (in tile we write individual tiles) - this
will help running skdiff also
3) flag to clone the picture before rendering
git-svn-id: http://skia.googlecode.com/svn/trunk@6890 2bbb7eff-a529-9590-31e7-b0007b416f81
In TiledPictureRenderer and CopyTilesRenderer, do a postTranslate so
the translate is not affected by the scale factor.
Likewise, use clipRegion for tiled renderer so it will be
unaffected by the scale factor.
Respect the viewport for record, playbackCreation, and pipe renderers.
Review URL: https://codereview.appspot.com/6947072
git-svn-id: http://skia.googlecode.com/svn/trunk@6853 2bbb7eff-a529-9590-31e7-b0007b416f81
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
Builds on https://codereview.appspot.com/6718046/ by mtklein.
Previously, each iteration of drawing a picture started new threads to draw the picture. Since each thread is using thread local storage for the font cache, this means that each iteration had to start with an empty font cache.
The newly added MultiCorePictureRenderer, separated from TiledPictureRenderer, now starts the drawing threads at the beginning of the test using an SkThreadPool, and keeps them alive through all iterations, so the font cache can be reused.
For now, I have removed the pipe version of the threaded renderer.
Updated bench_pictures_main and render_pictures_main to use the new
renderer, and to unref a renderer before early exit.
Review URL: https://codereview.appspot.com/6777063
git-svn-id: http://skia.googlecode.com/svn/trunk@6285 2bbb7eff-a529-9590-31e7-b0007b416f81
Since the passed in picture may represent an image which is too large
to be represented on the GPU, never create such a large canvas. Instead,
after drawing to each tile, create a file showing just that tile.
Review URL: https://codereview.appspot.com/6532056
git-svn-id: http://skia.googlecode.com/svn/trunk@5603 2bbb7eff-a529-9590-31e7-b0007b416f81
Also includes some code cleanup and code sharing.
Allow setting the number of threads on the command line.
Rename ThreadSafePipeController::playback to ::draw, to be the same
as SkPicture so DrawTileToCanvas can take a template parameter.
Disallow multithreading with GPU turned on.
Display help information with improper tiled arguments.
BUG=https://code.google.com/p/skia/issues/detail?id=871
Review URL: https://codereview.appspot.com/6536050
git-svn-id: http://skia.googlecode.com/svn/trunk@5602 2bbb7eff-a529-9590-31e7-b0007b416f81
Move SkBenchLogger into separate files and make bench_pictures use it.
Remove sk_tools::print_msg, since SkBenchLogger is now used instead.
Combine picture_benchmark with bench_pictures, since that is the
only project that uses it.
Refactor the aggregator for bench timer data into its own class and
make bench_pictures use it.
Consolidate the various virtual PictureBenchmark::run functions
into one for reuse.
BUG=https://code.google.com/p/skia/issues/detail?id=822
Review URL: https://codereview.appspot.com/6488086
git-svn-id: http://skia.googlecode.com/svn/trunk@5432 2bbb7eff-a529-9590-31e7-b0007b416f81