[Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code
authorpierre.rossi@gmail.com <pierre.rossi@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2012 10:53:07 +0000 (10:53 +0000)
committerpierre.rossi@gmail.com <pierre.rossi@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2012 10:53:07 +0000 (10:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=93960

Reviewed by Simon Hausmann.

Following the removal of Qt 4 support from trunk in r124879.

Source/WebCore:

No new tests. Simple cleanup job.

* Target.pri:
* platform/graphics/Font.cpp:
(WebCore::Font::codePath):
* platform/graphics/Font.h:
(Font):
* platform/graphics/GraphicsContext.cpp:
(WebCore):
* platform/graphics/SimpleFontData.cpp:
(WebCore::SimpleFontData::platformGlyphInit):
(WebCore::SimpleFontData::glyphForCharacter):
* platform/graphics/SimpleFontData.h:
(SimpleFontData):
(WebCore::SimpleFontData::widthForGlyph):
* platform/graphics/qt/FontCacheQt.cpp:
(WebCore::rawFontForCharacters):
(WebCore::FontCache::getFontDataForCharacters):
* platform/graphics/qt/FontCustomPlatformData.h:
(FontCustomPlatformData):
* platform/graphics/qt/FontCustomPlatformDataQt.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
(WebCore::createFontCustomPlatformData):
* platform/graphics/qt/FontPlatformData.h:
(WebCore::FontPlatformDataPrivate::FontPlatformDataPrivate):
(FontPlatformDataPrivate):
(FontPlatformData):
(WebCore::FontPlatformData::FontPlatformData):
* platform/graphics/qt/FontPlatformDataQt.cpp:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::operator==):
(WebCore::FontPlatformData::hash):
* platform/graphics/qt/FontQt4.cpp: Removed.
* platform/graphics/qt/GlyphPageTreeNodeQt.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/qt/SimpleFontDataQt.cpp:
(WebCore::SimpleFontData::determinePitch):
(WebCore::SimpleFontData::platformBoundsForGlyph):
(WebCore::SimpleFontData::platformInit):
(WebCore::SimpleFontData::platformCharWidthInit):
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::advance):
(WebCore::SVGTextMetricsBuilder::advanceSimpleText):
(WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):

Source/WebKit/blackberry:

* WebCoreSupport/AboutDataHaveFeatures.in: Remove all traces of HAVE_QRAWFONT's existence.

Source/WebKit2:

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWebCoreStatistics):

Tools:

* qmake/mkspecs/features/features.prf:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125766 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Target.pri
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/SimpleFontData.cpp
Source/WebCore/platform/graphics/SimpleFontData.h
Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h
Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
Source/WebCore/platform/graphics/qt/FontPlatformData.h
Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
Source/WebCore/platform/graphics/qt/FontQt4.cpp [deleted file]
Source/WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp
Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/AboutDataHaveFeatures.in
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebProcess.cpp
Tools/ChangeLog
Tools/qmake/mkspecs/features/features.prf

