diff options
Diffstat (limited to 'core/jni/android/graphics/TextLayoutCache.h')
-rw-r--r-- | core/jni/android/graphics/TextLayoutCache.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/core/jni/android/graphics/TextLayoutCache.h b/core/jni/android/graphics/TextLayoutCache.h index 35dd6fd..6dda1e5 100644 --- a/core/jni/android/graphics/TextLayoutCache.h +++ b/core/jni/android/graphics/TextLayoutCache.h @@ -72,8 +72,6 @@ public: TextLayoutCacheKey(const TextLayoutCacheKey& other); - bool operator<(const TextLayoutCacheKey& rhs) const; - /** * We need to copy the text when we insert the key into the cache itself. * We don't need to copy the text when we are only comparing keys. @@ -85,6 +83,8 @@ public: */ size_t getSize(); + static int compare(const TextLayoutCacheKey& lhs, const TextLayoutCacheKey& rhs); + private: const UChar* text; // if text is NULL, use textCopy String16 textCopy; @@ -97,11 +97,18 @@ private: uint32_t flags; SkPaint::Hinting hinting; - inline const UChar* getText() const { - return text ? text : textCopy.string(); - } + inline const UChar* getText() const { return text ? text : textCopy.string(); } + }; // TextLayoutCacheKey +inline int strictly_order_type(const TextLayoutCacheKey& lhs, const TextLayoutCacheKey& rhs) { + return TextLayoutCacheKey::compare(lhs, rhs) < 0; +} + +inline int compare_type(const TextLayoutCacheKey& lhs, const TextLayoutCacheKey& rhs) { + return TextLayoutCacheKey::compare(lhs, rhs); +} + /* * TextLayoutCacheValue is the Cache value */ |