From 8e372c98bf027d2b10bd10b05eddd0087403cd2b Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Thu, 3 Nov 2011 13:45:38 +0000 Subject: 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 --- bench/FontScalerBench.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bench/FontScalerBench.cpp') 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); -- cgit v1.2.3