diff options
| author | reed <reed@google.com> | 2015-01-28 13:28:53 -0800 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2015-01-28 13:28:53 -0800 |
| commit | 40dab98de1bdb803035304077f43410d1f86f2d2 (patch) | |
| tree | ea12b07f6367f637a584cc44467498848f3dd104 /samplecode/SamplePictFile.cpp | |
| parent | 6af314724f51ad79a640844536c667bb83de5690 (diff) | |
Use murmur3 finisher to improve font hash efficiency.
Add dump() method to inspect glyphcache strikes.
Murmur addition improves hash efficient roughly 50%
BUG=skia:
Review URL: https://codereview.chromium.org/877113002
Diffstat (limited to 'samplecode/SamplePictFile.cpp')
| -rw-r--r-- | samplecode/SamplePictFile.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp index 3fb335fc34..8f827e10aa 100644 --- a/samplecode/SamplePictFile.cpp +++ b/samplecode/SamplePictFile.cpp @@ -30,6 +30,8 @@ #include "SkSurface.h" #include "SkXMLParser.h" +#include "SkGlyphCache.h" + class PictFileView : public SampleView { public: PictFileView(const char name[] = NULL) @@ -89,12 +91,21 @@ protected: SkASSERT(static_cast<int>(fBBox) < kBBoxTypeCount); SkPicture** picture = fPictures + fBBox; +#ifdef SK_GLYPHCACHE_TRACK_HASH_STATS + SkGraphics::PurgeFontCache(); +#endif + if (!*picture) { *picture = LoadPicture(fFilename.c_str(), fBBox); } if (*picture) { canvas->drawPicture(*picture); } + +#ifdef SK_GLYPHCACHE_TRACK_HASH_STATS + SkGlyphCache::Dump(); + SkDebugf("\n"); +#endif } private: |
