From 6f1797f739a9b2741923a168eba55edda880321e Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Tue, 20 Oct 2009 09:39:47 -0400 Subject: motorola neon patch for blitMask, used by text drawing. --- bench/TextBench.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'bench') diff --git a/bench/TextBench.cpp b/bench/TextBench.cpp index 93ef1c5..5caaddb 100644 --- a/bench/TextBench.cpp +++ b/bench/TextBench.cpp @@ -73,17 +73,21 @@ protected: const SkScalar x0 = SkIntToScalar(-10); const SkScalar y0 = SkIntToScalar(-10); + const SkColor colors[] = { SK_ColorBLACK, SK_ColorGRAY }; - for (int i = 0; i < N; i++) { - SkScalar x = x0 + rand.nextUScalar1() * dim.fX; - SkScalar y = y0 + rand.nextUScalar1() * dim.fY; - if (fPos) { - canvas->save(SkCanvas::kMatrix_SaveFlag); - canvas->translate(x, y); - canvas->drawPosText(fText.c_str(), fText.size(), fPos, paint); - canvas->restore(); - } else { - canvas->drawText(fText.c_str(), fText.size(), x, y, paint); + for (size_t j = 0; j < SK_ARRAY_COUNT(colors); j++) { + paint.setColor(colors[j]); + for (int i = 0; i < N; i++) { + SkScalar x = x0 + rand.nextUScalar1() * dim.fX; + SkScalar y = y0 + rand.nextUScalar1() * dim.fY; + if (fPos) { + canvas->save(SkCanvas::kMatrix_SaveFlag); + canvas->translate(x, y); + canvas->drawPosText(fText.c_str(), fText.size(), fPos, paint); + canvas->restore(); + } else { + canvas->drawText(fText.c_str(), fText.size(), x, y, paint); + } } } } -- cgit v1.1