skia2/bench
kkinnunen b4a797f3aa Move font loading in gm tests and benches out of constructors
Constructing the gm tests and benches causes many calls to font loads.
This is visible as profiling samples in fontconfig and freetype on Linux
for all profiling runs of nanobench. This complicates analysis of
test-cases that are suspected of being slow due to font-related issues.

Move the font loading to GM::onOnceBeforeDraw and Benchmark::onPreDraw.
This way the code is not executed if the testcase does not match the
nanobench --match filter. This way the samples in font-related code are
more easy to identify as legitimate occurances caused by the testcase.

This should not cause differences in timings, because:
* Benchmark::preDraw / onPreDraw is defined to be run outside the timer
* GM::runAsBench is not enabled for any of the modified testcases. Also
  nanobench untimed warmup round should run the onOnceBeforeDraw.
  (and there are other GM::runAsBench gms already doing loading in
   onOnceBeforeDraw).

Changes the behavior:
In TextBench:
Before, the test would report two different gms with the same name if
the color emoji font was not loaded successfully.
After, the test always reports all tests as individual names.

Generally:
The errors from loading fonts now print inbetween each testcase, as
opposed to printing during construction phase. Sample output:
( 143/145 MB  1872) 14.7ms	8888 gm  quadclosepathResource /fonts/Funkster.ttf not a valid font.
( 160/160 MB  1831) 575µs	8888 gm  surfacenewResource /fonts/Funkster.ttf not a valid font.
( 163/165 MB  1816) 12.5ms	8888 gm  linepathResource /fonts/Funkster.ttf not a valid font.
( 263/411 MB  1493) 118ms	8888 gm  typefacestyles_kerningResource /fonts/Funkster.ttf not a valid font.
( 374/411 MB  1231) 7.16ms	565 gm  getpostextpathResource /fonts/Funkster.ttf not a valid font.
( 323/411 MB  1179) 4.92ms	565 gm  stringartResource /fonts/Funkster.ttf not a valid font.
( 347/493 MB   917) 191ms	565 gm  patch_gridResource /fonts/Funkster.ttf not a valid font.
( 375/493 MB   857) 23.9ms	gpu gm  clipdrawdrawCannot render path (0)
( 393/493 MB   706) 2.91ms	unit test  ParsePath------ png error IEND: CRC error
( 394/493 MB   584) 166ms	gpu gm  hairmodesResource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
...

