diff options
author | John Reck <jreck@google.com> | 2011-10-12 14:08:26 -0700 |
---|---|---|
committer | The Android Automerger <android-build@android.com> | 2011-10-12 14:54:47 -0700 |
commit | a120b06edde55ad594c59fcd8e6bbc93021d89d0 (patch) | |
tree | 4d67977d39d9ebf847c75554ce42364919d47401 | |
parent | 3a83708077ed736e7ecfc18634b796f0ef25204e (diff) | |
download | external_webkit-a120b06edde55ad594c59fcd8e6bbc93021d89d0.zip external_webkit-a120b06edde55ad594c59fcd8e6bbc93021d89d0.tar.gz external_webkit-a120b06edde55ad594c59fcd8e6bbc93021d89d0.tar.bz2 |
Revert "Support "Vertical Writing Mode"."
This reverts commit 5403113c5aa5d55a05ea001f562829e907632178
6 files changed, 16 insertions, 61 deletions
diff --git a/Source/WebCore/platform/graphics/android/FontAndroid.cpp b/Source/WebCore/platform/graphics/android/FontAndroid.cpp index fd6d41b..6b4296b 100644 --- a/Source/WebCore/platform/graphics/android/FontAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/FontAndroid.cpp @@ -183,10 +183,8 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, SkScalar y = SkFloatToScalar(point.y()); const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from); const GlyphBufferAdvance* adv = glyphBuffer.advances(from); - SkAutoSTMalloc<32, SkPoint> storage(numGlyphs), storage2(numGlyphs), storage3(numGlyphs); + SkAutoSTMalloc<32, SkPoint> storage(numGlyphs); SkPoint* pos = storage.get(); - SkPoint* vPosBegin = storage2.get(); - SkPoint* vPosEnd = storage3.get(); SkCanvas* canvas = gc->platformContext()->mCanvas; @@ -223,28 +221,12 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, localCount * sizeof(uint16_t), &pos[localIndex], paint); } else { - bool isVertical = font->platformData().orientation() == Vertical; for (int i = 0; i < numGlyphs; i++) { pos[i].set(x, y); + x += SkFloatToScalar(adv[i].width()); y += SkFloatToScalar(adv[i].height()); - if (isVertical) { - SkScalar myWidth = SkFloatToScalar(adv[i].width()); - vPosBegin[i].set(x + myWidth, y); - vPosEnd[i].set(x + myWidth, y - myWidth); - x += myWidth; - - SkPath path; - path.reset(); - path.moveTo(vPosBegin[i]); - path.lineTo(vPosEnd[i]); - canvas->drawTextOnPath(glyphs + i, 2, path, 0, paint); - } - else { - x += SkFloatToScalar(adv[i].width()); - } } - if (!isVertical) - canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, paint); + canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, paint); } } diff --git a/Source/WebCore/platform/graphics/android/FontCacheAndroid.cpp b/Source/WebCore/platform/graphics/android/FontCacheAndroid.cpp index 4fc3b4e..20ffd17 100644 --- a/Source/WebCore/platform/graphics/android/FontCacheAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/FontCacheAndroid.cpp @@ -177,9 +177,7 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD result = new FontPlatformData(tf, fontDescription.computedSize(), (style & SkTypeface::kBold) && !tf->isBold(), - (style & SkTypeface::kItalic) && !tf->isItalic(), - fontDescription.orientation(), - fontDescription.textOrientation()); + (style & SkTypeface::kItalic) && !tf->isItalic()); } tf->unref(); diff --git a/Source/WebCore/platform/graphics/android/FontCustomPlatformData.cpp b/Source/WebCore/platform/graphics/android/FontCustomPlatformData.cpp index 4279ce8..72fac68 100644 --- a/Source/WebCore/platform/graphics/android/FontCustomPlatformData.cpp +++ b/Source/WebCore/platform/graphics/android/FontCustomPlatformData.cpp @@ -45,8 +45,7 @@ FontCustomPlatformData::~FontCustomPlatformData() // the unref is enough to release the font data... } -FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, - FontOrientation fontOrientation, TextOrientation textOrientation, FontWidthVariant, FontRenderingMode) +FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode) { // turn bold/italic into fakeBold/fakeItalic if (m_typeface != NULL) { @@ -55,7 +54,7 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b if (m_typeface->isItalic() == italic) italic = false; } - return FontPlatformData(m_typeface, size, bold, italic, fontOrientation, textOrientation); + return FontPlatformData(m_typeface, size, bold, italic); } FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer) diff --git a/Source/WebCore/platform/graphics/android/FontDataAndroid.cpp b/Source/WebCore/platform/graphics/android/FontDataAndroid.cpp index c6dd174..1f19b6d 100644 --- a/Source/WebCore/platform/graphics/android/FontDataAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/FontDataAndroid.cpp @@ -32,7 +32,6 @@ #include "SimpleFontData.h" #include "FloatRect.h" #include "FontDescription.h" -#include "SkFontHost.h" #include "SkPaint.h" #include "SkTypeface.h" #include "SkTime.h" @@ -58,16 +57,6 @@ void SimpleFontData::platformInit() m_fontMetrics.setXHeight(SkScalarToFloat(-skiaFontMetrics.fAscent) * 0.56f); // hack I stole from the window's port m_fontMetrics.setLineSpacing(a + d); m_fontMetrics.setLineGap(SkScalarToFloat(skiaFontMetrics.fLeading)); - - if (platformData().orientation() == Vertical && !isTextOrientationFallback()) { - static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a'); - static const uint32_t vorgTag = SkSetFourByteTag('V', 'O', 'R', 'G'); - const SkFontID fontID = m_platformData.uniqueID(); - size_t vheaSize = SkFontHost::GetTableSize(fontID, vheaTag); - size_t vorgSize = SkFontHost::GetTableSize(fontID, vorgTag); - if ((vheaSize > 0) || (vorgSize > 0)) - m_hasVerticalGlyphs = true; - } } void SimpleFontData::platformCharWidthInit() diff --git a/Source/WebCore/platform/graphics/android/FontPlatformData.h b/Source/WebCore/platform/graphics/android/FontPlatformData.h index 5c3313e..56ce6e9 100644 --- a/Source/WebCore/platform/graphics/android/FontPlatformData.h +++ b/Source/WebCore/platform/graphics/android/FontPlatformData.h @@ -31,7 +31,6 @@ #define FontPlatformData_h #include "FontOrientation.h" -#include "TextOrientation.h" #include <wtf/text/StringImpl.h> #ifndef NDEBUG @@ -53,8 +52,7 @@ public: FontPlatformData(); FontPlatformData(const FontPlatformData&); - FontPlatformData(SkTypeface*, float textSize, bool fakeBold, bool fakeItalic, - FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight); + FontPlatformData(SkTypeface*, float textSize, bool fakeBold, bool fakeItalic); FontPlatformData(const FontPlatformData& src, float textSize); FontPlatformData(float size, bool syntheticBold, bool syntheticOblique); FontPlatformData(const FontPlatformData& src, SkTypeface* typeface); @@ -67,8 +65,9 @@ public: return mTypeface == hashTableDeletedFontValue(); } - FontOrientation orientation() const { return mOrientation; } - void setOrientation(FontOrientation orientation) { mOrientation = orientation; } + FontOrientation orientation() const { return Horizontal; } // FIXME: Implement. + void setOrientation(FontOrientation) { } // FIXME: Implement. + FontPlatformData& operator=(const FontPlatformData&); bool operator==(const FontPlatformData& a) const; @@ -115,8 +114,6 @@ private: float mTextSize; bool mFakeBold; bool mFakeItalic; - FontOrientation mOrientation; - TextOrientation mTextOrientation; mutable RefPtr<RefCountedHarfbuzzFace> m_harfbuzzFace; static SkTypeface* hashTableDeletedFontValue() { diff --git a/Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp b/Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp index 1185fa7..8e77b5b 100644 --- a/Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp @@ -92,17 +92,13 @@ FontPlatformData::FontPlatformData(const FontPlatformData& src) mFakeBold = src.mFakeBold; mFakeItalic = src.mFakeItalic; m_harfbuzzFace = src.m_harfbuzzFace; - mOrientation = src.mOrientation; - mTextOrientation = src.mTextOrientation; inc_count(); trace(2); } -FontPlatformData::FontPlatformData(SkTypeface* tf, float textSize, bool fakeBold, bool fakeItalic, - FontOrientation orientation, TextOrientation textOrientation) - : mTypeface(tf), mTextSize(textSize), mFakeBold(fakeBold), mFakeItalic(fakeItalic), - mOrientation(orientation), mTextOrientation(textOrientation) +FontPlatformData::FontPlatformData(SkTypeface* tf, float textSize, bool fakeBold, bool fakeItalic) + : mTypeface(tf), mTextSize(textSize), mFakeBold(fakeBold), mFakeItalic(fakeItalic) { if (hashTableDeletedFontValue() != mTypeface) { SkSafeRef(mTypeface); @@ -114,7 +110,7 @@ FontPlatformData::FontPlatformData(SkTypeface* tf, float textSize, bool fakeBold FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize) : mTypeface(src.mTypeface), mTextSize(textSize), mFakeBold(src.mFakeBold), mFakeItalic(src.mFakeItalic), - m_harfbuzzFace(src.m_harfbuzzFace), mOrientation(src.mOrientation), mTextOrientation(src.mTextOrientation) + m_harfbuzzFace(src.m_harfbuzzFace) { if (hashTableDeletedFontValue() != mTypeface) { SkSafeRef(mTypeface); @@ -133,8 +129,7 @@ FontPlatformData::FontPlatformData(float size, bool bold, bool oblique) FontPlatformData::FontPlatformData(const FontPlatformData& src, SkTypeface* tf) : mTypeface(tf), mTextSize(src.mTextSize), mFakeBold(src.mFakeBold), - mFakeItalic(src.mFakeItalic), mOrientation(src.mOrientation), - mTextOrientation(src.mTextOrientation) + mFakeItalic(src.mFakeItalic) { if (hashTableDeletedFontValue() != mTypeface) { SkSafeRef(mTypeface); @@ -170,8 +165,6 @@ FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src) mFakeBold = src.mFakeBold; mFakeItalic = src.mFakeItalic; m_harfbuzzFace = src.m_harfbuzzFace; - mOrientation = src.mOrientation; - mTextOrientation = src.mTextOrientation; return *this; } @@ -211,9 +204,7 @@ bool FontPlatformData::operator==(const FontPlatformData& a) const return mTypeface == a.mTypeface && mTextSize == a.mTextSize && mFakeBold == a.mFakeBold && - mFakeItalic == a.mFakeItalic && - mOrientation == a.mOrientation && - mTextOrientation == a.mTextOrientation; + mFakeItalic == a.mFakeItalic; } unsigned FontPlatformData::hash() const @@ -228,8 +219,7 @@ unsigned FontPlatformData::hash() const uint32_t sizeAsInt = *reinterpret_cast<const uint32_t*>(&mTextSize); - h ^= 0x01010101 * ((static_cast<int>(mTextOrientation) << 3) | (static_cast<int>(mOrientation) << 2) | - ((int)mFakeBold << 1) | (int)mFakeItalic); + h ^= 0x01010101 * (((int)mFakeBold << 1) | (int)mFakeItalic); h ^= sizeAsInt; return h; } |