Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(779)

Unified Diff: bench/CmapBench.cpp

Issue 18040004: impl charsToGlyphs for freetype (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ports/SkFontHost_FreeType.cpp » ('j') | src/ports/SkFontHost_FreeType.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/CmapBench.cpp
diff --git a/bench/CmapBench.cpp b/bench/CmapBench.cpp
index 9697477850e81a96586338c74eb4b295e6be4830..27498ceb9bc15e8796ac398bd72c65f0f3bf209e 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"); )
« no previous file with comments | « no previous file | src/ports/SkFontHost_FreeType.cpp » ('j') | src/ports/SkFontHost_FreeType.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698