diff options
author | Mike Reed <reed@google.com> | 2010-02-05 17:00:38 -0500 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2010-02-05 17:00:38 -0500 |
commit | ce2356c652e2b9cadd119b571673a314a8bc0943 (patch) | |
tree | 9ecddcb63d5be3891e0c67a0e05d273d3ecdf6b8 /WebCore/platform | |
parent | bdbb949a7bd75598dc571f80002cdc185cd515bf (diff) | |
download | external_webkit-ce2356c652e2b9cadd119b571673a314a8bc0943.zip external_webkit-ce2356c652e2b9cadd119b571673a314a8bc0943.tar.gz external_webkit-ce2356c652e2b9cadd119b571673a314a8bc0943.tar.bz2 |
use SkPaint::containsText for much faster containsCharacters in webkit
Diffstat (limited to 'WebCore/platform')
-rw-r--r-- | WebCore/platform/graphics/android/FontDataAndroid.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/WebCore/platform/graphics/android/FontDataAndroid.cpp b/WebCore/platform/graphics/android/FontDataAndroid.cpp index ca54eb3..c915eae 100644 --- a/WebCore/platform/graphics/android/FontDataAndroid.cpp +++ b/WebCore/platform/graphics/android/FontDataAndroid.cpp @@ -81,30 +81,13 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes return m_smallCapsFontData; } -#define kMaxBufferCount 64 - bool SimpleFontData::containsCharacters(const UChar* characters, int length) const { SkPaint paint; - uint16_t glyphs[kMaxBufferCount]; m_platformData.setupPaint(&paint); paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); - - while (length > 0) { - int n = SkMin32(length, SK_ARRAY_COUNT(glyphs)); - - int count = paint.textToGlyphs(characters, n << 1, glyphs); - for (int i = 0; i < count; i++) { - if (0 == glyphs[i]) { - return false; // missing glyph - } - } - - characters += n; - length -= n; - } - return true; + return paint.containsText(characters, length << 1); } void SimpleFontData::determinePitch() |