Review URL: https://codereview.chromium.org/1144023002
2015-05-21 06:15:28 -07:00
..
AAClipBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
AlternatingColorPatternBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
bench_compare.py Make bench_compare executable. 2013-11-12 15:25:31 +00:00
bench_util.py Restore bench_util.py 2014-08-08 17:28:53 -04:00
BenchLogger.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
BenchLogger.h Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
Benchmark.cpp SkPaint::FilterLevel -> SkFilterQuality 2015-03-16 10:08:34 -07:00
Benchmark.h Add _aa variants of Xfermode benches. 2015-05-13 11:54:00 -07:00
BezierBench.cpp Draw more accurate thick-stroked Beziers (disabled) 2014-10-09 05:36:04 -07:00
BigPathBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BigPathBench.inc add bench for very big paths 2015-02-06 13:04:16 -08:00
BitmapBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BitmapRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BitmapScaleBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BlurBench.cpp 2D kernel initial wiring for Guassian 2014-08-11 13:55:34 -07:00
BlurImageFilterBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BlurRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BlurRectsBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
BlurRoundRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ChartBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
check_bench_regressions.py Adds dashboard link for one-line plot on each alert item. 2014-05-13 17:38:17 +00:00
ChecksumBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ChromeBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
CmapBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
CodecBench.cpp Test SkCodec to kIndex8 in nanobench. 2015-04-02 13:22:38 -07:00
CodecBench.h Test SkCodec to kIndex8 in nanobench. 2015-04-02 13:22:38 -07:00
ColorCubeBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ColorFilterBench.cpp remove useless benches 2015-04-02 20:31:17 -07:00
ColorPrivBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ControlBench.cpp Add a control benchmark. 2015-05-06 12:42:04 -07:00
CoverageBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
DashBench.cpp Add matrix constructing helpers to SkMatrix 2015-03-26 19:57:08 -07:00
DecodingBench.cpp Test SkCodec to kIndex8 in nanobench. 2015-04-02 13:22:38 -07:00
DecodingBench.h Test SkCodec to kIndex8 in nanobench. 2015-04-02 13:22:38 -07:00
DecodingSubsetBench.cpp Adding new benchmark to test image decoding performance. 2015-02-13 09:05:42 -08:00
DecodingSubsetBench.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
DeferredSurfaceCopyBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
DisplacementBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ETCBitmapBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
FontCacheBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
FontScalerBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
FSRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
GameBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
gen_bench_expectations.py Added in framework to get more bench data 2014-06-12 11:27:40 -07:00
GeometryBench.cpp remove slower scalar code in favor of vectors 2015-03-26 07:26:08 -07:00
GMBench.cpp remove unused GM flags 2015-01-23 11:07:08 -08:00
GMBench.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
GradientBench.cpp Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of https://codereview.chromium.org/1138263002/) 2015-05-12 10:37:34 -07:00
GrMemoryPoolBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
GrOrderedSetBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
GrResourceCacheBench.cpp Make GrResourceCache perf less sensitive to key length change 2015-05-18 22:47:33 -07:00
gUniqueGlyphIDs.h switch array to uint16_t to fix overflows 2013-06-11 19:53:19 +00:00
HairlinePathBench.cpp crank up innerloop to make hairlinebench more usable/reliable 2015-04-13 11:12:06 -07:00
ImageCacheBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ImageFilterCollapse.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ImageFilterDAGBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
InterpBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
LightingBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
LineBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MagnifierBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MathBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
Matrix44Bench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MatrixBench.cpp use Sk4f for matrix math 2015-03-29 11:58:48 -07:00
MatrixConvolutionBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MemcpyBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MemoryBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MemsetBench.cpp Rewrite memset benches, then use results to add a small-N optimization. 2015-04-09 14:05:17 -07:00
MergeBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
microbench.json Fix the other microbench schema 2014-07-25 08:30:11 -07:00
MipMapBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
MorphologyBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
MutexBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
nanobench.cpp DM+nanobench: print both current and max RSS. 2015-04-30 07:11:22 -07:00
nanobench.h Minor cleanup in nanobench 2015-03-27 12:11:44 -07:00
nanobenchAndroid.cpp Move HWUI boilerplate into utils/android 2015-03-27 12:22:01 -07:00
nanobenchAndroid.h Move HWUI boilerplate into utils/android 2015-03-27 12:22:01 -07:00
PatchBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PatchGridBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PathBench.cpp Add matrix constructing helpers to SkMatrix 2015-03-26 19:57:08 -07:00
PathIterBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PerlinNoiseBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PictureNestingBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PictureOverheadBench.cpp Expand bench to cover no-draw SkPictures too. 2015-04-06 07:25:04 -07:00
PicturePlaybackBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
PMFloatBench.cpp New names for SkPMFloat methods. 2015-04-03 07:05:20 -07:00
PremulAndUnpremulAlphaOpsBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ReadPixBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RecordingBench.cpp add some debugging to SkNVRefCnt 2014-11-24 12:02:31 -08:00
RecordingBench.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RectanizerBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RectoriBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RefCntBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RegionBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RegionContainBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RepeatTileBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ResultsWriter.h Upload picture byte size and op count metrics for SKP recording. 2014-12-04 08:46:51 -08:00
RotatedRectBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
RTreeBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ScalarBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
ShaderMaskBench.cpp Cleanup: Remove a bunch of SkFontHost.h includes (unused). 2014-12-18 05:48:53 -08:00
SkipZeroesBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
SKPAnimationBench.cpp Change to add zoom animations to nanobench 2015-04-27 09:16:57 -07:00
SKPAnimationBench.h Change to add zoom animations to nanobench 2015-04-27 09:16:57 -07:00
SKPBench.cpp Change to add zoom animations to nanobench 2015-04-27 09:16:57 -07:00
SKPBench.h Change to add zoom animations to nanobench 2015-04-27 09:16:57 -07:00
skpbench.json Fix scale type in JSON format 2014-06-26 15:39:31 -07:00
SortBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
StrokeBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
TableBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
TextBench.cpp Move font loading in gm tests and benches out of constructors 2015-05-21 06:15:28 -07:00
TextBlobBench.cpp Move font loading in gm tests and benches out of constructors 2015-05-21 06:15:28 -07:00
tile_analyze.py Script to plot tile vs. viewport comparison for given platform and revision. 2013-02-13 23:22:29 +00:00
TileBench.cpp SkPaint::FilterLevel -> SkFilterQuality 2015-03-16 10:08:34 -07:00
VertBench.cpp Remove Sk prefix from some bench classes. 2014-06-19 12:32:29 -07:00
WritePixelsBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
WriterBench.cpp C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
XfermodeBench.cpp Add _aa variants of Xfermode benches. 2015-05-13 11:54:00 -07:00