summaryrefslogtreecommitdiffstats
path: root/WebCore/platform
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-06 11:36:03 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:38:32 +0100
commitc44f6b3b1e33ac1efbae8dc6e73fed0d329bafd4 (patch)
tree5cfdfcdffd55b38cecff572c74a9f89a9a02c795 /WebCore/platform
parentb2a9e2728d6dcf8aecf09fe037e942a8dba233c1 (diff)
downloadexternal_webkit-c44f6b3b1e33ac1efbae8dc6e73fed0d329bafd4.zip
external_webkit-c44f6b3b1e33ac1efbae8dc6e73fed0d329bafd4.tar.gz
external_webkit-c44f6b3b1e33ac1efbae8dc6e73fed0d329bafd4.tar.bz2
Merge WebKit at r74534: Fix FontDataAndroid.cpp
Add new functions introduced upstream for CSS text-emphasis property. See http://trac.webkit.org/changeset/74169 Change-Id: I5fff00db5b30979e29c9af75650e5df8d9eaff64
Diffstat (limited to 'WebCore/platform')
-rw-r--r--WebCore/platform/graphics/android/FontAndroid.cpp12
-rw-r--r--WebCore/platform/graphics/android/FontDataAndroid.cpp20
2 files changed, 25 insertions, 7 deletions
diff --git a/WebCore/platform/graphics/android/FontAndroid.cpp b/WebCore/platform/graphics/android/FontAndroid.cpp
index 0a9ce5a..6966e7d 100644
--- a/WebCore/platform/graphics/android/FontAndroid.cpp
+++ b/WebCore/platform/graphics/android/FontAndroid.cpp
@@ -33,6 +33,7 @@
#include "GraphicsContext.h"
#include "GlyphBuffer.h"
#include "IntRect.h"
+#include "NotImplemented.h"
#include "PlatformGraphicsContext.h"
#include "SkCanvas.h"
#include "SkColorFilter.h"
@@ -220,6 +221,11 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
}
}
+void Font::drawEmphasisMarksForComplexText(WebCore::GraphicsContext*, WebCore::TextRun const&, WTF::AtomicString const&, WebCore::FloatPoint const&, int, int) const
+{
+ notImplemented();
+}
+
#ifndef SUPPORT_COMPLEX_SCRIPTS
FloatRect Font::selectionRectForComplexText(const TextRun& run,
@@ -571,11 +577,11 @@ bool TextRunWalker::nextScriptRun()
// So we allow that to run first, then do a second pass over the range it
// found and take the largest subregion that stays within a single font.
const FontData* glyphData = m_font->glyphDataForCharacter(
- m_item.string[m_item.item.pos], false, false).fontData;
+ m_item.string[m_item.item.pos], false).fontData;
unsigned endOfRun;
for (endOfRun = 1; endOfRun < m_item.item.length; ++endOfRun) {
const FontData* nextGlyphData = m_font->glyphDataForCharacter(
- m_item.string[m_item.item.pos + endOfRun], false, false).fontData;
+ m_item.string[m_item.item.pos + endOfRun], false).fontData;
if (nextGlyphData != glyphData)
break;
}
@@ -609,7 +615,7 @@ void TextRunWalker::setWordAndLetterSpacing(int wordSpacingAdjustment,
void TextRunWalker::setupFontForScriptRun()
{
const FontData* fontData = m_font->glyphDataForCharacter(
- m_item.string[m_item.item.pos], false, false).fontData;
+ m_item.string[m_item.item.pos], false).fontData;
const FontPlatformData& platformData =
fontData->fontDataForCharacter(' ')->platformData();
m_item.face = platformData.harfbuzzFace();
diff --git a/WebCore/platform/graphics/android/FontDataAndroid.cpp b/WebCore/platform/graphics/android/FontDataAndroid.cpp
index 13e9500..545dcf7 100644
--- a/WebCore/platform/graphics/android/FontDataAndroid.cpp
+++ b/WebCore/platform/graphics/android/FontDataAndroid.cpp
@@ -74,10 +74,22 @@ void SimpleFontData::platformDestroy()
SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
{
- if (!m_smallCapsFontData) {
- m_smallCapsFontData = new SimpleFontData(FontPlatformData(m_platformData, fontDescription.computedSize() * 0.7f));
- }
- return m_smallCapsFontData;
+ if (!m_derivedFontData)
+ m_derivedFontData = DerivedFontData::create(isCustomFont());
+ if (!m_derivedFontData->smallCaps)
+ m_derivedFontData->smallCaps = new SimpleFontData(FontPlatformData(m_platformData, fontDescription.computedSize() * 0.7f));
+
+ return m_derivedFontData->smallCaps.get();
+}
+
+SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& fontDescription) const
+{
+ if (!m_derivedFontData)
+ m_derivedFontData = DerivedFontData::create(isCustomFont());
+ if (!m_derivedFontData->emphasisMark)
+ m_derivedFontData->emphasisMark = new SimpleFontData(FontPlatformData(m_platformData, fontDescription.computedSize() * 0.5f));
+
+ return m_derivedFontData->emphasisMark.get();
}
bool SimpleFontData::containsCharacters(const UChar* characters, int length) const