add rounded-join option to bigpath bench

BUG=skia:
TBR=
NOTRY=True
... win bot offline

Review URL: https://codereview.chromium.org/909893002
This commit is contained in:
reed 2015-02-09 08:05:52 -08:00 committed by Commit bot
parent 5a2a5e729c
commit 70a8ca8351

View File

@ -27,10 +27,14 @@ class BigPathBench : public Benchmark {
SkPath fPath; SkPath fPath;
SkString fName; SkString fName;
Align fAlign; Align fAlign;
bool fRound;
public: public:
BigPathBench(Align align) : fAlign(align) { BigPathBench(Align align, bool round) : fAlign(align), fRound(round) {
fName.printf("bigpath_%s", gAlignName[fAlign]); fName.printf("bigpath_%s", gAlignName[fAlign]);
if (round) {
fName.append("_round");
}
} }
protected: protected:
@ -51,6 +55,9 @@ protected:
paint.setAntiAlias(true); paint.setAntiAlias(true);
paint.setStyle(SkPaint::kStroke_Style); paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(2); paint.setStrokeWidth(2);
if (fRound) {
paint.setStrokeJoin(SkPaint::kRound_Join);
}
this->setupPaint(&paint); this->setupPaint(&paint);
const SkRect r = fPath.getBounds(); const SkRect r = fPath.getBounds();
@ -74,7 +81,11 @@ private:
typedef Benchmark INHERITED; typedef Benchmark INHERITED;
}; };
DEF_BENCH( return new BigPathBench(kLeft_Align); ) DEF_BENCH( return new BigPathBench(kLeft_Align, false); )
DEF_BENCH( return new BigPathBench(kMiddle_Align); ) DEF_BENCH( return new BigPathBench(kMiddle_Align, false); )
DEF_BENCH( return new BigPathBench(kRight_Align); ) DEF_BENCH( return new BigPathBench(kRight_Align, false); )
DEF_BENCH( return new BigPathBench(kLeft_Align, true); )
DEF_BENCH( return new BigPathBench(kMiddle_Align, true); )
DEF_BENCH( return new BigPathBench(kRight_Align, true); )