When skia run bench cases to test performance, it will run constructors for all cases one by one, then getName to skip unnecessary cases according to command line parameters, so these constructors should be lightweight enough to avoid redundant computing. Unfortunately, some constructors contain intensive computing/rendering. They are very heavy, maybe much heavier than need-to-run bench case itself. And these redundant computation will be run every time you run bench, even you just test a single simple case. Moreover, it will mislead the real hotspot/bottleneck of the case itself. 
For example, run a lightweight case, say, region_intersectsrgn_16, the hot spots are gles operation, SuperBlitter, SkRTree... introduced by irrelevant cases' constructors. These redundant computation will mislead performance tuning. 
So we can move these intensive computation to onPreDraw() of these case. They will be executed only if this case should be run.

R=reed@google.com, robertphillips@google.com, humper@google.com, tomhudson@chromium.org

Author: yunchao.he@intel.com

Review URL: https://chromiumcodereview.appspot.com/20997003

git-svn-id: http://skia.googlecode.com/svn/trunk@10486 2bbb7eff-a529-9590-31e7-b0007b416f81
3 files changed