index f6964d1..dcac1fd 100644 (file)
@@ -1,3 +1,57 @@
+2012-08-16  Pierre Rossi  <pierre.rossi@gmail.com>
+
+        [Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code
+        https://bugs.webkit.org/show_bug.cgi?id=93960
+
+        Reviewed by Simon Hausmann.
+
+        Following the removal of Qt 4 support from trunk in r124879.
+
+        No new tests. Simple cleanup job.
+
+        * Target.pri:
+        * platform/graphics/Font.cpp:
+        (WebCore::Font::codePath):
+        * platform/graphics/Font.h:
+        (Font):
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore):
+        * platform/graphics/SimpleFontData.cpp:
+        (WebCore::SimpleFontData::platformGlyphInit):
+        (WebCore::SimpleFontData::glyphForCharacter):
+        * platform/graphics/SimpleFontData.h:
+        (SimpleFontData):
+        (WebCore::SimpleFontData::widthForGlyph):
+        * platform/graphics/qt/FontCacheQt.cpp:
+        (WebCore::rawFontForCharacters):
+        (WebCore::FontCache::getFontDataForCharacters):
+        * platform/graphics/qt/FontCustomPlatformData.h:
+        (FontCustomPlatformData):
+        * platform/graphics/qt/FontCustomPlatformDataQt.cpp:
+        (WebCore::FontCustomPlatformData::fontPlatformData):
+        (WebCore::createFontCustomPlatformData):
+        * platform/graphics/qt/FontPlatformData.h:
+        (WebCore::FontPlatformDataPrivate::FontPlatformDataPrivate):
+        (FontPlatformDataPrivate):
+        (FontPlatformData):
+        (WebCore::FontPlatformData::FontPlatformData):
+        * platform/graphics/qt/FontPlatformDataQt.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+        (WebCore::FontPlatformData::operator==):
+        (WebCore::FontPlatformData::hash):
+        * platform/graphics/qt/FontQt4.cpp: Removed.
+        * platform/graphics/qt/GlyphPageTreeNodeQt.cpp:
+        (WebCore::GlyphPage::fill):
+        * platform/graphics/qt/SimpleFontDataQt.cpp:
+        (WebCore::SimpleFontData::determinePitch):
+        (WebCore::SimpleFontData::platformBoundsForGlyph):
+        (WebCore::SimpleFontData::platformInit):
+        (WebCore::SimpleFontData::platformCharWidthInit):
+        * rendering/svg/SVGTextMetricsBuilder.cpp:
+        (WebCore::SVGTextMetricsBuilder::advance):
+        (WebCore::SVGTextMetricsBuilder::advanceSimpleText):
+        (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
+
 2012-08-16  Yury Semikhatsky  <yurys@chromium.org>
 
         Web Inspector: memory instrumentation for Resource{Request/Response}Base
index b8c35d0..af77119 100644 (file)
@@ -944,9 +944,11 @@ SOURCES += \
     platform/graphics/FontData.cpp \
     platform/graphics/Font.cpp \
     platform/graphics/FontCache.cpp \
+    platform/graphics/FontFastPath.cpp \
     platform/graphics/FractionalLayoutBoxExtent.cpp \
     platform/graphics/FractionalLayoutRect.cpp \
     platform/graphics/GeneratorGeneratedImage.cpp \
+    platform/graphics/GlyphPageTreeNode.cpp \
     platform/graphics/Gradient.cpp \
     platform/graphics/GraphicsContext.cpp \
     platform/graphics/GraphicsLayer.cpp \
@@ -961,6 +963,7 @@ SOURCES += \
     platform/graphics/Path.cpp \
     platform/graphics/PathTraversalState.cpp \
     platform/graphics/Pattern.cpp \
+    platform/graphics/qt/FontQt.cpp \
     platform/graphics/Region.cpp \
     platform/graphics/RoundedRect.cpp \
     platform/graphics/SegmentedFontData.cpp \
@@ -970,6 +973,7 @@ SOURCES += \
     platform/graphics/StringTruncator.cpp \
     platform/graphics/surfaces/GraphicsSurface.cpp \
     platform/graphics/surfaces/qt/GraphicsSurfaceQt.cpp \
+    platform/graphics/SurrogatePairAwareTextIterator.cpp \
     platform/graphics/TextRun.cpp \
     platform/graphics/TiledBackingStore.cpp \
     platform/graphics/transforms/AffineTransform.cpp \
@@ -983,6 +987,7 @@ SOURCES += \
     platform/graphics/transforms/TransformOperations.cpp \
     platform/graphics/transforms/TransformState.cpp \
     platform/graphics/transforms/TranslateTransformOperation.cpp \
+    platform/graphics/WidthIterator.cpp \
     platform/image-decoders/ImageDecoder.cpp \
     platform/image-decoders/bmp/BMPImageDecoder.cpp \
     platform/image-decoders/bmp/BMPImageReader.cpp \
@@ -2102,6 +2107,7 @@ HEADERS += \
     platform/graphics/ShadowBlur.h \
     platform/graphics/SimpleFontData.h \
     platform/graphics/surfaces/GraphicsSurface.h \
+    platform/graphics/SurrogatePairAwareTextIterator.h \
     platform/graphics/texmap/GraphicsLayerTextureMapper.h \
     platform/graphics/texmap/TextureMapper.h \
     platform/graphics/texmap/TextureMapperBackingStore.h \
@@ -2121,6 +2127,7 @@ HEADERS += \
     platform/graphics/transforms/TransformOperations.h \
     platform/graphics/transforms/TransformState.h \
     platform/graphics/transforms/TranslateTransformOperation.h \
+    platform/graphics/WidthIterator.h \
     platform/image-decoders/bmp/BMPImageDecoder.h \
     platform/image-decoders/bmp/BMPImageReader.h \
     platform/image-decoders/ico/ICOImageDecoder.h \
@@ -3284,28 +3291,6 @@ contains(DEFINES, ENABLE_MATHML=1) {
         rendering/mathml/RenderMathMLUnderOver.cpp
 }
 
-# QRawFont transition handling.
-#
-# Even though QRawFont was already available in Qt 4.8, it had
-# limitations that made switching fully to it impossible.
-# We preserve the old code path when building with Qt 4.
-
-contains(DEFINES, HAVE_QRAWFONT=1) {
-    SOURCES += \
-        platform/graphics/qt/FontQt.cpp \
-        platform/graphics/FontFastPath.cpp \
-        platform/graphics/GlyphPageTreeNode.cpp \
-        platform/graphics/WidthIterator.cpp \
-        platform/graphics/SurrogatePairAwareTextIterator.cpp
-
-    HEADERS += \
-        platform/graphics/WidthIterator.h \
-        platform/graphics/SurrogatePairAwareTextIterator.h
-} else {
-    SOURCES += \
-        platform/graphics/qt/FontQt4.cpp
-}
-
 contains(DEFINES, ENABLE_TEXT_AUTOSIZING=1) {
     SOURCES += # FIXME!
 }
index 2994698..db07f0a 100644 (file)
@@ -259,11 +259,6 @@ Font::CodePath Font::codePath(const TextRun& run) const
         return Simple;
 #endif
 
-#if PLATFORM(QT) && !HAVE(QRAWFONT)
-    if (run.expansion() || run.rtl() || isSmallCaps() || wordSpacing() || letterSpacing())
-        return Complex;
-#endif
-
     if (m_fontDescription.featureSettings() && m_fontDescription.featureSettings()->size() > 0)
         return Complex;
     
index b3b61ba..5e38a96 100644 (file)
 #include <wtf/unicode/CharacterNames.h>
 
 #if PLATFORM(QT)
-#if HAVE(QRAWFONT)
 #include <QRawFont>
 QT_BEGIN_NAMESPACE
 class QTextLayout;
 QT_END_NAMESPACE
-#else
-#include <QFont>
-#endif
 #endif
 
 namespace WebCore {
@@ -184,11 +180,7 @@ public:
     static unsigned expansionOpportunityCount(const UChar*, size_t length, TextDirection, bool& isAfterExpansion);
 
 #if PLATFORM(QT)
-#if HAVE(QRAWFONT)
     QRawFont rawFont() const;
-#else
-    QFont font() const;
-#endif
     QFont syntheticFont() const;
 #endif
 
@@ -268,7 +260,8 @@ private:
     {
         return m_fontList && m_fontList->loadingCustomFonts();
     }
-#if PLATFORM(QT) && HAVE(QRAWFONT)
+
+#if PLATFORM(QT)
     void initFormatForTextLayout(QTextLayout*) const;
 #endif
 
index caef7ad..b0ee156 100644 (file)
@@ -376,7 +376,7 @@ bool GraphicsContext::paintingDisabled() const
     return m_state.paintingDisabled;
 }
 
-#if !OS(WINCE) || (PLATFORM(QT) && !HAVE(QRAWFONT))
+#if !OS(WINCE)
 void GraphicsContext::drawText(const Font& font, const TextRun& run, const FloatPoint& point, int from, int to)
 {
     if (paintingDisabled())
index 7951425..1232e47 100644 (file)
@@ -69,7 +69,6 @@ SimpleFontData::SimpleFontData(PassOwnPtr<AdditionalFontData> fontData, float fo
     m_fontData->initializeFontData(this, fontSize);
 }
 
-#if !(PLATFORM(QT) && !HAVE(QRAWFONT))
 // Estimates of avgCharWidth and maxCharWidth for platforms that don't support accessing these values from the font.
 void SimpleFontData::initCharWidths()
 {
@@ -130,7 +129,6 @@ void SimpleFontData::platformGlyphInit()
     m_missingGlyphData.fontData = this;
     m_missingGlyphData.glyph = 0;
 }
-#endif
 
 SimpleFontData::~SimpleFontData()
 {
@@ -148,13 +146,11 @@ const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const
     return this;
 }
 
-#if !(PLATFORM(QT) && !HAVE(QRAWFONT))
 Glyph SimpleFontData::glyphForCharacter(UChar32 character) const
 {
     GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, character / GlyphPage::size);
     return node->page() ? node->page()->glyphAt(character % GlyphPage::size) : 0;
 }
-#endif
 
 bool SimpleFontData::isSegmented() const
 {
index 0a389cd..c0b044d 100644 (file)
 #endif
 
 #if PLATFORM(QT)
-#if !HAVE(QRAWFONT)
-#include <QFont>
-#else
 #include <QRawFont>
 #endif
-#endif
 
 namespace WebCore {
 
@@ -186,11 +182,7 @@ public:
 #endif
 
 #if PLATFORM(QT)
-#if !HAVE(QRAWFONT)
-    QFont getQtFont() const { return m_platformData.font(); }
-#else
     QRawFont getQtRawFont() const { return m_platformData.rawFont(); }
-#endif // !HAVE(QRAWFONT)
 #endif
 
 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
@@ -295,7 +287,6 @@ private:
 #endif
 };
 
-#if !(PLATFORM(QT) && !HAVE(QRAWFONT))
 ALWAYS_INLINE FloatRect SimpleFontData::boundsForGlyph(Glyph glyph) const
 {
     if (isZeroWidthSpaceGlyph(glyph))
@@ -332,7 +323,6 @@ ALWAYS_INLINE float SimpleFontData::widthForGlyph(Glyph glyph) const
     m_glyphToWidthMap.setMetricsForGlyph(glyph, width);
     return width;
 }
-#endif // HAVE(QRAWFONT)
 
 } // namespace WebCore
 
index 816bccb..957d77a 100644 (file)
@@ -36,9 +36,7 @@
 
 #include <QFont>
 #include <QFontDatabase>
-#if HAVE(QRAWFONT)
 #include <QTextLayout>
-#endif
 
 using namespace WTF;
 
@@ -48,7 +46,6 @@ void FontCache::platformInit()
 {
 }
 
-#if HAVE(QRAWFONT)
 static QRawFont rawFontForCharacters(const QString& string, const QRawFont& font)
 {
     QTextLayout layout(string);
@@ -65,23 +62,15 @@ static QRawFont rawFontForCharacters(const QString& string, const QRawFont& font
     const QGlyphRun& glyphs(glyphList.at(0));
     return glyphs.rawFont();
 }
-#endif // HAVE(QRAWFONT)
 
 const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
 {
-#if HAVE(QRAWFONT)
     QString qstring = QString::fromRawData(reinterpret_cast<const QChar*>(characters), length);
     QRawFont computedFont = rawFontForCharacters(qstring, font.rawFont());
     if (!computedFont.isValid())
         return 0;
     FontPlatformData alternateFont(computedFont);
     return getCachedFontData(&alternateFont, DoNotRetain);
-#else
-    Q_UNUSED(font);
-    Q_UNUSED(characters);
-    Q_UNUSED(length);
-    return 0;
-#endif
 }
 
 SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
index 7fa9f8c..fbf9a15 100644 (file)
@@ -29,9 +29,7 @@
 #include <wtf/FastAllocBase.h>
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
-#if HAVE(QRAWFONT)
 #include <QRawFont>
-#endif
 
 namespace WebCore {
 
@@ -42,19 +40,13 @@ struct FontCustomPlatformData {
     WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); WTF_MAKE_FAST_ALLOCATED;
 public:
     FontCustomPlatformData() { }
-    ~FontCustomPlatformData();
-
-#if !HAVE(QRAWFONT)
-    // for use with QFontDatabase::addApplicationFont/removeApplicationFont
-    int m_handle;
-#else
-    QRawFont m_rawFont;
-#endif
 
     FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight,
                                       FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
 
     static bool supportsFormat(const String&);
+
+    QRawFont m_rawFont;
 };
 
 FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer);
index 4c5b964..2be3855 100644 (file)
 
 #include "FontPlatformData.h"
 #include "SharedBuffer.h"
-#if !HAVE(QRAWFONT)
-#include <QFontDatabase>
-#endif
 #include <QStringList>
 
 namespace WebCore {
 
-FontCustomPlatformData::~FontCustomPlatformData()
-{
-#if !HAVE(QRAWFONT)
-    QFontDatabase::removeApplicationFont(m_handle);
-#endif
-}
-
 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode)
 {
-#if !HAVE(QRAWFONT)
-    QFont font;
-    font.setFamily(QFontDatabase::applicationFontFamilies(m_handle)[0]);
-    font.setPixelSize(size);
-    if (bold)
-        font.setWeight(QFont::Bold);
-    font.setItalic(italic);
-    return FontPlatformData(font);
-#else
     Q_ASSERT(m_rawFont.isValid());
     m_rawFont.setPixelSize(qreal(size));
     return FontPlatformData(m_rawFont);
-#endif
 }
 
 FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
@@ -60,24 +40,13 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
     ASSERT_ARG(buffer, buffer);
 
     const QByteArray fontData(buffer->data(), buffer->size());
-#if !HAVE(QRAWFONT)
-    int id = QFontDatabase::addApplicationFontFromData(fontData);
-    if (id == -1)
-        return 0;
-    Q_ASSERT(QFontDatabase::applicationFontFamilies(id).size() > 0);
-#else
     // Pixel size doesn't matter at this point, it is set in FontCustomPlatformData::fontPlatformData.
     QRawFont rawFont(fontData, /*pixelSize = */0, QFont::PreferDefaultHinting);
     if (!rawFont.isValid())
         return 0;
-#endif
 
     FontCustomPlatformData *data = new FontCustomPlatformData;
-#if !HAVE(QRAWFONT)
-    data->m_handle = id;
-#else
     data->m_rawFont = rawFont;
-#endif
     return data;
 }
 
