Remove Qt from WebCore/platform.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Oct 2013 21:23:34 +0000 (21:23 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Oct 2013 21:23:34 +0000 (21:23 +0000)
<https://webkit.org/b/122228>

Reviewed by Anders Carlsson.

Purge PLATFORM(QT) blocks and FooBarQt.* files.

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

198 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/ContextMenuItem.h
Source/WebCore/platform/Cursor.h
Source/WebCore/platform/DragData.h
Source/WebCore/platform/DragImage.h
Source/WebCore/platform/FileSystem.h
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/LocalizedStrings.h
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/NotImplemented.h
Source/WebCore/platform/Pasteboard.h
Source/WebCore/platform/PlatformKeyboardEvent.h
Source/WebCore/platform/PlatformMenuDescription.h
Source/WebCore/platform/PlatformTouchEvent.h
Source/WebCore/platform/PlatformTouchPoint.h
Source/WebCore/platform/RunLoop.h
Source/WebCore/platform/SchemeRegistry.cpp
Source/WebCore/platform/ScrollAnimatorNone.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/SharedBuffer.cpp
Source/WebCore/platform/URL.cpp
Source/WebCore/platform/URL.h
Source/WebCore/platform/Widget.h
Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp
Source/WebCore/platform/audio/qt/AudioBusQt.cpp [deleted file]
Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/Color.h
Source/WebCore/platform/graphics/FloatPoint.h
Source/WebCore/platform/graphics/FloatRect.h
Source/WebCore/platform/graphics/FloatSize.h
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/FontPlatformData.h
Source/WebCore/platform/graphics/GlyphBuffer.h
Source/WebCore/platform/graphics/Gradient.h
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/GraphicsContext3D.cpp
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/Icon.h
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/ImageBufferData.h
Source/WebCore/platform/graphics/IntPoint.h
Source/WebCore/platform/graphics/IntRect.h
Source/WebCore/platform/graphics/IntSize.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/NativeImagePtr.h
Source/WebCore/platform/graphics/OpenGLESShims.h
Source/WebCore/platform/graphics/OpenGLShims.cpp
Source/WebCore/platform/graphics/OpenGLShims.h
Source/WebCore/platform/graphics/Path.cpp
Source/WebCore/platform/graphics/Path.h
Source/WebCore/platform/graphics/Pattern.h
Source/WebCore/platform/graphics/PlatformLayer.h
Source/WebCore/platform/graphics/SimpleFontData.h
Source/WebCore/platform/graphics/WidthIterator.h
Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp
Source/WebCore/platform/graphics/gpu/qt/DrawingBufferQt.cpp [deleted file]
Source/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp [deleted file]
Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp [deleted file]
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/qt/ColorQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/FloatPointQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/FloatRectQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/FloatSizeQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/FontCacheQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h [deleted file]
Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/FontPlatformData.h [deleted file]
Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/FontQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/GradientQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/IconQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h [deleted file]
Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/ImageDecoderQt.h [deleted file]
Source/WebCore/platform/graphics/qt/ImageQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/IntPointQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/IntRectQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/IntSizeQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h [deleted file]
Source/WebCore/platform/graphics/qt/NativeImageQt.h [deleted file]
Source/WebCore/platform/graphics/qt/PathQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/PatternQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/StillImageQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/StillImageQt.h [deleted file]
Source/WebCore/platform/graphics/qt/TileQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/TileQt.h [deleted file]
Source/WebCore/platform/graphics/qt/TransformationMatrixQt.cpp [deleted file]
Source/WebCore/platform/graphics/qt/TransparencyLayer.h [deleted file]
Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h
Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp
Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp [deleted file]
Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceQt.cpp [deleted file]
Source/WebCore/platform/graphics/surfaces/win/GraphicsSurfaceWin.cpp [deleted file]
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
Source/WebCore/platform/graphics/transforms/AffineTransform.h
Source/WebCore/platform/graphics/transforms/TransformationMatrix.h
Source/WebCore/platform/image-decoders/ImageDecoder.cpp
Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
Source/WebCore/platform/network/NetworkStateNotifier.h
Source/WebCore/platform/network/NetworkingContext.h
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/ResourceHandleInternal.h
Source/WebCore/platform/network/ResourceRequestBase.cpp
Source/WebCore/platform/network/qt/AuthenticationChallenge.h [deleted file]
Source/WebCore/platform/network/qt/CookieJarQt.cpp [deleted file]
Source/WebCore/platform/network/qt/CookieJarQt.h [deleted file]
Source/WebCore/platform/network/qt/CredentialStorageQt.cpp [deleted file]
Source/WebCore/platform/network/qt/DNSQt.cpp [deleted file]
Source/WebCore/platform/network/qt/NetworkStateNotifierPrivate.h [deleted file]
Source/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp [deleted file]
Source/WebCore/platform/network/qt/ProxyServerQt.cpp [deleted file]
Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp [deleted file]
Source/WebCore/platform/network/qt/QNetworkReplyHandler.h [deleted file]
Source/WebCore/platform/network/qt/QtMIMETypeSniffer.cpp [deleted file]
Source/WebCore/platform/network/qt/QtMIMETypeSniffer.h [deleted file]
Source/WebCore/platform/network/qt/ResourceError.h [deleted file]
Source/WebCore/platform/network/qt/ResourceHandleQt.cpp [deleted file]
Source/WebCore/platform/network/qt/ResourceRequest.h [deleted file]
Source/WebCore/platform/network/qt/ResourceRequestQt.cpp [deleted file]
Source/WebCore/platform/network/qt/ResourceResponse.h [deleted file]
Source/WebCore/platform/network/qt/SocketStreamError.h [deleted file]
Source/WebCore/platform/network/qt/SocketStreamHandle.h [deleted file]
Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h [deleted file]
Source/WebCore/platform/network/qt/SocketStreamHandleQt.cpp [deleted file]
Source/WebCore/platform/qt/CursorQt.cpp [deleted file]
Source/WebCore/platform/qt/DataTransferItemListQt.cpp [deleted file]
Source/WebCore/platform/qt/DataTransferItemListQt.h [deleted file]
Source/WebCore/platform/qt/DataTransferItemQt.cpp [deleted file]
Source/WebCore/platform/qt/DataTransferItemQt.h [deleted file]
Source/WebCore/platform/qt/DeviceMotionClientQt.cpp [deleted file]
Source/WebCore/platform/qt/DeviceMotionClientQt.h [deleted file]
Source/WebCore/platform/qt/DeviceMotionProviderQt.cpp [deleted file]
Source/WebCore/platform/qt/DeviceMotionProviderQt.h [deleted file]
Source/WebCore/platform/qt/DeviceOrientationClientQt.cpp [deleted file]
Source/WebCore/platform/qt/DeviceOrientationClientQt.h [deleted file]
Source/WebCore/platform/qt/DeviceOrientationProviderQt.cpp [deleted file]
Source/WebCore/platform/qt/DeviceOrientationProviderQt.h [deleted file]
Source/WebCore/platform/qt/DragDataQt.cpp [deleted file]
Source/WebCore/platform/qt/DragImageQt.cpp [deleted file]
Source/WebCore/platform/qt/EventLoopQt.cpp [deleted file]
Source/WebCore/platform/qt/FileSystemQt.cpp [deleted file]
Source/WebCore/platform/qt/GamepadsQt.cpp [deleted file]
Source/WebCore/platform/qt/LanguageQt.cpp [deleted file]
Source/WebCore/platform/qt/LocalizedStringsQt.cpp [deleted file]
Source/WebCore/platform/qt/LoggingQt.cpp [deleted file]
Source/WebCore/platform/qt/MIMETypeRegistryQt.cpp [deleted file]
Source/WebCore/platform/qt/PasteboardQt.cpp [deleted file]
Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp [deleted file]
Source/WebCore/platform/qt/PlatformScreenQt.cpp [deleted file]
Source/WebCore/platform/qt/PlatformSupport.h [deleted file]
Source/WebCore/platform/qt/PlatformSupportQt.cpp [deleted file]
Source/WebCore/platform/qt/QStyleFacade.h [deleted file]
Source/WebCore/platform/qt/QWebPageClient.h [deleted file]
Source/WebCore/platform/qt/QtTestSupport.cpp [deleted file]
Source/WebCore/platform/qt/QtTestSupport.h [deleted file]
Source/WebCore/platform/qt/RenderThemeQStyle.cpp [deleted file]
Source/WebCore/platform/qt/RenderThemeQStyle.h [deleted file]
Source/WebCore/platform/qt/RenderThemeQt.cpp [deleted file]
Source/WebCore/platform/qt/RenderThemeQt.h [deleted file]
Source/WebCore/platform/qt/RenderThemeQtMobile.cpp [deleted file]
Source/WebCore/platform/qt/RenderThemeQtMobile.h [deleted file]
Source/WebCore/platform/qt/RunLoopQt.cpp [deleted file]
Source/WebCore/platform/qt/ScrollViewQt.cpp [deleted file]
Source/WebCore/platform/qt/ScrollbarThemeQStyle.cpp [deleted file]
Source/WebCore/platform/qt/ScrollbarThemeQStyle.h [deleted file]
Source/WebCore/platform/qt/ScrollbarThemeQt.cpp [deleted file]
Source/WebCore/platform/qt/SharedBufferQt.cpp [deleted file]
Source/WebCore/platform/qt/SharedTimerQt.cpp [deleted file]
Source/WebCore/platform/qt/SoundQt.cpp [deleted file]
Source/WebCore/platform/qt/TemporaryLinkStubsQt.cpp [deleted file]
Source/WebCore/platform/qt/ThirdPartyCookiesQt.cpp [deleted file]
Source/WebCore/platform/qt/ThirdPartyCookiesQt.h [deleted file]
Source/WebCore/platform/qt/URLQt.cpp [deleted file]
Source/WebCore/platform/qt/UserAgentQt.cpp [deleted file]
Source/WebCore/platform/qt/UserAgentQt.h [deleted file]
Source/WebCore/platform/qt/WebCoreSystemInterface.h [deleted file]
Source/WebCore/platform/qt/WebCoreSystemInterface.mm [deleted file]
Source/WebCore/platform/qt/WidgetQt.cpp [deleted file]
Source/WebCore/platform/text/TextBoundaries.cpp
Source/WebCore/platform/text/qt/TextBoundariesQt.cpp [deleted file]
Source/WebCore/platform/text/qt/TextBreakIteratorInternalICUQt.cpp [deleted file]

index 62d8a82..707b71f 100644 (file)
@@ -1,3 +1,12 @@
+2013-10-02  Andreas Kling  <akling@apple.com>
+
+        Remove Qt from WebCore/platform.
+        <https://webkit.org/b/122228>
+
+        Reviewed by Anders Carlsson.
+
+        Purge PLATFORM(QT) blocks and FooBarQt.* files.
+
 2013-10-02  Tim Horton  <timothy_horton@apple.com>
 
         [mac] Stop using DrawingAreaImpl on PLATFORM(MAC) 
index 2af73dc..da8273d 100644 (file)
@@ -56,7 +56,7 @@ namespace WebCore {
         ContextMenuItemTagOpenImageInNewWindow,
         ContextMenuItemTagDownloadImageToDisk,
         ContextMenuItemTagCopyImageToClipboard,
-#if PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
+#if PLATFORM(GTK) || PLATFORM(EFL)
         ContextMenuItemTagCopyImageUrlToClipboard,
 #endif
         ContextMenuItemTagOpenFrameInNewWindow,
@@ -70,7 +70,7 @@ namespace WebCore {
 #if PLATFORM(GTK)
         ContextMenuItemTagDelete,
 #endif
-#if PLATFORM(GTK) || PLATFORM(QT) || PLATFORM (EFL)
+#if PLATFORM(GTK) || PLATFORM (EFL)
         ContextMenuItemTagSelectAll,
 #endif
 #if PLATFORM(GTK)
index d35420d..f20fdfa 100644 (file)
@@ -40,8 +40,6 @@ typedef HICON HCURSOR;
 #include <wtf/RetainPtr.h>
 #elif PLATFORM(GTK)
 #include "GRefPtrGtk.h"
-#elif PLATFORM(QT)
-#include <QCursor>
 #elif PLATFORM(BLACKBERRY)
 #include <BlackBerryPlatformCursor.h>
 #endif
@@ -56,7 +54,7 @@ typedef HICON HCURSOR;
 #endif
 
 // Looks like it's just PLATFORM(BLACKBERRY) still not using this?
-#if PLATFORM(WIN) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(NIX)
+#if PLATFORM(WIN) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(NIX)
 #define WTF_USE_LAZY_NATIVE_CURSOR 1
 #endif
 
@@ -81,9 +79,6 @@ namespace WebCore {
     typedef GRefPtr<GdkCursor> PlatformCursor;
 #elif PLATFORM(EFL) || PLATFORM(NIX)
     typedef const char* PlatformCursor;
-#elif PLATFORM(QT) && !defined(QT_NO_CURSOR)
-    // Do not need to be shared but need to be created dynamically via ensurePlatformCursor.
-    typedef QCursor* PlatformCursor;
 #elif PLATFORM(BLACKBERRY)
     typedef BlackBerry::Platform::BlackBerryCursor PlatformCursor;
 #else
index 1ba7ce0..9303769 100644 (file)
@@ -47,11 +47,6 @@ typedef id DragDataRef;
 typedef void* DragDataRef;
 #endif
 
-#elif PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QMimeData;
-QT_END_NAMESPACE
-typedef const QMimeData* DragDataRef;
 #elif PLATFORM(WIN)
 typedef struct IDataObject* DragDataRef;
 #include <wtf/text/WTFString.h>
@@ -120,7 +115,7 @@ public:
     const String& pasteboardName() const { return m_pasteboardName; }
 #endif
 
-#if PLATFORM(QT) || PLATFORM(GTK)
+#if PLATFORM(GTK)
     // This constructor should used only by WebKit2 IPC because DragData
     // is initialized by the decoder and not in the constructor.
     DragData() { }
index 1bbd07c..d8f52bc 100644 (file)
 #if PLATFORM(MAC)
 #include <wtf/RetainPtr.h>
 OBJC_CLASS NSImage;
-#elif PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QPixmap;
-QT_END_NAMESPACE
 #elif PLATFORM(WIN)
 typedef struct HBITMAP__* HBITMAP;
 #elif PLATFORM(GTK) || PLATFORM(NIX)
@@ -55,8 +51,6 @@ namespace WebCore {
 
 #if PLATFORM(MAC)
     typedef RetainPtr<NSImage> DragImageRef;
-#elif PLATFORM(QT)
-    typedef QPixmap* DragImageRef;
 #elif PLATFORM(WIN)
     typedef HBITMAP DragImageRef;
 #elif PLATFORM(GTK) || PLATFORM(NIX)
index 2c14eb2..fa033ed 100644 (file)
 #include <wtf/RetainPtr.h>
 #endif
 
-#if PLATFORM(QT)
-#include <QFile>
-#include <QLibrary>
-#if defined(Q_OS_WIN32)
-#include <windows.h>
-#endif
-#endif
-
-#if USE(CF) || (PLATFORM(QT) && defined(Q_WS_MAC))
+#if USE(CF)
 typedef struct __CFBundle* CFBundleRef;
 typedef const struct __CFData* CFDataRef;
 #endif
@@ -77,14 +69,6 @@ namespace WebCore {
 typedef HMODULE PlatformModule;
 #elif PLATFORM(EFL)
 typedef Eina_Module* PlatformModule;
-#elif PLATFORM(QT)
-#if defined(Q_WS_MAC)
-typedef CFBundleRef PlatformModule;
-#elif !defined(QT_NO_LIBRARY)
-typedef QLibrary* PlatformModule;
-#else
-typedef void* PlatformModule;
-#endif
 #elif USE(GLIB)
 typedef GModule* PlatformModule;
 #elif USE(CF)
@@ -117,10 +101,7 @@ typedef unsigned PlatformModuleVersion;
 #endif
 
 // PlatformFileHandle
-#if PLATFORM(QT)
-typedef QFile* PlatformFileHandle;
-const PlatformFileHandle invalidPlatformFileHandle = 0;
-#elif USE(GLIB) && !PLATFORM(EFL)
+#if USE(GLIB) && !PLATFORM(EFL)
 typedef GFileIOStream* PlatformFileHandle;
 const PlatformFileHandle invalidPlatformFileHandle = 0;
 #elif OS(WINDOWS)
@@ -218,7 +199,7 @@ String filenameForDisplay(const String&);
 CString applicationDirectoryPath();
 CString sharedResourcesPath();
 #endif
-#if USE(SOUP) || PLATFORM(QT)
+#if USE(SOUP)
 uint64_t getVolumeFreeSizeForPath(const char*);
 #endif
 
index 49ed222..599011b 100644 (file)
@@ -209,14 +209,6 @@ String contextMenuItemTagPaste()
     return WEB_UI_STRING("Paste", "Paste context menu item");
 }
 
-#if PLATFORM(QT)
-String contextMenuItemTagSelectAll()
-{
-    notImplemented();
-    return "Select All";
-}
-#endif
-
 String contextMenuItemTagNoGuessesFound()
 {
     return WEB_UI_STRING("No Guesses Found", "No Guesses Found context menu item");
index e976a96..1a86738 100644 (file)
@@ -49,15 +49,12 @@ namespace WebCore {
 
 #if ENABLE(CONTEXT_MENUS)
     String contextMenuItemTagOpenLinkInNewWindow();
-#if PLATFORM(QT)
-    String contextMenuItemTagOpenLinkInThisWindow();
-#endif
     String contextMenuItemTagDownloadLinkToDisk();
     String contextMenuItemTagCopyLinkToClipboard();
     String contextMenuItemTagOpenImageInNewWindow();
     String contextMenuItemTagDownloadImageToDisk();
     String contextMenuItemTagCopyImageToClipboard();
-#if PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
+#if PLATFORM(GTK) || PLATFORM(EFL)
     String contextMenuItemTagCopyImageUrlToClipboard();
 #endif
     String contextMenuItemTagOpenFrameInNewWindow();
@@ -83,7 +80,7 @@ namespace WebCore {
     String contextMenuItemTagUnicodeInsertZWJMark();
     String contextMenuItemTagUnicodeInsertZWNJMark();
 #endif
-#if PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
+#if PLATFORM(GTK) || PLATFORM(EFL)
     String contextMenuItemTagSelectAll();
 #endif
     String contextMenuItemTagNoGuessesFound();
index da77f10..7464e19 100644 (file)
 #include <wtf/RetainPtr.h>
 #endif
 
-#if PLATFORM(QT)
-#include <QImageReader>
-#include <QImageWriter>
-#endif
-
 #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
 #include "ArchiveFactory.h"
 #endif
@@ -251,29 +246,6 @@ static void initializeSupportedImageMIMETypes()
     supportedImageResourceMIMETypes->add("image/webp");
 #endif
 
-#if PLATFORM(QT)
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
-    QList<QByteArray> mimeTypes = QImageReader::supportedMimeTypes();
-    Q_FOREACH(const QByteArray& mimeType, mimeTypes) {
-        supportedImageMIMETypes->add(mimeType.constData());
-        supportedImageResourceMIMETypes->add(mimeType.constData());
-    }
-#else
-    QList<QByteArray> formats = QImageReader::supportedImageFormats();
-    for (int i = 0; i < formats.size(); ++i) {
-        String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
-        if (!mimeType.isEmpty()) {
-            supportedImageMIMETypes->add(mimeType);
-            supportedImageResourceMIMETypes->add(mimeType);
-        }
-    }
-#endif // QT_VERSION
-#if ENABLE(SVG)
-    // Do not treat SVG as images directly if WebKit can handle them.
-    supportedImageMIMETypes->remove("image/svg+xml");
-    supportedImageResourceMIMETypes->remove("image/svg+xml");
-#endif
-#endif // PLATFORM(QT)
 #endif // USE(CG)
 }
 
@@ -298,20 +270,6 @@ static void initializeSupportedImageMIMETypesForEncoding()
     supportedImageMIMETypesForEncoding->add("image/jpeg");
     supportedImageMIMETypesForEncoding->add("image/gif");
 #endif
-#elif PLATFORM(QT)
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
-    QList<QByteArray> mimeTypes = QImageWriter::supportedMimeTypes();
-    Q_FOREACH(const QByteArray& mimeType, mimeTypes) {
-        supportedImageMIMETypesForEncoding->add(mimeType.constData());
-    }
-#else
-    QList<QByteArray> formats = QImageWriter::supportedImageFormats();
-    for (int i = 0; i < formats.size(); ++i) {
-        String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
-        if (!mimeType.isEmpty())
-            supportedImageMIMETypesForEncoding->add(mimeType);
-    }
-#endif // QT_VERSION
 #elif PLATFORM(GTK)
     supportedImageMIMETypesForEncoding->add("image/png");
     supportedImageMIMETypesForEncoding->add("image/jpeg");
@@ -527,7 +485,6 @@ String MIMETypeRegistry::getWellKnownMIMETypeForExtension(const String& extensio
     return findMimeType(commonMediaTypes, sizeof(commonMediaTypes) / sizeof(commonMediaTypes[0]), extension);
 }
 
-#if !PLATFORM(QT)
 String MIMETypeRegistry::getMIMETypeForPath(const String& path)
 {
     size_t pos = path.reverseFind('.');
@@ -539,7 +496,6 @@ String MIMETypeRegistry::getMIMETypeForPath(const String& path)
     }
     return defaultMIMEType();
 }
-#endif
 
 bool MIMETypeRegistry::isSupportedImageMIMEType(const String& mimeType)
 {
@@ -692,7 +648,7 @@ const String& defaultMIMEType()
     return defaultMIMEType;
 }
 
-#if !PLATFORM(QT) && !PLATFORM(BLACKBERRY) && !USE(CURL)
+#if !PLATFORM(BLACKBERRY) && !USE(CURL)
 String MIMETypeRegistry::getNormalizedMIMEType(const String& mimeType)
 {
     return mimeType;
index c7e3f11..2aca431 100644 (file)
@@ -30,9 +30,6 @@
 
 #if PLATFORM(GTK) || PLATFORM(EFL)
     #define supressNotImplementedWarning() getenv("DISABLE_NI_WARNING")
-#elif PLATFORM(QT)
-    #include <QByteArray>
-    #define supressNotImplementedWarning() !qgetenv("DISABLE_NI_WARNING").isEmpty()
 #else
     #define supressNotImplementedWarning() false
 #endif
index b31495e..7627af7 100644 (file)
@@ -41,10 +41,6 @@ OBJC_CLASS NSArray;
 OBJC_CLASS NSString;
 #endif
 
-#if PLATFORM(QT)
-#include <QMimeData>
-#endif
-
 #if PLATFORM(WIN)
 #include "COMPtr.h"
 #include "WCDataObject.h"
@@ -72,7 +68,7 @@ enum ShouldSerializeSelectedTextForClipboard { DefaultSelectedTextType, IncludeI
 // For writing to the pasteboard. Generally sorted with the richest formats on top.
 
 struct PasteboardWebContent {
-#if !(PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WIN))
+#if !(PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(WIN))
     PasteboardWebContent();
     ~PasteboardWebContent();
     bool canSmartCopyOrDelete;
@@ -97,7 +93,7 @@ struct PasteboardImage {
     PasteboardImage();
     ~PasteboardImage();
     RefPtr<Image> image;
-#if !(PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WIN))
+#if !(PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(WIN))
     PasteboardURL url;
     RefPtr<SharedBuffer> resourceData;
     String resourceMIMEType;
@@ -110,7 +106,7 @@ class PasteboardWebContentReader {
 public:
     virtual ~PasteboardWebContentReader() { }
 
-#if !(PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WIN))
+#if !(PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(WIN))
     virtual bool readWebArchive(PassRefPtr<SharedBuffer>) = 0;
     virtual bool readFilenames(const Vector<String>&) = 0;
     virtual bool readHTML(const String&) = 0;
@@ -167,11 +163,11 @@ public:
     void setDragImage(DragImageRef, const IntPoint& hotSpot);
 #endif
 
-#if PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WIN)
+#if PLATFORM(GTK) || PLATFORM(WIN)
     PassRefPtr<DocumentFragment> documentFragment(Frame*, PassRefPtr<Range>, bool allowPlainText, bool& chosePlainText); // FIXME: Layering violation.
 #endif
 
-#if PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(WIN)
+#if PLATFORM(GTK) || PLATFORM(WIN)
     void writeImage(Node*, const URL&, const String& title); // FIXME: Layering violation.
     void writeSelection(Range*, bool canSmartCopyOrDelete, Frame*, ShouldSerializeSelectedTextForClipboard = DefaultSelectedTextType); // FIXME: Layering violation.
 #endif
@@ -182,7 +178,7 @@ public:
     PassRefPtr<DataObjectGtk> dataObject() const;
 #endif
 
-#if PLATFORM(GTK) || PLATFORM(QT)
+#if PLATFORM(GTK)
     static PassOwnPtr<Pasteboard> createForGlobalSelection();
 #endif
 
@@ -198,15 +194,6 @@ public:
     const String& name() const { return m_pasteboardName; }
 #endif
 
-#if PLATFORM(QT)
-    static PassOwnPtr<Pasteboard> create(const QMimeData* readableClipboard = 0, bool isForDragAndDrop = false);
-
-    QMimeData* clipboardData() const { return m_writableData; }
-    void invalidateWritableData() const { m_writableData = 0; }
-    bool isForDragAndDrop() const { return m_isForDragAndDrop; }
-    bool isForCopyAndPaste() const { return !m_isForDragAndDrop; }
-#endif
-
 #if PLATFORM(WIN)
     COMPtr<IDataObject> dataObject() const { return m_dataObject; }
     void setExternalDataObject(IDataObject*);
@@ -223,12 +210,6 @@ private:
     Pasteboard(GtkClipboard*);
 #endif
 
-#if PLATFORM(QT)
-    Pasteboard(const QMimeData* , bool);
-
-    const QMimeData* readData() const;
-#endif
-
 #if PLATFORM(WIN)
     explicit Pasteboard(IDataObject*);
     explicit Pasteboard(WCDataObject*);
@@ -254,13 +235,6 @@ private:
     long m_changeCount;
 #endif
 
-#if PLATFORM(QT)
-    bool m_selectionMode;
-    const QMimeData* m_readableData;
-    mutable QMimeData* m_writableData;
-    bool m_isForDragAndDrop;
-#endif
-
 #if PLATFORM(WIN)
     HWND m_owner;
     COMPtr<IDataObject> m_dataObject;
@@ -278,7 +252,7 @@ extern const char* const WebArchivePboardType;
 extern const char* const WebURLNamePboardType;
 #endif
 
-#if !(PLATFORM(GTK) || PLATFORM(QT))
+#if !PLATFORM(GTK)
 
 inline Pasteboard::~Pasteboard()
 {
index 2ed254c..59ba29b 100644 (file)
@@ -41,12 +41,6 @@ typedef struct _GdkEventKey GdkEventKey;
 #include "CompositionResults.h"
 #endif
 
-#if PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QKeyEvent;
-QT_END_NAMESPACE
-#endif
-
 #if PLATFORM(BLACKBERRY)
 namespace BlackBerry {
 namespace Platform {
@@ -79,10 +73,6 @@ namespace WebCore {
 #if PLATFORM(GTK)
             , m_gdkEventKey(0)
 #endif
-#if PLATFORM(QT)
-            , m_qtEvent(0)
-            , m_useNativeVirtualKeyAsDOMKey(false)
-#endif
         {
         }
 
@@ -155,13 +145,6 @@ namespace WebCore {
         static String singleCharacterString(unsigned);
 #endif
 
-#if PLATFORM(QT)
-        PlatformKeyboardEvent(QKeyEvent*, bool);
-        QKeyEvent* qtEvent() const { return m_qtEvent; }
-        uint32_t nativeModifiers() const;
-        uint32_t nativeScanCode() const;
-#endif
-
 #if PLATFORM(BLACKBERRY)
         PlatformKeyboardEvent(const BlackBerry::Platform::KeyboardEvent&);
 #endif
@@ -193,18 +176,8 @@ namespace WebCore {
         GdkEventKey* m_gdkEventKey;
         CompositionResults m_compositionResults;
 #endif
-#if PLATFORM(QT)
-        QKeyEvent* m_qtEvent;
-        bool m_useNativeVirtualKeyAsDOMKey;
-#endif
     };
     
-#if PLATFORM(QT)
-// Used by WebKit2.
-String keyIdentifierForQtKeyCode(int keyCode);
-int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad = false);    
-#endif
-
 } // namespace WebCore
 
 #endif // PlatformKeyboardEvent_h
index 7b18637..aa8230f 100644 (file)
@@ -30,8 +30,6 @@
 OBJC_CLASS NSMutableArray;
 #elif PLATFORM(WIN)
 #include <windows.h>
-#elif PLATFORM(QT)
-#include <qlist.h>
 #elif PLATFORM(GTK)
 typedef struct _GtkMenu GtkMenu;
 #endif
@@ -41,9 +39,6 @@ namespace WebCore {
 #if !USE(CROSS_PLATFORM_CONTEXT_MENUS)
 #if PLATFORM(MAC)
     typedef NSMutableArray* PlatformMenuDescription;
-#elif PLATFORM(QT)
-    class ContextMenuItem;
-    typedef const QList<ContextMenuItem>* PlatformMenuDescription;
 #elif PLATFORM(GTK)
     typedef GtkMenu* PlatformMenuDescription;
 #else
index 8784da5..7454bea 100644 (file)
 
 #if ENABLE(TOUCH_EVENTS)
 
-#if PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QTouchEvent;
-QT_END_NAMESPACE
-#endif
-
 #if PLATFORM(BLACKBERRY)
 namespace BlackBerry {
 namespace Platform {
index eb42015..0337023 100644 (file)
 
 #if ENABLE(TOUCH_EVENTS)
 
-#if PLATFORM(QT)
-#include <QTouchEvent>
-#endif
-
 #if PLATFORM(BLACKBERRY)
 namespace BlackBerry {
 namespace Platform {
index e28f544..6389a59 100644 (file)
@@ -96,10 +96,6 @@ public:
 #elif PLATFORM(MAC)
         static void timerFired(CFRunLoopTimerRef, void*);
         RetainPtr<CFRunLoopTimerRef> m_timer;
-#elif PLATFORM(QT)
-        static void timerFired(RunLoop*, int ID);
-        int m_ID;
-        bool m_isRepeating;
 #elif PLATFORM(EFL)
         static bool timerFired(void* data);
         Ecore_Timer* m_timer;
@@ -155,11 +151,6 @@ private:
     RetainPtr<CFRunLoopRef> m_runLoop;
     RetainPtr<CFRunLoopSourceRef> m_runLoopSource;
     int m_nestingLevel;
-#elif PLATFORM(QT)
-    typedef HashMap<int, TimerBase*> TimerMap;
-    TimerMap m_activeTimers;
-    class TimerObject;
-    TimerObject* m_timerObject;
 #elif PLATFORM(EFL)
     bool m_initEfl;
 
index 52eba12..f2b62c8 100644 (file)
@@ -38,9 +38,6 @@ static URLSchemesMap& localURLSchemes()
 #if PLATFORM(MAC)
         localSchemes.add("applewebdata");
 #endif
-#if PLATFORM(QT)
-        localSchemes.add("qrc");
-#endif
     }
 
     return localSchemes;
index 8794341..f7c1c09 100644 (file)
@@ -394,7 +394,6 @@ ScrollAnimatorNone::~ScrollAnimatorNone()
 
 ScrollAnimatorNone::Parameters ScrollAnimatorNone::parametersForScrollGranularity(ScrollGranularity granularity) const
 {
-#if !PLATFORM(QT)
     switch (granularity) {
     case ScrollByDocument:
         return Parameters(true, 20 * kTickTime, 10 * kTickTime, Cubic, 10 * kTickTime, Cubic, 10 * kTickTime, Linear, 1);
@@ -407,22 +406,6 @@ ScrollAnimatorNone::Parameters ScrollAnimatorNone::parametersForScrollGranularit
     default:
         ASSERT_NOT_REACHED();
     }
-#else
-    // This is a slightly different strategy for the animation with a steep attack curve and natural release curve.
-    // The fast acceleration makes the animation look more responsive to user input.
-    switch (granularity) {
-    case ScrollByDocument:
-        return Parameters(true, 20 * kTickTime, 10 * kTickTime, Cubic, 6 * kTickTime, Quadratic, 10 * kTickTime, Quadratic, 22 * kTickTime);
-    case ScrollByLine:
-        return Parameters(true, 6 * kTickTime, 5 * kTickTime, Cubic, 1 * kTickTime, Quadratic, 4 * kTickTime, Linear, 1);
-    case ScrollByPage:
-        return Parameters(true, 12 * kTickTime, 10 * kTickTime, Cubic, 3 * kTickTime, Quadratic, 6 * kTickTime, Linear, 1);
-    case ScrollByPixel:
-        return Parameters(true, 8 * kTickTime, 3 * kTickTime, Cubic, 2 * kTickTime, Quadratic, 5 * kTickTime, Quadratic, 1.25);
-    default:
-        ASSERT_NOT_REACHED();
-    }
-#endif
     return Parameters();
 }
 
index 18b0e2d..102c0d7 100644 (file)
@@ -1389,7 +1389,7 @@ void ScrollView::setScrollOrigin(const IntPoint& origin, bool updatePositionAtAl
         updateScrollbars(scrollOffset());
 }
 
-#if !PLATFORM(QT) && !PLATFORM(MAC)
+#if !PLATFORM(MAC)
 
 void ScrollView::platformAddChild(Widget*)
 {
index 3384515..ff789b2 100644 (file)
@@ -327,7 +327,7 @@ unsigned SharedBuffer::getSomeData(const char*& someData, unsigned position) con
 #endif
 }
 
-#if !USE(CF) || PLATFORM(QT)
+#if !USE(CF)
 
 inline void SharedBuffer::clearPlatformData()
 {
index d96137f..edc7836 100644 (file)
@@ -629,7 +629,7 @@ String URL::baseAsString() const
     return m_string.left(m_pathAfterLastSlash);
 }
 
-#if !PLATFORM(QT) && !USE(CF)
+#if !USE(CF)
 String URL::fileSystemPath() const
 {
     if (!isValid() || !isLocalFile())
index 2f313e9..c1329eb 100644 (file)
@@ -39,12 +39,6 @@ typedef const struct __CFURL* CFURLRef;
 OBJC_CLASS NSURL;
 #endif
 
-#if PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QUrl;
-QT_END_NAMESPACE
-#endif
-
 namespace WebCore {
 
 class TextEncoding;
@@ -174,11 +168,6 @@ public:
     operator NSString*() const { return string(); }
 #endif
 
-#if PLATFORM(QT)
-    URL(const QUrl&);
-    operator QUrl() const;
-#endif
-
     const URL* innerURL() const { return 0; }
 
 #ifndef NDEBUG
index 3ff1652..4d501df 100644 (file)
 #include <wtf/RetainPtr.h>
 #endif
 
-#if PLATFORM(QT)
-#include <QPointer>
-#include <qglobal.h>
-#endif
-
 #if PLATFORM(MAC)
 OBJC_CLASS NSView;
 OBJC_CLASS NSWindow;
@@ -58,13 +53,6 @@ typedef struct _GtkContainer GtkContainer;
 typedef GtkWidget* PlatformWidget;
 #endif
 
-#if PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QObject;
-QT_END_NAMESPACE
-typedef QObject* PlatformWidget;
-#endif
-
 #if PLATFORM(BLACKBERRY) || PLATFORM(NIX)
 typedef void* PlatformWidget;
 #endif
@@ -78,10 +66,7 @@ typedef struct _Evas_Object Evas_Object;
 typedef Evas_Object* PlatformWidget;
 #endif
 
-#if PLATFORM(QT)
-class QWebPageClient;
-typedef QWebPageClient* PlatformPageClient;
-#elif PLATFORM(BLACKBERRY)
+#if PLATFORM(BLACKBERRY)
 #include "PageClientBlackBerry.h"
 typedef PageClientBlackBerry* PlatformPageClient;
 #elif PLATFORM(EFL)
@@ -212,11 +197,6 @@ public:
     Evas_Object* evasObject() { return m_evasObject; }
 #endif
 
-#if PLATFORM(QT)
-    QObject* bindingObject() const;
-    void setBindingObject(QObject*);
-#endif
-
     // Virtual methods to convert points to/from the containing ScrollView
     virtual IntRect convertToContainingView(const IntRect&) const;
     virtual IntRect convertFromContainingView(const IntRect&) const;
@@ -256,11 +236,6 @@ private:
 #if PLATFORM(EFL)
     Evas_Object* m_evasObject;
 #endif
-
-#if PLATFORM(QT)
-    QPointer<QObject> m_bindingObject;
-#endif
-
 };
 
 #if !PLATFORM(MAC)
index cb5f1b8..cb55fc7 100644 (file)
 #include "AudioBus.h"
 #include "GStreamerVersioning.h"
 
-#if PLATFORM(QT)
-// Clear out offending Qt macro so the following header, gio.h, can be included.
-// https://bugs.webkit.org/show_bug.cgi?id=95081
-#undef signals
-#endif
-
 #include <gio/gio.h>
 #include <gst/app/gstappsink.h>
 #include <gst/gst.h>
diff --git a/Source/WebCore/platform/audio/qt/AudioBusQt.cpp b/Source/WebCore/platform/audio/qt/AudioBusQt.cpp
deleted file mode 100644 (file)
index 3ac5e4e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *  Copyright (C) 2012 Igalia S.L
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_AUDIO)
-
-#include "AudioBus.h"
-
-#include "AudioFileReader.h"
-#include <QResource>
-
-namespace WebCore {
-
-PassRefPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, float sampleRate)
-{
-    QString path = QStringLiteral(":/webkit/resources/audio/");
-    path.append(QLatin1String(name));
-    QResource resource(path);
-    return createBusFromInMemoryAudioFile(resource.data(), resource.size(), /* mixToMono */ false, sampleRate);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_AUDIO)
index 8c8f3c7..25123c8 100644 (file)
@@ -29,7 +29,7 @@
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
-#if !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(BLACKBERRY) && !PLATFORM(QT) && !PLATFORM(WIN) && !PLATFORM(NIX)
+#if !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(BLACKBERRY) && !PLATFORM(WIN) && !PLATFORM(NIX)
 #include "ANGLE/ShaderLang.h"
 #elif PLATFORM(WIN)
 #include "GLSLANG/ShaderLang.h"
index 7e6abac..bc9a63f 100644 (file)
@@ -111,7 +111,7 @@ public:
     {
         return adoptRef(new BitmapImage(observer));
     }
-#if PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS))
+#if PLATFORM(WIN)
     static PassRefPtr<BitmapImage> create(HBITMAP);
 #endif
     virtual ~BitmapImage();
index 4dd9e6f..8e40c24 100644 (file)
 typedef struct CGColor* CGColorRef;
 #endif
 
-#if PLATFORM(QT)
-#include <qglobal.h>
-QT_BEGIN_NAMESPACE
-class QColor;
-QT_END_NAMESPACE
-#endif
-
 #if PLATFORM(GTK)
 typedef struct _GdkColor GdkColor;
 #ifndef GTK_API_VERSION_2
@@ -129,11 +122,6 @@ public:
     Color blend(const Color&) const;
     Color blendWithWhite() const;
 
-#if PLATFORM(QT)
-    Color(const QColor&);
-    operator QColor() const;
-#endif
-
 #if PLATFORM(GTK)
     Color(const GdkColor&);
     // We can't sensibly go back to GdkColor without losing the alpha value
index e582c63..9216171 100644 (file)
@@ -51,13 +51,6 @@ typedef struct _NSPoint NSPoint;
 #endif
 #endif
 
-#if PLATFORM(QT)
-#include "qglobal.h"
-QT_BEGIN_NAMESPACE
-class QPointF;
-QT_END_NAMESPACE
-#endif
-
 namespace WebCore {
 
 class AffineTransform;
@@ -151,11 +144,6 @@ public:
     operator NSPoint() const;
 #endif
 
-#if PLATFORM(QT)
-    FloatPoint(const QPointF&);
-    operator QPointF() const;
-#endif
-
 #if PLATFORM(BLACKBERRY)
     FloatPoint(const BlackBerry::Platform::FloatPoint&);
     operator BlackBerry::Platform::FloatPoint() const;
index 8bf1a3b..043e574 100644 (file)
@@ -42,12 +42,6 @@ typedef struct _NSRect NSRect;
 #endif
 #endif
 
-#if PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QRectF;
-QT_END_NAMESPACE
-#endif
-
 #if PLATFORM(BLACKBERRY)
 namespace BlackBerry {
 namespace Platform {
@@ -192,12 +186,6 @@ public:
     operator NSRect() const;
 #endif
 
-#if PLATFORM(QT)
-    FloatRect(const QRectF&);
-    operator QRectF() const;
-    FloatRect normalized() const;
-#endif
-
 #if USE(CAIRO)
     FloatRect(const cairo_rectangle_t&);
     operator cairo_rectangle_t() const;
index 7aaed17..0fa8cc1 100644 (file)
 #include "IntPoint.h"
 #include <wtf/MathExtras.h>
 
-#if PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QSizeF;
-QT_END_NAMESPACE
-#endif
-
 #if PLATFORM(BLACKBERRY)
 namespace BlackBerry {
 namespace Platform {
@@ -118,11 +112,6 @@ public:
         return FloatSize(m_height, m_width);
     }
 
-#if PLATFORM(QT)
-    explicit FloatSize(const QSizeF&);
-    operator QSizeF() const;
-#endif
-
 #if PLATFORM(BLACKBERRY)
     FloatSize(const BlackBerry::Platform::FloatSize&);
     operator BlackBerry::Platform::FloatSize() const;
index bd8dbff..b0e2a25 100644 (file)
 #include <wtf/MathExtras.h>
 #include <wtf/unicode/CharacterNames.h>
 
-#if PLATFORM(QT)
-#include <QRawFont>
-QT_BEGIN_NAMESPACE
-class QTextLayout;
-QT_END_NAMESPACE
-#endif
-
 // "X11/X.h" defines Complex to 0 and conflicts
 // with Complex value in CodePath enum.
 #ifdef Complex
@@ -170,11 +163,6 @@ public:
     static unsigned expansionOpportunityCount(const LChar*, size_t length, TextDirection, bool& isAfterExpansion);
     static unsigned expansionOpportunityCount(const UChar*, size_t length, TextDirection, bool& isAfterExpansion);
 
-#if PLATFORM(QT)
-    QRawFont rawFont() const;
-    QFont syntheticFont() const;
-#endif
-
     static void setShouldUseSmoothing(bool);
     static bool shouldUseSmoothing();
 
@@ -308,10 +296,6 @@ private:
         return features;
     }
 
-#if PLATFORM(QT)
-    void initFormatForTextLayout(QTextLayout*, const TextRun&) const;
-#endif
-
     static TypesettingFeatures s_defaultTypesettingFeatures;
 
     FontDescription m_fontDescription;
index 7a0f228..700db95 100644 (file)
@@ -25,8 +25,6 @@
 // FIXME: This is temporary until all ports switch to using this file.
 #if PLATFORM(BLACKBERRY)
 #include "harfbuzz/FontPlatformDataHarfBuzz.h"
-#elif PLATFORM(QT)
-#include "qt/FontPlatformData.h"
 #elif USE(WINGDI)
 #include "wince/FontPlatformData.h"
 #elif PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(NIX)
index 6514158..3fff77b 100644 (file)
@@ -51,8 +51,6 @@ class SimpleFontData;
 typedef cairo_glyph_t GlyphBufferGlyph;
 #elif USE(WINGDI)
 typedef wchar_t GlyphBufferGlyph;
-#elif PLATFORM(QT)
-typedef quint32 GlyphBufferGlyph;
 #elif PLATFORM(BLACKBERRY)
 typedef unsigned GlyphBufferGlyph;
 #else
@@ -73,19 +71,6 @@ public:
     CGFloat width() const { return this->CGSize::width; }
     CGFloat height() const { return this->CGSize::height; }
 };
-#elif PLATFORM(QT)
-struct GlyphBufferAdvance : public QPointF {
-public:
-    GlyphBufferAdvance() : QPointF() { }
-    GlyphBufferAdvance(const QPointF& advance)
-        : QPointF(advance)
-    {
-    }
-
-    void setWidth(qreal width) { QPointF::setX(width); }
-    qreal width() const { return QPointF::x(); }
-    qreal height() const { return QPointF::y(); }
-};
 #else
 typedef FloatSize GlyphBufferAdvance;
 #endif
@@ -164,8 +149,6 @@ public:
 #if USE(CG)
         CGSize advance = { width, 0 };
         m_advances.append(advance);
-#elif PLATFORM(QT)
-        m_advances.append(QPointF(width, 0));
 #else
         m_advances.append(FloatSize(width, 0));
 #endif
index fb1df93..93474bf 100644 (file)
@@ -42,11 +42,6 @@ typedef struct CGContext* CGContextRef;
 typedef struct CGGradient* CGGradientRef;
 typedef CGGradientRef PlatformGradient;
 
-#elif PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QGradient;
-QT_END_NAMESPACE
-typedef QGradient* PlatformGradient;
 #elif USE(CAIRO)
 typedef struct _cairo_pattern cairo_pattern_t;
 typedef cairo_pattern_t* PlatformGradient;
index 8c5b5c3..afb5d9b 100644 (file)
@@ -189,7 +189,7 @@ bool GraphicsContext::hasBlurredShadow() const
     return m_state.shadowColor.isValid() && m_state.shadowColor.alpha() && m_state.shadowBlur;
 }
 
-#if PLATFORM(QT) || USE(CAIRO)
+#if USE(CAIRO)
 bool GraphicsContext::mustUseShadowBlur() const
 {
     // We can't avoid ShadowBlur if the shadow has blur.
@@ -380,12 +380,10 @@ void GraphicsContext::endTransparencyLayer()
     --m_transparencyCount;
 }
 
-#if !PLATFORM(QT)
 bool GraphicsContext::isInTransparencyLayer() const
 {
     return (m_transparencyCount > 0) && supportsTransparencyLayers();
 }
-#endif
 
 bool GraphicsContext::updatingControlTints() const
 {
@@ -599,12 +597,10 @@ void GraphicsContext::drawImageBuffer(ImageBuffer* image, ColorSpace styleColorS
         image->draw(this, styleColorSpace, dest, src, op, blendMode, useLowQualityScale);
 }
 
-#if !PLATFORM(QT)
 void GraphicsContext::clip(const IntRect& rect)
 {
     clip(FloatRect(rect));
 }
-#endif
 
 void GraphicsContext::clipRoundedRect(const RoundedRect& rect)
 {
@@ -643,7 +639,7 @@ void GraphicsContext::clipToImageBuffer(ImageBuffer* buffer, const FloatRect& re
     buffer->clip(this, rect);
 }
 
-#if !USE(CG) && !PLATFORM(QT) && !USE(CAIRO)
+#if !USE(CG) && !USE(CAIRO)
 IntRect GraphicsContext::clipBounds() const
 {
     ASSERT_NOT_REACHED();
@@ -693,7 +689,7 @@ void GraphicsContext::fillRoundedRect(const RoundedRect& rect, const Color& colo
         fillRect(rect.rect(), color, colorSpace, compositeOperation(), blendMode);
 }
 
-#if !USE(CG) && !PLATFORM(QT) && !USE(CAIRO)
+#if !USE(CG) && !USE(CAIRO)
 void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const RoundedRect& roundedHoleRect, const Color& color, ColorSpace colorSpace)
 {
     if (paintingDisabled())
@@ -756,7 +752,7 @@ void GraphicsContext::setPlatformTextDrawingMode(TextDrawingModeFlags)
 }
 #endif
 
-#if !PLATFORM(QT) && !USE(CAIRO)
+#if !USE(CAIRO)
 void GraphicsContext::setPlatformStrokeStyle(StrokeStyle)
 {
 }
index 973dbc2..2861edb 100644 (file)
@@ -46,9 +46,6 @@ namespace WebCore {
 class PlatformContextCairo;
 }
 typedef WebCore::PlatformContextCairo PlatformGraphicsContext;
-#elif PLATFORM(QT)
-#include <QPainter>
-typedef QPainter PlatformGraphicsContext;
 #elif USE(WINGDI)
 typedef struct HDC__ PlatformGraphicsContext;
 #elif PLATFORM(BLACKBERRY)
@@ -73,10 +70,6 @@ typedef unsigned char UInt8;
 #endif
 #endif
 
-#if PLATFORM(QT) && OS(WINDOWS)
-#include <windows.h>
-#endif
-
 namespace WebCore {
 
 #if USE(WINGDI)
@@ -366,7 +359,7 @@ namespace WebCore {
         void clearShadow();
 
         bool hasBlurredShadow() const;
-#if PLATFORM(QT) || USE(CAIRO)
+#if USE(CAIRO)
         bool mustUseShadowBlur() const;
 #endif
 
@@ -485,11 +478,6 @@ namespace WebCore {
 #endif // PLATFORM(WIN)
 #endif // OS(WINDOWS)
 
-#if PLATFORM(QT)
-        void pushTransparencyLayerInternal(const QRect&, qreal, QPixmap&);
-        void takeOwnershipOfPlatformContext();
-#endif
-
 #if USE(CAIRO)
         GraphicsContext(cairo_t*);
 #endif
index 159084a..7a38d8c 100644 (file)
@@ -1472,7 +1472,7 @@ unsigned GraphicsContext3D::getChannelBitsByFormat(GC3Denum format)
     }
 }
 
-#if !PLATFORM(BLACKBERRY) && !PLATFORM(QT) && !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(MAC) && !PLATFORM(WIN) && !PLATFORM(NIX)
+#if !PLATFORM(BLACKBERRY) && !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(MAC) && !PLATFORM(WIN) && !PLATFORM(NIX)
 PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const
 {
     return NullPlatformGraphicsContext3D;
index 78b5b00..36557fa 100644 (file)
 #endif
 
 // FIXME: Find a better way to avoid the name confliction for NO_ERROR.
-#if PLATFORM(WIN) || (PLATFORM(QT) && OS(WINDOWS))
+#if PLATFORM(WIN)
 #undef NO_ERROR
 #elif PLATFORM(GTK)
 // This define is from the X11 headers, but it's used below, so we must undefine it.
 #undef VERSION
 #endif
 
-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX)
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX)
 #include "ANGLEWebKitBridge.h"
 #endif
 
 #include <wtf/RetainPtr.h>
 OBJC_CLASS CALayer;
 OBJC_CLASS WebGLLayer;
-#elif PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QPainter;
-class QRect;
-class QOpenGLContext;
-class QSurface;
-QT_END_NAMESPACE
 #elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(NIX)
 typedef unsigned int GLuint;
 #endif
@@ -72,9 +65,6 @@ typedef unsigned int GLuint;
 typedef struct _CGLContextObject *CGLContextObj;
 
 typedef CGLContextObj PlatformGraphicsContext3D;
-#elif PLATFORM(QT)
-typedef QOpenGLContext* PlatformGraphicsContext3D;
-typedef QSurface* PlatformGraphicsSurface3D;
 #else
 typedef void* PlatformGraphicsContext3D;
 typedef void* PlatformGraphicsSurface3D;
@@ -92,9 +82,6 @@ class Extensions3DOpenGLES;
 #else
 class Extensions3DOpenGL;
 #endif
-#if PLATFORM(QT)
-class Extensions3DQt;
-#endif
 class HostWindow;
 class Image;
 class ImageBuffer;
@@ -501,7 +488,7 @@ public:
 
     bool makeContextCurrent();
 
-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX)
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX)
     // With multisampling on, blit from multisampleFBO to regular FBO.
     void prepareTexture();
 #endif
@@ -783,9 +770,6 @@ public:
 #if PLATFORM(GTK) || PLATFORM(EFL) || USE(CAIRO)
     void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
                        int canvasWidth, int canvasHeight, PlatformContextCairo* context);
-#elif PLATFORM(QT)
-    void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
-                       int canvasWidth, int canvasHeight, QPainter* context);
 #elif PLATFORM(BLACKBERRY) || USE(CG)
     void paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
                        int canvasWidth, int canvasHeight, GraphicsContext*);
@@ -903,8 +887,6 @@ public:
         RetainPtr<CGImageRef> m_decodedImage;
         RetainPtr<CFDataRef> m_pixelData;
         std::unique_ptr<uint8_t[]> m_formalizedRGBA8Data;
-#elif PLATFORM(QT)
-        QImage m_qtImage;
 #elif PLATFORM(BLACKBERRY)
         Vector<unsigned> m_imageData;
 #endif
@@ -929,7 +911,7 @@ private:
     // Destination data will have no gaps between rows.
     static bool packPixels(const uint8_t* sourceData, DataFormat sourceDataFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, unsigned destinationFormat, unsigned destinationType, AlphaOp, void* destinationData, bool flipY);
 
-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX)
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX)
     // Take into account the user's requested context creation attributes,
     // in particular stencil and antialias, and determine which could or
     // could not be honored based on the capabilities of the OpenGL
@@ -950,7 +932,7 @@ private:
 
     bool reshapeFBOs(const IntSize&);
     void resolveMultisamplingIfNecessary(const IntRect& = IntRect());
-#if (PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(NIX)) && USE(GRAPHICS_SURFACE)
+#if (PLATFORM(EFL) || PLATFORM(NIX)) && USE(GRAPHICS_SURFACE)
     void createGraphicsSurfaces(const IntSize&);
 #endif
 
@@ -969,7 +951,7 @@ private:
     void* m_context;
 #endif
 
-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX)
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX)
     struct SymbolInfo {
         SymbolInfo()
             : type(0)
@@ -1030,7 +1012,7 @@ private:
     OwnPtr<ShaderNameHash> nameHashMapForShaders;
 #endif
 
-#if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || ((PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)) && USE(OPENGL_ES_2))
+#if PLATFORM(BLACKBERRY) || ((PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)) && USE(OPENGL_ES_2))
     friend class Extensions3DOpenGLES;
     OwnPtr<Extensions3DOpenGLES> m_extensions;
 #else
index a78b265..2ab7ca0 100644 (file)
@@ -31,8 +31,6 @@
 OBJC_CLASS NSImage;
 #elif PLATFORM(WIN)
 typedef struct HICON__* HICON;
-#elif PLATFORM(QT)
-#include <QIcon>
 #elif PLATFORM(GTK)
 typedef struct _GdkPixbuf GdkPixbuf;
 #endif
@@ -61,9 +59,6 @@ private:
 #elif PLATFORM(WIN)
     Icon(HICON);
     HICON m_hIcon;
-#elif PLATFORM(QT)
-    Icon();
-    QIcon m_icon;
 #elif PLATFORM(GTK)
     Icon();
     GdkPixbuf* m_icon;
index 987a56b..a870199 100644 (file)
@@ -54,10 +54,6 @@ typedef SIZE* LPSIZE;
 typedef struct HBITMAP__ *HBITMAP;
 #endif
 
-#if PLATFORM(QT)
-#include <QPixmap>
-#endif
-
 #if PLATFORM(GTK)
 typedef struct _GdkPixbuf GdkPixbuf;
 #endif
@@ -170,10 +166,6 @@ public:
     static PassRefPtr<Image> loadPlatformThemeIcon(const char* name, int size);
 #endif
 
-#if PLATFORM(QT)
-    static void setPlatformResource(const char* name, const QPixmap&);
-#endif
-
 #if PLATFORM(EFL)
     virtual Evas_Object* getEvasObject(Evas*) { return 0; }
 #endif
index 0f59e02..2626473 100644 (file)
@@ -27,8 +27,6 @@
 #include "ImageBufferDataCG.h"
 #elif USE(CAIRO)
 #include "ImageBufferDataCairo.h"
-#elif PLATFORM(QT)
-#include "ImageBufferDataQt.h"
 #elif USE(WINGDI)
 #include "ImageBufferDataWince.h"
 #elif PLATFORM(BLACKBERRY)
index e5c7a30..1692037 100644 (file)
@@ -34,7 +34,7 @@ typedef struct CGPoint CGPoint;
 #endif
 
 
-#if OS(DARWIN) && !PLATFORM(QT)
+#if OS(DARWIN)
 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGPoint NSPoint;
 #else
@@ -45,10 +45,6 @@ typedef struct _NSPoint NSPoint;
 #if PLATFORM(WIN)
 typedef struct tagPOINT POINT;
 typedef struct tagPOINTS POINTS;
-#elif PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QPoint;
-QT_END_NAMESPACE
 #elif PLATFORM(GTK)
 typedef struct _GdkPoint GdkPoint;
 #elif PLATFORM(BLACKBERRY)
@@ -115,7 +111,7 @@ public:
     operator CGPoint() const;
 #endif
 
-#if OS(DARWIN) && !PLATFORM(QT) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
+#if OS(DARWIN) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
     explicit IntPoint(const NSPoint&); // don't do this implicitly since it's lossy
     operator NSPoint() const;
 #endif
@@ -125,9 +121,6 @@ public:
     operator POINT() const;
     IntPoint(const POINTS&);
     operator POINTS() const;
-#elif PLATFORM(QT)
-    IntPoint(const QPoint&);
-    operator QPoint() const;
 #elif PLATFORM(GTK)
     IntPoint(const GdkPoint&);
     operator GdkPoint() const;
index c99fae1..b778c4c 100644 (file)
@@ -43,10 +43,6 @@ typedef struct _NSRect NSRect;
 
 #if PLATFORM(WIN)
 typedef struct tagRECT RECT;
-#elif PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QRect;
-QT_END_NAMESPACE
 #elif PLATFORM(GTK)
 #ifdef GTK_API_VERSION_2
 typedef struct _GdkRectangle GdkRectangle;
@@ -177,9 +173,6 @@ public:
 #if PLATFORM(WIN)
     IntRect(const RECT&);
     operator RECT() const;
-#elif PLATFORM(QT)
-    IntRect(const QRect&);
-    operator QRect() const;
 #elif PLATFORM(GTK)
 #ifdef GTK_API_VERSION_2
     IntRect(const GdkRectangle&);
index 3077458..db7dba7 100644 (file)
@@ -42,11 +42,6 @@ typedef struct _NSSize NSSize;
 
 #if PLATFORM(WIN)
 typedef struct tagSIZE SIZE;
-#elif PLATFORM(QT)
-#include <qglobal.h>
-QT_BEGIN_NAMESPACE
-class QSize;
-QT_END_NAMESPACE
 #elif PLATFORM(BLACKBERRY)
 namespace BlackBerry {
 namespace Platform {
@@ -145,11 +140,6 @@ public:
     operator SIZE() const;
 #endif
 
-#if PLATFORM(QT)
-    IntSize(const QSize&);
-    operator QSize() const;
-#endif
-
 #if PLATFORM(BLACKBERRY)
     IntSize(const BlackBerry::Platform::IntSize&);
     operator BlackBerry::Platform::IntSize() const;
index 3bc8b29..38ca586 100644 (file)
 #include "HTMLMediaSource.h"
 #endif
 
-#if PLATFORM(QT)
-#include <QtGlobal>
-#endif
-
 #if USE(GSTREAMER)
 #include "MediaPlayerPrivateGStreamer.h"
 #define PlatformMediaEngineClassName MediaPlayerPrivateGStreamer
@@ -62,7 +58,7 @@
 #if USE(AVFOUNDATION)
 #include "MediaPlayerPrivateAVFoundationObjC.h"
 #endif
-#elif OS(WINCE) && !PLATFORM(QT)
+#elif OS(WINCE)
 #include "MediaPlayerPrivateWinCE.h"
 #define PlatformMediaEngineClassName MediaPlayerPrivate
 #elif PLATFORM(WIN)
 #if USE(AVFOUNDATION)
 #include "MediaPlayerPrivateAVFoundationCF.h"
 #endif
-#elif PLATFORM(QT)
-#if USE(QT_MULTIMEDIA) && !USE(GSTREAMER)
-#include "MediaPlayerPrivateQt.h"
-#define PlatformMediaEngineClassName MediaPlayerPrivateQt
-#endif
 #elif PLATFORM(BLACKBERRY)
 #include "MediaPlayerPrivateBlackBerry.h"
 #define PlatformMediaEngineClassName MediaPlayerPrivate
index 37540bc..a2ab11e 100644 (file)
 
 #if USE(CG)
 typedef struct CGImage* CGImageRef;
-#elif PLATFORM(QT)
-#include "NativeImageQt.h"
-#include <qglobal.h>
-QT_BEGIN_NAMESPACE
-class QPixmap;
-QT_END_NAMESPACE
 #elif USE(CAIRO)
 #include "RefPtrCairo.h"
 #elif USE(WINGDI)
@@ -56,8 +50,6 @@ namespace WebCore {
 // pointers (see SVGImage::nativeImageForCurrentFrame()).
 #if USE(CG)
 typedef CGImageRef NativeImagePtr;
-#elif PLATFORM(QT)
-typedef QPixmap* NativeImagePtr;
 #elif USE(CAIRO)
 typedef RefPtr<cairo_surface_t> NativeImagePtr;
 typedef PassRefPtr<cairo_surface_t> PassNativeImagePtr;
index 7256f41..b495814 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef OpenGLESShims_h
 #define OpenGLESShims_h
 
-#if PLATFORM(BLACKBERRY) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
+#if PLATFORM(BLACKBERRY) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
 #define glBindFramebufferEXT glBindFramebuffer
 #define glFramebufferTexture2DEXT glFramebufferTexture2D
 #define glBindRenderbufferEXT glBindRenderbuffer
index 6a03bfe..50734f9 100644 (file)
@@ -22,7 +22,7 @@
 #define DISABLE_SHIMS
 #include "OpenGLShims.h"
 
-#if !PLATFORM(QT) && !PLATFORM(WIN)
+#if !PLATFORM(WIN)
 #include <dlfcn.h>
 #endif
 
@@ -41,14 +41,7 @@ OpenGLFunctionTable* openGLFunctionTable()
     return &table;
 }
 
-#if PLATFORM(QT)
-static void* getProcAddress(const char* procName)
-{
-    if (QOpenGLContext* context = QOpenGLContext::currentContext())
-        return reinterpret_cast<void*>(context->getProcAddress(procName));
-    return 0;
-}
-#elif PLATFORM(WIN)
+#if PLATFORM(WIN)
 static void* getProcAddress(const char* procName)
 {
     return GetProcAddress(GetModuleHandleA("libGLESv2"), procName);
@@ -115,7 +108,7 @@ static void* lookupOpenGLFunctionAddress(const char* functionName, bool* success
     return target;
 }
 
-#if (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || (PLATFORM(NIX) && USE(OPENGL_ES_2))
+#if PLATFORM(NIX) && USE(OPENGL_ES_2)
 
 // With Angle only EGL/GLES2 extensions are available through eglGetProcAddress, not the regular standardized functions.
 #define ASSIGN_FUNCTION_TABLE_ENTRY(FunctionName, success) \
index a73099f..fa696f3 100644 (file)
 #ifndef OpenGLShims_h
 #define OpenGLShims_h
 
-#if PLATFORM(QT)
-#include <qglobal.h>
-#include <qopenglfunctions.h>
-#include <QOpenGLContext>
-#include <QSurface>
-#elif PLATFORM(NIX) && USE(OPENGL_ES_2)
+#if PLATFORM(NIX) && USE(OPENGL_ES_2)
 #include <GLES2/gl2.h>
 #else
 #include <GL/gl.h>
index d66ad52..2b04951 100644 (file)
@@ -38,7 +38,6 @@
 
 namespace WebCore {
 
-#if !PLATFORM(QT)
 static void pathLengthApplierFunction(void* info, const PathElement* element)
 {
     PathTraversalState& traversalState = *static_cast<PathTraversalState*>(info);
@@ -91,7 +90,6 @@ float Path::normalAngleAtLength(float length, bool& ok) const
     ok = traversalState.m_success;
     return traversalState.m_normalAngle;
 }
-#endif
 
 void Path::addRoundedRect(const RoundedRect& r)
 {
@@ -187,7 +185,7 @@ void Path::addBeziersForRoundedRect(const FloatRect& rect, const FloatSize& topL
     closeSubpath();
 }
 
-#if !USE(CG) && !PLATFORM(QT)
+#if !USE(CG)
 FloatRect Path::fastBoundingRect() const
 {
     return boundingRect();
index 122215e..db645e0 100644 (file)
@@ -34,9 +34,6 @@
 
 #if USE(CG)
 typedef struct CGPath PlatformPath;
-#elif PLATFORM(QT)
-#include <qpainterpath.h>
-typedef QPainterPath PlatformPath;
 #elif USE(CAIRO)
 namespace WebCore {
 class CairoPath;
@@ -56,12 +53,7 @@ typedef BlackBerry::Platform::Graphics::Path PlatformPath;
 typedef void PlatformPath;
 #endif
 
-#if PLATFORM(QT)
-/* QPainterPath is valued based */
-typedef PlatformPath PlatformPathPtr;
-#else
 typedef PlatformPath* PlatformPathPtr;
-#endif
 
 namespace WebCore {
 
@@ -113,11 +105,7 @@ namespace WebCore {
         float normalAngleAtLength(float length, bool& ok) const;
 
         void clear();
-#if PLATFORM(QT)
-        bool isNull() const { return false; }
-#else
         bool isNull() const { return !m_path; }
-#endif
         bool isEmpty() const;
         // Gets the current point of the current path, which is conceptually the final point reached by the path so far.
         // Note the Path can be empty (isEmpty() == true) and still have a current point.
@@ -147,14 +135,10 @@ namespace WebCore {
         void translate(const FloatSize&);
 
         // To keep Path() cheap, it does not allocate a PlatformPath immediately
-        // meaning Path::platformPath() can return null (except on Qt).
+        // meaning Path::platformPath() can return null.
         PlatformPathPtr platformPath() const { return m_path; }
-#if PLATFORM(QT)
-        PlatformPathPtr ensurePlatformPath() { return platformPath(); }
-#else
         // ensurePlatformPath() will allocate a PlatformPath if it has not yet been and will never return null.
         PlatformPathPtr ensurePlatformPath();
-#endif
 
         void apply(void* info, PathApplierFunction) const;
         void transform(const AffineTransform&);
index ef347d6..5850858 100644 (file)
@@ -40,9 +40,6 @@ typedef CGPatternRef PlatformPatternPtr;
 #elif USE(CAIRO)
 #include <cairo.h>
 typedef cairo_pattern_t* PlatformPatternPtr;
-#elif PLATFORM(QT)
-#include <QBrush>
-typedef QBrush PlatformPatternPtr;
 #elif USE(WINGDI)
 typedef void* PlatformPatternPtr;
 #endif
@@ -62,12 +59,7 @@ public:
     void platformDestroy();
 
     // Pattern space is an abstract space that maps to the default user space by the transformation 'userSpaceTransformation' 
-#if PLATFORM(QT)
-    // Qt ignores user space transformation and uses pattern's instead
-    PlatformPatternPtr createPlatformPattern() const;
-#else
     PlatformPatternPtr createPlatformPattern(const AffineTransform& userSpaceTransformation) const;
-#endif
     void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation);
     const AffineTransform& getPatternSpaceTransform() { return m_patternSpaceTransformation; };
     void setPlatformPatternSpaceTransform();
index 36a93e9..7f2f3f8 100644 (file)
@@ -33,11 +33,6 @@ OBJC_CLASS CALayer;
 typedef CALayer PlatformLayer;
 #elif PLATFORM(WIN)
 typedef struct _CACFLayer PlatformLayer;
-#elif PLATFORM(QT)
-namespace WebCore {
-class TextureMapperPlatformLayer;
-typedef TextureMapperPlatformLayer PlatformLayer;
-};
 #elif PLATFORM(GTK)
 #if USE(TEXTURE_MAPPER_GL)
 namespace WebCore {
index 637b77f..5488588 100644 (file)
 #include <cairo.h>
 #endif
 
-#if PLATFORM(QT)
-#include <QRawFont>
-#endif
-
 namespace WebCore {
 
 class FontDescription;
@@ -204,9 +200,6 @@ public:
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080
         wkCTFontTransformOptions options = (typesettingFeatures & Kerning ? wkCTFontTransformApplyPositioning : 0) | (typesettingFeatures & Ligatures ? wkCTFontTransformApplyShaping : 0);
         return wkCTFontTransformGlyphs(m_platformData.ctFont(), glyphs, reinterpret_cast<CGSize*>(advances), glyphCount, options);
-#elif PLATFORM(QT) && QT_VERSION >= 0x050100
-        QRawFont::LayoutFlags flags = (typesettingFeatures & Kerning) ? QRawFont::KernedAdvances : QRawFont::SeparateAdvances;
-        return m_platformData.rawFont().advancesForGlyphIndexes(glyphs, advances, glyphCount, flags);
 #else
         UNUSED_PARAM(glyphs);
         UNUSED_PARAM(advances);
@@ -216,10 +209,6 @@ public:
 #endif
     }
 
-#if PLATFORM(QT)
-    QRawFont getQtRawFont() const { return m_platformData.rawFont(); }
-#endif
-
 #if PLATFORM(WIN)
     bool isSystemFont() const { return m_isSystemFont; }
 #if !OS(WINCE) // disable unused members to save space
index 8aa2678..bf635c9 100644 (file)
@@ -65,8 +65,6 @@ public:
             return !font.typesettingFeatures();
 
         return !(font.typesettingFeatures() & ~(Kerning | Ligatures));
-#elif PLATFORM(QT) && QT_VERSION >= 0x050100
-        return !(font.typesettingFeatures() & ~Kerning) && !font.isSmallCaps() && !font.letterSpacing();
 #else
         return !font.typesettingFeatures();
 #endif
index 19bdc71..b0d2cdc 100644 (file)
@@ -39,7 +39,7 @@
 
 namespace WebCore {
 
-#if PLATFORM(WIN) || PLATFORM(QT) || USE(CAIRO)
+#if PLATFORM(WIN) || USE(CAIRO)
 DrawingBuffer::DrawingBuffer(GraphicsContext3D* context, const IntSize& size, bool multisampleExtensionSupported, bool packedDepthStencilExtensionSupported, PreserveDrawingBuffer preserveDrawingBuffer, AlphaRequirement alpha)
     : m_preserveDrawingBuffer(preserveDrawingBuffer)
     , m_alpha(alpha)
diff --git a/Source/WebCore/platform/graphics/gpu/qt/DrawingBufferQt.cpp b/Source/WebCore/platform/graphics/gpu/qt/DrawingBufferQt.cpp
deleted file mode 100644 (file)
index 47cb4b9..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2011 Andrew Wason (rectalogic@rectalogic.com)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-
-#if USE(3D_GRAPHICS)
-
-#include "DrawingBuffer.h"
-
-namespace WebCore {
-
-#if USE(ACCELERATED_COMPOSITING)
-PlatformLayer* DrawingBuffer::platformLayer()
-{
-    return 0;
-}
-
-unsigned DrawingBuffer::frontColorBuffer() const
-{
-    return colorBuffer();
-}
-
-void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer*)
-{
-}
-#endif
-
-}
-
-#endif
diff --git a/Source/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp b/Source/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp
deleted file mode 100644 (file)
index 375026d..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
-
-    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 "ImageGStreamer.h"
-
-#if ENABLE(VIDEO) && USE(GSTREAMER)
-#include <gst/gst.h>
-#include <gst/video/video.h>
-
-#ifdef GST_API_VERSION_1
-#include <gst/video/gstvideometa.h>
-#endif
-
-#include <wtf/gobject/GOwnPtr.h>
-
-using namespace std;
-using namespace WebCore;
-
-ImageGStreamer::ImageGStreamer(GstBuffer* buffer, GstCaps* caps)
-    : m_image(0)
-{
-    GstVideoFormat format;
-    IntSize size;
-    int pixelAspectRatioNumerator, pixelAspectRatioDenominator, stride;
-    getVideoSizeAndFormatFromCaps(caps, size, format, pixelAspectRatioNumerator, pixelAspectRatioDenominator, stride);
-
-#ifdef GST_API_VERSION_1
-    GstMapInfo info;
-    gst_buffer_map(buffer, &info, GST_MAP_READ);
-    uchar* bufferData = reinterpret_cast<uchar*>(info.data);
-#else
-    uchar* bufferData = reinterpret_cast<uchar*>(GST_BUFFER_DATA(buffer));
-#endif
-    QImage::Format imageFormat;
-    QImage::InvertMode invertMode;
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-    if (format == GST_VIDEO_FORMAT_BGRA) {
-        imageFormat = QImage::Format_ARGB32;
-        invertMode = QImage::InvertRgba;
-    } else {
-        imageFormat = QImage::Format_RGB32;
-        invertMode = QImage::InvertRgb;
-    }
-#else
-    imageFormat = (format == GST_VIDEO_FORMAT_ARGB) ? QImage::Format_ARGB32 : QImage::Format_RGB32;
-#endif
-
-    QImage image(bufferData, size.width(), size.height(), imageFormat);
-
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-    image.invertPixels(invertMode);
-#endif
-    QPixmap* surface = new QPixmap;
-    surface->convertFromImage(image);
-    m_image = BitmapImage::create(surface);
-
-#ifdef GST_API_VERSION_1
-    if (GstVideoCropMeta* cropMeta = gst_buffer_get_video_crop_meta(buffer))
-        setCropRect(FloatRect(cropMeta->x, cropMeta->y, cropMeta->width, cropMeta->height));
-
-    gst_buffer_unmap(buffer, &info);
-#endif
-}
-
-ImageGStreamer::~ImageGStreamer()
-{
-    if (m_image)
-        m_image.clear();
-
-    m_image = 0;
-}
-#endif // USE(GSTREAMER)
-
diff --git a/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp b/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp
deleted file mode 100644 (file)
index 1dcfd01..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
-    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
-
-    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 "PlatformVideoWindow.h"
-#if ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO)
-
-#include "HTMLVideoElement.h"
-#include "PlatformVideoWindowPrivate.h"
-
-#include <QCursor>
-#include <QGuiApplication>
-#include <QKeyEvent>
-#include <QPalette>
-
-using namespace WebCore;
-
-#ifndef QT_NO_CURSOR
-static const int gHideMouseCursorDelay = 3000;
-#endif
-
-FullScreenVideoWindow::FullScreenVideoWindow()
-    : m_mediaElement(0)
-{
-    setModality(Qt::ApplicationModal);
-
-#ifndef QT_NO_CURSOR
-    m_cursorTimer.setSingleShot(true);
-    connect(&m_cursorTimer, SIGNAL(timeout()), this, SLOT(hideCursor()));
-#endif
-}
-
-void FullScreenVideoWindow::setVideoElement(HTMLVideoElement* element)
-{
-    m_mediaElement = element;
-}
-
-void FullScreenVideoWindow::keyPressEvent(QKeyEvent* ev)
-{
-    if (m_mediaElement && ev->key() == Qt::Key_Space) {
-        if (!m_mediaElement->paused())
-            m_mediaElement->pause();
-        else
-            m_mediaElement->play();
-    } else if (ev->key() == Qt::Key_Escape)
-        emit closed();
-    QWindow::keyPressEvent(ev);
-}
-
-bool FullScreenVideoWindow::event(QEvent* ev)
-{
-    switch (ev->type()) {
-    case QEvent::MouseMove:
-        showCursor();
-        ev->accept();
-        return true;
-    case QEvent::MouseButtonDblClick:
-        emit closed();
-        ev->accept();
-        return true;
-    case QEvent::Close:
-#ifndef QT_NO_CURSOR
-        m_cursorTimer.stop();
-#endif
-#ifndef QT_NO_CURSOR
-        QGuiApplication::restoreOverrideCursor();
-#endif
-        break;
-    default:
-        break;
-    }
-    return QWindow::event(ev);
-}
-
-void FullScreenVideoWindow::showFullScreen()
-{
-    QWindow::showFullScreen();
-    raise();
-    hideCursor();
-}
-
-void FullScreenVideoWindow::hideCursor()
-{
-#ifndef QT_NO_CURSOR
-    QGuiApplication::setOverrideCursor(QCursor(Qt::BlankCursor));
-#endif
-}
-
-void FullScreenVideoWindow::showCursor()
-{
-#ifndef QT_NO_CURSOR
-    QGuiApplication::restoreOverrideCursor();
-    m_cursorTimer.start(gHideMouseCursorDelay);
-#endif
-}
-
-
-PlatformVideoWindow::PlatformVideoWindow()
-{
-    QWindow* win = new FullScreenVideoWindow();
-    m_window = win;
-    win->setFlags(win->flags() | Qt::FramelessWindowHint);
-    // FIXME: Port to Qt 5.
-    win->showFullScreen();
-    m_videoWindowId = win->winId();
-}
-
-PlatformVideoWindow::~PlatformVideoWindow()
-{
-    delete m_window;
-    m_videoWindowId = 0;
-}
-
-void PlatformVideoWindow::prepareForOverlay(GstMessage*)
-{
-}
-#endif // ENABLE(VIDEO) && USE(GSTREAMER) && USE(NATIVE_FULLSCREEN_VIDEO)
index 194799f..38478bb 100644 (file)
@@ -35,7 +35,7 @@
 #if PLATFORM(MAC)
 #include "ANGLE/ShaderLang.h"
 #include <OpenGL/gl.h>
-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) || PLATFORM(NIX)
+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
 #include "OpenGLShims.h"
 #endif
 
@@ -65,7 +65,7 @@ Platform3DObject Extensions3DOpenGL::createVertexArrayOES()
 {
     m_context->makeContextCurrent();
     GLuint array = 0;
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
     if (isVertexArrayObjectSupported())
         glGenVertexArrays(1, &array);
 #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
@@ -80,7 +80,7 @@ void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array)
         return;
 
     m_context->makeContextCurrent();
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
     if (isVertexArrayObjectSupported())
         glDeleteVertexArrays(1, &array);
 #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
@@ -94,7 +94,7 @@ GC3Dboolean Extensions3DOpenGL::isVertexArrayOES(Platform3DObject array)
         return GL_FALSE;
 
     m_context->makeContextCurrent();
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
     if (isVertexArrayObjectSupported())
         return glIsVertexArray(array);
 #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
@@ -106,7 +106,7 @@ GC3Dboolean Extensions3DOpenGL::isVertexArrayOES(Platform3DObject array)
 void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array)
 {
     m_context->makeContextCurrent();
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
     if (isVertexArrayObjectSupported())
         glBindVertexArray(array);
 #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
@@ -160,7 +160,7 @@ bool Extensions3DOpenGL::supportsExtension(const String& name)
 
     // GL_OES_vertex_array_object
     if (name == "GL_OES_vertex_array_object") {
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(NIX))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(NIX))
         return m_availableExtensions.contains("GL_ARB_vertex_array_object");
 #else
         return m_availableExtensions.contains("GL_APPLE_vertex_array_object");
@@ -205,7 +205,7 @@ String Extensions3DOpenGL::getExtensions()
     return String(reinterpret_cast<const char*>(::glGetString(GL_EXTENSIONS)));
 }
 
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
 bool Extensions3DOpenGL::isVertexArrayObjectSupported()
 {
     static const bool supportsVertexArrayObject = supports("GL_OES_vertex_array_object");
index 4c0e0bc..5ce029a 100644 (file)
@@ -60,7 +60,7 @@ protected:
 
     virtual bool supportsExtension(const WTF::String&);
     virtual String getExtensions();
-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
 private:
     bool isVertexArrayObjectSupported();
 #endif
index b0f7f9e..174289b 100644 (file)
@@ -42,7 +42,7 @@
 #include <GLES2/gl2ext.h>
 #elif PLATFORM(MAC)
 #include <OpenGL/gl.h>
-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) || PLATFORM(NIX)
+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
 #include "OpenGLShims.h"
 #endif
 
index e3ac1ec..e411fbe 100644 (file)
 
 #include "Extensions3DOpenGLCommon.h"
 
-#if PLATFORM(QT)
-// Takes care of declaring the GLES extensions.
-#include <qopengl.h>
-#else
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
-#endif
 
-#if OS(QNX) || PLATFORM(QT)
+#if OS(QNX)
 // See https://bugs.webkit.org/show_bug.cgi?id=91030.
 // Newer Khorons headers do define these with a PROC suffix, but older headers don't.
 #define PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC
index e7df94d..8644c9c 100644 (file)
@@ -42,7 +42,7 @@
 
 #if PLATFORM(MAC)
 #include <OpenGL/gl.h>
-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) || PLATFORM(NIX)
+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
 #include "OpenGLShims.h"
 #endif
 
index da20aa4..7ea3299 100644 (file)
@@ -57,7 +57,7 @@
 #include "OpenGLESShims.h"
 #elif PLATFORM(MAC)
 #include <OpenGL/gl.h>
-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) || PLATFORM(NIX)
+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
 #include "OpenGLShims.h"
 #endif
 
@@ -255,7 +255,7 @@ void GraphicsContext3D::reshape(int width, int height)
     if (width == m_currentWidth && height == m_currentHeight)
         return;
 
-#if (PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(NIX)) && USE(GRAPHICS_SURFACE)
+#if (PLATFORM(EFL) || PLATFORM(NIX)) && USE(GRAPHICS_SURFACE)
     ::glFlush(); // Make sure all GL calls have been committed before resizing.
     createGraphicsSurfaces(IntSize(width, height));
 #endif
diff --git a/Source/WebCore/platform/graphics/qt/ColorQt.cpp b/Source/WebCore/platform/graphics/qt/ColorQt.cpp
deleted file mode 100644 (file)
index 151766a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Color.h"
-
-#include <QColor>
-
-namespace WebCore {
-
-Color::Color(const QColor& c)
-    : m_color(makeRGBA(c.red(), c.green(), c.blue(), c.alpha()))
-{
-    m_valid = c.isValid();
-}
-
-Color::operator QColor() const
-{
-    if (m_valid)
-        return QColor(red(), green(), blue(), alpha());
-    else
-        return QColor();
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/FloatPointQt.cpp b/Source/WebCore/platform/graphics/qt/FloatPointQt.cpp
deleted file mode 100644 (file)
index 82093d8..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FloatPoint.h"
-
-#include <QPointF>
-
-namespace WebCore {
-
-FloatPoint::FloatPoint(const QPointF& p)
-    : m_x(p.x())
-    , m_y(p.y())
-{
-}
-
-FloatPoint::operator QPointF() const
-{
-    return QPointF(m_x, m_y);
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/FloatRectQt.cpp b/Source/WebCore/platform/graphics/qt/FloatRectQt.cpp
deleted file mode 100644 (file)
index 063876b..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FloatRect.h"
-
-#include <QRectF>
-
-namespace WebCore {
-
-FloatRect::FloatRect(const QRectF& r)
-    : m_location(r.topLeft())
-    , m_size(r.width()
-    , r.height())
-{
-}
-
-FloatRect::operator QRectF() const
-{
-    return QRectF(x(), y(), width(), height());
-}
-
-FloatRect FloatRect::normalized() const
-{
-    FloatRect normalizedRect = *this;
-
-    if (width() < 0) {
-        normalizedRect.setX(x() + width());
-        normalizedRect.setWidth(-width());
-    }
-    if (height() < 0) {
-        normalizedRect.setY(y() + height());
-        normalizedRect.setHeight(-height());
-    }
-    return normalizedRect;
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/FloatSizeQt.cpp b/Source/WebCore/platform/graphics/qt/FloatSizeQt.cpp
deleted file mode 100644 (file)
index 3ecfaa9..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-    Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
-
-    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 "FloatSize.h"
-
-#include <QSizeF>
-
-namespace WebCore {
-
-FloatSize::FloatSize(const QSizeF& size)
-    : m_width(size.width())
-    , m_height(size.height())
-{
-}
-
-FloatSize::operator QSizeF() const
-{
-    return QSizeF(width(), height());
-}
-
-} // namespace
diff --git a/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp b/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
deleted file mode 100644 (file)
index 8a987c7..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
-    Copyright (C) 2008 Holger Hans Peter Freyther
-    Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
-    Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
-
-    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.
-
-    This class provides all functionality needed for loading images, style sheets and html
-    pages from the web. It has a memory cache for these objects.
-*/
-#include "config.h"
-#include "FontCache.h"
-
-#include "Font.h"
-#include "FontDescription.h"
-#include "FontPlatformData.h"
-#include <utility>
-#include <wtf/ListHashSet.h>
-#include <wtf/StdLibExtras.h>
-#include <wtf/text/StringHash.h>
-#include <wtf/text/WTFString.h>
-
-#include <QFont>
-#include <QFontDatabase>
-#include <QTextLayout>
-
-using namespace WTF;
-
-namespace WebCore {
-
-void FontCache::platformInit()
-{
-}
-
-static QRawFont rawFontForCharacters(const QString& string, const QRawFont& font)
-{
-    QTextLayout layout(string);
-    layout.setRawFont(font);
-    layout.beginLayout();
-    layout.createLine();
-    layout.endLayout();
-
-    QList<QGlyphRun> glyphList = layout.glyphRuns();
-    ASSERT(glyphList.size() <= 1);
-    if (!glyphList.size())
-        return QRawFont();
-
-    const QGlyphRun& glyphs(glyphList.at(0));
-    return glyphs.rawFont();
-}
-
-PassRefPtr<SimpleFontData> FontCache::systemFallbackForCharacters(const FontDescription&, const SimpleFontData* originalFontData, bool, const UChar* characters, int length)
-{
-    QString qstring = QString::fromRawData(reinterpret_cast<const QChar*>(characters), length);
-    QRawFont computedFont = rawFontForCharacters(qstring, originalFontData->getQtRawFont());
-    if (!computedFont.isValid())
-        return 0;
-    FontPlatformData alternateFont(computedFont);
-    return getCachedFontData(&alternateFont, DoNotRetain);
-}
-
-PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& fontDescription, ShouldRetain shouldRetain)
-{
-    const AtomicString fallbackFamily = QFont(fontDescription.firstFamily()).lastResortFamily();
-    FontPlatformData platformData(fontDescription, fallbackFamily);
-    return getCachedFontData(&platformData, shouldRetain);
-}
-
-void FontCache::getTraitsInFamily(const AtomicString&, Vector<unsigned>&)
-{
-}
-
-PassOwnPtr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
-{
-    QFontDatabase db;
-    if (!db.hasFamily(familyName))
-        return nullptr;
-    return adoptPtr(new FontPlatformData(fontDescription, familyName));
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h b/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h
deleted file mode 100644 (file)
index 181c32f..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
-
-    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.
-
-    This class provides all functionality needed for loading images, style sheets and html
-    pages from the web. It has a memory cache for these objects.
-*/
-#ifndef FontCustomPlatformData_h
-#define FontCustomPlatformData_h
-
-#include "FontOrientation.h"
-#include "FontRenderingMode.h"
-#include "FontWidthVariant.h"
-#include <QRawFont>
-#include <wtf/FastMalloc.h>
-#include <wtf/Forward.h>
-#include <wtf/Noncopyable.h>
-
-namespace WebCore {
-
-class FontPlatformData;
-class SharedBuffer;
-
-struct FontCustomPlatformData {
-    WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); WTF_MAKE_FAST_ALLOCATED;
-public:
-    FontCustomPlatformData() { }
-
-    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal,
-                                      FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
-
-    static bool supportsFormat(const String&);
-
-    QRawFont m_rawFont;
-};
-
-FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer);
-
-} // namespace WebCore
-
-#endif // FontCustomPlatformData_h
diff --git a/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp b/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
deleted file mode 100644 (file)
index 957978d..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
-
-    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.
-
-    This class provides all functionality needed for loading images, style sheets and html
-    pages from the web. It has a memory cache for these objects.
-*/
-#include "config.h"
-#include "FontCustomPlatformData.h"
-
-#include "FontPlatformData.h"
-#include "SharedBuffer.h"
-#if USE(ZLIB)
-#include "WOFFFileFormat.h"
-#endif
-#include <QStringList>
-
-namespace WebCore {
-
-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, FontWidthVariant, FontRenderingMode)
-{
-    Q_ASSERT(m_rawFont.isValid());
-    m_rawFont.setPixelSize(qreal(size));
-    return FontPlatformData(m_rawFont);
-}
-
-FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
-{
-    ASSERT_ARG(buffer, buffer);
-
-#if USE(ZLIB)
-    RefPtr<SharedBuffer> sfntBuffer;
-    if (isWOFF(buffer)) {
-        Vector<char> sfnt;
-        if (!convertWOFFToSfnt(buffer, sfnt))
-            return 0;
-
-        sfntBuffer = SharedBuffer::adoptVector(sfnt);
-        buffer = sfntBuffer.get();
-    }
-#endif // USE(ZLIB)
-
-    const QByteArray fontData(buffer->data(), buffer->size());
-#if !USE(ZLIB)
-    if (fontData.startsWith("wOFF")) {
-        qWarning("WOFF support requires QtWebKit to be built with zlib support.");
-        return 0;
-    }
-#endif // !USE(ZLIB)
-    // 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;
-
-    FontCustomPlatformData *data = new FontCustomPlatformData;
-    data->m_rawFont = rawFont;
-    return data;
-}
-
-bool FontCustomPlatformData::supportsFormat(const String& format)
-{
-    return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype")
-#if USE(ZLIB)
-            || equalIgnoringCase(format, "woff")
-#endif
-    ;
-}
-
-}
diff --git a/Source/WebCore/platform/graphics/qt/FontPlatformData.h b/Source/WebCore/platform/graphics/qt/FontPlatformData.h
deleted file mode 100644 (file)
index 50885e2..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
-    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
-    Copyright (C) 2008 Holger Hans Peter Freyther
-    Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
-
-    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.
-
-    This class provides all functionality needed for loading images, style sheets and html
-    pages from the web. It has a memory cache for these objects.
-*/
-#ifndef FontPlatformData_h
-#define FontPlatformData_h
-
-#include "FontDescription.h"
-#include "FontOrientation.h"
-#include <QFont>
-#include <QHash>
-#include <QRawFont>
-#include <wtf/Forward.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class FontPlatformDataPrivate : public RefCounted<FontPlatformDataPrivate> {
-    WTF_MAKE_NONCOPYABLE(FontPlatformDataPrivate); WTF_MAKE_FAST_ALLOCATED;
-public:
-    FontPlatformDataPrivate()
-        : size(0)
-        , bold(false)
-        , oblique(false)
-        , isDeletedValue(false)
-    { }
-    FontPlatformDataPrivate(const float size, const bool bold, const bool oblique)
-        : size(size)
-        , bold(bold)
-        , oblique(oblique)
-        , isDeletedValue(false)
-    {
-// 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.
-        QFont font;
-        font.setBold(bold);
-        font.setItalic(oblique);
-        rawFont = QRawFont::fromFont(font, QFontDatabase::Any);
-        rawFont.setPixelSize(size);
-    }
-
-    FontPlatformDataPrivate(const QRawFont& rawFont)
-        : rawFont(rawFont)
-        , size(rawFont.pixelSize())
-        , bold(rawFont.weight() >= QFont::Bold)
-        , oblique(false)
-        , isDeletedValue(false)
-    { }
-
-    FontPlatformDataPrivate(WTF::HashTableDeletedValueType)
-        : isDeletedValue(true)
-    { }
-
-    QRawFont rawFont;
-    float size;
-    bool bold : 1;
-    bool oblique : 1;
-    bool isDeletedValue : 1;
-};
-
-class FontPlatformData {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    FontPlatformData(float size, bool bold, bool oblique);
-    FontPlatformData(const FontDescription&, const AtomicString& familyName, int wordSpacing = 0, int letterSpacing = 0);
-    FontPlatformData(const FontPlatformData&, float size);
-    FontPlatformData(const QRawFont& rawFont)
-        : m_data(adoptRef(new FontPlatformDataPrivate(rawFont)))
-    { }
-    FontPlatformData(WTF::HashTableDeletedValueType)
-        : m_data(adoptRef(new FontPlatformDataPrivate()))
-    {
-        m_data->isDeletedValue = true;
-    }
-
-    bool operator==(const FontPlatformData&) const;
-
-    bool isHashTableDeletedValue() const
-    {
-        return m_data && m_data->isDeletedValue;
-    }
-
-    QRawFont rawFont() const
-    {
-        Q_ASSERT(!isHashTableDeletedValue());
-        if (!m_data)
-            return QRawFont();
-        return m_data->rawFont;
-    }
-
-    float size() const
-    {
-        Q_ASSERT(!isHashTableDeletedValue());
-        if (!m_data)
-            return 0;
-        return m_data->size;
-    }
-
-    FontOrientation orientation() const { return Horizontal; } // FIXME: Implement.
-    void setOrientation(FontOrientation) { } // FIXME: Implement.
-
-    unsigned hash() const;
-
-#ifndef NDEBUG
-    String description() const;
-#endif
-private:
-    RefPtr<FontPlatformDataPrivate> m_data;
-};
-
-} // namespace WebCore
-
-#endif // FontPlatformData_h
diff --git a/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp b/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
deleted file mode 100644 (file)
index 94f3a91..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
-    Copyright (C) 2008 Holger Hans Peter Freyther
-    Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
-    Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
-    Copyright (C) 2013 Digia Plc. and/or its subsidiary(-ies)
-
-    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 "FontPlatformData.h"
-
-#include "Font.h"
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-static inline QFont::Weight toQFontWeight(FontWeight fontWeight)
-{
-    switch (fontWeight) {
-    case FontWeight100:
-    case FontWeight200:
-        return QFont::Light; // QFont::Light == Weight of 25
-    case FontWeight600:
-        return QFont::DemiBold; // QFont::DemiBold == Weight of 63
-    case FontWeight700:
-    case FontWeight800:
-        return QFont::Bold; // QFont::Bold == Weight of 75
-    case FontWeight900:
-        return QFont::Black; // QFont::Black == Weight of 87
-    case FontWeight300:
-    case FontWeight400:
-    case FontWeight500:
-    default:
-        return QFont::Normal; // QFont::Normal == Weight of 50
-    }
-}
-
-static inline bool isEmptyValue(const float size, const bool bold, const bool oblique)
-{
-     // this is the empty value by definition of the trait FontDataCacheKeyTraits
-    return !bold && !oblique && size == 0.f;
-}
-
-FontPlatformData::FontPlatformData(float size, bool bold, bool oblique)
-{
-    if (!isEmptyValue(size, bold, oblique))
-        m_data = adoptRef(new FontPlatformDataPrivate(size, bold, oblique));
-}
-
-FontPlatformData::FontPlatformData(const FontDescription& description, const AtomicString& familyName, int wordSpacing, int letterSpacing)
-    : m_data(adoptRef(new FontPlatformDataPrivate()))
-{
-    QFont font;
-    int requestedSize = description.computedPixelSize();
-    font.setFamily(familyName);
-    if (requestedSize)
-        font.setPixelSize(requestedSize);
-    font.setItalic(description.italic());
-    font.setWeight(toQFontWeight(description.weight()));
-    font.setWordSpacing(wordSpacing);
-    font.setLetterSpacing(QFont::AbsoluteSpacing, letterSpacing);
-    if (description.fontSmoothing() == NoSmoothing
-        || (description.fontSmoothing() == AutoSmoothing && !Font::shouldUseSmoothing()))
-        font.setStyleStrategy(QFont::NoAntialias);
-
-    m_data->bold = font.bold();
-    // 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();
-    m_data->rawFont = QRawFont::fromFont(font, QFontDatabase::Any);
-}
-
-FontPlatformData::FontPlatformData(const FontPlatformData& other, float size)
-    : m_data(adoptRef(new FontPlatformDataPrivate()))
-{
-    m_data->rawFont = other.m_data->rawFont;
-    m_data->bold = other.m_data->bold;
-    m_data->oblique = other.m_data->oblique;
-    m_data->rawFont.setPixelSize(size);
-    m_data->size = m_data->rawFont.pixelSize();
-}
-
-bool FontPlatformData::operator==(const FontPlatformData& other) const
-{
-    if (m_data == other.m_data)
-        return true;
-
-    if (!m_data || !other.m_data || m_data->isDeletedValue || other.m_data->isDeletedValue)
-        return false;
-
-    const bool equals = (m_data->size == other.m_data->size
-                         && m_data->bold == other.m_data->bold
-                         && m_data->oblique == other.m_data->oblique
-                         && m_data->rawFont == other.m_data->rawFont);
-    return equals;
-}
-
-unsigned FontPlatformData::hash() const
-{
-    if (!m_data)
-        return 0;
-    if (m_data->isDeletedValue)
-        return 1;
-    return qHash(m_data->rawFont.familyName()) ^ qHash(m_data->rawFont.style())
-            ^ qHash(m_data->rawFont.weight())
-            ^ qHash(*reinterpret_cast<quint32*>(&m_data->size));
-}
-
-#ifndef NDEBUG
-String FontPlatformData::description() const
-{
-    return String();
-}
-#endif
-
-}
diff --git a/Source/WebCore/platform/graphics/qt/FontQt.cpp b/Source/WebCore/platform/graphics/qt/FontQt.cpp
deleted file mode 100644 (file)
index 5f0d5ee..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
-    Copyright (C) 2012 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 "FontGlyphs.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 <QPainter>
-#include <QPainterPath>
-#include <QPen>
-#include <QPointF>
-#include <QTextLayout>
-#include <qalgorithms.h>
-
-#include <limits.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()), 0);
-}
-
-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 QPainterPath pathForGlyphs(const QGlyphRun& glyphRun, const QPointF& offset)
-{
-    QPainterPath path;
-    const QRawFont rawFont(glyphRun.rawFont());
-    const QVector<quint32> glyphIndices = glyphRun.glyphIndexes();
-    const QVector<QPointF> positions = glyphRun.positions();
-    for (int i = 0; i < glyphIndices.size(); ++i) {
-        QPainterPath glyphPath = rawFont.pathForGlyph(glyphIndices.at(i));
-        glyphPath.translate(positions.at(i) + offset);
-        path.addPath(glyphPath);
-    }
-    return path;
-}
-
-static void drawQtGlyphRun(GraphicsContext* context, const QGlyphRun& qtGlyphRun, const QPointF& point, int baseLineOffset)
-{
-    QPainter* painter = context->platformContext();
-
-    QPainterPath textStrokePath;
-    if (context->textDrawingMode() & TextModeStroke)
-        textStrokePath = pathForGlyphs(qtGlyphRun, point);
-
-    if (context->hasShadow()) {
-        const GraphicsContextState& state = context->state();
-        if (context->mustUseShadowBlur()) {
-            ShadowBlur shadow(state);
-            const int width = qtGlyphRun.boundingRect().width();
-            const QRawFont& font = qtGlyphRun.rawFont();
-            const int height = font.ascent() + font.descent();
-            const QRectF boundingRect(point.x(), point.y() - font.ascent() + baseLineOffset, width, height);
-            GraphicsContext* shadowContext = shadow.beginShadowLayer(context, boundingRect);
-            if (shadowContext) {
-                QPainter* shadowPainter = shadowContext->platformContext();
-                shadowPainter->setPen(state.shadowColor);
-                if (shadowContext->textDrawingMode() & TextModeFill)
-                    shadowPainter->drawGlyphRun(point, qtGlyphRun);
-                else if (shadowContext->textDrawingMode() & TextModeStroke)
-                    shadowPainter->strokePath(textStrokePath, shadowPainter->pen());
-                shadow.endShadowLayer(context);
-            }
-        } else {
-            QPen previousPen = painter->pen();
-            painter->setPen(state.shadowColor);
-            const QPointF shadowOffset(state.shadowOffset.width(), state.shadowOffset.height());
-            painter->translate(shadowOffset);
-            if (context->textDrawingMode() & TextModeFill)
-                painter->drawGlyphRun(point, qtGlyphRun);
-            else if (context->textDrawingMode() & TextModeStroke)
-                painter->strokePath(textStrokePath, painter->pen());
-            painter->translate(-shadowOffset);
-            painter->setPen(previousPen);
-        }
-    }
-
-    if (context->textDrawingMode() & TextModeStroke)
-        painter->strokePath(textStrokePath, strokePenForContext(context));
-
-    if (context->textDrawingMode() & TextModeFill) {
-        QPen previousPen = painter->pen();
-        painter->setPen(fillPenForContext(context));
-        painter->drawGlyphRun(point, qtGlyphRun);
-        painter->setPen(previousPen);
-    }
-}
-
-void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const FloatPoint& point, int from, int to) const
-{
-    String sanitized = Font::normalizeSpaces(run.characters16(), run.length());
-    const QString string = fromRawDataWithoutRef(sanitized);
-    QTextLayout layout(string);
-    layout.setRawFont(rawFont());
-    initFormatForTextLayout(&layout, run);
-    QTextLine line = setupLayout(&layout, run);
-    const QPointF adjustedPoint(point.x(), point.y() - line.ascent());
-
-    QList<QGlyphRun> runs = line.glyphRuns(from, to - from);
-    Q_FOREACH(QGlyphRun glyphRun, runs)
-        drawQtGlyphRun(ctx, glyphRun, adjustedPoint, line.ascent());
-}
-
-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 primaryFont()->spaceWidth() + run.expansion();
-    String sanitized = Font::normalizeSpaces(run.characters16(), run.length());
-    QString string = fromRawDataWithoutRef(sanitized);
-
-    QTextLayout layout(string);
-    layout.setRawFont(rawFont());
-    initFormatForTextLayout(&layout, run);
-    QTextLine line = setupLayout(&layout, run);
-    float x1 = line.cursorToX(0);
-    float x2 = line.cursorToX(run.length());
-    float width = qAbs(x2 - x1);
-
-    return width + run.expansion();
-}
-
-int Font::offsetForPositionForComplexText(const TextRun& run, float position, bool) const
-{
-    String sanitized = Font::normalizeSpaces(run.characters16(), run.length());
-    QString string = fromRawDataWithoutRef(sanitized);
-
-    QTextLayout layout(string);
-    layout.setRawFont(rawFont());
-    initFormatForTextLayout(&layout, run);
-    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.characters16(), run.length());
-    QString string = fromRawDataWithoutRef(sanitized);
-
-    QTextLayout layout(string);
-    layout.setRawFont(rawFont());
-    initFormatForTextLayout(&layout, run);
-    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);
-}
-
-void Font::initFormatForTextLayout(QTextLayout* layout, const TextRun& run) const
-{
-    QTextLayout::FormatRange range;
-    // WebCore expects word-spacing to be ignored on leading spaces contrary to what Qt does.
-    // To avoid word-spacing on any leading spaces, we exclude them from FormatRange which
-    // word-spacing along with other options would be applied to. This is safe since the other
-    // formatting options does not affect spaces.
-    unsigned length = run.length();
-    for (range.start = 0; range.start < length && treatAsSpace(run[range.start]); ++range.start) { }
-    range.length = length - range.start;
-
-    if (m_wordSpacing)
-        range.format.setFontWordSpacing(m_wordSpacing);
-    if (m_letterSpacing)
-        range.format.setFontLetterSpacing(m_letterSpacing);
-    if (typesettingFeatures() & Kerning)
-        range.format.setFontKerning(true);
-    if (isSmallCaps())
-        range.format.setFontCapitalization(QFont::SmallCaps);
-
-    if (range.format.propertyCount() && range.length)
-        layout->setAdditionalFormats(QList<QTextLayout::FormatRange>() << range);
-}
-
-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::drawGlyphs(GraphicsContext* context, const SimpleFontData* fontData, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point) const
-{
-    if (!fontData->platformData().size())
-        return;
-
-    if (context->paintingDisabled())
-        return;
-
-    bool shouldFill = context->textDrawingMode() & TextModeFill;
-    bool shouldStroke = context->textDrawingMode() & TextModeStroke;
-
-    if (!shouldFill && !shouldStroke)
-        return;
-
-    QVector<quint32> glyphIndexes;
-    QVector<QPointF> positions;
-
-    glyphIndexes.reserve(numGlyphs);
-    positions.reserve(numGlyphs);
-    const QRawFont& font(fontData->getQtRawFont());
-
-    float width = 0;
-
-    for (int i = 0; i < numGlyphs; ++i) {
-        Glyph glyph = glyphBuffer.glyphAt(from + i);
-        float advance = glyphBuffer.advanceAt(from + i).width();
-        if (!glyph)
-            continue;
-        glyphIndexes.append(glyph);
-        positions.append(QPointF(width, 0));
-        width += advance;
-    }
-
-    QGlyphRun qtGlyphs;
-    qtGlyphs.setGlyphIndexes(glyphIndexes);
-    qtGlyphs.setPositions(positions);
-    qtGlyphs.setRawFont(font);
-
-    drawQtGlyphRun(context, qtGlyphs, point, /* baselineOffset = */0);
-}
-
-
-bool Font::canExpandAroundIdeographsInComplexText()
-{
-    return false;
-}
-
-QFont Font::syntheticFont() const
-{
-    QRawFont rawFont(primaryFont()->getQtRawFont());
-    QFont f(rawFont.familyName());
-    if (rawFont.pixelSize())
-        f.setPixelSize(rawFont.pixelSize());
-    f.setWeight(rawFont.weight());
-    f.setStyle(rawFont.style());
-    if (m_letterSpacing)
-        f.setLetterSpacing(QFont::AbsoluteSpacing, m_letterSpacing);
-    if (m_wordSpacing)
-        f.setWordSpacing(m_wordSpacing);
-    return f;
-}
-
-
-QRawFont Font::rawFont() const
-{
-    return primaryFont()->getQtRawFont();
-}
-
-}
diff --git a/Source/WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp b/Source/WebCore/platform/graphics/qt/GlyphPageTreeNodeQt.cpp
deleted file mode 100644 (file)
index 5ee9922..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-    Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
-    Copyright (C) 2008 Holger Hans Peter Freyther
-
-    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.
-
-    This class provides all functionality needed for loading images, style sheets and html
-    pages from the web. It has a memory cache for these objects.
-*/
-#include "config.h"
-#include "GlyphPageTreeNode.h"
-
-#include "SimpleFontData.h"
-#include <QFontMetricsF>
-#include <QTextLayout>
-
-namespace WebCore {
-
-bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
-{
-    QRawFont rawFont = fontData->platformData().rawFont();
-    QString qstring = QString::fromRawData(reinterpret_cast<const QChar*>(buffer), static_cast<int>(bufferLength));
-    QVector<quint32> indexes = rawFont.glyphIndexesForString(qstring);
-
-    bool haveGlyphs = false;
-
-    for (unsigned i = 0; i < length; ++i) {
-        Glyph glyph = (i < indexes.size()) ? indexes.at(i) : 0;
-        if (!glyph)
-            setGlyphDataForIndex(offset + i, 0, 0);
-        else {
-            haveGlyphs = true;
-            setGlyphDataForIndex(offset + i, glyph, fontData);
-        }
-    }
-    return haveGlyphs;
-}
-
-}
diff --git a/Source/WebCore/platform/graphics/qt/GradientQt.cpp b/Source/WebCore/platform/graphics/qt/GradientQt.cpp
deleted file mode 100644 (file)
index 72bb009..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "Gradient.h"
-
-#include "CSSParser.h"
-#include "GraphicsContext.h"
-
-#include <QGradient>
-#include <QPainter>
-
-namespace WebCore {
-
-void Gradient::platformDestroy()
-{
-    delete m_gradient;
-    m_gradient = 0;
-}
-
-QGradient* Gradient::platformGradient()
-{
-    if (m_gradient)
-        return m_gradient;
-
-    bool reversed = m_r0 > m_r1;
-
-    qreal innerRadius = reversed ? m_r1 : m_r0;
-    qreal outerRadius = reversed ? m_r0 : m_r1;
-    QPointF center = reversed ? m_p0 : m_p1;
-    QPointF focalPoint = reversed ? m_p1 : m_p0;
-
-    if (m_radial)
-        m_gradient = new QRadialGradient(center, outerRadius, focalPoint);
-    else
-        m_gradient = new QLinearGradient(m_p0.x(), m_p0.y(), m_p1.x(), m_p1.y());
-
-    m_gradient->setInterpolationMode(QGradient::ComponentInterpolation);
-
-    sortStopsIfNecessary();
-
-    QColor stopColor;
-    Vector<ColorStop>::iterator stopIterator = m_stops.begin();
-    qreal lastStop(0.0);
-    const qreal lastStopDiff = 0.0000001;
-    while (stopIterator != m_stops.end()) {
-        stopColor.setRgbF(stopIterator->red, stopIterator->green, stopIterator->blue, stopIterator->alpha);
-        if (qFuzzyCompare(lastStop, qreal(stopIterator->stop)))
-            lastStop = stopIterator->stop + lastStopDiff;
-        else
-            lastStop = stopIterator->stop;
-
-        if (m_radial && !qFuzzyCompare(1 + outerRadius, qreal(1))) {
-            lastStop = lastStop * (1.0f - innerRadius / outerRadius);
-            if (!reversed)
-                lastStop += innerRadius / outerRadius;
-        }
-
-        qreal stopPosition = qMin(lastStop, qreal(1.0f));
-
-        if (m_radial && reversed)
-            stopPosition = 1 - stopPosition;
-
-        m_gradient->setColorAt(stopPosition, stopColor);
-        // Keep the lastStop as orginal value, since the following stopColor depend it
-        lastStop = stopIterator->stop;
-        ++stopIterator;
-    }
-
-    if (m_stops.isEmpty()) {
-        // The behavior of QGradient with no stops is defined differently from HTML5 spec,
-        // where the latter requires the gradient to be transparent black.
-        m_gradient->setColorAt(0.0, QColor(0, 0, 0, 0));
-    }
-
-    switch (m_spreadMethod) {
-    case SpreadMethodPad:
-        m_gradient->setSpread(QGradient::PadSpread);
-        break;
-    case SpreadMethodReflect:
-        m_gradient->setSpread(QGradient::ReflectSpread);
-        break;
-    case SpreadMethodRepeat:
-        m_gradient->setSpread(QGradient::RepeatSpread);
-        break;
-    }
-
-    return m_gradient;
-}
-
-void Gradient::fill(GraphicsContext* context, const FloatRect& rect)
-{
-    context->platformContext()->fillRect(rect, *platformGradient());
-}
-
-} //namespace
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
deleted file mode 100644 (file)
index 1c7289c..0000000
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
-    Copyright (C) 2010 Tieto Corporation.
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 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
-    Lesser General Public License for more details.
-     
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#include "config.h"
-#include "GraphicsContext3D.h"
-
-#if USE(OPENGL_ES_2)
-#include "Extensions3DOpenGLES.h"
-#else
-#include "Extensions3DOpenGL.h"
-#endif
-#include "GraphicsContext.h"
-#include "GraphicsSurface.h"
-#include "HostWindow.h"
-#include "ImageBuffer.h"
-#include "ImageData.h"
-#include "NativeImageQt.h"
-#include "NotImplemented.h"
-#include "OpenGLShims.h"
-#include "QWebPageClient.h"
-#include "SharedBuffer.h"
-#include "TextureMapperPlatformLayer.h"
-#include <qpa/qplatformpixmap.h>
-#include <wtf/text/CString.h>
-
-#if QT_VERSION >= 0x050100
-#include <QOffscreenSurface>
-#else
-#include <QWindow>
-#endif
-
-#if USE(TEXTURE_MAPPER_GL)
-#include <texmap/TextureMapperGL.h>
-#endif
-
-#if USE(3D_GRAPHICS)
-
-namespace WebCore {
-
-#if !defined(GLchar)
-typedef char GLchar;
-#endif
-
-#if !defined(GL_DEPTH24_STENCIL8)
-#define GL_DEPTH24_STENCIL8 0x88F0
-#endif
-
-class GraphicsContext3DPrivate
-#if USE(ACCELERATED_COMPOSITING)
-        : public TextureMapperPlatformLayer
-#endif
-{
-public:
-    GraphicsContext3DPrivate(GraphicsContext3D*, HostWindow*, GraphicsContext3D::RenderStyle);
-    ~GraphicsContext3DPrivate();
-
-#if USE(ACCELERATED_COMPOSITING)
-    virtual void paintToTextureMapper(TextureMapper*, const FloatRect& target, const TransformationMatrix&, float opacity);
-#endif
-#if USE(GRAPHICS_SURFACE)
-    virtual IntSize platformLayerSize() const;
-    virtual uint32_t copyToGraphicsSurface();
-    virtual GraphicsSurfaceToken graphicsSurfaceToken() const;
-#endif
-
-    QRectF boundingRect() const;
-    void blitMultisampleFramebuffer() const;
-    void blitMultisampleFramebufferAndRestoreContext() const;
-    bool makeCurrentIfNeeded() const;
-    void createOffscreenBuffers();
-    void initializeANGLE();
-    void createGraphicsSurfaces(const IntSize&);
-
-    GraphicsContext3D* m_context;
-    HostWindow* m_hostWindow;
-    PlatformGraphicsSurface3D m_surface;
-    PlatformGraphicsContext3D m_platformContext;
-    QObject* m_surfaceOwner;
-#if USE(GRAPHICS_SURFACE)
-    GraphicsSurface::Flags m_surfaceFlags;
-    RefPtr<GraphicsSurface> m_graphicsSurface;
-#endif
-};
-
-bool GraphicsContext3D::isGLES2Compliant() const
-{
-#if USE(OPENGL_ES_2)
-    return true;
-#else
-    return false;
-#endif
-}
-
-GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
-    : m_context(context)
-    , m_hostWindow(hostWindow)
-    , m_surface(0)
-    , m_platformContext(0)
-    , m_surfaceOwner(0)
-{
-    if (renderStyle == GraphicsContext3D::RenderToCurrentGLContext) {
-        m_platformContext = QOpenGLContext::currentContext();
-        if (m_platformContext)
-            m_surface = m_platformContext->surface();
-        return;
-    }
-
-    QOpenGLContext* shareContext = 0;
-    if (hostWindow && hostWindow->platformPageClient() && hostWindow->platformPageClient()->makeOpenGLContextCurrentIfAvailable())
-        shareContext = QOpenGLContext::currentContext();
-
-#if QT_VERSION >= 0x050100
-    QOffscreenSurface* surface = new QOffscreenSurface;
-    surface->create();
-    m_surface = surface;
-    m_surfaceOwner = surface;
-#else
-    QWindow* window = new QWindow;
-    window->setSurfaceType(QSurface::OpenGLSurface);
-    window->setGeometry(-10, -10, 1, 1);
-    window->create();
-    m_surface = window;
-    m_surfaceOwner = window;
-#endif
-
-    m_platformContext = new QOpenGLContext(m_surfaceOwner);
-    if (shareContext)
-        m_platformContext->setShareContext(shareContext);
-
-    if (!m_platformContext->create())
-        return;
-
-    makeCurrentIfNeeded();
-
-#if USE(GRAPHICS_SURFACE)
-    IntSize surfaceSize(m_context->m_currentWidth, m_context->m_currentHeight);
-    m_surfaceFlags = GraphicsSurface::SupportsTextureTarget
-                    | GraphicsSurface::SupportsSharing;
-
-    if (!surfaceSize.isEmpty())
-        m_graphicsSurface = GraphicsSurface::create(surfaceSize, m_surfaceFlags, m_platformContext);
-#endif
-}
-
-void GraphicsContext3DPrivate::createOffscreenBuffers()
-{
-    glGenFramebuffers(/* count */ 1, &m_context->m_fbo);
-
-    glGenTextures(1, &m_context->m_texture);
-    glBindTexture(GraphicsContext3D::TEXTURE_2D, m_context->m_texture);
-    glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
-    glTexParameterf(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
-    glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
-    glTexParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
-    glBindTexture(GraphicsContext3D::TEXTURE_2D, 0);
-
-    // Create a multisample FBO.
-    if (m_context->m_attrs.antialias) {
-        glGenFramebuffers(1, &m_context->m_multisampleFBO);
-        glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_multisampleFBO);
-        m_context->m_state.boundFBO = m_context->m_multisampleFBO;
-        glGenRenderbuffers(1, &m_context->m_multisampleColorBuffer);
-        if (m_context->m_attrs.stencil || m_context->m_attrs.depth)
-            glGenRenderbuffers(1, &m_context->m_multisampleDepthStencilBuffer);
-    } else {
-        // Bind canvas FBO.
-        glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_fbo);
-        m_context->m_state.boundFBO = m_context->m_fbo;
-#if USE(OPENGL_ES_2)
-        if (m_context->m_attrs.depth)
-            glGenRenderbuffers(1, &m_context->m_depthBuffer);
-        if (m_context->m_attrs.stencil)
-            glGenRenderbuffers(1, &m_context->m_stencilBuffer);
-#endif
-        if (m_context->m_attrs.stencil || m_context->m_attrs.depth)
-            glGenRenderbuffers(1, &m_context->m_depthStencilBuffer);
-    }
-}
-
-void GraphicsContext3DPrivate::initializeANGLE()
-{
-    ShBuiltInResources ANGLEResources;
-    ShInitBuiltInResources(&ANGLEResources);
-
-    m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_ATTRIBS, &ANGLEResources.MaxVertexAttribs);
-    m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_UNIFORM_VECTORS, &ANGLEResources.MaxVertexUniformVectors);
-    m_context->getIntegerv(GraphicsContext3D::MAX_VARYING_VECTORS, &ANGLEResources.MaxVaryingVectors);
-    m_context->getIntegerv(GraphicsContext3D::MAX_VERTEX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxVertexTextureImageUnits);
-    m_context->getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxCombinedTextureImageUnits);
-    m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_IMAGE_UNITS, &ANGLEResources.MaxTextureImageUnits);
-    m_context->getIntegerv(GraphicsContext3D::MAX_FRAGMENT_UNIFORM_VECTORS, &ANGLEResources.MaxFragmentUniformVectors);
-
-    // Always set to 1 for OpenGL ES.
-    ANGLEResources.MaxDrawBuffers = 1;
-
-    Extensions3D* extensions = m_context->getExtensions();
-    if (extensions->supports("GL_ARB_texture_rectangle"))
-        ANGLEResources.ARB_texture_rectangle = 1;
-
-    GC3Dint range[2], precision;
-    m_context->getShaderPrecisionFormat(GraphicsContext3D::FRAGMENT_SHADER, GraphicsContext3D::HIGH_FLOAT, range, &precision);
-    ANGLEResources.FragmentPrecisionHigh = (range[0] || range[1] || precision);
-
-    m_context->m_compiler.setResources(ANGLEResources);
-}
-
-GraphicsContext3DPrivate::~GraphicsContext3DPrivate()
-{
-    delete m_surfaceOwner;
-    m_surfaceOwner = 0;
-}
-
-static inline quint32 swapBgrToRgb(quint32 pixel)
-{
-    return (((pixel << 16) | (pixel >> 16)) & 0x00ff00ff) | (pixel & 0xff00ff00);
-}
-
-#if USE(ACCELERATED_COMPOSITING)
-void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
-{
-    m_context->markLayerComposited();
-    blitMultisampleFramebufferAndRestoreContext();
-
-    if (textureMapper->accelerationMode() == TextureMapper::OpenGLMode) {
-        TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
-#if USE(GRAPHICS_SURFACE)
-        ASSERT(m_graphicsSurface);
-        // CGL only provides us the context, but not the view the context is currently bound to.
-        // To make sure the context is bound the the right surface we have to do a makeCurrent through QOpenGL again.
-        // FIXME: Remove this code as soon as GraphicsSurfaceMac makes use of NSOpenGL.
-        QOpenGLContext* currentContext = QOpenGLContext::currentContext();
-        QSurface* currentSurface = currentContext->surface();
-        makeCurrentIfNeeded();
-
-        m_graphicsSurface->copyFromTexture(m_context->m_texture, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight));
-
-        // CGL only provides us the context, but not the view the context is currently bound to.
-        // To make sure the context is bound the the right surface we have to do a makeCurrent through QOpenGL again.
-        // FIXME: Remove this code as soon as GraphicsSurfaceMac makes use of NSOpenGL.
-        currentContext->makeCurrent(currentSurface);
-
-        m_graphicsSurface->paintToTextureMapper(texmapGL, targetRect, matrix, opacity);
-#else
-        TextureMapperGL::Flags flags = TextureMapperGL::ShouldFlipTexture | (m_context->m_attrs.alpha ? TextureMapperGL::ShouldBlend : 0);
-        IntSize textureSize(m_context->m_currentWidth, m_context->m_currentHeight);
-        texmapGL->drawTexture(m_context->m_texture, flags, textureSize, targetRect, matrix, opacity);
-#endif
-        return;
-    }
-
-    GraphicsContext* context = textureMapper->graphicsContext();
-    QPainter* painter = context->platformContext();
-    painter->save();
-    painter->setTransform(matrix);
-    painter->setOpacity(opacity);
-
-    const int height = m_context->m_currentHeight;
-    const int width = m_context->m_currentWidth;
-
-    // Alternatively read pixels to a memory buffer.
-    QImage offscreenImage(width, height, QImage::Format_ARGB32);
-    quint32* imagePixels = reinterpret_cast<quint32*>(offscreenImage.bits());
-
-    makeCurrentIfNeeded();
-    glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_fbo);
-    glReadPixels(/* x */ 0, /* y */ 0, width, height, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, imagePixels);
-    glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_state.boundFBO);
-
-    // OpenGL gives us ABGR on 32 bits, and with the origin at the bottom left
-    // We need RGB32 or ARGB32_PM, with the origin at the top left.
-    quint32* pixelsSrc = imagePixels;
-    const int halfHeight = height / 2;
-    for (int row = 0; row < halfHeight; ++row) {
-        const int targetIdx = (height - 1 - row) * width;
-        quint32* pixelsDst = imagePixels + targetIdx;
-        for (int column = 0; column < width; ++column) {
-            quint32 tempPixel = *pixelsSrc;
-            *pixelsSrc = swapBgrToRgb(*pixelsDst);
-            *pixelsDst = swapBgrToRgb(tempPixel);
-            ++pixelsSrc;
-            ++pixelsDst;
-        }
-    }
-    if (static_cast<int>(height) % 2) {
-        for (int column = 0; column < width; ++column) {
-            *pixelsSrc = swapBgrToRgb(*pixelsSrc);
-            ++pixelsSrc;
-        }
-    }
-
-    painter->drawImage(targetRect, offscreenImage);
-    painter->restore();
-}
-#endif // USE(ACCELERATED_COMPOSITING)
-
-#if USE(GRAPHICS_SURFACE)
-IntSize GraphicsContext3DPrivate::platformLayerSize() const
-{
-    return IntSize(m_context->m_currentWidth, m_context->m_currentHeight);
-}
-
-uint32_t GraphicsContext3DPrivate::copyToGraphicsSurface()
-{
-    if (!m_graphicsSurface)
-        return 0;
-
-    m_context->markLayerComposited();
-    blitMultisampleFramebufferAndRestoreContext();
-    m_graphicsSurface->copyFromTexture(m_context->m_texture, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight));
-    return m_graphicsSurface->frontBuffer();
-}
-
-GraphicsSurfaceToken GraphicsContext3DPrivate::graphicsSurfaceToken() const
-{
-    return m_graphicsSurface->exportToken();
-}
-#endif
-
-QRectF GraphicsContext3DPrivate::boundingRect() const
-{
-    return QRectF(QPointF(0, 0), QSizeF(m_context->m_currentWidth, m_context->m_currentHeight));
-}
-
-void GraphicsContext3DPrivate::blitMultisampleFramebuffer() const
-{
-    if (!m_context->m_attrs.antialias)
-        return;
-#if !USE(OPENGL_ES_2)
-    glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_context->m_multisampleFBO);
-    glBindFramebuffer(GL_DRAW_FRAMEBUFFER_EXT, m_context->m_fbo);
-    glBlitFramebuffer(0, 0, m_context->m_currentWidth, m_context->m_currentHeight, 0, 0, m_context->m_currentWidth, m_context->m_currentHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
-#endif
-    glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_context->m_state.boundFBO);
-}
-
-void GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext() const
-{
-    const QOpenGLContext* currentContext = QOpenGLContext::currentContext();
-    QSurface* currentSurface = 0;
-    if (currentContext && currentContext != m_platformContext) {
-        currentSurface = currentContext->surface();
-        m_platformContext->makeCurrent(m_surface);
-    }
-
-    if (m_context->m_attrs.antialias)
-        blitMultisampleFramebuffer();
-
-    // While the context is still bound, make sure all the Framebuffer content is in finished state.
-    // This is necessary as we are doing our own double buffering instead of using a drawable that provides swapBuffers.
-    glFinish();
-
-    if (currentContext && currentContext != m_platformContext)
-        const_cast<QOpenGLContext*>(currentContext)->makeCurrent(currentSurface);
-}
-
-bool GraphicsContext3DPrivate::makeCurrentIfNeeded() const
-{
-    const QOpenGLContext* currentContext = QOpenGLContext::currentContext();
-    if (currentContext == m_platformContext)
-        return true;
-    return m_platformContext->makeCurrent(m_surface);
-}
-
-void GraphicsContext3DPrivate::createGraphicsSurfaces(const IntSize& size)
-{
-#if USE(GRAPHICS_SURFACE)
-    if (size.isEmpty())
-        m_graphicsSurface.clear();
-    else
-        m_graphicsSurface = GraphicsSurface::create(size, m_surfaceFlags, m_platformContext);
-#endif
-}
-
-PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
-{
-    // This implementation doesn't currently support rendering directly to the HostWindow.
-    if (renderStyle == RenderDirectlyToHostWindow)
-        return 0;
-    RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderStyle));
-    return context->m_private ? context.release() : 0;
-}
-
-GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
-    : m_currentWidth(0)
-    , m_currentHeight(0)
-    , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT)
-    , m_attrs(attrs)
-    , m_renderStyle(renderStyle)
-    , m_texture(0)
-    , m_compositorTexture(0)
-    , m_fbo(0)
-#if USE(OPENGL_ES_2)
-    , m_depthBuffer(0)
-    , m_stencilBuffer(0)
-#endif
-    , m_depthStencilBuffer(0)
-    , m_layerComposited(false)
-    , m_internalColorFormat(0)
-    , m_multisampleFBO(0)
-    , m_multisampleDepthStencilBuffer(0)
-    , m_multisampleColorBuffer(0)
-    , m_private(adoptPtr(new GraphicsContext3DPrivate(this, hostWindow, renderStyle)))
-{
-    validateAttributes();
-
-    if (!m_private->m_surface || !m_private->m_platformContext) {
-        LOG_ERROR("GraphicsContext3D: GL context creation failed.");
-        m_private = nullptr;
-        return;
-    }
-
-    static bool initialized = false;
-    static bool success = true;
-    if (!initialized) {
-        success = initializeOpenGLShims();
-        initialized = true;
-    }
-    if (!success) {
-        m_private = nullptr;
-        return;
-    }
-
-    if (renderStyle == RenderOffscreen)
-        m_private->createOffscreenBuffers();
-
-    m_private->initializeANGLE();
-
-#if !USE(OPENGL_ES_2)
-    glEnable(GL_POINT_SPRITE);
-    glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
-#endif
-
-    if (renderStyle != RenderToCurrentGLContext)
-        glClearColor(0.0, 0.0, 0.0, 0.0);
-}
-
-GraphicsContext3D::~GraphicsContext3D()
-{
-    // If GraphicsContext3D init failed in constructor, m_private set to nullptr and no buffers are allocated.
-    if (!m_private)
-        return;
-
-    makeContextCurrent();
-    glDeleteTextures(1, &m_texture);
-    glDeleteFramebuffers(1, &m_fbo);
-    if (m_attrs.antialias) {
-        glDeleteRenderbuffers(1, &m_multisampleColorBuffer);
-        glDeleteFramebuffers(1, &m_multisampleFBO);
-        if (m_attrs.stencil || m_attrs.depth)
-            glDeleteRenderbuffers(1, &m_multisampleDepthStencilBuffer);
-    } else if (m_attrs.stencil || m_attrs.depth) {
-#if USE(OPENGL_ES_2)
-        if (m_attrs.depth)
-            glDeleteRenderbuffers(1, &m_depthBuffer);
-        if (m_attrs.stencil)
-            glDeleteRenderbuffers(1, &m_stencilBuffer);
-#endif
-        glDeleteRenderbuffers(1, &m_depthStencilBuffer);
-    }
-}
-
-PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D()
-{
-    return m_private->m_platformContext;
-}
-
-Platform3DObject GraphicsContext3D::platformTexture() const
-{
-    return m_texture;
-}
-
-#if USE(ACCELERATED_COMPOSITING)
-PlatformLayer* GraphicsContext3D::platformLayer() const
-{
-    return m_private.get();
-}
-#endif
-
-bool GraphicsContext3D::makeContextCurrent()
-{
-    if (!m_private || m_renderStyle == RenderToCurrentGLContext)
-        return false;
-    return m_private->makeCurrentIfNeeded();
-}
-
-void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight,
-                                      int canvasWidth, int canvasHeight, QPainter* context)
-{
-    QImage image(imagePixels, imageWidth, imageHeight, NativeImageQt::defaultFormatForAlphaEnabledImages());
-    context->save();
-    context->translate(0, imageHeight);
-    context->scale(1, -1);
-    context->setCompositionMode(QPainter::CompositionMode_Source);
-    context->drawImage(QRect(0, 0, canvasWidth, -canvasHeight), image);
-    context->restore();
-}
-
-#if USE(GRAPHICS_SURFACE)
-void GraphicsContext3D::createGraphicsSurfaces(const IntSize& size)
-{
-    m_private->createGraphicsSurfaces(size);
-}
-#endif
-
-GraphicsContext3D::ImageExtractor::~ImageExtractor()
-{
-}
-
-bool GraphicsContext3D::ImageExtractor::extractImage(bool premultiplyAlpha, bool ignoreGammaAndColorProfile)
-{
-    UNUSED_PARAM(ignoreGammaAndColorProfile);
-    if (!m_image)
-        return false;
-
-    // Is image already loaded? If not, load it.
-    if (m_image->data())
-        m_qtImage = QImage::fromData(reinterpret_cast<const uchar*>(m_image->data()->data()), m_image->data()->size());
-    else {
-        QPixmap* nativePixmap = m_image->nativeImageForCurrentFrame();
-        if (!nativePixmap)
-            return false;
-
-        // With QPA, we can avoid a deep copy.
-        m_qtImage = *nativePixmap->handle()->buffer();
-    }
-
-    m_alphaOp = AlphaDoNothing;
-    switch (m_qtImage.format()) {
-    case QImage::Format_RGB32:
-        // For opaque images, we should not premultiply or unmultiply alpha.
-        break;
-    case QImage::Format_ARGB32:
-        if (premultiplyAlpha)
-            m_alphaOp = AlphaDoPremultiply;
-        break;
-    case QImage::Format_ARGB32_Premultiplied:
-        if (!premultiplyAlpha)
-            m_alphaOp = AlphaDoUnmultiply;
-        break;
-    default:
-        // The image has a format that is not supported in packPixels. We have to convert it here.
-        m_qtImage = m_qtImage.convertToFormat(premultiplyAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32);
-        break;
-    }
-
-    m_imageWidth = m_image->width();
-    m_imageHeight = m_image->height();
-    if (!m_imageWidth || !m_imageHeight)
-        return false;
-    m_imagePixelData = m_qtImage.constBits();
-    m_imageSourceFormat = DataFormatBGRA8;
-    m_imageSourceUnpackAlignment = 0;
-
-    return true;
-}
-
-void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>)
-{
-}
-
-void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>)
-{
-}
-
-}
-
-#endif // USE(3D_GRAPHICS)
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
deleted file mode 100644 (file)
index 1e6bede..0000000
+++ /dev/null
@@ -1,1699 +0,0 @@
-/*
- * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- * Copyright (C) 2006 George Staikos <staikos@kde.org>
- * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
- * Copyright (C) 2006 Allan Sandfeld Jensen <sandfeld@kde.org>
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
- * Copyright (C) 2008 Dirk Schulze <vbs85@gmx.de>
- * Copyright (C) 2010, 2011 Sencha, Inc.
- * Copyright (C) 2011 Andreas Kling <kling@webkit.org>
- * Copyright (C) 2013 Digia Plc. and/or its subsidiary(-ies).
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "GraphicsContext.h"
-
-#if OS(WINDOWS)
-#include <windows.h>
-#endif
-
-#include "AffineTransform.h"
-#include "Color.h"
-#include "FloatConversion.h"
-#include "Font.h"
-#include "ImageBuffer.h"
-#include "NotImplemented.h"
-#include "Path.h"
-#include "Pattern.h"
-#include "ShadowBlur.h"
-#include "TransformationMatrix.h"
-#include "TransparencyLayer.h"
-
-#include <QBrush>
-#include <QGradient>
-#include <QPaintDevice>
-#include <QPaintEngine>
-#include <QPainter>
-#include <QPainterPath>
-#include <QPainterPathStroker>
-#include <QPixmap>
-#include <QPolygonF>
-#include <QStack>
-#include <QVector>
-#include <wtf/MathExtras.h>
-
-#if OS(WINDOWS)
-QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP, int hbitmapFormat = 0);
-QT_END_NAMESPACE
-
-enum HBitmapFormat {
-    HBitmapNoAlpha,
-    HBitmapPremultipliedAlpha,
-    HBitmapAlpha
-};
-#endif
-
-namespace WebCore {
-
-static inline QPainter::CompositionMode toQtCompositionMode(CompositeOperator op)
-{
-    switch (op) {
-    case CompositeClear:
-        return QPainter::CompositionMode_Clear;
-    case CompositeCopy:
-        return QPainter::CompositionMode_Source;
-    case CompositeSourceOver:
-        return QPainter::CompositionMode_SourceOver;
-    case CompositeSourceIn:
-        return QPainter::CompositionMode_SourceIn;
-    case CompositeSourceOut:
-        return QPainter::CompositionMode_SourceOut;
-    case CompositeSourceAtop:
-        return QPainter::CompositionMode_SourceAtop;
-    case CompositeDestinationOver:
-        return QPainter::CompositionMode_DestinationOver;
-    case CompositeDestinationIn:
-        return QPainter::CompositionMode_DestinationIn;
-    case CompositeDestinationOut:
-        return QPainter::CompositionMode_DestinationOut;
-    case CompositeDestinationAtop:
-        return QPainter::CompositionMode_DestinationAtop;
-    case CompositeXOR:
-        return QPainter::CompositionMode_Xor;
-    case CompositePlusDarker:
-        // there is no exact match, but this is the closest
-        return QPainter::CompositionMode_Darken;
-    case CompositePlusLighter:
-        return QPainter::CompositionMode_Plus;
-    case CompositeDifference:
-        return QPainter::CompositionMode_Difference;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-
-    return QPainter::CompositionMode_SourceOver;
-}
-
-static inline QPainter::CompositionMode toQtCompositionMode(BlendMode op)
-{
-    switch (op) {
-    case BlendModeNormal:
-        return QPainter::CompositionMode_SourceOver;
-    case BlendModeMultiply:
-        return QPainter::CompositionMode_Multiply;
-    case BlendModeScreen:
-        return QPainter::CompositionMode_Screen;
-    case BlendModeOverlay:
-        return QPainter::CompositionMode_Overlay;
-    case BlendModeDarken:
-        return QPainter::CompositionMode_Darken;
-    case BlendModeLighten:
-        return QPainter::CompositionMode_Lighten;
-    case BlendModeColorDodge:
-        return QPainter::CompositionMode_ColorDodge;
-    case BlendModeColorBurn:
-        return QPainter::CompositionMode_ColorBurn;
-    case BlendModeHardLight:
-        return QPainter::CompositionMode_HardLight;
-    case BlendModeSoftLight:
-        return QPainter::CompositionMode_SoftLight;
-    case BlendModeDifference:
-        return QPainter::CompositionMode_Difference;
-    case BlendModeExclusion:
-        return QPainter::CompositionMode_Exclusion;
-    case BlendModeHue:
-    case BlendModeSaturation:
-    case BlendModeColor:
-    case BlendModeLuminosity:
-        // Not supported.
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-
-    return QPainter::CompositionMode_SourceOver;
-}
-
-static inline Qt::PenCapStyle toQtLineCap(LineCap lc)
-{
-    switch (lc) {
-    case ButtCap:
-        return Qt::FlatCap;
-    case RoundCap:
-        return Qt::RoundCap;
-    case SquareCap:
-        return Qt::SquareCap;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-
-    return Qt::FlatCap;
-}
-
-static inline Qt::PenJoinStyle toQtLineJoin(LineJoin lj)
-{
-    switch (lj) {
-    case MiterJoin:
-        return Qt::SvgMiterJoin;
-    case RoundJoin:
-        return Qt::RoundJoin;
-    case BevelJoin:
-        return Qt::BevelJoin;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-
-    return Qt::SvgMiterJoin;
-}
-
-static Qt::PenStyle toQPenStyle(StrokeStyle style)
-{
-    switch (style) {
-    case NoStroke:
-        return Qt::NoPen;
-        break;
-    case SolidStroke:
-#if ENABLE(CSS3_TEXT)
-    case DoubleStroke:
-    case WavyStroke:
-#endif
-        return Qt::SolidLine;
-        break;
-    case DottedStroke:
-        return Qt::DotLine;
-        break;
-    case DashedStroke:
-        return Qt::DashLine;
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-    return Qt::NoPen;
-}
-
-static inline Qt::FillRule toQtFillRule(WindRule rule)
-{
-    switch (rule) {
-    case RULE_EVENODD:
-        return Qt::OddEvenFill;
-    case RULE_NONZERO:
-        return Qt::WindingFill;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-    return Qt::OddEvenFill;
-}
-
-static inline void adjustPointsForDottedLine(FloatPoint& p1, FloatPoint& p2, float width, bool isVerticalLine)
-{
-    if (isVerticalLine) {
-        p1.setY(p1.y() - width / 2);
-        p2.setY(p2.y() + width / 2);
-    } else {
-        p1.setX(p1.x() - width / 2);
-        p2.setX(p2.x() + width / 2);
-    }
-}
-
-static inline void drawLineEndpointsForStyle(QPainter *painter, const FloatPoint& p1, const FloatPoint& p2, float width, bool isVerticalLine, StrokeStyle style, Color color)
-{
-    // Do a rect fill of our endpoints. This ensures we always have the
-    // appearance of being a border.
-    if (style == DashedStroke) {
-        if (isVerticalLine) {
-            painter->fillRect(FloatRect(p1.x() - width / 2, p1.y() - width, width, width), QColor(color));
-            painter->fillRect(FloatRect(p2.x() - width / 2, p2.y(), width, width), QColor(color));
-        } else {
-            painter->fillRect(FloatRect(p1.x() - width, p1.y() - width / 2, width, width), QColor(color));
-            painter->fillRect(FloatRect(p2.x(), p2.y() - width / 2, width, width), QColor(color));
-        }
-    }
-
-    // As per css spec a dotted stroke should be made of circles so we're
-    // drawing circles as endpoints.
-    if (style == DottedStroke) {
-        painter->setPen(Qt::NoPen);
-        painter->setBrush(QColor(color));
-        painter->drawEllipse(p1.x() - width / 2, p1.y() - width / 2, width, width);
-        painter->drawEllipse(p2.x() - width / 2, p2.y() - width / 2, width, width);
-    }
-}
-
-class GraphicsContextPlatformPrivate {
-    WTF_MAKE_NONCOPYABLE(GraphicsContextPlatformPrivate); WTF_MAKE_FAST_ALLOCATED;
-public:
-    GraphicsContextPlatformPrivate(QPainter*, const QColor& initialSolidColor);
-    ~GraphicsContextPlatformPrivate();
-
-    inline QPainter* p() const
-    {
-        if (layers.isEmpty())
-            return painter;
-        return &layers.top()->painter;
-    }
-
-    bool antiAliasingForRectsAndLines;
-
-    QStack<TransparencyLayer*> layers;
-    // Counting real layers. Required by isInTransparencyLayer() calls
-    // For example, layers with valid alphaMask are not real layers
-    int layerCount;
-
-    // reuse this brush for solid color (to prevent expensive QBrush construction)
-    QBrush solidColor;
-
-    InterpolationQuality imageInterpolationQuality;
-    bool initialSmoothPixmapTransformHint;
-
-    QRectF clipBoundingRect() const
-    {
-        return p()->clipBoundingRect();
-    }
-
-    void takeOwnershipOfPlatformContext() { platformContextIsOwned = true; }
-
-private:
-    QPainter* painter;
-    bool platformContextIsOwned;
-};
-
-GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(QPainter* p, const QColor& initialSolidColor)
-    : antiAliasingForRectsAndLines(false)
-    , layerCount(0)
-    , solidColor(initialSolidColor)
-    , imageInterpolationQuality(InterpolationDefault)
-    , initialSmoothPixmapTransformHint(false)
-    , painter(p)
-    , platformContextIsOwned(false)
-{
-    if (!painter)
-        return;
-
-    // Use the default the QPainter was constructed with.
-    antiAliasingForRectsAndLines = painter->testRenderHint(QPainter::Antialiasing);
-
-    // Used for default image interpolation quality.
-    initialSmoothPixmapTransformHint = painter->testRenderHint(QPainter::SmoothPixmapTransform);
-
-    painter->setRenderHint(QPainter::Antialiasing, true);
-
-}
-
-GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate()
-{
-    if (!platformContextIsOwned)
-        return;
-
-    QPaintDevice* device = painter->device();
-    painter->end();
-    delete painter;
-    delete device;
-}
-
-void GraphicsContext::platformInit(PlatformGraphicsContext* painter)
-{
-    m_data = new GraphicsContextPlatformPrivate(painter, fillColor());
-
-    setPaintingDisabled(!painter);
-
-    if (!painter)
-        return;
-
-    // solidColor is initialized with the fillColor().
-    painter->setBrush(m_data->solidColor);
-
-    QPen pen(painter->pen());
-    pen.setColor(strokeColor());
-    pen.setJoinStyle(toQtLineJoin(MiterJoin));
-    painter->setPen(pen);
-}
-
-void GraphicsContext::platformDestroy()
-{
-    while (!m_data->layers.isEmpty())
-        endTransparencyLayer();
-
-    delete m_data;
-}
-
-PlatformGraphicsContext* GraphicsContext::platformContext() const
-{
-    return m_data->p();
-}
-
-AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
-{
-    if (paintingDisabled())
-        return AffineTransform();
-
-    const QTransform& matrix = platformContext()->combinedTransform();
-    return AffineTransform(matrix.m11(), matrix.m12(), matrix.m21(),
-                           matrix.m22(), matrix.dx(), matrix.dy());
-}
-
-void GraphicsContext::savePlatformState()
-{
-    if (!m_data->layers.isEmpty() && !m_data->layers.top()->alphaMask.isNull())
-        ++m_data->layers.top()->saveCounter;
-    m_data->p()->save();
-}
-
-void GraphicsContext::restorePlatformState()
-{
-    if (!m_data->layers.isEmpty() && !m_data->layers.top()->alphaMask.isNull())
-        if (!--m_data->layers.top()->saveCounter)
-            endPlatformTransparencyLayer();
-
-    m_data->p()->restore();
-}
-
-// Draws a filled rectangle with a stroked border.
-// This is only used to draw borders (real fill is done via fillRect), and
-// thus it must not cast any shadow.
-void GraphicsContext::drawRect(const IntRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    ASSERT(!rect.isEmpty());
-
-    QPainter* p = m_data->p();
-    const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);
-    p->setRenderHint(QPainter::Antialiasing, m_data->antiAliasingForRectsAndLines);
-
-    p->drawRect(rect);
-
-    p->setRenderHint(QPainter::Antialiasing, antiAlias);
-}
-
-// This is only used to draw borders.
-// Must not cast any shadow.
-void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
-{
-    if (paintingDisabled())
-        return;
-
-    StrokeStyle style = strokeStyle();
-    Color color = strokeColor();
-    if (style == NoStroke)
-        return;
-
-    float width = strokeThickness();
-
-    FloatPoint p1 = point1;
-    FloatPoint p2 = point2;
-    bool isVerticalLine = (p1.x() == p2.x());
-
-    QPainter* p = m_data->p();
-    const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);
-    p->setRenderHint(QPainter::Antialiasing, m_data->antiAliasingForRectsAndLines);
-    adjustLineToPixelBoundaries(p1, p2, width, style);
-
-    Qt::PenCapStyle capStyle = Qt::FlatCap;
-    QVector<qreal> dashes;
-    int patWidth = 0;
-
-    switch (style) {
-    case NoStroke:
-    case SolidStroke:
-#if ENABLE(CSS3_TEXT)
-    case DoubleStroke:
-    case WavyStroke:
-#endif
-        break;
-    case DottedStroke: {
-        capStyle = Qt::RoundCap;
-        patWidth = static_cast<int>(width);
-        // The actual length of one line element can not be set to zero and at 0.1 the dots
-        // are still slightly elongated. Setting it to 0.01 will make it look like the
-        // line endings are being stuck together, close enough to look like a circle.
-        // For the distance of the line elements we subtract the small amount again.
-        const qreal lineElementLength = 0.01;
-        dashes << lineElementLength << qreal(2 * patWidth) / width - lineElementLength;
-        adjustPointsForDottedLine(p1, p2, width, isVerticalLine);
-        break;
-    }
-    case DashedStroke:
-        capStyle = Qt::FlatCap;
-        patWidth = 3 * static_cast<int>(width);
-        dashes << qreal(patWidth) / width << qreal(patWidth) / width;
-        break;
-    }
-
-    if (patWidth) {
-        p->save();
-
-        QPen pen = p->pen();
-
-        drawLineEndpointsForStyle(p, p1, p2, width, isVerticalLine, style, color);
-
-        // Example: 80 pixels with a width of 30 pixels.
-        // Remainder is 20.  The maximum pixels of line we could paint
-        // will be 50 pixels.
-        int distance = (isVerticalLine ? (point2.y() - point1.y()) : (point2.x() - point1.x())) - 2*(int)width;
-        int remainder = distance % patWidth;
-        int coverage = distance - remainder;
-        int numSegments = coverage / patWidth;
-
-        float patternOffset = 0.0f;
-        // Special case 1px dotted borders for speed.
-        if (patWidth == 1)
-            patternOffset = 1.0f;
-        else {
-            bool evenNumberOfSegments = !(numSegments % 2);
-            if (remainder)
-                evenNumberOfSegments = !evenNumberOfSegments;
-            if (evenNumberOfSegments) {
-                if (remainder) {
-                    patternOffset += patWidth - remainder;
-                    patternOffset += remainder / 2;
-                } else
-                    patternOffset = patWidth / 2;
-            } else {
-                if (remainder)
-                    patternOffset = (patWidth - remainder) / 2;
-            }
-        }
-
-        pen.setWidthF(width);
-        pen.setCapStyle(capStyle);
-        pen.setDashPattern(dashes);
-        pen.setDashOffset(patternOffset / width);
-        p->setPen(pen);
-    }
-
-#if ENABLE(CSS3_TEXT)
-    if (style == WavyStroke) {
-        const float step = 2 * width; // Make wave height equal to two times strokeThickness().
-        const float flat = width; // Set size of flat lines between diagonal lines.
-        short signal = -1;
-        QPainterPath path;
-        float x1, y1, x2, y2;
-
-        if (isVerticalLine) {
-            x1 = x2 = p1.x();
-
-            // Make sure (x1, y1) < (x2, y2)
-            if (p1.y() < p2.y()) {
-                y1 = p1.y();
-                y2 = p2.y();
-            } else {
-                y1 = p2.y();
-                y2 = p1.y();
-            }
-
-            // Qt interprets geometric units as end-point inclusive, while WebCore interprets geometric units as endpoint exclusive.
-            // This means we need to subtract one from the endpoint, or the line will be painted one pixel too long.
-            y2 -= 1;
-            path.moveTo(x1 + signal * step, y1);
-            float y = y1 + 2 * step;
-
-            while (y <= y2) {
-                signal = -signal;
-                path.lineTo(x1 + signal * step, y);
-                path.lineTo(x1 + signal * step, y + flat); // Draw flat line between diagonal lines.
-                y += 2 * step + flat;
-            }
-        } else {
-            y1 = y2 = p1.y();
-
-            // Make sure (x1, y1) < (x2, y2)
-            if (p1.x() < p2.x()) {
-                x1 = p1.x();
-                x2 = p2.x();
-            } else {
-                x1 = p2.x();
-                x2 = p1.x();
-            }
-
-            // Qt interprets geometric units as end-point inclusive, while WebCore interprets geometric units as endpoint exclusive.
-            // This means we need to subtract one from the endpoint, or the line will be painted one pixel too long.
-            x2 -= 1;
-            path.moveTo(x1, y1 + signal * step);
-            float x = x1 + 2 * step;
-
-            while (x <= x2) {
-                signal = -signal;
-                path.lineTo(x, y1 + signal * step);
-                path.lineTo(x + flat, y1 + signal * step); // Draw flat line between diagonal lines.
-                x += 2 * step + flat;
-            }
-        }
-
-        // The last point created by the while loops above may not be the end
-        // point, so complete the wave by connecting the end point.
-        path.lineTo(x2, y2);
-        QPen pen = p->pen();
-        pen.setJoinStyle(Qt::BevelJoin); // A bevelled line join is more suitable for wavy than miter or round.
-        pen.setWidth(width);
-        const bool oldAntiAliasing = p->testRenderHint(QPainter::Antialiasing);
-        p->setRenderHint(QPainter::Antialiasing, true); // AntiAliasing is needed for diagonal lines of wavy stroke
-        p->strokePath(path, pen);
-        p->setRenderHint(QPainter::Antialiasing, oldAntiAliasing);
-    } else {
-#endif // CSS3_TEXT
-    // Qt interprets geometric units as end-point inclusive, while WebCore interprets geomtric units as endpoint exclusive.
-    // This means we need to subtract one from the endpoint, or the line will be painted one pixel too long.
-    if (p1.x() == p2.x())
-        p->drawLine(p1, p2 - FloatSize(0, 1));
-    else
-        p->drawLine(p1, p2 - FloatSize(1, 0));
-#if ENABLE(CSS3_TEXT)
-    }
-#endif // CSS3_TEXT
-
-    if (patWidth)
-        p->restore();
-
-    p->setRenderHint(QPainter::Antialiasing, antiAlias);
-}
-
-// This method is only used to draw the little circles used in lists.
-void GraphicsContext::drawEllipse(const IntRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    m_data->p()->drawEllipse(rect);
-}
-
-void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points, bool shouldAntialias)
-{
-    if (paintingDisabled())
-        return;
-
-    if (npoints <= 1)
-        return;
-
-    QPolygonF polygon(npoints);
-
-    for (size_t i = 0; i < npoints; i++)
-        polygon[i] = points[i];
-
-    QPainter* p = m_data->p();
-
-    const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);
-    p->setRenderHint(QPainter::Antialiasing, shouldAntialias);
-
-    p->drawConvexPolygon(polygon);
-
-    p->setRenderHint(QPainter::Antialiasing, antiAlias);
-}
-
-void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
-{
-    if (paintingDisabled())
-        return;
-
-    if (numPoints <= 1)
-        return;
-
-    QPainterPath path(points[0]);
-    for (size_t i = 1; i < numPoints; ++i)
-        path.lineTo(points[i]);
-    path.setFillRule(Qt::WindingFill);
-
-    QPainter* p = m_data->p();
-
-    bool painterWasAntialiased = p->testRenderHint(QPainter::Antialiasing);
-
-    if (painterWasAntialiased != antialiased)
-        p->setRenderHint(QPainter::Antialiasing, antialiased);
-
-    p->setClipPath(path, Qt::IntersectClip);
-
-    if (painterWasAntialiased != antialiased)
-        p->setRenderHint(QPainter::Antialiasing, painterWasAntialiased);
-}
-
-void GraphicsContext::fillPath(const Path& path)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QPainterPath platformPath = path.platformPath();
-    platformPath.setFillRule(toQtFillRule(fillRule()));
-
-    if (hasShadow()) {
-        if (mustUseShadowBlur() || m_state.fillPattern || m_state.fillGradient)
-        {
-            ShadowBlur shadow(m_state);
-            GraphicsContext* shadowContext = shadow.beginShadowLayer(this, platformPath.controlPointRect());
-            if (shadowContext) {
-                QPainter* shadowPainter = shadowContext->platformContext();
-                if (m_state.fillPattern) {
-                    shadowPainter->fillPath(platformPath, QBrush(m_state.fillPattern->createPlatformPattern()));
-                } else if (m_state.fillGradient) {
-                    QBrush brush(*m_state.fillGradient->platformGradient());
-                    brush.setTransform(m_state.fillGradient->gradientSpaceTransform());
-                    shadowPainter->fillPath(platformPath, brush);
-                } else {
-                    shadowPainter->fillPath(platformPath, p->brush());
-                }
-                shadow.endShadowLayer(this);
-            }
-        } else {
-            QPointF offset(m_state.shadowOffset.width(), m_state.shadowOffset.height());
-            p->translate(offset);
-            QColor shadowColor = m_state.shadowColor;
-            shadowColor.setAlphaF(shadowColor.alphaF() * p->brush().color().alphaF());
-            p->fillPath(platformPath, shadowColor);
-            p->translate(-offset);
-        }
-    }
-    if (m_state.fillPattern) {
-        p->fillPath(platformPath, QBrush(m_state.fillPattern->createPlatformPattern()));
-    } else if (m_state.fillGradient) {
-        QBrush brush(*m_state.fillGradient->platformGradient());
-        brush.setTransform(m_state.fillGradient->gradientSpaceTransform());
-        p->fillPath(platformPath, brush);
-    } else
-        p->fillPath(platformPath, p->brush());
-}
-
-inline static void fillPathStroke(QPainter* painter, QPainterPathStroker& pathStroker, const QPainterPath& platformPath, const QBrush& brush)
-{
-    QPainterPath stroke = pathStroker.createStroke(platformPath);
-    painter->fillPath(stroke, brush);
-}
-
-void GraphicsContext::strokePath(const Path& path)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QPen pen(p->pen());
-    QPainterPath platformPath = path.platformPath();
-    platformPath.setFillRule(toQtFillRule(fillRule()));
-    QPainterPathStroker pathStroker;
-    pathStroker.setJoinStyle(pen.joinStyle());
-    pathStroker.setDashOffset(pen.dashOffset());
-    pathStroker.setMiterLimit(pen.miterLimit());
-    pathStroker.setCapStyle(pen.capStyle());
-    pathStroker.setWidth(pen.widthF());
-
-    if (hasShadow()) {
-        if (mustUseShadowBlur() || m_state.strokePattern || m_state.strokeGradient)
-        {
-            ShadowBlur shadow(m_state);
-            FloatRect boundingRect = platformPath.controlPointRect();
-            boundingRect.inflate(pen.miterLimit() + pen.widthF());
-            GraphicsContext* shadowContext = shadow.beginShadowLayer(this, boundingRect);
-            if (shadowContext) {
-                QPainter* shadowPainter = shadowContext->platformContext();
-                if (m_state.strokeGradient) {
-                    QBrush brush(*m_state.strokeGradient->platformGradient());
-                    brush.setTransform(m_state.strokeGradient->gradientSpaceTransform());
-                    fillPathStroke(shadowPainter, pathStroker, platformPath, brush);
-                } else
-                    fillPathStroke(shadowPainter, pathStroker, platformPath, pen.brush());
-                shadow.endShadowLayer(this);
-            }
-        } else {
-            QPointF offset(m_state.shadowOffset.width(), m_state.shadowOffset.height());
-            p->translate(offset);
-            QColor shadowColor = m_state.shadowColor;
-            shadowColor.setAlphaF(shadowColor.alphaF() * pen.color().alphaF());
-            QPen shadowPen(pen);
-            shadowPen.setColor(shadowColor);
-            fillPathStroke(p, pathStroker, platformPath, shadowPen.brush());
-            p->translate(-offset);
-        }
-    }
-
-    if (m_state.strokePattern) {
-        QBrush brush = m_state.strokePattern->createPlatformPattern();
-        fillPathStroke(p, pathStroker, platformPath, brush);
-    } else if (m_state.strokeGradient) {
-        QBrush brush(*m_state.strokeGradient->platformGradient());
-        brush.setTransform(m_state.strokeGradient->gradientSpaceTransform());
-        fillPathStroke(p, pathStroker, platformPath, brush);
-    } else
-        fillPathStroke(p, pathStroker, platformPath, pen.brush());
-}
-
-static inline void drawRepeatPattern(QPainter* p, PassRefPtr<Pattern> pattern, const FloatRect& rect)
-{
-    ASSERT(pattern);
-
-    const QBrush brush = pattern->createPlatformPattern();
-    if (brush.style() != Qt::TexturePattern)
-        return;
-
-    const bool repeatX = pattern->repeatX();
-    const bool repeatY = pattern->repeatY();
-    // Patterns must be painted so that the top left of the first image is anchored at
-    // the origin of the coordinate space
-
-    QRectF targetRect(rect);
-    const int w = brush.texture().width();
-    const int h = brush.texture().height();
-
-    ASSERT(p);
-    QRegion oldClip;
-    if (p->hasClipping())
-        oldClip = p->clipRegion();
-
-    // The only type of transforms supported for the brush are translations.
-    ASSERT(!brush.transform().isRotating());
-
-    QRectF clip = targetRect;
-    QRectF patternRect = brush.transform().mapRect(QRectF(0, 0, w, h));
-    if (!repeatX) {
-        clip.setLeft(patternRect.left());
-        clip.setWidth(patternRect.width());
-    }
-    if (!repeatY) {
-        clip.setTop(patternRect.top());
-        clip.setHeight(patternRect.height());
-    }
-    if (!repeatX || !repeatY)
-        p->setClipRect(clip);
-
-    p->fillRect(targetRect, brush);
-
-    if (!oldClip.isEmpty())
-        p->setClipRegion(oldClip);
-    else if (!repeatX || !repeatY)
-        p->setClipping(false);
-}
-
-void GraphicsContext::fillRect(const FloatRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QRectF normalizedRect = rect.normalized();
-
-    if (m_state.fillPattern) {
-        if (hasShadow()) {
-            ShadowBlur shadow(m_state);
-            GraphicsContext* shadowContext = shadow.beginShadowLayer(this, normalizedRect);
-            if (shadowContext) {
-                QPainter* shadowPainter = shadowContext->platformContext();
-                drawRepeatPattern(shadowPainter, m_state.fillPattern, normalizedRect);
-                shadow.endShadowLayer(this);
-            }
-        }
-        drawRepeatPattern(p, m_state.fillPattern, normalizedRect);
-    } else if (m_state.fillGradient) {
-        QBrush brush(*m_state.fillGradient->platformGradient());
-        brush.setTransform(m_state.fillGradient->gradientSpaceTransform());
-        if (hasShadow()) {
-            ShadowBlur shadow(m_state);
-            GraphicsContext* shadowContext = shadow.beginShadowLayer(this, normalizedRect);
-            if (shadowContext) {
-                QPainter* shadowPainter = shadowContext->platformContext();
-                shadowPainter->fillRect(normalizedRect, brush);
-                shadow.endShadowLayer(this);
-            }
-        }
-        p->fillRect(normalizedRect, brush);
-    } else {
-        if (hasShadow()) {
-            if (mustUseShadowBlur()) {
-                ShadowBlur shadow(m_state);
-                // drawRectShadowWithTiling does not work with rotations, and the fallback of
-                // drawing though clipToImageBuffer() produces scaling artifacts for us.
-                if (!getCTM().preservesAxisAlignment()) {
-                    GraphicsContext* shadowContext = shadow.beginShadowLayer(this, normalizedRect);
-                    if (shadowContext) {
-                        QPainter* shadowPainter = shadowContext->platformContext();
-                        shadowPainter->fillRect(normalizedRect, p->brush());
-                        shadow.endShadowLayer(this);
-                    }
-                } else
-                    shadow.drawRectShadow(this, rect, RoundedRect::Radii());
-            } else {
-                // Solid rectangle fill with no blur shadow or transformations applied can be done
-                // faster without using the shadow layer at all.
-                QColor shadowColor = m_state.shadowColor;
-                shadowColor.setAlphaF(shadowColor.alphaF() * p->brush().color().alphaF());
-                p->fillRect(normalizedRect.translated(QPointF(m_state.shadowOffset.width(), m_state.shadowOffset.height())), shadowColor);
-            }
-        }
-
-        p->fillRect(normalizedRect, p->brush());
-    }
-}
-
-
-void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace)
-{
-    if (paintingDisabled() || !color.isValid())
-        return;
-
-    QRectF platformRect(rect);
-    QPainter* p = m_data->p();
-    if (hasShadow()) {
-        if (mustUseShadowBlur()) {
-            ShadowBlur shadow(m_state);
-            shadow.drawRectShadow(this, platformRect, RoundedRect::Radii());
-        } else {
-            QColor shadowColor = m_state.shadowColor;
-            shadowColor.setAlphaF(shadowColor.alphaF() * p->brush().color().alphaF());
-            p->fillRect(platformRect.translated(QPointF(m_state.shadowOffset.width(), m_state.shadowOffset.height())), shadowColor);
-        }
-    }
-    p->fillRect(platformRect, QColor(color));
-}
-
-void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color, ColorSpace colorSpace)
-{
-    if (paintingDisabled() || !color.isValid())
-        return;
-
-    Path path;
-    path.addRoundedRect(rect, topLeft, topRight, bottomLeft, bottomRight);
-    QPainter* p = m_data->p();
-    if (hasShadow()) {
-        if (mustUseShadowBlur()) {
-            ShadowBlur shadow(m_state);
-            shadow.drawRectShadow(this, rect, RoundedRect::Radii(topLeft, topRight, bottomLeft, bottomRight));
-        } else {
-            const QPointF shadowOffset(m_state.shadowOffset.width(), m_state.shadowOffset.height());
-            p->translate(shadowOffset);
-            p->fillPath(path.platformPath(), QColor(m_state.shadowColor));
-            p->translate(-shadowOffset);
-        }
-    }
-    p->fillPath(path.platformPath(), QColor(color));
-}
-
-void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const RoundedRect& roundedHoleRect, const Color& color, ColorSpace colorSpace)
-{
-    if (paintingDisabled() || !color.isValid())
-        return;
-
-    Path path;
-    path.addRect(rect);
-    if (!roundedHoleRect.radii().isZero())
-        path.addRoundedRect(roundedHoleRect);
-    else
-        path.addRect(roundedHoleRect.rect());
-
-    QPainterPath platformPath = path.platformPath();
-    platformPath.setFillRule(Qt::OddEvenFill);
-
-    QPainter* p = m_data->p();
-    if (hasShadow()) {
-        if (mustUseShadowBlur()) {
-            ShadowBlur shadow(m_state);
-            shadow.drawInsetShadow(this, rect, roundedHoleRect.rect(), roundedHoleRect.radii());
-        } else {
-            const QPointF shadowOffset(m_state.shadowOffset.width(), m_state.shadowOffset.height());
-            p->translate(shadowOffset);
-            p->fillPath(platformPath, QColor(m_state.shadowColor));
-            p->translate(-shadowOffset);
-        }
-    }
-
-    p->fillPath(platformPath, QColor(color));
-}
-
-bool GraphicsContext::isInTransparencyLayer() const
-{
-    return m_data->layerCount;
-}
-
-void GraphicsContext::clip(const IntRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    m_data->p()->setClipRect(rect, Qt::IntersectClip);
-}
-
-void GraphicsContext::clip(const FloatRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    m_data->p()->setClipRect(rect, Qt::IntersectClip);
-}
-IntRect GraphicsContext::clipBounds() const
-{
-    QPainter* p = m_data->p();
-    QRectF clipRect;
-
-    clipRect = p->transform().inverted().mapRect(p->window());
-
-    if (p->hasClipping())
-        clipRect = clipRect.intersected(m_data->clipBoundingRect());
-
-    return enclosingIntRect(clipRect);
-}
-
-void GraphicsContext::clipPath(const Path& path, WindRule clipRule)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QPainterPath platformPath = path.platformPath();
-    platformPath.setFillRule(clipRule == RULE_EVENODD ? Qt::OddEvenFill : Qt::WindingFill);
-    p->setClipPath(platformPath, Qt::IntersectClip);
-}
-
-void drawFocusRingForPath(QPainter* p, const QPainterPath& path, const Color& color, bool antiAliasing)
-{
-    const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);
-    p->setRenderHint(QPainter::Antialiasing, antiAliasing);
-
-    const QPen oldPen = p->pen();
-    const QBrush oldBrush = p->brush();
-
-    QPen nPen = p->pen();
-    nPen.setColor(color);
-    p->setBrush(Qt::NoBrush);
-    nPen.setStyle(Qt::DotLine);
-
-    p->strokePath(path, nPen);
-    p->setBrush(oldBrush);
-    p->setPen(oldPen);
-
-    p->setRenderHint(QPainter::Antialiasing, antiAlias);
-}
-
-void GraphicsContext::drawFocusRing(const Path& path, int /* width */, int offset, const Color& color)
-{
-    // FIXME: Use 'offset' for something? http://webkit.org/b/49909
-
-    if (paintingDisabled() || !color.isValid())
-        return;
-
-    drawFocusRingForPath(m_data->p(), path.platformPath(), color, m_data->antiAliasingForRectsAndLines);
-}
-
-/**
- * Focus ring handling for form controls is not handled here. Qt style in
- * RenderTheme handles drawing focus on widgets which 
- * need it. It is still handled here for links.
- */
-void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
-{
-    if (paintingDisabled() || !color.isValid())
-        return;
-
-    unsigned rectCount = rects.size();
-
-    if (!rects.size())
-        return;
-
-    int radius = (width - 1) / 2;
-    QPainterPath path;
-    for (unsigned i = 0; i < rectCount; ++i) {
-        QRect rect = QRect((rects[i])).adjusted(-offset - radius, -offset - radius, offset + radius, offset + radius);
-        // This is not the most efficient way to add a rect to a path, but if we don't create the tmpPath,
-        // we will end up with ugly lines in between rows of text on anchors with multiple lines.
-        QPainterPath tmpPath;
-        tmpPath.addRoundedRect(rect, radius, radius);
-        path = path.united(tmpPath);
-    }
-    drawFocusRingForPath(m_data->p(), path, color, m_data->antiAliasingForRectsAndLines);
-}
-
-void GraphicsContext::drawLineForText(const FloatPoint& origin, float width, bool)
-{
-    if (paintingDisabled())
-        return;
-
-    FloatPoint startPoint = origin;
-    FloatPoint endPoint = origin + FloatSize(width, 0);
-
-    // If paintengine type is X11 to avoid artifacts
-    // like bug https://bugs.webkit.org/show_bug.cgi?id=42248
-#if defined(Q_WS_X11)
-    QPainter* p = m_data->p();
-    if (p->paintEngine()->type() == QPaintEngine::X11) {
-        // If stroke thickness is odd we need decrease Y coordinate by 1 pixel,
-        // because inside method adjustLineToPixelBoundaries(...), which
-        // called from drawLine(...), Y coordinate will be increased by 0.5f
-        // and then inside Qt painting engine will be rounded to next greater
-        // integer value.
-        float strokeWidth = strokeThickness();
-        if (static_cast<int>(strokeWidth) % 2) {
-            startPoint.setY(startPoint.y() - 1);
-            endPoint.setY(endPoint.y() - 1);
-        }
-    }
-#endif // defined(Q_WS_X11)
-
-    drawLine(roundedIntPoint(startPoint), roundedIntPoint(endPoint));
-}
-
-
-/*
- *   NOTE: This code is completely based upon the one from
- *   Source/WebCore/platform/graphics/cairo/DrawErrorUnderline.{h|cpp}
- *
- *   Draws an error underline that looks like one of:
- *
- *               H       E                H
- *      /\      /\      /\        /\      /\               -
- *    A/  \    /  \    /  \     A/  \    /  \              |
- *     \   \  /    \  /   /D     \   \  /    \             |
- *      \   \/  C   \/   /        \   \/   C  \            | height = heightSquares * square
- *       \      /\  F   /          \  F   /\   \           |
- *        \    /  \    /            \    /  \   \G         |
- *         \  /    \  /              \  /    \  /          |
- *          \/      \/                \/      \/           -
- *          B                         B
- *          |---|
- *        unitWidth = (heightSquares - 1) * square
- *
- *  The x, y, width, height passed in give the desired bounding box;
- *  x/width are adjusted to make the underline a integer number of units wide.
-*/
-static void drawErrorUnderline(QPainter *painter, qreal x, qreal y, qreal width, qreal height)
-{
-    const qreal heightSquares = 2.5;
-
-    qreal square = height / heightSquares;
-    qreal halfSquare = 0.5 * square;
-
-    qreal unitWidth = (heightSquares - 1.0) * square;
-    int widthUnits = static_cast<int>((width + 0.5 * unitWidth) / unitWidth);
-
-    x += 0.5 * (width - widthUnits * unitWidth);
-    width = widthUnits * unitWidth;
-
-    qreal bottom = y + height;
-    qreal top = y;
-
-    QPainterPath path;
-
-    // Bottom of squiggle.
-    path.moveTo(x - halfSquare, top + halfSquare); // A
-
-    int i = 0;
-    for (i = 0; i < widthUnits; i += 2) {
-        qreal middle = x + (i + 1) * unitWidth;
-        qreal right = x + (i + 2) * unitWidth;
-
-        path.lineTo(middle, bottom); // B
-
-        if (i + 2 == widthUnits)
-            path.lineTo(right + halfSquare, top + halfSquare); // D
-        else if (i + 1 != widthUnits)
-            path.lineTo(right, top + square); // C
-    }
-
-    // Top of squiggle.
-    for (i -= 2; i >= 0; i -= 2) {
-        qreal left = x + i * unitWidth;
-        qreal middle = x + (i + 1) * unitWidth;
-        qreal right = x + (i + 2) * unitWidth;
-
-        if (i + 1 == widthUnits)
-            path.lineTo(middle + halfSquare, bottom - halfSquare); // G
-        else {
-            if (i + 2 == widthUnits)
-                path.lineTo(right, top); // E
-
-            path.lineTo(middle, bottom - halfSquare); // F
-        }
-
-        path.lineTo(left, top); // H
-    }
-
-    painter->drawPath(path);
-}
-
-
-void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* painter = platformContext();
-    const QPen originalPen = painter->pen();
-
-    switch (style) {
-    case DocumentMarkerSpellingLineStyle:
-        painter->setPen(Qt::red);
-        break;
-    case DocumentMarkerGrammarLineStyle:
-        painter->setPen(Qt::green);
-        break;
-    default:
-        return;
-    }
-
-    drawErrorUnderline(painter, origin.x(), origin.y(), width, cMisspellingLineThickness);
-    painter->setPen(originalPen);
-}
-
-FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect, RoundingMode)
-{
-    // It is not enough just to round to pixels in device space. The rotation part of the
-    // affine transform matrix to device space can mess with this conversion if we have a
-    // rotating image like the hands of the world clock widget. We just need the scale, so
-    // we get the affine transform matrix and extract the scale.
-    QPainter* painter = platformContext();
-    QTransform deviceTransform = painter->deviceTransform();
-    if (deviceTransform.isIdentity())
-        return frect;
-
-    qreal deviceScaleX = sqrtf(deviceTransform.m11() * deviceTransform.m11() + deviceTransform.m12() * deviceTransform.m12());
-    qreal deviceScaleY = sqrtf(deviceTransform.m21() * deviceTransform.m21() + deviceTransform.m22() * deviceTransform.m22());
-
-    QPoint deviceOrigin(frect.x() * deviceScaleX, frect.y() * deviceScaleY);
-    QPoint deviceLowerRight(frect.maxX() * deviceScaleX, frect.maxY() * deviceScaleY);
-
-    // Don't let the height or width round to 0 unless either was originally 0
-    if (deviceOrigin.y() == deviceLowerRight.y() && frect.height())
-        deviceLowerRight.setY(deviceLowerRight.y() + 1);
-    if (deviceOrigin.x() == deviceLowerRight.x() && frect.width())
-        deviceLowerRight.setX(deviceLowerRight.x() + 1);
-
-    FloatPoint roundedOrigin = FloatPoint(deviceOrigin.x() / deviceScaleX, deviceOrigin.y() / deviceScaleY);
-    FloatPoint roundedLowerRight = FloatPoint(deviceLowerRight.x() / deviceScaleX, deviceLowerRight.y() / deviceScaleY);
-    return FloatRect(roundedOrigin, roundedLowerRight - roundedOrigin);
-}
-
-void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const Color& color, ColorSpace colorSpace)
-{
-    // Qt doesn't support shadows natively, they are drawn manually in the draw*
-    // functions
-    if (m_state.shadowsIgnoreTransforms) {
-        // Meaning that this graphics context is associated with a CanvasRenderingContext
-        // We flip the height since CG and HTML5 Canvas have opposite Y axis
-        m_state.shadowOffset = FloatSize(size.width(), -size.height());
-    }
-}
-
-void GraphicsContext::clearPlatformShadow()
-{
-}
-
-void GraphicsContext::pushTransparencyLayerInternal(const QRect &rect, qreal opacity, QPixmap& alphaMask)
-{
-    QPainter* p = m_data->p();
-
-    QTransform deviceTransform = p->transform();
-    QRect deviceClip = deviceTransform.mapRect(rect);
-
-    alphaMask = alphaMask.transformed(deviceTransform);
-    if (alphaMask.width() != deviceClip.width() || alphaMask.height() != deviceClip.height())
-        alphaMask = alphaMask.scaled(deviceClip.width(), deviceClip.height());
-
-    m_data->layers.push(new TransparencyLayer(p, deviceClip, 1.0, alphaMask));
-}
-
-void GraphicsContext::beginPlatformTransparencyLayer(float opacity)
-{
-    if (paintingDisabled())
-        return;
-
-    int x, y, w, h;
-    x = y = 0;
-    QPainter* p = m_data->p();
-    const QPaintDevice* device = p->device();
-    w = device->width();
-    h = device->height();
-
-    if (p->hasClipping()) {
-        QRectF clip = m_data->clipBoundingRect();
-        QRectF deviceClip = p->transform().mapRect(clip);
-        x = int(qBound(qreal(0), deviceClip.x(), (qreal)w));
-        y = int(qBound(qreal(0), deviceClip.y(), (qreal)h));
-        w = int(qBound(qreal(0), deviceClip.width(), (qreal)w) + 2);
-        h = int(qBound(qreal(0), deviceClip.height(), (qreal)h) + 2);
-    }
-
-    QPixmap emptyAlphaMask;
-    m_data->layers.push(new TransparencyLayer(p, QRect(x, y, w, h), opacity, emptyAlphaMask));
-    ++m_data->layerCount;
-}
-
-void GraphicsContext::endPlatformTransparencyLayer()
-{
-    if (paintingDisabled())
-        return;
-
-    TransparencyLayer* layer = m_data->layers.pop();
-    if (!layer->alphaMask.isNull()) {
-        layer->painter.resetTransform();
-        layer->painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
-        layer->painter.drawPixmap(QPoint(), layer->alphaMask);
-    } else
-        --m_data->layerCount; // see the comment for layerCount
-    layer->painter.end();
-
-    QPainter* p = m_data->p();
-    p->save();
-    p->resetTransform();
-    p->setOpacity(layer->opacity);
-    p->drawPixmap(layer->offset, layer->pixmap);
-    p->restore();
-
-    delete layer;
-}
-
-bool GraphicsContext::supportsTransparencyLayers()
-{
-    return true;
-}
-
-void GraphicsContext::clearRect(const FloatRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QPainter::CompositionMode currentCompositionMode = p->compositionMode();
-    p->setCompositionMode(QPainter::CompositionMode_Source);
-    p->fillRect(rect, Qt::transparent);
-    p->setCompositionMode(currentCompositionMode);
-}
-
-void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth)
-{
-    if (paintingDisabled())
-        return;
-
-    Path path;
-    path.addRect(rect);
-
-    float previousStrokeThickness = strokeThickness();
-
-    if (lineWidth != previousStrokeThickness)
-        setStrokeThickness(lineWidth);
-
-    strokePath(path);
-
-    if (lineWidth != previousStrokeThickness)
-        setStrokeThickness(previousStrokeThickness);
-}
-
-void GraphicsContext::setLineCap(LineCap lc)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QPen nPen = p->pen();
-    nPen.setCapStyle(toQtLineCap(lc));
-    p->setPen(nPen);
-}
-
-void GraphicsContext::setLineDash(const DashArray& dashes, float dashOffset)
-{
-    QPainter* p = m_data->p();
-    QPen pen = p->pen();
-    unsigned dashLength = dashes.size();
-    if (dashLength) {
-        QVector<qreal> pattern;
-        unsigned count = dashLength;
-        if (dashLength % 2)
-            count *= 2;
-
-        float penWidth = narrowPrecisionToFloat(double(pen.widthF()));
-        if (penWidth <= 0.f)
-            penWidth = 1.f;
-
-        for (unsigned i = 0; i < count; i++)
-            pattern.append(dashes[i % dashLength] / penWidth);
-
-        pen.setDashPattern(pattern);
-        pen.setDashOffset(dashOffset / penWidth);
-    } else
-        pen.setStyle(Qt::SolidLine);
-    p->setPen(pen);
-}
-
-void GraphicsContext::setLineJoin(LineJoin lj)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QPen nPen = p->pen();
-    nPen.setJoinStyle(toQtLineJoin(lj));
-    p->setPen(nPen);
-}
-
-void GraphicsContext::setMiterLimit(float limit)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QPen nPen = p->pen();
-    nPen.setMiterLimit(limit);
-    p->setPen(nPen);
-}
-
-void GraphicsContext::setAlpha(float opacity)
-{
-    if (paintingDisabled())
-        return;
-    QPainter* p = m_data->p();
-    p->setOpacity(opacity);
-}
-
-void GraphicsContext::setPlatformCompositeOperation(CompositeOperator op, BlendMode blendMode)
-{
-    if (paintingDisabled())
-        return;
-
-    ASSERT(op == WebCore::CompositeSourceOver || blendMode == WebCore::BlendModeNormal);
-
-    if (op == WebCore::CompositeSourceOver)
-        m_data->p()->setCompositionMode(toQtCompositionMode(blendMode));
-    else
-        m_data->p()->setCompositionMode(toQtCompositionMode(op));
-}
-
-void GraphicsContext::clip(const Path& path, WindRule windRule)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainterPath clipPath = path.platformPath();
-    clipPath.setFillRule(toQtFillRule(windRule));
-    m_data->p()->setClipPath(clipPath, Qt::IntersectClip);
-}
-
-void GraphicsContext::canvasClip(const Path& path, WindRule windRule)
-{
-    clip(path, windRule);
-}
-
-void GraphicsContext::clipOut(const Path& path)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QPainterPath clippedOut = path.platformPath();
-    QPainterPath newClip;
-    newClip.setFillRule(Qt::OddEvenFill);
-    if (p->hasClipping()) {
-        newClip.addRect(m_data->clipBoundingRect());
-        newClip.addPath(clippedOut);
-        p->setClipPath(newClip, Qt::IntersectClip);
-    } else {
-        QRect windowRect = p->transform().inverted().mapRect(p->window());
-        newClip.addRect(windowRect);
-        newClip.addPath(clippedOut.intersected(newClip));
-        p->setClipPath(newClip);
-    }
-}
-
-void GraphicsContext::translate(float x, float y)
-{
-    if (paintingDisabled())
-        return;
-
-    m_data->p()->translate(x, y);
-}
-
-void GraphicsContext::rotate(float radians)
-{
-    if (paintingDisabled())
-        return;
-
-    QTransform rotation = QTransform().rotateRadians(radians);
-    m_data->p()->setTransform(rotation, true);
-}
-
-void GraphicsContext::scale(const FloatSize& s)
-{
-    if (paintingDisabled())
-        return;
-
-    m_data->p()->scale(s.width(), s.height());
-}
-
-void GraphicsContext::clipOut(const IntRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    QPainter* p = m_data->p();
-    QPainterPath newClip;
-    newClip.setFillRule(Qt::OddEvenFill);
-    if (p->hasClipping()) {
-        newClip.addRect(m_data->clipBoundingRect());
-        newClip.addRect(QRect(rect));
-        p->setClipPath(newClip, Qt::IntersectClip);
-    } else {
-        QRect clipOutRect(rect);
-        QRect window = p->transform().inverted().mapRect(p->window());
-        clipOutRect &= window;
-        newClip.addRect(window);
-        newClip.addRect(clipOutRect);
-        p->setClipPath(newClip);
-    }
-}
-
-void GraphicsContext::concatCTM(const AffineTransform& transform)
-{
-    if (paintingDisabled())
-        return;
-
-    m_data->p()->setWorldTransform(transform, true);
-}
-
-void GraphicsContext::setCTM(const AffineTransform& transform)
-{
-    if (paintingDisabled())
-        return;
-
-    m_data->p()->setWorldTransform(transform);
-}
-
-#if ENABLE(3D_RENDERING)
-TransformationMatrix GraphicsContext::get3DTransform() const
-{
-    if (paintingDisabled())
-        return TransformationMatrix();
-
-    return platformContext()->combinedTransform();
-}
-
-void GraphicsContext::concat3DTransform(const TransformationMatrix& transform)
-{
-    if (paintingDisabled())
-        return;
-
-    m_data->p()->setWorldTransform(transform, true);
-}
-
-void GraphicsContext::set3DTransform(const TransformationMatrix& transform)
-{
-    if (paintingDisabled())
-        return;
-
-    m_data->p()->setWorldTransform(transform, false);
-}
-#endif
-
-void GraphicsContext::setURLForRect(const URL&, const IntRect&)
-{
-    notImplemented();
-}
-
-void GraphicsContext::setPlatformStrokeColor(const Color& color, ColorSpace colorSpace)
-{
-    if (paintingDisabled() || !color.isValid())
-        return;
-
-    QPainter* p = m_data->p();
-    QPen newPen(p->pen());
-    m_data->solidColor.setColor(color);
-    newPen.setBrush(m_data->solidColor);
-    p->setPen(newPen);
-}
-
-void GraphicsContext::setPlatformStrokeStyle(StrokeStyle strokeStyle)
-{
-    if (paintingDisabled())
-        return;
-    QPainter* p = m_data->p();
-    QPen newPen(p->pen());
-    newPen.setStyle(toQPenStyle(strokeStyle));
-    p->setPen(newPen);
-}
-
-void GraphicsContext::setPlatformStrokeThickness(float thickness)
-{
-    if (paintingDisabled())
-        return;
-    QPainter* p = m_data->p();
-    QPen newPen(p->pen());
-    newPen.setWidthF(thickness);
-    p->setPen(newPen);
-}
-
-void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorSpace)
-{
-    if (paintingDisabled() || !color.isValid())
-        return;
-
-    m_data->solidColor.setColor(color);
-    m_data->p()->setBrush(m_data->solidColor);
-}
-
-void GraphicsContext::setPlatformShouldAntialias(bool enable)
-{
-    if (paintingDisabled())
-        return;
-    m_data->p()->setRenderHint(QPainter::Antialiasing, enable);
-}
-
-#if OS(WINDOWS)
-
-HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
-{
-    // painting through native HDC is only supported for plugin, where mayCreateBitmap is always true
-    Q_ASSERT(mayCreateBitmap);
-
-    if (dstRect.isEmpty())
-        return 0;
-
-    // Create a bitmap DC in which to draw.
-    BITMAPINFO bitmapInfo;
-    bitmapInfo.bmiHeader.biSize          = sizeof(BITMAPINFOHEADER);
-    bitmapInfo.bmiHeader.biWidth         = dstRect.width();
-    bitmapInfo.bmiHeader.biHeight        = dstRect.height();
-    bitmapInfo.bmiHeader.biPlanes        = 1;
-    bitmapInfo.bmiHeader.biBitCount      = 32;
-    bitmapInfo.bmiHeader.biCompression   = BI_RGB;
-    bitmapInfo.bmiHeader.biSizeImage     = 0;
-    bitmapInfo.bmiHeader.biXPelsPerMeter = 0;
-    bitmapInfo.bmiHeader.biYPelsPerMeter = 0;
-    bitmapInfo.bmiHeader.biClrUsed       = 0;
-    bitmapInfo.bmiHeader.biClrImportant  = 0;
-
-    void* pixels = 0;
-    HBITMAP bitmap = ::CreateDIBSection(0, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0);
-    if (!bitmap)
-        return 0;
-
-    HDC displayDC = ::GetDC(0);
-    HDC bitmapDC = ::CreateCompatibleDC(displayDC);
-    ::ReleaseDC(0, displayDC);
-
-    ::SelectObject(bitmapDC, bitmap);
-
-    // Fill our buffer with clear if we're going to alpha blend.
-    if (supportAlphaBlend) {
-        BITMAP bmpInfo;
-        GetObject(bitmap, sizeof(bmpInfo), &bmpInfo);
-        int bufferSize = bmpInfo.bmWidthBytes * bmpInfo.bmHeight;
-        memset(bmpInfo.bmBits, 0, bufferSize);
-    }
-
-#if !OS(WINCE)
-    // Make sure we can do world transforms.
-    SetGraphicsMode(bitmapDC, GM_ADVANCED);
-
-    // Apply a translation to our context so that the drawing done will be at (0,0) of the bitmap.
-    XFORM xform;
-    xform.eM11 = 1.0f;
-    xform.eM12 = 0.0f;
-    xform.eM21 = 0.0f;
-    xform.eM22 = 1.0f;
-    xform.eDx = -dstRect.x();
-    xform.eDy = -dstRect.y();
-    ::SetWorldTransform(bitmapDC, &xform);
-#endif
-
-    return bitmapDC;
-}
-
-void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
-{
-    // painting through native HDC is only supported for plugin, where mayCreateBitmap is always true
-    Q_ASSERT(mayCreateBitmap);
-
-    if (hdc) {
-
-        if (!dstRect.isEmpty()) {
-
-            HBITMAP bitmap = static_cast<HBITMAP>(GetCurrentObject(hdc, OBJ_BITMAP));
-            BITMAP info;
-            GetObject(bitmap, sizeof(info), &info);
-            ASSERT(info.bmBitsPixel == 32);
-
-            QPixmap pixmap = qt_pixmapFromWinHBITMAP(bitmap, supportAlphaBlend ? HBitmapPremultipliedAlpha : HBitmapNoAlpha);
-            m_data->p()->drawPixmap(dstRect, pixmap);
-
-            ::DeleteObject(bitmap);
-        }
-
-        ::DeleteDC(hdc);
-    }
-}
-#endif
-
-void GraphicsContext::setImageInterpolationQuality(InterpolationQuality quality)
-{
-    m_data->imageInterpolationQuality = quality;
-
-    switch (quality) {
-    case InterpolationNone:
-    case InterpolationLow:
-        // use nearest-neigbor
-        m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, false);
-        break;
-
-    case InterpolationMedium:
-    case InterpolationHigh:
-        // use the filter
-        m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, true);
-        break;
-
-    case InterpolationDefault:
-    default:
-        m_data->p()->setRenderHint(QPainter::SmoothPixmapTransform, m_data->initialSmoothPixmapTransformHint);
-        break;
-    };
-}
-
-InterpolationQuality GraphicsContext::imageInterpolationQuality() const
-{
-    return m_data->imageInterpolationQuality;
-}
-
-void GraphicsContext::takeOwnershipOfPlatformContext()
-{
-    m_data->takeOwnershipOfPlatformContext();
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/IconQt.cpp b/Source/WebCore/platform/graphics/qt/IconQt.cpp
deleted file mode 100644 (file)
index b6cc612..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.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 "Icon.h"
-
-#include "GraphicsContext.h"
-#include "IntRect.h"
-#include "NotImplemented.h"
-#include <QMimeDatabase>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-Icon::Icon()
-{
-}
-
-Icon::~Icon()
-{
-}
-
-// FIXME: Move the code to ChromeClient::iconForFiles().
-PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>& filenames)
-{
-    if (filenames.isEmpty())
-        return 0;
-
-    QMimeType mimeType = QMimeDatabase().mimeTypeForFile(filenames[0], QMimeDatabase::MatchExtension);
-
-    QString iconName = mimeType.iconName();
-    QString genericIconName = mimeType.genericIconName();
-
-    // We try to match one of three cases:
-    // 1. All the files have the same type.
-    // 2. All the files are of the same generic type.
-    // 3. The files are not even of the same generic type.
-    const int count = filenames.size();
-    for (int i = 1; i < count; ++i) {
-        mimeType = QMimeDatabase().mimeTypeForFile(filenames[i], QMimeDatabase::MatchExtension);
-        if (iconName != mimeType.iconName())
-            iconName.clear();
-        if (genericIconName != mimeType.genericIconName()) {
-            genericIconName.clear();
-            break;
-        }
-    }
-
-    // FIXME: By default, only X11 will support themed icons.
-    RefPtr<Icon> icon = adoptRef(new Icon);
-    if (!iconName.isEmpty())
-        icon->m_icon = QIcon::fromTheme(iconName, QIcon::fromTheme(genericIconName));
-    else if (!genericIconName.isEmpty())
-        icon->m_icon = QIcon::fromTheme(genericIconName);
-
-    if (icon->m_icon.isNull())
-        return 0;
-    return icon.release();
-}
-
-void Icon::paint(GraphicsContext* context, const IntRect& rect)
-{
-    if (m_icon.isNull())
-        return;
-
-    m_icon.paint(context->platformContext(), rect);
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h
deleted file mode 100644 (file)
index 9cf782b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2008 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "Image.h"
-
-#include <QPainter>
-#include <QPixmap>
-
-#include <wtf/OwnPtr.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class IntSize;
-
-class ImageBufferData {
-public:
-    ImageBufferData(const IntSize&);
-
-    QImage toQImage() const;
-
-    QPixmap m_pixmap;
-    OwnPtr<QPainter> m_painter;
-    RefPtr<Image> m_image;
-};
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
deleted file mode 100644 (file)
index 6b13a26..0000000
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2008 Holger Hans Peter Freyther
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "ImageBuffer.h"
-
-#include "GraphicsContext.h"
-#include "ImageData.h"
-#include "MIMETypeRegistry.h"
-#include "StillImageQt.h"
-#include "TransparencyLayer.h"
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
-
-#include <QBuffer>
-#include <QColor>
-#include <QImage>
-#include <QImageWriter>
-#include <QPainter>
-#include <QPixmap>
-#include <math.h>
-
-namespace WebCore {
-
-ImageBufferData::ImageBufferData(const IntSize& size)
-    : m_pixmap(size)
-{
-    if (m_pixmap.isNull())
-        return;
-
-    m_pixmap.fill(QColor(Qt::transparent));
-
-    QPainter* painter = new QPainter;
-    m_painter = adoptPtr(painter);
-
-    if (!painter->begin(&m_pixmap))
-        return;
-
-    // Since ImageBuffer is used mainly for Canvas, explicitly initialize
-    // its painter's pen and brush with the corresponding canvas defaults
-    // NOTE: keep in sync with CanvasRenderingContext2D::State
-    QPen pen = painter->pen();
-    pen.setColor(Qt::black);
-    pen.setWidth(1);
-    pen.setCapStyle(Qt::FlatCap);
-    pen.setJoinStyle(Qt::SvgMiterJoin);
-    pen.setMiterLimit(10);
-    painter->setPen(pen);
-    QBrush brush = painter->brush();
-    brush.setColor(Qt::black);
-    painter->setBrush(brush);
-    painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
-    
-    m_image = StillImage::createForRendering(&m_pixmap);
-}
-
-QImage ImageBufferData::toQImage() const
-{
-    QPaintEngine* paintEngine = m_pixmap.paintEngine();
-    if (!paintEngine || paintEngine->type() != QPaintEngine::Raster)
-        return m_pixmap.toImage();
-
-    // QRasterPixmapData::toImage() will deep-copy the backing QImage if there's an active QPainter on it.
-    // For performance reasons, we don't want that here, so we temporarily redirect the paint engine.
-    QPaintDevice* currentPaintDevice = paintEngine->paintDevice();
-    paintEngine->setPaintDevice(0);
-    QImage image = m_pixmap.toImage();
-    paintEngine->setPaintDevice(currentPaintDevice);
-    return image;
-}
-
-ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode, bool& success)
-    : m_data(size)
-    , m_size(size)
-    , m_logicalSize(size)
-{
-    success = m_data.m_painter && m_data.m_painter->isActive();
-    if (!success)
-        return;
-
-    m_context = adoptPtr(new GraphicsContext(m_data.m_painter.get()));
-}
-
-ImageBuffer::~ImageBuffer()
-{
-}
-
-GraphicsContext* ImageBuffer::context() const
-{
-    ASSERT(m_data.m_painter->isActive());
-
-    return m_context.get();
-}
-
-PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
-{
-    if (copyBehavior == CopyBackingStore)
-        return StillImage::create(m_data.m_pixmap);
-
-    return StillImage::createForRendering(&m_data.m_pixmap);
-}
-
-BackingStoreCopy ImageBuffer::fastCopyImageMode()
-{
-    return DontCopyBackingStore;
-}
-
-void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
-    CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
-{
-    if (destContext == context()) {
-        // We're drawing into our own buffer.  In order for this to work, we need to copy the source buffer first.
-        RefPtr<Image> copy = copyImage(CopyBackingStore);
-        destContext->drawImage(copy.get(), ColorSpaceDeviceRGB, destRect, srcRect, op, blendMode, ImageOrientationDescription(), useLowQualityScale);
-    } else
-        destContext->drawImage(m_data.m_image.get(), styleColorSpace, destRect, srcRect, op, blendMode, ImageOrientationDescription(), useLowQualityScale);
-}
-
-void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
-                              const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
-{
-    if (destContext == context()) {
-        // We're drawing into our own buffer.  In order for this to work, we need to copy the source buffer first.
-        RefPtr<Image> copy = copyImage(CopyBackingStore);
-        copy->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
-    } else
-        m_data.m_image->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
-}
-
-void ImageBuffer::clip(GraphicsContext* context, const FloatRect& floatRect) const
-{
-    QPixmap* nativeImage = m_data.m_image->nativeImageForCurrentFrame();
-    if (!nativeImage)
-        return;
-
-    IntRect rect = enclosingIntRect(floatRect);
-    QPixmap alphaMask = *nativeImage;
-
-    context->pushTransparencyLayerInternal(rect, 1.0, alphaMask);
-}
-
-void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
-{
-    bool isPainting = m_data.m_painter->isActive();
-    if (isPainting)
-        m_data.m_painter->end();
-
-    QImage image = m_data.toQImage().convertToFormat(QImage::Format_ARGB32);
-    ASSERT(!image.isNull());
-
-    uchar* bits = image.bits();
-    const int bytesPerLine = image.bytesPerLine();
-
-    for (int y = 0; y < m_size.height(); ++y) {
-        quint32* scanLine = reinterpret_cast_ptr<quint32*>(bits + y * bytesPerLine);
-        for (int x = 0; x < m_size.width(); ++x) {
-            QRgb& pixel = scanLine[x];
-            pixel = qRgba(lookUpTable[qRed(pixel)],
-                          lookUpTable[qGreen(pixel)],
-                          lookUpTable[qBlue(pixel)],
-                          qAlpha(pixel));
-        }
-    }
-
-    m_data.m_pixmap = QPixmap::fromImage(image);
-
-    if (isPainting)
-        m_data.m_painter->begin(&m_data.m_pixmap);
-}
-
-static inline void copyColorToRGBA(Color& from, uchar* to)
-{
-    // Copy from endian dependent 32bit ARGB to endian independent RGBA8888.
-    to[0] = from.red();
-    to[1] = from.green();
-    to[2] = from.blue();
-    to[3] = from.alpha();
-}
-
-static inline void copyRGBAToColor(const uchar* from, Color& to)
-{
-    // Copy from endian independent RGBA8888 to endian dependent 32bit ARGB.
-    to = Color::createUnchecked(from[0], from[1], from[2], from[3]);
-}
-
-template <Multiply multiplied>
-PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const ImageBufferData& imageData, const IntSize& size)
-{
-    float area = 4.0f * rect.width() * rect.height();
-    if (area > static_cast<float>(std::numeric_limits<int>::max()))
-        return 0;
-
-    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
-    uchar* resultData = result->data();
-
-    if (rect.x() < 0 || rect.y() < 0 || rect.maxX() > size.width() || rect.maxY() > size.height())
-        result->zeroFill();
-
-    int originx = rect.x();
-    int destx = 0;
-    if (originx < 0) {
-        destx = -originx;
-        originx = 0;
-    }
-    int endx = rect.maxX();
-    if (endx > size.width())
-        endx = size.width();
-    int numColumns = endx - originx;
-
-    int originy = rect.y();
-    int desty = 0;
-    if (originy < 0) {
-        desty = -originy;
-        originy = 0;
-    }
-    int endy = rect.maxY();
-    if (endy > size.height())
-        endy = size.height();
-    int numRows = endy - originy;
-
-    const unsigned destBytesPerRow = 4 * rect.width();
-
-    // NOTE: For unmultiplied data, we undo the premultiplication below.
-    QImage image = imageData.toQImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
-
-    ASSERT(!image.isNull());
-
-    // The Canvas 2D Context expects RGBA order, while Qt uses 32bit QRgb (ARGB/BGRA).
-    for (int y = 0; y < numRows; ++y) {
-        // This cast and the calls below relies on both QRgb and WebCore::RGBA32 being 32bit ARGB.
-        const unsigned* srcRow = reinterpret_cast<const unsigned*>(image.constScanLine(originy + y)) + originx;
-        uchar* destRow = resultData + (desty + y) * destBytesPerRow + destx * 4;
-        for (int x = 0; x < numColumns; x++, srcRow++, destRow += 4) {
-            Color pixelColor;
-            if (multiplied == Unmultiplied)
-                pixelColor = colorFromPremultipliedARGB(*srcRow);
-            else
-                pixelColor = Color(*srcRow);
-            copyColorToRGBA(pixelColor, destRow);
-        }
-    }
-
-    return result.release();
-}
-
-PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
-{
-    return getImageData<Unmultiplied>(rect, m_data, m_size);
-}
-
-PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
-{
-    return getImageData<Premultiplied>(rect, m_data, m_size);
-}
-
-void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
-{
-    ASSERT(sourceRect.width() > 0);
-    ASSERT(sourceRect.height() > 0);
-
-    int originx = sourceRect.x();
-    int destx = destPoint.x() + sourceRect.x();
-    ASSERT(destx >= 0);
-    ASSERT(destx < m_size.width());
-    ASSERT(originx >= 0);
-    ASSERT(originx <= sourceRect.maxX());
-
-    int endx = destPoint.x() + sourceRect.maxX();
-    ASSERT(endx <= m_size.width());
-
-    int numColumns = endx - destx;
-
-    int originy = sourceRect.y();
-    int desty = destPoint.y() + sourceRect.y();
-    ASSERT(desty >= 0);
-    ASSERT(desty < m_size.height());
-    ASSERT(originy >= 0);
-    ASSERT(originy <= sourceRect.maxY());
-
-    int endy = destPoint.y() + sourceRect.maxY();
-    ASSERT(endy <= m_size.height());
-    int numRows = endy - desty;
-
-    const unsigned srcBytesPerRow = 4 * sourceSize.width();
-
-    // NOTE: For unmultiplied input data, we do the premultiplication below.
-    QImage image(numColumns, numRows, QImage::Format_ARGB32_Premultiplied);
-
-    unsigned* destData = reinterpret_cast<unsigned*>(image.bits());
-    const uchar* srcData = source->data();
-
-    for (int y = 0; y < numRows; ++y) {
-        const uchar* srcRow = srcData + (originy + y) * srcBytesPerRow + originx * 4;
-        // This cast and the calls below relies on both QRgb and WebCore::RGBA32 being 32bit ARGB.
-        unsigned* destRow = destData + y * numColumns;
-        for (int x = 0; x < numColumns; x++, srcRow += 4, destRow++) {
-            Color pixelColor;
-            copyRGBAToColor(srcRow, pixelColor);
-            if (multiplied == Unmultiplied)
-                *destRow = premultipliedARGBFromColor(pixelColor);
-            else
-                *destRow = pixelColor.rgb();
-        }
-    }
-
-    bool isPainting = m_data.m_painter->isActive();
-    if (!isPainting)
-        m_data.m_painter->begin(&m_data.m_pixmap);
-    else {
-        m_data.m_painter->save();
-
-        // putImageData() should be unaffected by painter state
-        m_data.m_painter->resetTransform();
-        m_data.m_painter->setOpacity(1.0);
-        m_data.m_painter->setClipping(false);
-    }
-
-    m_data.m_painter->setCompositionMode(QPainter::CompositionMode_Source);
-    m_data.m_painter->drawImage(destx, desty, image);
-
-    if (!isPainting)
-        m_data.m_painter->end();
-    else
-        m_data.m_painter->restore();
-}
-
-static bool encodeImage(const QPixmap& pixmap, const String& format, const double* quality, QByteArray& data)
-{
-    int compressionQuality = 100;
-    if (quality && *quality >= 0.0 && *quality <= 1.0)
-        compressionQuality = static_cast<int>(*quality * 100 + 0.5);
-
-    QBuffer buffer(&data);
-    buffer.open(QBuffer::WriteOnly);
-    bool success = pixmap.save(&buffer, format.utf8().data(), compressionQuality);
-    buffer.close();
-
-    return success;
-}
-
-String ImageBuffer::toDataURL(const String& mimeType, const double* quality, CoordinateSystem) const
-{
-    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
-
-    // QImageWriter does not support mimetypes. It does support Qt image formats (png,
-    // gif, jpeg..., xpm) so skip the image/ to get the Qt image format used to encode
-    // the m_pixmap image.
-
-    QByteArray data;
-    if (!encodeImage(m_data.m_pixmap, mimeType.substring(sizeof "image"), quality, data))
-        return "data:,";
-
-    return "data:" + mimeType + ";base64," + data.toBase64().data();
-}
-
-}
diff --git a/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
deleted file mode 100644 (file)
index a3f4465..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright (C) 2006 Friedemann Kleint <fkleint@trolltech.com>
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ImageDecoderQt.h"
-
-#include <QtCore/QBuffer>
-#include <QtCore/QByteArray>
-#include <QtGui/QImageReader>
-
-namespace WebCore {
-
-ImageDecoderQt::ImageDecoderQt(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption)
-    , m_repetitionCount(cAnimationNone)
-{
-}
-
-ImageDecoderQt::~ImageDecoderQt()
-{
-}
-
-void ImageDecoderQt::setData(SharedBuffer* data, bool allDataReceived)
-{
-    if (failed())
-        return;
-
-    // No progressive loading possible
-    if (!allDataReceived)
-        return;
-
-    // Cache our own new data.
-    ImageDecoder::setData(data, allDataReceived);
-
-    // We expect to be only called once with allDataReceived
-    ASSERT(!m_buffer);
-    ASSERT(!m_reader);
-
-    // Attempt to load the data
-    QByteArray imageData = QByteArray::fromRawData(m_data->data(), m_data->size());
-    m_buffer = adoptPtr(new QBuffer);
-    m_buffer->setData(imageData);
-    m_buffer->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
-    m_reader = adoptPtr(new QImageReader(m_buffer.get(), m_format));
-
-    // This will force the JPEG decoder to use JDCT_IFAST
-    m_reader->setQuality(49);
-
-    // QImageReader only allows retrieving the format before reading the image
-    m_format = m_reader->format();
-}
-
-bool ImageDecoderQt::isSizeAvailable()
-{
-    if (!ImageDecoder::isSizeAvailable() && m_reader)
-        internalDecodeSize();
-
-    return ImageDecoder::isSizeAvailable();
-}
-
-size_t ImageDecoderQt::frameCount()
-{
-    if (m_frameBufferCache.isEmpty() && m_reader) {
-        if (m_reader->supportsAnimation()) {
-            int imageCount = m_reader->imageCount();
-
-            // Fixup for Qt decoders... imageCount() is wrong
-            // and jumpToNextImage does not work either... so
-            // we will have to parse everything...
-            if (!imageCount)
-                forceLoadEverything();
-            else {
-                m_frameBufferCache.resize(imageCount);
-                for (size_t i = 0; i < m_frameBufferCache.size(); ++i)
-                    m_frameBufferCache[i].setPremultiplyAlpha(m_premultiplyAlpha);
-            }
-        } else {
-            m_frameBufferCache.resize(1);
-            m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha);
-        }
-    }
-
-    return m_frameBufferCache.size();
-}
-
-int ImageDecoderQt::repetitionCount() const
-{
-    if (m_reader && m_reader->supportsAnimation())
-        m_repetitionCount = m_reader->loopCount();
-    return m_repetitionCount;
-}
-
-String ImageDecoderQt::filenameExtension() const
-{
-    return String(m_format.constData(), m_format.length());
-}
-
-ImageFrame* ImageDecoderQt::frameBufferAtIndex(size_t index)
-{
-    // In case the ImageDecoderQt got recreated we don't know
-    // yet how many images we are going to have and need to
-    // find that out now.
-    size_t count = m_frameBufferCache.size();
-    if (!failed() && !count) {
-        internalDecodeSize();
-        count = frameCount();
-    }
-
-    if (index >= count)
-        return 0;
-
-    ImageFrame& frame = m_frameBufferCache[index];
-    if (frame.status() != ImageFrame::FrameComplete && m_reader)
-        internalReadImage(index);
-    return &frame;
-}
-
-void ImageDecoderQt::clearFrameBufferCache(size_t /*index*/)
-{
-}
-
-void ImageDecoderQt::internalDecodeSize()
-{
-    ASSERT(m_reader);
-
-    // If we have a QSize() something failed
-    QSize size = m_reader->size();
-    if (size.isEmpty()) {
-        setFailed();
-        return clearPointers();
-    }
-
-    setSize(size.width(), size.height());
-
-    // We don't need the tables set by prepareScaleDataIfNecessary,
-    // but their dimensions are used by ImageDecoder::scaledSize().
-    prepareScaleDataIfNecessary();
-    if (m_scaled)
-        m_reader->setScaledSize(scaledSize());
-}
-
-void ImageDecoderQt::internalReadImage(size_t frameIndex)
-{
-    ASSERT(m_reader);
-
-    if (m_reader->supportsAnimation())
-        m_reader->jumpToImage(frameIndex);
-    else if (frameIndex) {
-        setFailed();
-        return clearPointers();
-    }
-
-    if (!internalHandleCurrentImage(frameIndex))
-      setFailed();
-
-    // Attempt to return some memory
-    for (int i = 0; i < m_frameBufferCache.size(); ++i) {
-        if (m_frameBufferCache[i].status() != ImageFrame::FrameComplete)
-            return;
-    }
-
-    clearPointers();
-}
-
-bool ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex)
-{
-    ImageFrame* const buffer = &m_frameBufferCache[frameIndex];
-    QSize imageSize = m_reader->scaledSize();
-    if (imageSize.isEmpty())
-        imageSize = m_reader->size();
-
-    if (!buffer->setSize(imageSize.width(), imageSize.height()))
-        return false;
-
-    QImage image(reinterpret_cast<uchar*>(buffer->getAddr(0, 0)), imageSize.width(), imageSize.height(), sizeof(ImageFrame::PixelData) * imageSize.width(), m_reader->imageFormat());
-
-    buffer->setDuration(m_reader->nextImageDelay());
-    m_reader->read(&image);
-
-    // ImageFrame expects ARGB32.
-    if (buffer->premultiplyAlpha()) {
-        if (image.format() != QImage::Format_ARGB32_Premultiplied)
-            image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
-    } else {
-        if (image.format() != QImage::Format_ARGB32)
-            image = image.convertToFormat(QImage::Format_ARGB32);
-    }
-
-    if (reinterpret_cast<const uchar*>(image.constBits()) != reinterpret_cast<const uchar*>(buffer->getAddr(0, 0))) {
-        // The in-buffer was replaced during decoding with another, so copy into it manually.
-        memcpy(buffer->getAddr(0, 0), image.constBits(),  image.byteCount());
-    }
-
-    if (image.isNull()) {
-        frameCount();
-        repetitionCount();
-        clearPointers();
-        return false;
-    }
-
-    buffer->setOriginalFrameRect(image.rect());
-    buffer->setHasAlpha(image.hasAlphaChannel());
-    buffer->setStatus(ImageFrame::FrameComplete);
-
-    return true;
-}
-
-// The QImageIOHandler is not able to tell us how many frames
-// we have and we need to parse every image. We do this by
-// increasing the m_frameBufferCache by one and try to parse
-// the image. We stop when QImage::read fails and then need
-// to resize the m_frameBufferCache to the final size and update
-// the failed bit. If we failed to decode the first image
-// then we truly failed to decode, otherwise we're OK.
-
-// TODO: Do not increment the m_frameBufferCache.size() by one but more than one
-void ImageDecoderQt::forceLoadEverything()
-{
-    int imageCount = 0;
-
-    do {
-        m_frameBufferCache.resize(++imageCount);
-    } while (internalHandleCurrentImage(imageCount - 1));
-
-    // If we failed decoding the first image we actually
-    // have no images and need to set the failed bit.
-    // Otherwise, we want to forget about
-    // the last attempt to decode a image.
-    m_frameBufferCache.resize(imageCount - 1);
-    for (size_t i = 0; i < m_frameBufferCache.size(); ++i)
-        m_frameBufferCache[i].setPremultiplyAlpha(m_premultiplyAlpha);
-    if (imageCount == 1)
-      setFailed();
-}
-
-void ImageDecoderQt::clearPointers()
-{
-    m_reader.clear();
-    m_buffer.clear();
-}
-
-PassNativeImagePtr ImageFrame::asNewNativeImage() const
-{
-    QImage::Format format;
-    if (m_hasAlpha)
-        format = m_premultiplyAlpha ?  QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32;
-    else
-        format = QImage::Format_RGB32;
-
-    QImage img(reinterpret_cast<uchar*>(m_bytes), m_size.width(), m_size.height(), sizeof(PixelData) * m_size.width(), format);
-
-    return new QPixmap(QPixmap::fromImage(img));
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/ImageDecoderQt.h b/Source/WebCore/platform/graphics/qt/ImageDecoderQt.h
deleted file mode 100644 (file)
index 8ae3b42..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2006 Friedemann Kleint <fkleint@trolltech.com>
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ImageDecoderQt_h
-#define ImageDecoderQt_h
-
-#include "ImageDecoder.h"
-#include <QtCore/QBuffer>
-#include <QtCore/QHash>
-#include <QtCore/QList>
-#include <QtGui/QImageReader>
-#include <QtGui/QPixmap>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
-
-namespace WebCore {
-
-
-class ImageDecoderQt : public ImageDecoder
-{
-public:
-    ImageDecoderQt(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
-    ~ImageDecoderQt();
-
-    virtual void setData(SharedBuffer* data, bool allDataReceived);
-    virtual bool isSizeAvailable();
-    virtual size_t frameCount();
-    virtual int repetitionCount() const;
-    virtual ImageFrame* frameBufferAtIndex(size_t index);
-
-    virtual String filenameExtension() const;
-
-    virtual void clearFrameBufferCache(size_t clearBeforeFrame);
-
-private:
-    ImageDecoderQt(const ImageDecoderQt&);
-    ImageDecoderQt &operator=(const ImageDecoderQt&);
-
-private:
-    void internalDecodeSize();
-    void internalReadImage(size_t);
-    bool internalHandleCurrentImage(size_t);
-    void forceLoadEverything();
-    void clearPointers();
-
-private:
-    QByteArray m_format;
-    OwnPtr<QBuffer> m_buffer;
-    OwnPtr<QImageReader> m_reader;
-    mutable int m_repetitionCount;
-};
-
-
-
-}
-
-#endif
-
diff --git a/Source/WebCore/platform/graphics/qt/ImageQt.cpp b/Source/WebCore/platform/graphics/qt/ImageQt.cpp
deleted file mode 100644 (file)
index ac47fcb..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
- * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
- * Copyright (C) 2010 Sencha, Inc.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Image.h"
-
-#include "AffineTransform.h"
-#include "BitmapImage.h"
-#include "FloatRect.h"
-#include "GraphicsContext.h"
-#include "ImageObserver.h"
-#include "ShadowBlur.h"
-#include "StillImageQt.h"
-#include <wtf/text/WTFString.h>
-
-#include <QCoreApplication>
-#include <QImage>
-#include <QImageReader>
-#include <QPainter>
-#include <QPixmap>
-#include <QPixmapCache>
-#include <QTransform>
-#include <private/qhexstring_p.h>
-
-#include <math.h>
-
-#if OS(WINDOWS)
-QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP, int hbitmapFormat = 0);
-QT_END_NAMESPACE
-#endif
-
-typedef QHash<QByteArray, QPixmap> WebGraphicHash;
-Q_GLOBAL_STATIC(WebGraphicHash, _graphics)
-
-static void earlyClearGraphics()
-{
-    _graphics()->clear();
-}
-
-static WebGraphicHash* graphics()
-{
-    WebGraphicHash* hash = _graphics();
-
-    if (hash->isEmpty()) {
-
-        // prevent ~QPixmap running after ~QApplication (leaks native pixmaps)
-        qAddPostRoutine(earlyClearGraphics);
-
-        // QWebSettings::MissingImageGraphic
-        hash->insert("missingImage", QPixmap(QLatin1String(":webkit/resources/missingImage.png")));
-        // QWebSettings::MissingPluginGraphic
-        hash->insert("nullPlugin", QPixmap(QLatin1String(":webkit/resources/nullPlugin.png")));
-        // QWebSettings::DefaultFrameIconGraphic
-        hash->insert("urlIcon", QPixmap(QLatin1String(":webkit/resources/urlIcon.png")));
-        // QWebSettings::TextAreaSizeGripCornerGraphic
-        hash->insert("textAreaResizeCorner", QPixmap(QLatin1String(":webkit/resources/textAreaResizeCorner.png")));
-        // QWebSettings::DeleteButtonGraphic
-        hash->insert("deleteButton", QPixmap(QLatin1String(":webkit/resources/deleteButton.png")));
-        // QWebSettings::InputSpeechButtonGraphic
-        hash->insert("inputSpeech", QPixmap(QLatin1String(":webkit/resources/inputSpeech.png")));
-    }
-
-    return hash;
-}
-
-// This function loads resources into WebKit
-static QPixmap loadResourcePixmap(const char *name)
-{
-    return graphics()->value(name);
-}
-
-namespace WebCore {
-
-bool FrameData::clear(bool clearMetadata)
-{
-    if (clearMetadata)
-        m_haveMetadata = false;
-
-    if (m_frame) {
-        delete m_frame;
-        m_frame = 0;
-        return true;
-    }
-    return false;
-}
-
-
-// ================================================
-// Image Class
-// ================================================
-
-PassRefPtr<Image> Image::loadPlatformResource(const char* name)
-{
-    return StillImage::create(loadResourcePixmap(name));
-}
-
-void Image::setPlatformResource(const char* name, const QPixmap& pixmap)
-{
-    WebGraphicHash* h = graphics();
-    if (pixmap.isNull())
-        h->remove(name);
-    else
-        h->insert(name, pixmap);
-}
-
-void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, ColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode)
-{
-    QPixmap* framePixmap = nativeImageForCurrentFrame();
-    if (!framePixmap) // If it's too early we won't have an image yet.
-        return;
-
-#if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
-    FloatRect tileRectAdjusted = adjustSourceRectForDownSampling(tileRect, framePixmap->size());
-#else
-    FloatRect tileRectAdjusted = tileRect;
-#endif
-
-    // Qt interprets 0 width/height as full width/height so just short circuit.
-    QRectF dr = QRectF(destRect).normalized();
-    QRect tr = QRectF(tileRectAdjusted).toRect().normalized();
-    if (!dr.width() || !dr.height() || !tr.width() || !tr.height())
-        return;
-
-    QPixmap pixmap = *framePixmap;
-    if (tr.x() || tr.y() || tr.width() != pixmap.width() || tr.height() != pixmap.height())
-        pixmap = pixmap.copy(tr);
-
-    CompositeOperator previousOperator = ctxt->compositeOperation();
-
-    ctxt->setCompositeOperation(!pixmap.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op);
-
-    QPainter* p = ctxt->platformContext();
-    QTransform transform(patternTransform);
-
-    // If this would draw more than one scaled tile, we scale the pixmap first and then use the result to draw.
-    if (transform.type() == QTransform::TxScale) {
-        QRectF tileRectInTargetCoords = (transform * QTransform().translate(phase.x(), phase.y())).mapRect(tr);
-
-        bool tileWillBePaintedOnlyOnce = tileRectInTargetCoords.contains(dr);
-        if (!tileWillBePaintedOnlyOnce) {
-            QSizeF scaledSize(float(pixmap.width()) * transform.m11(), float(pixmap.height()) * transform.m22());
-            QPixmap scaledPixmap(scaledSize.toSize());
-            if (pixmap.hasAlpha())
-                scaledPixmap.fill(Qt::transparent);
-            {
-                QPainter painter(&scaledPixmap);
-                painter.setCompositionMode(QPainter::CompositionMode_Source);
-                painter.setRenderHints(p->renderHints());
-                painter.drawPixmap(QRect(0, 0, scaledPixmap.width(), scaledPixmap.height()), pixmap);
-            }
-            pixmap = scaledPixmap;
-            transform = QTransform::fromTranslate(transform.dx(), transform.dy());
-        }
-    }
-
-    /* Translate the coordinates as phase is not in world matrix coordinate space but the tile rect origin is. */
-    transform *= QTransform().translate(phase.x(), phase.y());
-    transform.translate(tr.x(), tr.y());
-
-    QBrush b(pixmap);
-    b.setTransform(transform);
-    p->fillRect(dr, b);
-
-    ctxt->setCompositeOperation(previousOperator);
-
-    if (imageObserver())
-        imageObserver()->didDraw(this);
-}
-
-BitmapImage::BitmapImage(QPixmap* pixmap, ImageObserver* observer)
-    : Image(observer)
-    , m_currentFrame(0)
-    , m_frames(0)
-    , m_frameTimer(0)
-    , m_repetitionCount(cAnimationNone)
-    , m_repetitionCountStatus(Unknown)
-    , m_repetitionsComplete(0)
-    , m_decodedSize(0)
-    , m_frameCount(1)
-    , m_isSolidColor(false)
-    , m_checkedForSolidColor(false)
-    , m_animationFinished(true)
-    , m_allDataReceived(true)
-    , m_haveSize(true)
-    , m_sizeAvailable(true)
-    , m_haveFrameCount(true)
-{
-    int width = pixmap->width();
-    int height = pixmap->height();
-    m_decodedSize = width * height * 4;
-    m_size = IntSize(width, height);
-
-    m_frames.grow(1);
-    m_frames[0].m_frame = pixmap;
-    m_frames[0].m_hasAlpha = pixmap->hasAlpha();
-    m_frames[0].m_haveMetadata = true;
-    checkForSolidColor();
-}
-
-void BitmapImage::invalidatePlatformData()
-{
-}
-
-QPixmap* prescaleImageIfRequired(QPainter* painter, QPixmap* image, QPixmap* buffer, const QRectF& destRect, QRectF* srcRect)
-{
-    // The quality of down scaling at 0.5x and below in QPainter is not very good
-    // due to using bilinear sampling, so for high quality scaling we need to
-    // perform scaling ourselves.
-    ASSERT(image);
-    ASSERT(painter);
-    if (!(painter->renderHints() & QPainter::SmoothPixmapTransform))
-        return image;
-
-    QTransform transform = painter->combinedTransform();
-
-    // Prescaling transforms that does more than scale or translate is not supported.
-    if (transform.type() > QTransform::TxScale)
-        return image;
-
-    QRectF transformedDst = transform.mapRect(destRect);
-    // Only prescale if downscaling to 0.5x or less
-    if (transformedDst.width() * 2 > srcRect->width() && transformedDst.height() * 2 > srcRect->height())
-        return image;
-
-    // This may not work right with subpixel positions, but that can not currently happen.
-    QRect pixelSrc = srcRect->toRect();
-    QSize scaledSize = transformedDst.size().toSize();
-
-    QString key = QStringLiteral("qtwebkit_prescaled_")
-        % HexString<qint64>(image->cacheKey())
-        % HexString<int>(pixelSrc.x()) % HexString<int>(pixelSrc.y())
-        % HexString<int>(pixelSrc.width()) % HexString<int>(pixelSrc.height())
-        % HexString<int>(scaledSize.width()) % HexString<int>(scaledSize.height());
-
-    if (!QPixmapCache::find(key, buffer)) {
-        if (pixelSrc != image->rect())
-            *buffer = image->copy(pixelSrc).scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-        else
-            *buffer = image->scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-        QPixmapCache::insert(key, *buffer);
-    }
-
-    *srcRect = QRectF(QPointF(), buffer->size());
-    return buffer;
-}
-
-// Drawing Routines
-void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
-    const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
-{
-    QRectF normalizedDst = dst.normalized();
-    QRectF normalizedSrc = src.normalized();
-
-    startAnimation();
-
-    if (normalizedSrc.isEmpty() || normalizedDst.isEmpty())
-        return;
-
-    QPixmap* image = nativeImageForCurrentFrame();
-    if (!image)
-        return;
-
-    if (mayFillWithSolidColor()) {
-        fillWithSolidColor(ctxt, normalizedDst, solidColor(), styleColorSpace, op);
-        return;
-    }
-
-#if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
-    normalizedSrc = adjustSourceRectForDownSampling(normalizedSrc, image->size());
-#endif
-
-    QPixmap prescaledBuffer;
-    image = prescaleImageIfRequired(ctxt->platformContext(), image, &prescaledBuffer, normalizedDst, &normalizedSrc);
-
-    CompositeOperator previousOperator = ctxt->compositeOperation();
-    BlendMode previousBlendMode = ctxt->blendModeOperation();
-    ctxt->setCompositeOperation(!image->hasAlpha() && op == CompositeSourceOver && blendMode == BlendModeNormal ? CompositeCopy : op, blendMode);
-
-    if (ctxt->hasShadow()) {
-        ShadowBlur shadow(ctxt->state());
-        GraphicsContext* shadowContext = shadow.beginShadowLayer(ctxt, normalizedDst);
-        if (shadowContext) {
-            QPainter* shadowPainter = shadowContext->platformContext();
-            shadowPainter->drawPixmap(normalizedDst, *image, normalizedSrc);
-            shadow.endShadowLayer(ctxt);
-        }
-    }
-
-    ctxt->platformContext()->drawPixmap(normalizedDst, *image, normalizedSrc);
-
-    ctxt->setCompositeOperation(previousOperator, previousBlendMode);
-
-    if (imageObserver())
-        imageObserver()->didDraw(this);
-}
-
-void BitmapImage::checkForSolidColor()
-{
-    m_isSolidColor = false;
-    m_checkedForSolidColor = true;
-
-    if (frameCount() > 1)
-        return;
-
-    QPixmap* framePixmap = frameAtIndex(0);
-    if (!framePixmap || framePixmap->width() != 1 || framePixmap->height() != 1)
-        return;
-
-    m_isSolidColor = true;
-    m_solidColor = QColor::fromRgba(framePixmap->toImage().pixel(0, 0));
-}
-
-#if OS(WINDOWS)
-PassRefPtr<BitmapImage> BitmapImage::create(HBITMAP hBitmap)
-{
-    QPixmap* qPixmap = new QPixmap(qt_pixmapFromWinHBITMAP(hBitmap));
-
-    return BitmapImage::create(qPixmap);
-}
-#endif
-
-}
-
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/IntPointQt.cpp b/Source/WebCore/platform/graphics/qt/IntPointQt.cpp
deleted file mode 100644 (file)
index f9d336a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IntPoint.h"
-
-#include <QPoint>
-
-namespace WebCore {
-
-IntPoint::IntPoint(const QPoint& p)
-    : m_x(p.x())
-    , m_y(p.y())
-{
-}
-
-IntPoint::operator QPoint() const
-{
-    return QPoint(m_x, m_y);
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/IntRectQt.cpp b/Source/WebCore/platform/graphics/qt/IntRectQt.cpp
deleted file mode 100644 (file)
index ccc153e..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IntRect.h"
-
-#include <QRect>
-
-namespace WebCore {
-
-IntRect::IntRect(const QRect& r)
-    : m_location(r.topLeft())
-    , m_size(r.width(), r.height())
-{
-}
-
-IntRect::operator QRect() const
-{
-    return QRect(x(), y(), width(), height());
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/IntSizeQt.cpp b/Source/WebCore/platform/graphics/qt/IntSizeQt.cpp
deleted file mode 100644 (file)
index 4f2bf35..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include <QSize>
-
-#include "IntSize.h"
-
-namespace WebCore {
-
-IntSize::IntSize(const QSize& r)
-    : m_width(r.width())
-    , m_height(r.height())
-{
-}
-
-IntSize::operator QSize() const
-{
-    return QSize(width(), height());
-}
-
-}
-
-// vim: ts=4 sw=4 et
diff --git a/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
deleted file mode 100644 (file)
index 2c6eb54..0000000
+++ /dev/null
@@ -1,659 +0,0 @@
-/*
-    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
-
-    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 "MediaPlayerPrivateQt.h"
-
-#include "Frame.h"
-#include "FrameView.h"
-#include "GraphicsContext.h"
-#include "GraphicsLayer.h"
-#include "HTMLMediaElement.h"
-#include "HTMLVideoElement.h"
-#include "Logging.h"
-#include "NetworkingContext.h"
-#include "NotImplemented.h"
-#include "RenderVideo.h"
-#include "TimeRanges.h"
-#include "Widget.h"
-
-#include <QMediaPlayerControl>
-#include <QMediaService>
-#include <QNetworkAccessManager>
-#include <QNetworkCookie>
-#include <QNetworkCookieJar>
-#include <QNetworkRequest>
-#include <QPainter>
-#include <QPoint>
-#include <QRect>
-#include <QTime>
-#include <QTimer>
-#include <QUrl>
-#include <limits>
-#include <qmediametadata.h>
-#include <qmultimedia.h>
-#include <wtf/HashSet.h>
-#include <wtf/text/CString.h>
-
-#if USE(ACCELERATED_COMPOSITING)
-#include "texmap/TextureMapper.h"
-#endif
-
-using namespace WTF;
-
-namespace WebCore {
-
-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQt::create(MediaPlayer* player)
-{
-    return adoptPtr(new MediaPlayerPrivateQt(player));
-}
-
-void MediaPlayerPrivateQt::registerMediaEngine(MediaEngineRegistrar registrar)
-{
-    registrar(create, getSupportedTypes, supportsType, 0, 0, 0);
-}
-
-void MediaPlayerPrivateQt::getSupportedTypes(HashSet<String> &supported)
-{
-    QStringList types = QMediaPlayer::supportedMimeTypes();
-
-    for (int i = 0; i < types.size(); i++) {
-        QString mime = types.at(i);
-        if (mime.startsWith(QString::fromLatin1("audio/")) || mime.startsWith(QString::fromLatin1("video/")))
-            supported.add(mime);
-    }
-}
-
-MediaPlayer::SupportsType MediaPlayerPrivateQt::supportsType(const String& mime, const String& codec, const URL&)
-{
-    if (!mime.startsWith("audio/") && !mime.startsWith("video/"))
-        return MediaPlayer::IsNotSupported;
-
-    // Parse and trim codecs.
-    QString codecStr = codec;
-    QStringList codecList = codecStr.split(QLatin1Char(','), QString::SkipEmptyParts);
-    QStringList codecListTrimmed;
-    foreach (const QString& codecStrNotTrimmed, codecList) {
-        QString codecStrTrimmed = codecStrNotTrimmed.trimmed();
-        if (!codecStrTrimmed.isEmpty())
-            codecListTrimmed.append(codecStrTrimmed);
-    }
-
-    if (QMediaPlayer::hasSupport(mime, codecListTrimmed) >= QMultimedia::ProbablySupported)
-        return MediaPlayer::IsSupported;
-
-    return MediaPlayer::MayBeSupported;
-}
-
-MediaPlayerPrivateQt::MediaPlayerPrivateQt(MediaPlayer* player)
-    : m_webCorePlayer(player)
-    , m_mediaPlayer(new QMediaPlayer)
-    , m_mediaPlayerControl(0)
-    , m_networkState(MediaPlayer::Empty)
-    , m_readyState(MediaPlayer::HaveNothing)
-    , m_currentSize(0, 0)
-    , m_naturalSize(RenderVideo::defaultSize())
-    , m_isSeeking(false)
-    , m_composited(false)
-    , m_preload(MediaPlayer::Auto)
-    , m_bytesLoadedAtLastDidLoadingProgress(0)
-    , m_suppressNextPlaybackChanged(false)
-{
-    m_mediaPlayer->setVideoOutput(this);
-
-    // Signal Handlers
-    connect(m_mediaPlayer, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
-            this, SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus)));
-    connect(m_mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)),
-            this, SLOT(stateChanged(QMediaPlayer::State)));
-    connect(m_mediaPlayer, SIGNAL(error(QMediaPlayer::Error)),
-            this, SLOT(handleError(QMediaPlayer::Error)));
-    connect(m_mediaPlayer, SIGNAL(bufferStatusChanged(int)),
-            this, SLOT(bufferStatusChanged(int)));
-    connect(m_mediaPlayer, SIGNAL(durationChanged(qint64)),
-            this, SLOT(durationChanged(qint64)));
-    connect(m_mediaPlayer, SIGNAL(positionChanged(qint64)),
-            this, SLOT(positionChanged(qint64)));
-    connect(m_mediaPlayer, SIGNAL(volumeChanged(int)),
-            this, SLOT(volumeChanged(int)));
-    connect(m_mediaPlayer, SIGNAL(mutedChanged(bool)),
-            this, SLOT(mutedChanged(bool)));
-    connect(this, SIGNAL(surfaceFormatChanged(const QVideoSurfaceFormat&)),
-            this, SLOT(surfaceFormatChanged(const QVideoSurfaceFormat&)));
-
-    // Grab the player control
-    if (QMediaService* service = m_mediaPlayer->service()) {
-        m_mediaPlayerControl = qobject_cast<QMediaPlayerControl *>(
-                service->requestControl(QMediaPlayerControl_iid));
-    }
-}
-
-MediaPlayerPrivateQt::~MediaPlayerPrivateQt()
-{
-    m_mediaPlayer->disconnect(this);
-    m_mediaPlayer->stop();
-    m_mediaPlayer->setMedia(QMediaContent());
-
-    delete m_mediaPlayer;
-}
-
-bool MediaPlayerPrivateQt::hasVideo() const
-{
-    return m_mediaPlayer->isVideoAvailable();
-}
-
-bool MediaPlayerPrivateQt::hasAudio() const
-{
-    return true;
-}
-
-void MediaPlayerPrivateQt::load(const String& url)
-{
-    m_mediaUrl = url;
-
-    // QtMultimedia does not have an API to throttle loading
-    // so we handle this ourselves by delaying the load
-    if (m_preload == MediaPlayer::None) {
-        m_delayingLoad = true;
-        return;
-    }
-
-    commitLoad(url);
-}
-
-void MediaPlayerPrivateQt::commitLoad(const String& url)
-{
-    // We are now loading
-    if (m_networkState != MediaPlayer::Loading) {
-        m_networkState = MediaPlayer::Loading;
-        m_webCorePlayer->networkStateChanged();
-    }
-
-    // And we don't have any data yet
-    if (m_readyState != MediaPlayer::HaveNothing) {
-        m_readyState = MediaPlayer::HaveNothing;
-        m_webCorePlayer->readyStateChanged();
-    }
-
-    URL kUrl(ParsedURLString, url);
-    const QUrl rUrl = kUrl;
-    const QString scheme = rUrl.scheme().toLower();
-
-    // Construct the media content with a network request if the resource is http[s]
-    if (scheme == QString::fromLatin1("http") || scheme == QString::fromLatin1("https")) {
-        QNetworkRequest request = QNetworkRequest(rUrl);
-
-        // Grab the current document
-        Document* document = m_webCorePlayer->mediaPlayerClient()->mediaPlayerOwningDocument();
-
-        // Grab the frame and network manager
-        Frame* frame = document ? document->frame() : 0;
-        FrameLoader* frameLoader = frame ? &frame->loader() : 0;
-        QNetworkAccessManager* manager = frameLoader ? frameLoader->networkingContext()->networkAccessManager() : 0;
-
-        if (manager) {
-            // Set the cookies
-            QNetworkCookieJar* jar = manager->cookieJar();
-            QList<QNetworkCookie> cookies = jar->cookiesForUrl(rUrl);
-
-            // Don't set the header if there are no cookies.
-            // This prevents a warning from being emitted.
-            if (!cookies.isEmpty())
-                request.setHeader(QNetworkRequest::CookieHeader, QVariant::fromValue(cookies));
-
-            // Set the refferer, but not when requesting insecure content from a secure page
-            QUrl documentUrl = QUrl(QString(document->documentURI()));
-            if (documentUrl.scheme().toLower() == QString::fromLatin1("http") || scheme == QString::fromLatin1("https"))
-                request.setRawHeader("Referer", documentUrl.toEncoded());
-
-            // Set the user agent
-            request.setRawHeader("User-Agent", frameLoader->userAgent(rUrl).utf8().data());
-        }
-
-        m_mediaPlayer->setMedia(QMediaContent(request));
-    } else {
-        // Otherwise, just use the URL
-        m_mediaPlayer->setMedia(QMediaContent(rUrl));
-    }
-
-    // Set the current volume and mute status
-    // We get these from the element, rather than the player, in case we have
-    // transitioned from a media engine which doesn't support muting, to a media
-    // engine which does.
-    m_mediaPlayer->setMuted(m_webCorePlayer->muted());
-    m_mediaPlayer->setVolume(static_cast<int>(m_webCorePlayer->volume() * 100.0));
-
-    // Don't send PlaybackChanged notification for pre-roll.
-    m_suppressNextPlaybackChanged = true;
-
-    // Setting a media source will start loading the media, but we need
-    // to pre-roll as well to get video size-hints and buffer-status
-    if (m_webCorePlayer->paused())
-        m_mediaPlayer->pause();
-    else
-        m_mediaPlayer->play();
-}
-
-void MediaPlayerPrivateQt::resumeLoad()
-{
-    m_delayingLoad = false;
-
-    if (!m_mediaUrl.isNull())
-        commitLoad(m_mediaUrl);
-}
-
-void MediaPlayerPrivateQt::cancelLoad()
-{
-    m_mediaPlayer->setMedia(QMediaContent());
-    updateStates();
-}
-
-void MediaPlayerPrivateQt::prepareToPlay()
-{
-    if (m_mediaPlayer->media().isNull() || m_delayingLoad)
-        resumeLoad();
-}
-
-void MediaPlayerPrivateQt::play()
-{
-    if (m_mediaPlayer->state() != QMediaPlayer::PlayingState)
-        m_mediaPlayer->play();
-}
-
-void MediaPlayerPrivateQt::pause()
-{
-    if (m_mediaPlayer->state() == QMediaPlayer::PlayingState)
-        m_mediaPlayer->pause();
-}
-
-bool MediaPlayerPrivateQt::paused() const
-{
-    return (m_mediaPlayer->state() != QMediaPlayer::PlayingState);
-}
-
-void MediaPlayerPrivateQt::seek(float position)
-{
-    if (!m_mediaPlayer->isSeekable())
-        return;
-
-    if (m_mediaPlayerControl && !m_mediaPlayerControl->availablePlaybackRanges().contains(position * 1000))
-        return;
-
-    m_isSeeking = true;
-    m_mediaPlayer->setPosition(static_cast<qint64>(position * 1000));
-}
-
-bool MediaPlayerPrivateQt::seeking() const
-{
-    return m_isSeeking;
-}
-
-float MediaPlayerPrivateQt::duration() const
-{
-    if (m_readyState < MediaPlayer::HaveMetadata)
-        return 0.0f;
-
-    float duration = m_mediaPlayer->duration() / 1000.0f;
-
-    // We are streaming
-    if (duration <= 0.0f)
-        duration = std::numeric_limits<float>::infinity();
-
-    return duration;
-}
-
-float MediaPlayerPrivateQt::currentTime() const
-{
-    return m_mediaPlayer->position() / 1000.0f;
-}
-
-PassRefPtr<TimeRanges> MediaPlayerPrivateQt::buffered() const
-{
-    RefPtr<TimeRanges> buffered = TimeRanges::create();
-
-    if (!m_mediaPlayerControl)
-        return buffered;
-
-    QMediaTimeRange playbackRanges = m_mediaPlayerControl->availablePlaybackRanges();
-
-    foreach (const QMediaTimeInterval interval, playbackRanges.intervals()) {
-        float rangeMin = static_cast<float>(interval.start()) / 1000.0f;
-        float rangeMax = static_cast<float>(interval.end()) / 1000.0f;
-        buffered->add(rangeMin, rangeMax);
-    }
-
-    return buffered.release();
-}
-
-float MediaPlayerPrivateQt::maxTimeSeekable() const
-{
-    if (!m_mediaPlayerControl)
-        return 0;
-
-    return static_cast<float>(m_mediaPlayerControl->availablePlaybackRanges().latestTime()) / 1000.0f;
-}
-
-bool MediaPlayerPrivateQt::didLoadingProgress() const
-{
-    unsigned bytesLoaded = 0;
-    QLatin1String bytesLoadedKey("bytes-loaded");
-    if (m_mediaPlayer->availableMetaData().contains(bytesLoadedKey))
-        bytesLoaded = m_mediaPlayer->metaData(bytesLoadedKey).toInt();
-    else
-        bytesLoaded = m_mediaPlayer->bufferStatus();
-    bool didLoadingProgress = bytesLoaded != m_bytesLoadedAtLastDidLoadingProgress;
-    m_bytesLoadedAtLastDidLoadingProgress = bytesLoaded;
-    return didLoadingProgress;
-}
-
-unsigned MediaPlayerPrivateQt::totalBytes() const
-{
-    if (m_mediaPlayer->availableMetaData().contains(QMediaMetaData::Size))
-        return m_mediaPlayer->metaData(QMediaMetaData::Size).toInt();
-
-    return 100;
-}
-
-void MediaPlayerPrivateQt::setPreload(MediaPlayer::Preload preload)
-{
-    m_preload = preload;
-    if (m_delayingLoad && m_preload != MediaPlayer::None)
-        resumeLoad();
-}
-
-void MediaPlayerPrivateQt::setRate(float rate)
-{
-    m_mediaPlayer->setPlaybackRate(rate);
-}
-
-void MediaPlayerPrivateQt::setVolume(float volume)
-{
-    m_mediaPlayer->setVolume(static_cast<int>(volume * 100.0));
-}
-
-bool MediaPlayerPrivateQt::supportsMuting() const
-{
-    return true;
-}
-
-void MediaPlayerPrivateQt::setMuted(bool muted)
-{
-    m_mediaPlayer->setMuted(muted);
-}
-
-MediaPlayer::NetworkState MediaPlayerPrivateQt::networkState() const
-{
-    return m_networkState;
-}
-
-MediaPlayer::ReadyState MediaPlayerPrivateQt::readyState() const
-{
-    return m_readyState;
-}
-
-void MediaPlayerPrivateQt::setVisible(bool)
-{
-}
-
-void MediaPlayerPrivateQt::mediaStatusChanged(QMediaPlayer::MediaStatus)
-{
-    updateStates();
-}
-
-void MediaPlayerPrivateQt::handleError(QMediaPlayer::Error)
-{
-    updateStates();
-}
-
-void MediaPlayerPrivateQt::stateChanged(QMediaPlayer::State)
-{
-    if (!m_suppressNextPlaybackChanged)
-        m_webCorePlayer->playbackStateChanged();
-    else
-        m_suppressNextPlaybackChanged = false;
-}
-
-void MediaPlayerPrivateQt::surfaceFormatChanged(const QVideoSurfaceFormat& format)
-{
-    QSize size = format.sizeHint();
-    LOG(Media, "MediaPlayerPrivateQt::naturalSizeChanged(%dx%d)",
-            size.width(), size.height());
-
-    if (!size.isValid())
-        return;
-
-    IntSize webCoreSize = size;
-    if (webCoreSize == m_naturalSize)
-        return;
-
-    m_naturalSize = webCoreSize;
-    m_webCorePlayer->sizeChanged();
-}
-
-void MediaPlayerPrivateQt::positionChanged(qint64)
-{
-    // Only propagate this event if we are seeking
-    if (m_isSeeking) {
-        m_isSeeking = false;
-        m_webCorePlayer->timeChanged();
-    }
-}
-
-void MediaPlayerPrivateQt::bufferStatusChanged(int)
-{
-    notImplemented();
-}
-
-void MediaPlayerPrivateQt::durationChanged(qint64)
-{
-    m_webCorePlayer->durationChanged();
-}
-
-void MediaPlayerPrivateQt::volumeChanged(int volume)
-{
-    m_webCorePlayer->volumeChanged(static_cast<float>(volume) / 100.0);
-}
-
-void MediaPlayerPrivateQt::mutedChanged(bool muted)
-{
-    m_webCorePlayer->muteChanged(muted);
-}
-
-void MediaPlayerPrivateQt::updateStates()
-{
-    // Store the old states so that we can detect a change and raise change events
-    MediaPlayer::NetworkState oldNetworkState = m_networkState;
-    MediaPlayer::ReadyState oldReadyState = m_readyState;
-
-    QMediaPlayer::MediaStatus currentStatus = m_mediaPlayer->mediaStatus();
-    QMediaPlayer::Error currentError = m_mediaPlayer->error();
-
-    if (currentError != QMediaPlayer::NoError) {
-        m_readyState = MediaPlayer::HaveNothing;
-        if (currentError == QMediaPlayer::FormatError || currentError == QMediaPlayer::ResourceError)
-            m_networkState = MediaPlayer::FormatError;
-        else
-            m_networkState = MediaPlayer::NetworkError;
-    } else if (currentStatus == QMediaPlayer::UnknownMediaStatus
-               || currentStatus == QMediaPlayer::NoMedia) {
-        m_networkState = MediaPlayer::Idle;
-        m_readyState = MediaPlayer::HaveNothing;
-    } else if (currentStatus == QMediaPlayer::LoadingMedia) {
-        m_networkState = MediaPlayer::Loading;
-        m_readyState = MediaPlayer::HaveNothing;
-    } else if (currentStatus == QMediaPlayer::LoadedMedia) {
-        m_networkState = MediaPlayer::Loading;
-        m_readyState = MediaPlayer::HaveMetadata;
-    } else if (currentStatus == QMediaPlayer::BufferingMedia) {
-        m_networkState = MediaPlayer::Loading;
-        m_readyState = MediaPlayer::HaveFutureData;
-    } else if (currentStatus == QMediaPlayer::StalledMedia) {
-        m_networkState = MediaPlayer::Loading;
-        m_readyState = MediaPlayer::HaveCurrentData;
-    } else if (currentStatus == QMediaPlayer::BufferedMedia
-               || currentStatus == QMediaPlayer::EndOfMedia) {
-        m_networkState = MediaPlayer::Loaded;
-        m_readyState = MediaPlayer::HaveEnoughData;
-    } else if (currentStatus == QMediaPlayer::InvalidMedia) {
-        m_networkState = MediaPlayer::FormatError;
-        m_readyState = MediaPlayer::HaveNothing;
-    }
-
-    // Log the state changes and raise the state change events
-    // NB: The readyStateChanged event must come before the networkStateChanged event.
-    // Breaking this invariant will cause the resource selection algorithm for multiple
-    // sources to fail.
-    if (m_readyState != oldReadyState)
-        m_webCorePlayer->readyStateChanged();
-
-    if (m_networkState != oldNetworkState)
-        m_webCorePlayer->networkStateChanged();
-}
-
-void MediaPlayerPrivateQt::setSize(const IntSize& size)
-{
-    LOG(Media, "MediaPlayerPrivateQt::setSize(%dx%d)",
-            size.width(), size.height());
-
-    if (size == m_currentSize)
-        return;
-
-    m_currentSize = size;
-}
-
-IntSize MediaPlayerPrivateQt::naturalSize() const
-{
-    if (!hasVideo() ||  m_readyState < MediaPlayer::HaveMetadata) {
-        LOG(Media, "MediaPlayerPrivateQt::naturalSize() -> 0x0 (!hasVideo || !haveMetaData)");
-        return IntSize();
-    }
-
-    LOG(Media, "MediaPlayerPrivateQt::naturalSize() -> %dx%d (m_naturalSize)",
-            m_naturalSize.width(), m_naturalSize.height());
-
-    return m_naturalSize;
-}
-
-void MediaPlayerPrivateQt::removeVideoItem()
-{
-    m_mediaPlayer->setVideoOutput(static_cast<QAbstractVideoSurface*>(0));
-}
-
-void MediaPlayerPrivateQt::restoreVideoItem()
-{
-    m_mediaPlayer->setVideoOutput(this);
-}
-
-// Begin QAbstractVideoSurface implementation.
-
-bool MediaPlayerPrivateQt::start(const QVideoSurfaceFormat& format)
-{
-    m_currentVideoFrame = QVideoFrame();
-    m_frameFormat = format;
-
-    // If the pixel format is not supported by QImage, then we return false here and the QtMultimedia back-end
-    // will re-negotiate and call us again with a better format.
-    if (QVideoFrame::imageFormatFromPixelFormat(m_frameFormat.pixelFormat()) == QImage::Format_Invalid)
-        return false;
-
-    return QAbstractVideoSurface::start(format);
-}
-
-QList<QVideoFrame::PixelFormat> MediaPlayerPrivateQt::supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const
-{
-    QList<QVideoFrame::PixelFormat> formats;
-    switch (handleType) {
-    case QAbstractVideoBuffer::QPixmapHandle:
-    case QAbstractVideoBuffer::NoHandle:
-        formats << QVideoFrame::Format_RGB32 << QVideoFrame::Format_ARGB32 << QVideoFrame::Format_RGB565;
-        break;
-    default: break;
-    }
-    return formats;
-}
-
-bool MediaPlayerPrivateQt::present(const QVideoFrame& frame)
-{
-    m_currentVideoFrame = frame;
-    m_webCorePlayer->repaint();
-    return true;
-}
-
-// End QAbstractVideoSurface implementation.
-
-void MediaPlayerPrivateQt::paint(GraphicsContext* context, const IntRect& rect)
-{
-#if USE(ACCELERATED_COMPOSITING)
-    if (m_composited)
-        return;
-#endif
-    paintCurrentFrameInContext(context, rect);
-}
-
-void MediaPlayerPrivateQt::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect)
-{
-    if (context->paintingDisabled())
-        return;
-
-    if (!m_currentVideoFrame.isValid())
-        return;
-
-    QPainter* painter = context->platformContext();
-
-    if (m_currentVideoFrame.handleType() == QAbstractVideoBuffer::QPixmapHandle) {
-        painter->drawPixmap(rect, m_currentVideoFrame.handle().value<QPixmap>());
-    } else if (m_currentVideoFrame.map(QAbstractVideoBuffer::ReadOnly)) {
-        QImage image(m_currentVideoFrame.bits(),
-                     m_frameFormat.frameSize().width(),
-                     m_frameFormat.frameSize().height(),
-                     m_currentVideoFrame.bytesPerLine(),
-                     QVideoFrame::imageFormatFromPixelFormat(m_frameFormat.pixelFormat()));
-        const QRect target = rect;
-
-        if (m_frameFormat.scanLineDirection() == QVideoSurfaceFormat::BottomToTop) {
-            const QTransform oldTransform = painter->transform();
-            painter->scale(1, -1);
-            painter->translate(0, -target.bottom());
-            painter->drawImage(QRect(target.x(), 0, target.width(), target.height()), image);
-            painter->setTransform(oldTransform);
-        } else {
-            painter->drawImage(target, image);
-        }
-
-        m_currentVideoFrame.unmap();
-    }
-}
-
-#if USE(ACCELERATED_COMPOSITING)
-void MediaPlayerPrivateQt::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
-{
-}
-#endif
-
-PlatformMedia MediaPlayerPrivateQt::platformMedia() const
-{
-    PlatformMedia pm;
-    pm.type = PlatformMedia::QtMediaPlayerType;
-    pm.media.qtMediaPlayer = const_cast<MediaPlayerPrivateQt*>(this);
-    return pm;
-}
-
-} // namespace WebCore
-
-#include "moc_MediaPlayerPrivateQt.cpp"
diff --git a/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h b/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
deleted file mode 100644 (file)
index 13e900e..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
-    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
-
-    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.
-*/
-
-#ifndef MediaPlayerPrivateQt_h
-#define MediaPlayerPrivateQt_h
-
-#include "MediaPlayerPrivate.h"
-
-#include <QAbstractVideoSurface>
-#include <QMediaPlayer>
-#include <QObject>
-#include <QVideoSurfaceFormat>
-
-QT_BEGIN_NAMESPACE
-class QMediaPlayerControl;
-class QGraphicsVideoItem;
-class QGraphicsScene;
-QT_END_NAMESPACE
-
-#if USE(ACCELERATED_COMPOSITING)
-#include "TextureMapperPlatformLayer.h"
-#endif
-
-namespace WebCore {
-
-class MediaPlayerPrivateQt : public QAbstractVideoSurface, public MediaPlayerPrivateInterface
-#if USE(ACCELERATED_COMPOSITING)
-                           , public TextureMapperPlatformLayer
-#endif
-{
-
-    Q_OBJECT
-
-public:
-    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
-    ~MediaPlayerPrivateQt();
-
-    static void registerMediaEngine(MediaEngineRegistrar);
-    static void getSupportedTypes(HashSet<String>&);
-    static MediaPlayer::SupportsType supportsType(const String&, const String&, const URL&);
-    static bool isAvailable() { return true; }
-
-    bool hasVideo() const;
-    bool hasAudio() const;
-
-    void load(const String &url);
-    void commitLoad(const String& url);
-    void resumeLoad();
-    void cancelLoad();
-
-    void play();
-    void pause();
-    void prepareToPlay();
-
-    bool paused() const;
-    bool seeking() const;
-
-    float duration() const;
-    float currentTime() const;
-    void seek(float);
-
-    void setRate(float);
-    void setVolume(float);
-
-    bool supportsMuting() const;
-    void setMuted(bool);
-
-    void setPreload(MediaPlayer::Preload);
-
-    MediaPlayer::NetworkState networkState() const;
-    MediaPlayer::ReadyState readyState() const;
-
-    PassRefPtr<TimeRanges> buffered() const;
-    float maxTimeSeekable() const;
-    bool didLoadingProgress() const;
-    unsigned totalBytes() const;
-
-    void setVisible(bool);
-
-    IntSize naturalSize() const;
-    void setSize(const IntSize&);
-
-    void paint(GraphicsContext*, const IntRect&);
-    // reimplemented for canvas drawImage(HTMLVideoElement)
-    void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
-
-    bool supportsFullscreen() const { return true; }
-
-#if USE(ACCELERATED_COMPOSITING)
-    // whether accelerated rendering is supported by the media engine for the current media.
-    virtual bool supportsAcceleratedRendering() const { return false; }
-    // called when the rendering system flips the into or out of accelerated rendering mode.
-    virtual void acceleratedRenderingStateChanged() { }
-    // Const-casting here is safe, since all of TextureMapperPlatformLayer's functions are const.g
-    virtual PlatformLayer* platformLayer() const { return 0; }
-    virtual void paintToTextureMapper(TextureMapper*, const FloatRect& targetRect, const TransformationMatrix&, float opacity);
-#endif
-
-    virtual PlatformMedia platformMedia() const;
-
-    QMediaPlayer* mediaPlayer() const { return m_mediaPlayer; }
-    void removeVideoItem();
-    void restoreVideoItem();
-
-    // QAbstractVideoSurface methods
-    virtual bool start(const QVideoSurfaceFormat& format);
-    virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
-    virtual bool present(const QVideoFrame& frame);
-
-private Q_SLOTS:
-    void mediaStatusChanged(QMediaPlayer::MediaStatus);
-    void handleError(QMediaPlayer::Error);
-    void stateChanged(QMediaPlayer::State);
-    void surfaceFormatChanged(const QVideoSurfaceFormat&);
-    void positionChanged(qint64);
-    void durationChanged(qint64);
-    void bufferStatusChanged(int);
-    void volumeChanged(int);
-    void mutedChanged(bool);
-
-private:
-    void updateStates();
-
-    virtual String engineDescription() const { return "Qt"; }
-
-private:
-    MediaPlayerPrivateQt(MediaPlayer*);
-
-    MediaPlayer* m_webCorePlayer;
-    QMediaPlayer* m_mediaPlayer;
-    QMediaPlayerControl* m_mediaPlayerControl;
-    QVideoSurfaceFormat m_frameFormat;
-    QVideoFrame m_currentVideoFrame;
-
-    mutable MediaPlayer::NetworkState m_networkState;
-    mutable MediaPlayer::ReadyState m_readyState;
-
-    IntSize m_currentSize;
-    IntSize m_naturalSize;
-    bool m_isVisible;
-    bool m_isSeeking;
-    bool m_composited;
-    MediaPlayer::Preload m_preload;
-    mutable unsigned m_bytesLoadedAtLastDidLoadingProgress;
-    bool m_delayingLoad;
-    String m_mediaUrl;
-    bool m_suppressNextPlaybackChanged;
-
-};
-}
-
-#endif // MediaPlayerPrivateQt_h
diff --git a/Source/WebCore/platform/graphics/qt/NativeImageQt.h b/Source/WebCore/platform/graphics/qt/NativeImageQt.h
deleted file mode 100644 (file)
index 0fd1d2c..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2012 Zoltan Horvath (zoltan@webkit.org) 2012 University of Szeged.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef NativeImageQt_h
-#define NativeImageQt_h
-
-#include <QImage>
-
-namespace WebCore {
-
-class NativeImageQt {
-public:
-    static QImage::Format defaultFormatForAlphaEnabledImages()
-    {
-        return QImage::Format_ARGB32_Premultiplied;
-    }
-
-    static QImage::Format defaultFormatForOpaqueImages()
-    {
-        return QImage::Format_RGB32;
-    }
-};
-
-}
-
-#endif // NativeImageQt_h
diff --git a/Source/WebCore/platform/graphics/qt/PathQt.cpp b/Source/WebCore/platform/graphics/qt/PathQt.cpp
deleted file mode 100644 (file)
index 577023b..0000000
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- * Copyright (C) 2006 Rob Buis <buis@kde.org>
- * Copyright (C) 2009, 2010 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2010, 2011 Andreas Kling <kling@webkit.org>
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Path.h"
-
-#include "AffineTransform.h"
-#include "FloatRect.h"
-#include "GraphicsContext.h"
-#include "ImageBuffer.h"
-#include "NativeImageQt.h"
-#include "StrokeStyleApplier.h"
-#include <QPainterPath>
-#include <QString>
-#include <QTransform>
-#include <wtf/MathExtras.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-Path::Path()
-{
-}
-
-Path::~Path()
-{
-}
-
-Path::Path(const Path& other)
-    : m_path(other.m_path)
-{
-}
-
-Path& Path::operator=(const Path& other)
-{
-    m_path = other.m_path;
-    return *this;
-}
-
-static inline bool areCollinear(const QPointF& a, const QPointF& b, const QPointF& c)
-{
-    // Solved from comparing the slopes of a to b and b to c: (ay-by)/(ax-bx) == (cy-by)/(cx-bx)
-    return qFuzzyCompare((c.y() - b.y()) * (a.x() - b.x()), (a.y() - b.y()) * (c.x() - b.x()));
-}
-
-static inline bool withinRange(qreal p, qreal a, qreal b)
-{
-    return (p >= a && p <= b) || (p >= b && p <= a);
-}
-
-// Check whether a point is on the border
-static bool isPointOnPathBorder(const QPolygonF& border, const QPointF& p)
-{
-    // null border&nb