diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-02 16:28:53 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-02 16:28:53 +0000 |
commit | 231129753cdbefbfa026d4c14b260aece973b4e9 (patch) | |
tree | cf783aa3bff908769ce95ec898dd7ff4bd356a03 | |
parent | d1b5b14747212e372f804ae9d732b1a923dbf66b (diff) |
test null-glyphs param case
git-svn-id: http://skia.googlecode.com/svn/trunk@9865 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | bench/CmapBench.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/bench/CmapBench.cpp b/bench/CmapBench.cpp index 9697477850..27498ceb9b 100644 --- a/bench/CmapBench.cpp +++ b/bench/CmapBench.cpp @@ -53,6 +53,16 @@ static void charsToGlyphs_proc(const SkPaint& paint, const void* text, } } +static void charsToGlyphsNull_proc(const SkPaint& paint, const void* text, + size_t len, int glyphCount) { + SkTypeface::Encoding encoding = paint2Encoding(paint); + + SkTypeface* face = paint.getTypeface(); + for (int i = 0; i < LOOP; ++i) { + face->charsToGlyphs(text, encoding, NULL, glyphCount); + } +} + class CMAPBench : public SkBenchmark { TypefaceProc fProc; SkString fName; @@ -66,7 +76,7 @@ public: for (int i = 0; i < NGLYPHS; ++i) { // we're just jamming values into utf8, so we must keep it legal - fText[i] = i; + fText[i] = 'A' + i; } fPaint.setTypeface(SkTypeface::RefDefault())->unref(); } @@ -90,4 +100,5 @@ private: DEF_BENCH( return new CMAPBench(p, containsText_proc, "paint_containsText"); ) DEF_BENCH( return new CMAPBench(p, textToGlyphs_proc, "paint_textToGlyphs"); ) DEF_BENCH( return new CMAPBench(p, charsToGlyphs_proc, "face_charsToGlyphs"); ) +DEF_BENCH( return new CMAPBench(p, charsToGlyphsNull_proc, "face_charsToGlyphs_null"); ) |