index b60d05d..50885e2 100644 (file)
@@ -28,9 +28,7 @@
 #include "FontOrientation.h"
 #include <QFont>
 #include <QHash>
-#if HAVE(QRAWFONT)
 #include <QRawFont>
-#endif
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
 
@@ -40,13 +38,8 @@ class FontPlatformDataPrivate : public RefCounted<FontPlatformDataPrivate> {
     WTF_MAKE_NONCOPYABLE(FontPlatformDataPrivate); WTF_MAKE_FAST_ALLOCATED;
 public:
     FontPlatformDataPrivate()
-#if !HAVE(QRAWFONT)
-        : size(font.pixelSize())
-        , bold(font.bold())
-#else
         : size(0)
         , bold(false)
-#endif
         , oblique(false)
         , isDeletedValue(false)
     { }
@@ -58,23 +51,13 @@ public:
     {
 // This is necessary for SVG Fonts, which are only supported when using QRawFont.
 // It is used to construct the appropriate platform data to use as a fallback.
-#if HAVE(QRAWFONT)
         QFont font;
         font.setBold(bold);
         font.setItalic(oblique);
         rawFont = QRawFont::fromFont(font, QFontDatabase::Any);
         rawFont.setPixelSize(size);
-#endif
     }
-#if !HAVE(QRAWFONT)
-    FontPlatformDataPrivate(const QFont& font)
-        : font(font)
-        , size(font.pixelSize())
-        , bold(font.bold())
-        , oblique(false)
-        , isDeletedValue(false)
-    { }
-#else
+
     FontPlatformDataPrivate(const QRawFont& rawFont)
         : rawFont(rawFont)
         , size(rawFont.pixelSize())
@@ -82,16 +65,12 @@ public:
         , oblique(false)
         , isDeletedValue(false)
     { }
-#endif
+
     FontPlatformDataPrivate(WTF::HashTableDeletedValueType)
         : isDeletedValue(true)
     { }
 
-#if !HAVE(QRAWFONT)
-    QFont font;
-#else
     QRawFont rawFont;
-#endif
     float size;
     bool bold : 1;
     bool oblique : 1;
@@ -103,16 +82,10 @@ class FontPlatformData {
 public:
     FontPlatformData(float size, bool bold, bool oblique);
     FontPlatformData(const FontDescription&, const AtomicString& familyName, int wordSpacing = 0, int letterSpacing = 0);
-#if !HAVE(QRAWFONT)
-    FontPlatformData(const QFont& font)
-        : m_data(adoptRef(new FontPlatformDataPrivate(font)))
-    { }
-#else
     FontPlatformData(const FontPlatformData&, float size);
     FontPlatformData(const QRawFont& rawFont)
         : m_data(adoptRef(new FontPlatformDataPrivate(rawFont)))
     { }
-#endif
     FontPlatformData(WTF::HashTableDeletedValueType)
         : m_data(adoptRef(new FontPlatformDataPrivate()))
     {
@@ -126,15 +99,6 @@ public:
         return m_data && m_data->isDeletedValue;
     }
 
-#if !HAVE(QRAWFONT)
-    QFont font() const
-    {
-        Q_ASSERT(!isHashTableDeletedValue());
-        if (!m_data)
-            return QFont();
-        return m_data->font;
-    }
-#else
     QRawFont rawFont() const
     {
         Q_ASSERT(!isHashTableDeletedValue());
@@ -142,7 +106,7 @@ public:
             return QRawFont();
         return m_data->rawFont;
     }
-#endif
+
     float size() const
     {
         Q_ASSERT(!isHashTableDeletedValue());
index 44c9fdf..c1a1574 100644 (file)
@@ -63,11 +63,7 @@ FontPlatformData::FontPlatformData(float size, bool bold, bool oblique)
 FontPlatformData::FontPlatformData(const FontDescription& description, const AtomicString& familyName, int wordSpacing, int letterSpacing)
     : m_data(adoptRef(new FontPlatformDataPrivate()))
 {
-#if !HAVE(QRAWFONT)
-    QFont& font = m_data->font;
-#else
     QFont font;
-#endif
     int requestedSize = description.computedPixelSize();
     font.setFamily(familyName);
     font.setPixelSize(requestedSize);
@@ -78,20 +74,13 @@ FontPlatformData::FontPlatformData(const FontDescription& description, const Ato
     font.setStyleStrategy(QFont::ForceIntegerMetrics);
 
     m_data->bold = font.bold();
-#if !HAVE(QRAWFONT)
-    const bool smallCaps = description.smallCaps();
-    font.setCapitalization(smallCaps ? QFont::SmallCaps : QFont::MixedCase);
     // WebKit allows font size zero but QFont does not. We will return
     // m_data->size if a font size of zero is requested and pixelSize()
     // otherwise.
     m_data->size = (!requestedSize) ? requestedSize : font.pixelSize();
-#else
     m_data->rawFont = QRawFont::fromFont(font, QFontDatabase::Any);
-    m_data->size = requestedSize;
-#endif
 }
 
-#if HAVE(QRAWFONT)
 FontPlatformData::FontPlatformData(const FontPlatformData& other, float size)
     : m_data(adoptRef(new FontPlatformDataPrivate()))
 {
@@ -101,7 +90,6 @@ FontPlatformData::FontPlatformData(const FontPlatformData& other, float size)
     m_data->rawFont.setPixelSize(size);
     m_data->size = m_data->rawFont.pixelSize();
 }
-#endif // HAVE(QRAWFONT)
 
 bool FontPlatformData::operator==(const FontPlatformData& other) const
 {
@@ -114,11 +102,7 @@ bool FontPlatformData::operator==(const FontPlatformData& other) const
     const bool equals = (m_data->size == other.m_data->size
                          && m_data->bold == other.m_data->bold
                          && m_data->oblique == other.m_data->oblique
-#if !HAVE(QRAWFONT)
-                         && m_data->font == other.m_data->font);
-#else
                          && m_data->rawFont == other.m_data->rawFont);
-#endif
     return equals;
 }
 
@@ -128,15 +112,9 @@ unsigned FontPlatformData::hash() const
         return 0;
     if (m_data->isDeletedValue)
         return 1;
-#if !HAVE(QRAWFONT)
-    return (qHash(m_data->font.toString()) ^ qHash(m_data->bold)
-            ^ qHash(m_data->oblique))
-            ^ qHash(*reinterpret_cast<quint32*>(&m_data->size));
-#else
     return qHash(m_data->rawFont.familyName()) ^ qHash(m_data->rawFont.style())
             ^ qHash(m_data->rawFont.weight())
             ^ qHash(*reinterpret_cast<quint32*>(&m_data->size));
-#endif
 }
 
 #ifndef NDEBUG
diff --git a/Source/WebCore/platform/graphics/qt/FontQt4.cpp b/Source/WebCore/platform/graphics/qt/FontQt4.cpp
deleted file mode 100644 (file)
index 232b8ff..0000000
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
-    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
-    Copyright (C) 2008, 2010 Holger Hans Peter Freyther
-    Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-#include "Font.h"
-
-#include "AffineTransform.h"
-#include "FontDescription.h"
-#include "FontFallbackList.h"
-#include "FontSelector.h"
-#include "GlyphBuffer.h"
-#include "Gradient.h"
-#include "GraphicsContext.h"
-#include "NotImplemented.h"
-#include "Pattern.h"
-#include "ShadowBlur.h"
-#include "TextRun.h"
-
-#include <QBrush>
-#include <QFontInfo>
-#include <QFontMetrics>
-#include <QPainter>
-#include <QPainterPath>
-#include <QPen>
-#include <QTextLayout>
-#include <limits.h>
-#include <qalgorithms.h>
-#include <qdebug.h>
-
-
-namespace WebCore {
-
-static const QString fromRawDataWithoutRef(const String& string, int start = 0, int len = -1)
-{
-    if (len < 0)
-        len = string.length() - start;
-    Q_ASSERT(start + len <= string.length());
-
-    // We don't detach. This assumes the WebCore string data will stay valid for the
-    // lifetime of the QString we pass back, since we don't ref the WebCore string.
-    return QString::fromRawData(reinterpret_cast<const QChar*>(string.characters() + start), len);
-}
-
-static QTextLine setupLayout(QTextLayout* layout, const TextRun& style)
-{
-    int flags = style.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
-    if (style.expansion())
-        flags |= Qt::TextJustificationForced;
-    layout->setFlags(flags);
-    layout->beginLayout();
-    QTextLine line = layout->createLine();
-    line.setLineWidth(INT_MAX / 256);
-    if (style.expansion())
-        line.setLineWidth(line.naturalTextWidth() + style.expansion());
-    layout->endLayout();
-    return line;
-}
-
-static QPen fillPenForContext(GraphicsContext* ctx)
-{
-    if (ctx->fillGradient()) {
-        QBrush brush(*ctx->fillGradient()->platformGradient());
-        brush.setTransform(ctx->fillGradient()->gradientSpaceTransform());
-        return QPen(brush, 0);
-    }
-
-    if (ctx->fillPattern()) {
-        return QPen(QBrush(ctx->fillPattern()->createPlatformPattern()), 0);
-    }
-
-    return QPen(QColor(ctx->fillColor()));
-}
-
-static QPen strokePenForContext(GraphicsContext* ctx)
-{
-    if (ctx->strokeGradient()) {
-        QBrush brush(*ctx->strokeGradient()->platformGradient());
-        brush.setTransform(ctx->strokeGradient()->gradientSpaceTransform());
-        return QPen(brush, ctx->strokeThickness());
-    }
-
-    if (ctx->strokePattern()) {
-        QBrush brush(ctx->strokePattern()->createPlatformPattern());
-        return QPen(brush, ctx->strokeThickness());
-    }
-
-    return QPen(QColor(ctx->strokeColor()), ctx->strokeThickness());
-}
-
-static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const FloatPoint& point, int from, int to, const QFont& font, bool isComplexText)
-{
-    if (to < 0)
-        to = run.length();
-
-    QPainter* p = ctx->platformContext();
-
-    QPen textFillPen;
-    if (ctx->textDrawingMode() & TextModeFill)
-        textFillPen = fillPenForContext(ctx);
-
-    QPen textStrokePen;
-    if (ctx->textDrawingMode() & TextModeStroke)
-        textStrokePen = strokePenForContext(ctx);
-
-    String sanitized = Font::normalizeSpaces(run.characters(), run.length());
-    QString string = fromRawDataWithoutRef(sanitized);
-    QPointF pt(point.x(), point.y());
-
-    if (from > 0 || to < run.length()) {
-        if (isComplexText) {
-            QTextLayout layout(string, font);
-            QTextLine line = setupLayout(&layout, run);
-            float x1 = line.cursorToX(from);
-            float x2 = line.cursorToX(to);
-            if (x2 < x1)
-                qSwap(x1, x2);
-
-            QFontMetrics fm(font);
-            int ascent = fm.ascent();
-            QRectF boundingRect(point.x() + x1, point.y() - ascent, x2 - x1, fm.height());
-            QRectF clip = boundingRect;
-
-            ShadowBlur* ctxShadow = ctx->shadowBlur();
-            if (ctxShadow->type() != ShadowBlur::NoShadow) {
-                const QPointF shadowOffset(ctx->state().shadowOffset.width(), ctx->state().shadowOffset.height());
-                qreal dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0;
-                if (shadowOffset.x() > 0)
-                    dx2 = shadowOffset.x();
-                else
-                    dx1 = -shadowOffset.x();
-                if (shadowOffset.y() > 0)
-                    dy2 = shadowOffset.y();
-                else
-                    dy1 = -shadowOffset.y();
-                // expand the clip rect to include the text shadow as well
-                const float blurDistance = ctx->state().shadowBlur;
-                clip.adjust(dx1, dx2, dy1, dy2);
-                clip.adjust(-blurDistance, -blurDistance, blurDistance, blurDistance);
-            }
-            p->save();
-            p->setClipRect(clip.toRect(), Qt::IntersectClip);
-            pt.setY(pt.y() - ascent);
-
-            if (ctxShadow->type() != ShadowBlur::NoShadow) {
-                ShadowBlur* ctxShadow = ctx->shadowBlur();
-                if (ctxShadow->type() != ShadowBlur::BlurShadow
-                    && (!ctxShadow->shadowsIgnoreTransforms() || ctx->getCTM().isIdentity())) {
-                    p->save();
-                    p->setPen(ctx->state().shadowColor);
-                    p->translate(QPointF(ctx->state().shadowOffset.width(), ctx->state().shadowOffset.height()));
-                    line.draw(p, pt);
-                    p->restore();
-                } else {
-                    GraphicsContext* shadowContext = ctxShadow->beginShadowLayer(ctx, boundingRect);
-                    if (shadowContext) {
-                        QPainter* shadowPainter = shadowContext->platformContext();
-                        // Since it will be blurred anyway, we don't care about render hints.
-                        shadowPainter->setFont(p->font());
-                        shadowPainter->setPen(ctx->state().shadowColor);
-                        line.draw(shadowPainter, pt);
-                        ctxShadow->endShadowLayer(ctx);
-                    }
-                }
-            }
-            p->setPen(textFillPen);
-            line.draw(p, pt);
-            p->restore();
-            return;
-        }
-        int skipWidth = QFontMetrics(font).width(string, from, Qt::TextBypassShaping);
-        pt.setX(pt.x() + skipWidth);
-        string = fromRawDataWithoutRef(sanitized, from, to - from);
-    }
-
-    p->setFont(font);
-
-    int flags = run.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
-    if (!isComplexText && !(ctx->textDrawingMode() & TextModeStroke))
-        flags |= Qt::TextBypassShaping;
-
-    QPainterPath textStrokePath;
-    if (ctx->textDrawingMode() & TextModeStroke)
-        textStrokePath.addText(pt, font, string);
-
-    ShadowBlur* ctxShadow = ctx->shadowBlur();
-    if (ctx->hasShadow() && ctxShadow->type() != ShadowBlur::NoShadow) {
-        if (ctx->textDrawingMode() & TextModeFill) {
-            if (ctxShadow->type() != ShadowBlur::BlurShadow) {
-                p->save();
-                p->setPen(ctx->state().shadowColor);
-                p->translate(QPointF(ctx->state().shadowOffset.width(), ctx->state().shadowOffset.height()));
-                p->drawText(pt, string, flags, run.expansion());
-                p->restore();
-            } else {
-                QFontMetrics fm(font);
-                QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string, -1, flags), fm.height());
-                GraphicsContext* shadowContext = ctxShadow->beginShadowLayer(ctx, boundingRect);
-                if (shadowContext) {
-                    QPainter* shadowPainter = shadowContext->platformContext();
-                    // Since it will be blurred anyway, we don't care about render hints.
-                    shadowPainter->setFont(p->font());
-                    shadowPainter->setPen(ctx->state().shadowColor);
-                    shadowPainter->drawText(pt, string, flags, run.expansion());
-                    ctxShadow->endShadowLayer(ctx);
-                }
-            }
-        } else if (ctx->textDrawingMode() & TextModeStroke) {
-            if (ctxShadow->type() != ShadowBlur::BlurShadow) {
-                const QPointF shadowOffset(ctx->state().shadowOffset.width(), ctx->state().shadowOffset.height());
-                p->translate(shadowOffset);
-                p->strokePath(textStrokePath, QPen(ctx->state().shadowColor));
-                p->translate(-shadowOffset);
-            } else {
-                QFontMetrics fm(font);
-                QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string, -1, flags), fm.height());
-                GraphicsContext* shadowContext = ctxShadow->beginShadowLayer(ctx, boundingRect);
-                if (shadowContext) {
-                    QPainter* shadowPainter = shadowContext->platformContext();
-                    // Since it will be blurred anyway, we don't care about render hints.
-                    shadowPainter->setFont(p->font());
-                    shadowPainter->strokePath(textStrokePath, QPen(ctx->state().shadowColor));
-                    ctxShadow->endShadowLayer(ctx);
-                }
-            }
-        }
-    }
-
-    if (ctx->textDrawingMode() & TextModeStroke)
-        p->strokePath(textStrokePath, textStrokePen);
-
-    if (ctx->textDrawingMode() & TextModeFill) {
-        QPen previousPen = p->pen();
-        p->setPen(textFillPen);
-        p->drawText(pt, string, flags, run.expansion());
-        p->setPen(previousPen);
-    }
-}
-
-void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const FloatPoint& point, int from, int to) const
-{
-    drawTextCommon(ctx, run, point, from, to, font(), /* isComplexText = */true);
-}
-
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const
-{
-    if (!primaryFont()->platformData().size())
-        return 0;
-
-    if (!run.length())
-        return 0;
-
-    if (run.length() == 1 && treatAsSpace(run[0]))
-        return QFontMetrics(font()).width(space) + run.expansion();
-
-    String sanitized = Font::normalizeSpaces(run.characters(), run.length());
-    QString string = fromRawDataWithoutRef(sanitized);
-
-    int w = QFontMetrics(font()).width(string);
-    // WebKit expects us to ignore word spacing on the first character (as opposed to what Qt does)
-    if (treatAsSpace(run[0]))
-        w -= m_wordSpacing;
-
-    return w + run.expansion();
-}
-
-int Font::offsetForPositionForComplexText(const TextRun& run, float position, bool) const
-{
-    String sanitized = Font::normalizeSpaces(run.characters(), run.length());
-    QString string = fromRawDataWithoutRef(sanitized);
-
-    QTextLayout layout(string, font());
-    QTextLine line = setupLayout(&layout, run);
-    return line.xToCursor(position);
-}
-
-FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& pt, int h, int from, int to) const
-{
-    String sanitized = Font::normalizeSpaces(run.characters(), run.length());
-    QString string = fromRawDataWithoutRef(sanitized);
-
-    QTextLayout layout(string, font());
-    QTextLine line = setupLayout(&layout, run);
-
-    float x1 = line.cursorToX(from);
-    float x2 = line.cursorToX(to);
-    if (x2 < x1)
-        qSwap(x1, x2);
-
-    return FloatRect(pt.x() + x1, pt.y(), x2 - x1, h);
-}
-
-bool Font::canReturnFallbackFontsForComplexText()
-{
-    return false;
-}
-
-void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
-{
-    notImplemented();
-}
-
-void Font::drawSimpleText(GraphicsContext* ctx, const TextRun& run, const FloatPoint& point, int from, int to) const
-{
-    drawTextCommon(ctx, run, point, from, to, font(), /* isComplexText = */false);
-}
-
-int Font::offsetForPositionForSimpleText(const TextRun& run, float position, bool includePartialGlyphs) const
-{
-    String sanitized = Font::normalizeSpaces(run.characters(), run.length());
-    QString string = fromRawDataWithoutRef(sanitized);
-
-    QFontMetrics fm(font());
-    float delta = position;
-    int curPos = 0;
-    do {
-        float charWidth = fm.width(string[curPos]);
-        delta -= charWidth;
-        if (includePartialGlyphs) {
-            if (delta + charWidth / 2 <= 0)
-                break;
-        } else {
-            if (delta + charWidth <= 0)
-                break;
-        }
-    } while (++curPos < string.size());
-
-    return curPos;
-}
-
-
-float Font::floatWidthForSimpleText(const TextRun& run, GlyphBuffer* glyphBuffer, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
-{
-    if (!primaryFont()->platformData().size())
-        return 0;
-
-    if (!run.length())
-        return 0;
-
-    String sanitized = Font::normalizeSpaces(run.characters(), run.length());
-    QString string = fromRawDataWithoutRef(sanitized);
-
-    int w = QFontMetrics(font()).width(string, -1, Qt::TextBypassShaping);
-
-    // WebKit expects us to ignore word spacing on the first character (as opposed to what Qt does)
-    if (treatAsSpace(run[0]))
-        w -= m_wordSpacing;
-
-    return w + run.expansion();
-}
-
-
-FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint& pt, int h, int from, int to) const
-{
-    String sanitized = Font::normalizeSpaces(run.characters(), run.length());
-    QString wholeText = fromRawDataWithoutRef(sanitized);
-    QString selectedText = fromRawDataWithoutRef(sanitized, from, qMin(to - from, wholeText.length() - from));
-
-    int startX = QFontMetrics(font()).width(wholeText, from, Qt::TextBypassShaping);
-    int width = QFontMetrics(font()).width(selectedText, -1, Qt::TextBypassShaping);
-
-    return FloatRect(pt.x() + startX, pt.y(), width, h);
-}
-
-bool Font::canExpandAroundIdeographsInComplexText()
-{
-    return false;
-}
-
-bool Font::primaryFontHasGlyphForCharacter(UChar32) const
-{
-    notImplemented();
-    return true;
-}
-
-int Font::emphasisMarkAscent(const AtomicString&) const
-{
-    notImplemented();
-    return 0;
-}
-
-int Font::emphasisMarkDescent(const AtomicString&) const
-{
-    notImplemented();
-    return 0;
-}
-
-int Font::emphasisMarkHeight(const AtomicString&) const
-{
-    notImplemented();
-    return 0;
-}
-
-void Font::drawEmphasisMarksForSimpleText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
-{
-    notImplemented();
-}
-
-QFont Font::font() const
-{
-    QFont f = primaryFont()->getQtFont();
-    if (m_letterSpacing)
-        f.setLetterSpacing(QFont::AbsoluteSpacing, m_letterSpacing);
-    if (m_wordSpacing)
-        f.setWordSpacing(m_wordSpacing);
-    return f;
-}
-
-QFont Font::syntheticFont() const
-{
-    return font();
-}
-
-}
-
index 7b76804..5ee9922 100644 (file)
 #include "config.h"
 #include "GlyphPageTreeNode.h"
 
