diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-11-03 13:45:38 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-11-03 13:45:38 +0000 |
commit | 8e372c98bf027d2b10bd10b05eddd0087403cd2b (patch) | |
tree | 1734ae54ec97bca788d0a9937a8cbd22afdd7031 /bench/FontScalerBench.cpp | |
parent | 51c2fa7bb19af4e1ecae00c62c61b2b6d0669728 (diff) |
custom memset32 to speed up erasing the offscreen when its width is small.
git-svn-id: http://skia.googlecode.com/svn/trunk@2594 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/FontScalerBench.cpp')
-rw-r--r-- | bench/FontScalerBench.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bench/FontScalerBench.cpp b/bench/FontScalerBench.cpp index 596b830809..4255f67bad 100644 --- a/bench/FontScalerBench.cpp +++ b/bench/FontScalerBench.cpp @@ -17,10 +17,12 @@ extern bool gSkSuppressFontCachePurgeSpew; class FontScalerBench : public SkBenchmark { SkString fName; SkString fText; + bool fDoLCD; public: - FontScalerBench(void* param) : INHERITED(param) { - fName.set("fontscaler"); + FontScalerBench(void* param, bool doLCD) : INHERITED(param) { + fName.printf("fontscaler_%s", doLCD ? "lcd" : "aa"); fText.set("abcdefghijklmnopqrstuvwxyz01234567890"); + fDoLCD = doLCD; } protected: @@ -28,6 +30,7 @@ protected: virtual void onDraw(SkCanvas* canvas) { SkPaint paint; this->setupPaint(&paint); + paint.setLCDRenderText(fDoLCD); bool prev = gSkSuppressFontCachePurgeSpew; gSkSuppressFontCachePurgeSpew = true; @@ -49,6 +52,8 @@ private: /////////////////////////////////////////////////////////////////////////////// -static SkBenchmark* Fact(void* p) { return SkNEW_ARGS(FontScalerBench, (p)); } +static SkBenchmark* Fact0(void* p) { return SkNEW_ARGS(FontScalerBench, (p, false)); } +static SkBenchmark* Fact1(void* p) { return SkNEW_ARGS(FontScalerBench, (p, true)); } -static BenchRegistry gReg(Fact); +static BenchRegistry gReg0(Fact0); +static BenchRegistry gReg1(Fact1); |