summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2015-07-09 15:58:16 -0700
committerRaph Levien <raph@google.com>2015-07-09 17:38:58 -0700
commit6c4d167bff33c24c239d77ddb1044b18d180766a (patch)
tree0a38faf831cddea734b8a1f1a7b849157912aa80 /include
parent3e0fc64da064b8c4156daf53242b8eeb47830f64 (diff)
downloadandroid_frameworks_minikin-6c4d167bff33c24c239d77ddb1044b18d180766a.tar.gz
android_frameworks_minikin-6c4d167bff33c24c239d77ddb1044b18d180766a.tar.bz2
android_frameworks_minikin-6c4d167bff33c24c239d77ddb1044b18d180766a.zip
Add HyphenEdit to layout cache
We bypass the word layout cache for "complex" cases, which includes things like OpenType features. We were counting a hyphen edit as such a case, but the problem is that we measure a _lot_ of these when doing layout with hyphenation. This patch adds plumbing for hyphen edits to the layout cache, so that word fragments with hyphens can be cached as well. Bug: 22378829 Change-Id: Idba4df4faa14f48a5faccc8a7a7955a36c19ef27
Diffstat (limited to 'include')
-rw-r--r--include/minikin/MinikinFont.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/minikin/MinikinFont.h b/include/minikin/MinikinFont.h
index ee885f4..7f65cd7 100644
--- a/include/minikin/MinikinFont.h
+++ b/include/minikin/MinikinFont.h
@@ -35,6 +35,7 @@ public:
HyphenEdit() : hyphen(0) { }
HyphenEdit(uint32_t hyphenInt) : hyphen(hyphenInt) { }
bool hasHyphen() const { return hyphen != 0; }
+ bool operator==(const HyphenEdit &other) const { return hyphen == other.hyphen; }
private:
uint32_t hyphen;
};
@@ -48,8 +49,7 @@ struct MinikinPaint {
fakery(), fontFeatureSettings() { }
bool skipCache() const {
- // TODO: add hyphen to cache
- return !fontFeatureSettings.empty() || hyphenEdit.hasHyphen();
+ return !fontFeatureSettings.empty();
}
MinikinFont *font;