-#if HAVE(QRAWFONT)
 #include "SimpleFontData.h"
 #include <QFontMetricsF>
 #include <QTextLayout>
-#endif
 
 namespace WebCore {
 
-#if HAVE(QRAWFONT)
 bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
 {
     QRawFont rawFont = fontData->platformData().rawFont();
@@ -51,15 +48,5 @@ bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
     }
     return haveGlyphs;
 }
-#else
-
-void GlyphPageTreeNode::pruneTreeCustomFontData(const FontData*)
-{
-}
-
-void GlyphPageTreeNode::pruneTreeFontData(const WebCore::SimpleFontData*)
-{
-}
-#endif // HAVE(QRAWFONT)
 
 }
index 5790865..8ce9f77 100644 (file)
 #include "config.h"
 #include "SimpleFontData.h"
 
-#if HAVE(QRAWFONT)
 #include "NotImplemented.h"
-#else
-#include <QFontMetricsF>
-#endif
 
 namespace WebCore {
 
 void SimpleFontData::determinePitch()
 {
-#if HAVE(QRAWFONT)
     notImplemented();
     m_treatAsFixedPitch = false;
-#else
-    m_treatAsFixedPitch = m_platformData.font().fixedPitch();
-#endif
 }
 
-#if HAVE(QRAWFONT)
-
 static const float smallCapsFraction = 0.7;
 static const float emphasisMarkFraction = 0.5;
 
@@ -102,23 +92,6 @@ FloatRect SimpleFontData::platformBoundsForGlyph(Glyph) const
     notImplemented();
     return FloatRect();
 }
