summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Fabrice Di Meglio <fdimeglio@google.com> 2011-03-30 16:06:02 -0700
committer Fabrice Di Meglio <fdimeglio@google.com> 2011-03-30 16:06:02 -0700
commitaabe537f1ed3b64f755af9fc62022d6074eec169 (patch)
treeabdab90c25e374e22f4e010ad11338f8fe6160bb
parent4111bec3b68a200932817f4b8924fea08f4d5905 (diff)
Update TextLayoutCache key for supporting more SkPaint properties
Change-Id: I35bb991e536e662c1a0724ab7e311fba3d52487a
-rw-r--r--core/jni/android/graphics/TextLayoutCache.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/core/jni/android/graphics/TextLayoutCache.h b/core/jni/android/graphics/TextLayoutCache.h
index 31d802cdb1c6..36b7404e1a7e 100644
--- a/core/jni/android/graphics/TextLayoutCache.h
+++ b/core/jni/android/graphics/TextLayoutCache.h
@@ -65,7 +65,8 @@ namespace android {
class TextLayoutCacheKey {
public:
TextLayoutCacheKey() : text(NULL), start(0), count(0), contextCount(0),
- dirFlags(0), textSize(0), typeface(NULL), textSkewX(0), fakeBoldText(false) {
+ dirFlags(0), typeface(NULL), textSize(0), textSkewX(0), textScaleX(0), flags(0),
+ hinting(SkPaint::kNo_Hinting) {
}
TextLayoutCacheKey(const SkPaint* paint,
@@ -73,22 +74,28 @@ public:
size_t contextCount, int dirFlags) :
text(text), start(start), count(count), contextCount(contextCount),
dirFlags(dirFlags) {
- textSize = paint->getTextSize();
typeface = paint->getTypeface();
+ textSize = paint->getTextSize();
textSkewX = paint->getTextSkewX();
- fakeBoldText = paint->isFakeBoldText();
+ textScaleX = paint->getTextScaleX();
+ flags = paint->getFlags();
+ hinting = paint->getHinting();
}
bool operator<(const TextLayoutCacheKey& rhs) const {
LTE_INT(count) {
LTE_INT(contextCount) {
LTE_INT(start) {
- LTE_FLOAT(textSize) {
- LTE_INT(typeface) {
- LTE_INT(textSkewX) {
- LTE_INT(fakeBoldText) {
- LTE_INT(dirFlags) {
- return strncmp16(text, rhs.text, contextCount) < 0;
+ LTE_INT(typeface) {
+ LTE_FLOAT(textSize) {
+ LTE_FLOAT(textSkewX) {
+ LTE_FLOAT(textScaleX) {
+ LTE_INT(flags) {
+ LTE_INT(hinting) {
+ LTE_INT(dirFlags) {
+ return strncmp16(text, rhs.text, contextCount) < 0;
+ }
+ }
}
}
}
@@ -121,10 +128,12 @@ private:
size_t count;
size_t contextCount;
int dirFlags;
- float textSize;
SkTypeface* typeface;
- float textSkewX;
- bool fakeBoldText;
+ SkScalar textSize;
+ SkScalar textSkewX;
+ SkScalar textScaleX;
+ uint32_t flags;
+ SkPaint::Hinting hinting;
}; // TextLayoutCacheKey
/*