Title: [108981] trunk
Revision
108981
Author
ves...@webkit.org
Date
2012-02-27 03:30:29 -0800 (Mon, 27 Feb 2012)

Log Message

[Qt] Use USE() macro instead of ENABLE() for using the Qt image decoder

Reviewed by Kenneth Rohde Christiansen.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (108980 => 108981)


--- trunk/Source/WebCore/ChangeLog	2012-02-27 11:13:44 UTC (rev 108980)
+++ trunk/Source/WebCore/ChangeLog	2012-02-27 11:30:29 UTC (rev 108981)
@@ -1,3 +1,21 @@
+2012-02-27  Tor Arne Vestbø  <tor.arne.ves...@nokia.com>
+
+        [Qt] Use USE() macro instead of ENABLE() for using the Qt image decoder
+
+        Reviewed by Kenneth Rohde Christiansen..
+
+        * Target.pri:
+        * WebCore.pri:
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::initializeSupportedImageMIMETypes):
+        (WebCore::initializeSupportedImageMIMETypesForEncoding):
+        * platform/image-decoders/ImageDecoder.h:
+        (WebCore::ImageFrame::getAddr):
+        (ImageFrame):
+        * platform/image-decoders/qt/ImageFrameQt.cpp:
+        (WebCore):
+        (WebCore::ImageFrame::asNewNativeImage):
+
 2012-02-27  MORITA Hajime  <morr...@google.com>
 
         Removing <ul>, <li> inside shadow DOM triggers assertion in updateListMarkerNumbers

Modified: trunk/Source/WebCore/Target.pri (108980 => 108981)


--- trunk/Source/WebCore/Target.pri	2012-02-27 11:13:44 UTC (rev 108980)
+++ trunk/Source/WebCore/Target.pri	2012-02-27 11:30:29 UTC (rev 108981)
@@ -3941,7 +3941,7 @@
         page/PageSerializer.cpp
 }
 
-contains(DEFINES, ENABLE_QT_IMAGE_DECODER=1) {
+contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=1) {
     HEADERS += platform/graphics/qt/ImageDecoderQt.h
     SOURCES += platform/graphics/qt/ImageDecoderQt.cpp
 } else {

Modified: trunk/Source/WebCore/WebCore.pri (108980 => 108981)


--- trunk/Source/WebCore/WebCore.pri	2012-02-27 11:13:44 UTC (rev 108980)
+++ trunk/Source/WebCore/WebCore.pri	2012-02-27 11:30:29 UTC (rev 108981)
@@ -204,7 +204,7 @@
     LIBS += -lsqlite3
 }
 
-contains(DEFINES, ENABLE_QT_IMAGE_DECODER=0) {
+contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=0) {
     INCLUDEPATH += \
         $$SOURCE_DIR/platform/image-decoders/bmp \
         $$SOURCE_DIR/platform/image-decoders/gif \

Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.cpp (108980 => 108981)


--- trunk/Source/WebCore/platform/MIMETypeRegistry.cpp	2012-02-27 11:13:44 UTC (rev 108980)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.cpp	2012-02-27 11:30:29 UTC (rev 108981)
@@ -39,7 +39,7 @@
 #include <ApplicationServices/ApplicationServices.h>
 #include <wtf/RetainPtr.h>
 #endif
-#if PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
+#if PLATFORM(QT) && USE(QT_IMAGE_DECODER)
 #include <qimagereader.h>
 #include <qimagewriter.h>
 #endif
@@ -229,7 +229,7 @@
     supportedImageMIMETypes->remove("application/pdf");
     supportedImageMIMETypes->remove("application/postscript");
 
-#elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
+#elif PLATFORM(QT) && USE(QT_IMAGE_DECODER)
     QList<QByteArray> formats = QImageReader::supportedImageFormats();
     for (size_t i = 0; i < static_cast<size_t>(formats.size()); ++i) {
 #if ENABLE(SVG)
@@ -289,7 +289,7 @@
     supportedImageMIMETypesForEncoding->add("image/jpeg");
     supportedImageMIMETypesForEncoding->add("image/gif");
 #endif
-#elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
+#elif PLATFORM(QT) && USE(QT_IMAGE_DECODER)
     QList<QByteArray> formats = QImageWriter::supportedImageFormats();
     for (int i = 0; i < formats.size(); ++i) {
         String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());

Modified: trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h (108980 => 108981)


--- trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h	2012-02-27 11:13:44 UTC (rev 108980)
+++ trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h	2012-02-27 11:30:29 UTC (rev 108981)
@@ -64,7 +64,7 @@
             DisposeOverwritePrevious  // Clear frame to previous framebuffer
                                       // contents
         };
-#if USE(SKIA) || (PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER))
+#if USE(SKIA) || (PLATFORM(QT) && USE(QT_IMAGE_DECODER))
         typedef uint32_t PixelData;
 #else
         typedef unsigned PixelData;
@@ -140,7 +140,7 @@
         {
 #if USE(SKIA)
             return m_bitmap.bitmap().getAddr32(x, y);
-#elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
+#elif PLATFORM(QT) && USE(QT_IMAGE_DECODER)
             m_image = m_pixmap.toImage();
             m_pixmap = QPixmap();
             return reinterpret_cast_ptr<QRgb*>(m_image.scanLine(y)) + x;
@@ -149,7 +149,7 @@
 #endif
         }
 
-#if PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
+#if PLATFORM(QT) && USE(QT_IMAGE_DECODER)
         void setPixmap(const QPixmap& pixmap);
 #endif
 
@@ -190,7 +190,7 @@
 #if PLATFORM(CHROMIUM) && OS(DARWIN)
         ColorProfile m_colorProfile;
 #endif
-#elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
+#elif PLATFORM(QT) && USE(QT_IMAGE_DECODER)
         mutable QPixmap m_pixmap;
         mutable QImage m_image;
         bool m_hasAlpha;

Modified: trunk/Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp (108980 => 108981)


--- trunk/Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp	2012-02-27 11:13:44 UTC (rev 108980)
+++ trunk/Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp	2012-02-27 11:30:29 UTC (rev 108981)
@@ -32,23 +32,8 @@
 
 namespace WebCore {
 
-#if !ENABLE(QT_IMAGE_DECODER)
+#if USE(QT_IMAGE_DECODER)
 
-QPixmap* ImageFrame::asNewNativeImage() const
-{
-    QImage::Format fmt;
-    if (m_hasAlpha)
-        fmt = m_premultiplyAlpha ?  QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32;
-    else
-        fmt = QImage::Format_RGB32;
-
-    QImage img(reinterpret_cast<uchar*>(m_bytes), m_size.width(), m_size.height(), sizeof(PixelData) * m_size.width(), fmt);
-
-    return new QPixmap(QPixmap::fromImage(img));
-}
-
-#else
-
 ImageFrame::ImageFrame()
     : m_hasAlpha(false) 
     , m_size()
@@ -168,6 +153,21 @@
     return m_size.height();
 }
 
-#endif
+#else
 
+QPixmap* ImageFrame::asNewNativeImage() const
+{
+    QImage::Format fmt;
+    if (m_hasAlpha)
+        fmt = m_premultiplyAlpha ?  QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32;
+    else
+        fmt = QImage::Format_RGB32;
+
+    QImage img(reinterpret_cast<uchar*>(m_bytes), m_size.width(), m_size.height(), sizeof(PixelData) * m_size.width(), fmt);
+
+    return new QPixmap(QPixmap::fromImage(img));
 }
+
+#endif // USE(QT_IMAGE_DECODER)
+
+}