-#else
-bool SimpleFontData::containsCharacters(const UChar*, int) const
-{
-    return true;
-}
-
-void SimpleFontData::platformGlyphInit()
-{
-    if (!m_platformData.size())
-        return;
-    m_spaceGlyph = 0;
-    m_adjustedSpaceWidth = m_spaceWidth;
-    determinePitch();
-    m_missingGlyphData.fontData = this;
-    m_missingGlyphData.glyph = 0;
-}
-#endif
 
 void SimpleFontData::platformInit()
 {
@@ -129,7 +102,6 @@ void SimpleFontData::platformInit()
          return;
     }
 
-#if HAVE(QRAWFONT)
     QRawFont rawFont(m_platformData.rawFont());
     float descent = rawFont.descent();
     float ascent = rawFont.ascent();
@@ -139,14 +111,6 @@ void SimpleFontData::platformInit()
     QVector<quint32> indexes = rawFont.glyphIndexesForString(QLatin1String(" "));
     QVector<QPointF> advances = rawFont.advancesForGlyphIndexes(indexes);
     float spaceWidth = advances.at(0).x();
-#else
-    QFontMetricsF fm(m_platformData.font());
-    float descent = fm.descent();
-    float ascent = fm.ascent();
-    float xHeight = fm.xHeight();
-    float lineSpacing = fm.lineSpacing();
-    float spaceWidth = fm.width(QLatin1Char(' '));
-#endif
 
     // The line spacing should always be >= (ascent + descent), but this
     // may be false in some cases due to misbehaving platform libraries.
