summaryrefslogtreecommitdiffstats
path: root/sample
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-05-21 08:37:49 -0700
committerRaph Levien <raph@google.com>2014-05-27 15:39:33 +0000
commit4d4e6bc8118d15542f1f2a9218f0f7a91a29474f (patch)
treecdfd772d61a6eb71d7268f5d278e82202a247769 /sample
parentd973b3926b3a34c19d3d6f309fae1138e782e4dc (diff)
downloadandroid_frameworks_minikin-4d4e6bc8118d15542f1f2a9218f0f7a91a29474f.tar.gz
android_frameworks_minikin-4d4e6bc8118d15542f1f2a9218f0f7a91a29474f.tar.bz2
android_frameworks_minikin-4d4e6bc8118d15542f1f2a9218f0f7a91a29474f.zip
Caching for layouts and harfbuzz faces
This patch adds caching for both layouts and for HarfBuzz face objects. The granularity of the cache for layouts is words, so it splits the input string at word boundaries (using a heuristic). There are is also some refactoring to reduce the amount of allocation and copying, and movement towards properly supporting contexts. The size of the caches is a fixed number of entries; thus, it is possible to consume a large amount of memory by filling the cache with lots of large strings. This should be refined towards a scheme that bounds the total memory used by the cache. This patch fixes bug 15237293 "Regression: Measure performance is significantly slower with minikin". Change-Id: Ie8176857e2d78656ce5479a7c04969819ef2718d
Diffstat (limited to 'sample')
-rw-r--r--sample/example.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/sample/example.cpp b/sample/example.cpp
index 9b012ef..b8bd66f 100644
--- a/sample/example.cpp
+++ b/sample/example.cpp
@@ -89,7 +89,7 @@ int runMinikinTest() {
layout.doLayout(icuText.getBuffer(), icuText.length());
layout.dump();
Bitmap bitmap(250, 50);
- layout.draw(&bitmap, 10, 40);
+ layout.draw(&bitmap, 10, 40, 32);
std::ofstream o;
o.open("/data/local/tmp/foo.pgm", std::ios::out | std::ios::binary);
bitmap.writePnm(o);