diff options
author | Feng Qian <fqian@google.com> | 2009-06-17 12:12:20 -0700 |
---|---|---|
committer | Feng Qian <fqian@google.com> | 2009-06-17 12:12:20 -0700 |
commit | 5f1ab04193ad0130ca8204aadaceae083aca9881 (patch) | |
tree | 5a92cd389e2cfe7fb67197ce14b38469462379f8 /WebCore/platform/graphics/android/FontDataAndroid.cpp | |
parent | 194315e5a908cc8ed67d597010544803eef1ac59 (diff) | |
download | external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.zip external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.gz external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.bz2 |
Get WebKit r44544.
Diffstat (limited to 'WebCore/platform/graphics/android/FontDataAndroid.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/FontDataAndroid.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/WebCore/platform/graphics/android/FontDataAndroid.cpp b/WebCore/platform/graphics/android/FontDataAndroid.cpp index 3d31eaf..2bb53e4 100644 --- a/WebCore/platform/graphics/android/FontDataAndroid.cpp +++ b/WebCore/platform/graphics/android/FontDataAndroid.cpp @@ -48,7 +48,7 @@ void SimpleFontData::platformInit() SkPaint paint; SkPaint::FontMetrics metrics; - m_font.setupPaint(&paint); + m_platformData.setupPaint(&paint); (void)paint.getFontMetrics(&metrics); // use ceil instead of round to favor descent, given a lot of accidental @@ -64,6 +64,13 @@ void SimpleFontData::platformInit() m_lineGap = SkScalarRound(metrics.fLeading); } +void SimpleFontData::platformCharWidthInit() +{ + m_avgCharWidth = 0.f; + m_maxCharWidth = 0.f; + initCharWidths(); +} + void SimpleFontData::platformDestroy() { delete m_smallCapsFontData; @@ -72,7 +79,7 @@ void SimpleFontData::platformDestroy() SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const { if (!m_smallCapsFontData) { - m_smallCapsFontData = new SimpleFontData(FontPlatformData(m_font, fontDescription.computedSize() * 0.7f)); + m_smallCapsFontData = new SimpleFontData(FontPlatformData(m_platformData, fontDescription.computedSize() * 0.7f)); } return m_smallCapsFontData; } @@ -84,7 +91,7 @@ bool SimpleFontData::containsCharacters(const UChar* characters, int length) con SkPaint paint; uint16_t glyphs[kMaxBufferCount]; - m_font.setupPaint(&paint); + m_platformData.setupPaint(&paint); paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); while (length > 0) { @@ -114,7 +121,7 @@ float SimpleFontData::platformWidthForGlyph(Glyph glyph) const SkPaint paint; - m_font.setupPaint(&paint); + m_platformData.setupPaint(&paint); if (EmojiFont::IsEmojiGlyph(glyph)) return EmojiFont::GetAdvanceWidth(glyph, paint); |