@@ -171,15 +135,9 @@ void SimpleFontData::platformCharWidthInit()
 {
     if (!m_platformData.size())
         return;
-#if HAVE(QRAWFONT)
     QRawFont rawFont(m_platformData.rawFont());
     m_avgCharWidth = rawFont.averageCharWidth();
     m_maxCharWidth = rawFont.maxCharWidth();
-#else
-    QFontMetricsF fm(m_platformData.font());
-    m_avgCharWidth = fm.averageCharWidth();
-    m_maxCharWidth = fm.maxWidth();
-#endif
 }
 
 void SimpleFontData::platformDestroy()
index 685e515..5ac85cb 100644 (file)
@@ -48,23 +48,16 @@ bool SVGTextMetricsBuilder::advance()
     if (int(m_textPosition) >= m_run.charactersLength())
         return false;
 
-#if PLATFORM(QT) && !HAVE(QRAWFONT)
-    advanceComplexText();
-#else
     if (m_isComplexText)
         advanceComplexText();
     else
         advanceSimpleText();
-#endif
 
     return m_currentMetrics.length() > 0;
 }
 
 void SVGTextMetricsBuilder::advanceSimpleText()
 {
-#if PLATFORM(QT) && !HAVE(QRAWFONT)
-    ASSERT_NOT_REACHED();
-#else
     unsigned metricsLength = m_simpleWidthIterator->advance(m_textPosition + 1);
     if (!metricsLength) {
         m_currentMetrics = SVGTextMetrics();
@@ -82,7 +75,6 @@ void SVGTextMetricsBuilder::advanceSimpleText()
 #else
     m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, currentWidth, emptyString());
 #endif
-#endif
 }
 
 void SVGTextMetricsBuilder::advanceComplexText()
