change params to getPaths callback, avoiding a xform/copy up front.
Before
18/18 MB 1 33.1µs 33.3µs 33.4µs 34.2µs 1% █▄▃▂▂▁▁▁▁▂ nonrendering font-path-batch
18/18 MB 12 43.7µs 43.8µs 43.8µs 44.1µs 0% █▂▁▂▁▅▂▂▆▂ nonrendering font-path-loop
After
17/17 MB 1 10.2µs 10.3µs 10.4µs 11µs 2% █▃▂▂▂▂▂▁▁▂ nonrendering font-path-batch
17/17 MB 21 23.4µs 23.4µs 23.4µs 23.4µs 0% █▂▁▃▃▂▄▁▂▂ nonrendering font-path-loop
Bug: skia:
Change-Id: Ib1aa886fd675326bf5936b47b0d459ba02f1681e
Reviewed-on: https://skia-review.googlesource.com/c/172743
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/bench/FontCacheBench.cpp b/bench/FontCacheBench.cpp
index 98caa2b..beae47a 100644
--- a/bench/FontCacheBench.cpp
+++ b/bench/FontCacheBench.cpp
@@ -184,9 +184,9 @@
}
} else {
fFont.getPaths(fGlyphs, SK_ARRAY_COUNT(fGlyphs),
- [](uint16_t, const SkPath* src, void* ctx) {
+ [](const SkPath* src, const SkMatrix& mx, void* ctx) {
if (src) {
- *static_cast<SkPath*>(ctx) = *src;
+ src->transform(mx, static_cast<SkPath*>(ctx));
}
}, &path);
}