Modified: trunk/Tools/ChangeLog (108980 => 108981)


--- trunk/Tools/ChangeLog	2012-02-27 11:13:44 UTC (rev 108980)
+++ trunk/Tools/ChangeLog	2012-02-27 11:30:29 UTC (rev 108981)
@@ -1,3 +1,11 @@
+2012-02-27  Tor Arne Vestbø  <tor.arne.ves...@nokia.com>
+
+        [Qt] Use USE() macro instead of ENABLE() for using the Qt image decoder
+
+        Reviewed by Kenneth Rohde Christiansen..
+
+        * qmake/mkspecs/features/features.prf:
+
 2012-02-27  Hao Zheng  <zheng...@chromium.org>
 
         Add a ChromiumGpuAndroid port.

Modified: trunk/Tools/qmake/mkspecs/features/features.prf (108980 => 108981)


--- trunk/Tools/qmake/mkspecs/features/features.prf	2012-02-27 11:13:44 UTC (rev 108980)
+++ trunk/Tools/qmake/mkspecs/features/features.prf	2012-02-27 11:30:29 UTC (rev 108981)
@@ -53,7 +53,7 @@
     DEFINES += HAVE_FONTCONFIG=1
 }
 
-
+# Feature defines: for web-facing features only
 !contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=.): DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=1
 !contains(DEFINES, ENABLE_GAMEPAD=.): DEFINES += ENABLE_GAMEPAD=0
 !contains(DEFINES, ENABLE_SQL_DATABASE=.): DEFINES += ENABLE_SQL_DATABASE=1
@@ -86,8 +86,10 @@
 !contains(DEFINES, ENABLE_VIDEO_TRACK=.): DEFINES += ENABLE_VIDEO_TRACK=0
 !contains(DEFINES, ENABLE_TOUCH_ICON_LOADING=.): DEFINES += ENABLE_TOUCH_ICON_LOADING=0
 !contains(DEFINES, ENABLE_ANIMATION_API=.): DEFINES += ENABLE_ANIMATION_API=0
-!contains(DEFINES, ENABLE_QT_IMAGE_DECODER=.): DEFINES += ENABLE_QT_IMAGE_DECODER=1
 
+# Policy decisions: for using a particular third-party library or optional OS service
+!contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=.): DEFINES += WTF_USE_QT_IMAGE_DECODER=1
+
 # Enabled in Source/_javascript_Core/wtf/Platform.h if not set
 # We have to do the same to be able to disable the feature in build-webkit
 !contains(DEFINES, ENABLE_FTPDIR=.): DEFINES += ENABLE_FTPDIR=1
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to