@@ -115,12 +107,10 @@ void SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer(RenderSVGInlin
     m_run = SVGTextMetrics::constructTextRun(text, text->characters(), 0, text->textLength());
     m_isComplexText = scaledFont.codePath(m_run) == Font::Complex;
 
-#if !PLATFORM(QT) || HAVE(QRAWFONT)
     if (m_isComplexText)
         m_simpleWidthIterator.clear();
     else
         m_simpleWidthIterator = adoptPtr(new WidthIterator(&scaledFont, m_run));
-#endif
 }
 
 struct MeasureTextData {
index 97ec22e..d1907bb 100644 (file)
@@ -1,3 +1,14 @@
+2012-08-16  Pierre Rossi  <pierre.rossi@gmail.com>
+
+        [Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code
+        https://bugs.webkit.org/show_bug.cgi?id=93960
+
+        Reviewed by Simon Hausmann.
+
+        Following the removal of Qt 4 support from trunk in r124879.
+
+        * WebCoreSupport/AboutDataHaveFeatures.in: Remove all traces of HAVE_QRAWFONT's existence.
+
 2012-08-15  Benjamin C Meyer  <bmeyer@rim.com>
 
         [BlackBerry] When there is an exception we want to check if the ref is 0, not the
index 7bf8029..97dc983 100644 (file)
@@ -1,3 +1,15 @@
+2012-08-16  Pierre Rossi  <pierre.rossi@gmail.com>
+
+        [Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code
+        https://bugs.webkit.org/show_bug.cgi?id=93960
+
+        Reviewed by Simon Hausmann.
+
+        Following the removal of Qt 4 support from trunk in r124879.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::getWebCoreStatistics):
+
 2012-08-16  Christophe Dumez  <christophe.dumez@intel.com>
 
         [EFL][WK2] Add unit tests for Web intent registration
index 480cd71..ac4bab2 100644 (file)
@@ -1005,9 +1005,7 @@ void WebProcess::getWebCoreStatistics(uint64_t callbackID)
     data.statisticsNumbers.set("CachedFontDataInactiveCount", fontCache()->inactiveFontDataCount());
     
     // Gather glyph page statistics.
-#if !(PLATFORM(QT) && !HAVE(QRAWFONT)) // Qt doesn't use the glyph page tree currently. See: bug 63467.
     data.statisticsNumbers.set("GlyphPageCount", GlyphPageTreeNode::treeGlyphPageCount());
-#endif
     
     // Get WebCore memory cache statistics
     getWebCoreMemoryCacheStatistics(data.webCoreCacheStatistics);
index 9d9b9e0..1c0f517 100644 (file)
@@ -1,3 +1,14 @@
+2012-08-16  Pierre Rossi  <pierre.rossi@gmail.com>
+
+        [Qt] Remove FontQt4, HAVE_QRAWFONT flag and the related dead code
+        https://bugs.webkit.org/show_bug.cgi?id=93960
+
+        Reviewed by Simon Hausmann.
+
+        Following the removal of Qt 4 support from trunk in r124879.
+
+        * qmake/mkspecs/features/features.prf:
+
 2012-08-16  Taiju Tsuiki  <tzik@chromium.org>
 
         Add deleteFileSystem support to DumpRenderTree for chromium
index 8d4b614..4215b27 100644 (file)
@@ -34,11 +34,6 @@ load(mobilityconfig, true)
 DEFINES += WTF_USE_ICU_UNICODE=1
 DEFINES -= WTF_USE_QT4_UNICODE=1
 
-!contains(DEFINES, HAVE_QRAWFONT=.) {
-    # Use of QRawFont in Qt 5:
-    DEFINES += HAVE_QRAWFONT=1
-}
-
 # We need fontconfig to set up the test fonts for DumpRenderTree and WebKitTestRunner.
 config_fontconfig:!mac {
     DEFINES += HAVE_FONTCONFIG=1
@@ -201,8 +196,8 @@ for(feature, FEATURE_DEFAULTS) {
 
 # ---------------- Sanitize defines -------------------
 
-# Disable SVG fonts if SVG is disabled or we don't have raw fonts
-contains(DEFINES, ENABLE_SVG=0)|!contains(DEFINES, HAVE_QRAWFONT=1): DEFINES += ENABLE_SVG_FONTS=0
+# Disable SVG fonts if SVG is disabled
+contains(DEFINES, ENABLE_SVG=0): DEFINES += ENABLE_SVG_FONTS=0
 
 # JavaScript debugger requires the inspector
 contains(DEFINES, ENABLE_INSPECTOR=0) {