Changeset 108981 in webkit


Ignore:
Timestamp:
Feb 27, 2012 3:30:29 AM (12 years ago)
Author:
vestbo@webkit.org
Message:

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

Reviewed by Kenneth Rohde Christiansen.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r108980 r108981  
     12012-02-27  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Use USE() macro instead of ENABLE() for using the Qt image decoder
     4
     5        Reviewed by Kenneth Rohde Christiansen..
     6
     7        * Target.pri:
     8        * WebCore.pri:
     9        * platform/MIMETypeRegistry.cpp:
     10        (WebCore::initializeSupportedImageMIMETypes):
     11        (WebCore::initializeSupportedImageMIMETypesForEncoding):
     12        * platform/image-decoders/ImageDecoder.h:
     13        (WebCore::ImageFrame::getAddr):
     14        (ImageFrame):
     15        * platform/image-decoders/qt/ImageFrameQt.cpp:
     16        (WebCore):
     17        (WebCore::ImageFrame::asNewNativeImage):
     18
    1192012-02-27  MORITA Hajime  <morrita@google.com>
    220
  • trunk/Source/WebCore/Target.pri

    r108976 r108981  
    39423942}
    39433943
    3944 contains(DEFINES, ENABLE_QT_IMAGE_DECODER=1) {
     3944contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=1) {
    39453945    HEADERS += platform/graphics/qt/ImageDecoderQt.h
    39463946    SOURCES += platform/graphics/qt/ImageDecoderQt.cpp
  • trunk/Source/WebCore/WebCore.pri

    r108930 r108981  
    205205}
    206206
    207 contains(DEFINES, ENABLE_QT_IMAGE_DECODER=0) {
     207contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=0) {
    208208    INCLUDEPATH += \
    209209        $$SOURCE_DIR/platform/image-decoders/bmp \
  • trunk/Source/WebCore/platform/MIMETypeRegistry.cpp

    r108792 r108981  
    4040#include <wtf/RetainPtr.h>
    4141#endif
    42 #if PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
     42#if PLATFORM(QT) && USE(QT_IMAGE_DECODER)
    4343#include <qimagereader.h>
    4444#include <qimagewriter.h>
     
    230230    supportedImageMIMETypes->remove("application/postscript");
    231231
    232 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
     232#elif PLATFORM(QT) && USE(QT_IMAGE_DECODER)
    233233    QList<QByteArray> formats = QImageReader::supportedImageFormats();
    234234    for (size_t i = 0; i < static_cast<size_t>(formats.size()); ++i) {
     
    290290    supportedImageMIMETypesForEncoding->add("image/gif");
    291291#endif
    292 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
     292#elif PLATFORM(QT) && USE(QT_IMAGE_DECODER)
    293293    QList<QByteArray> formats = QImageWriter::supportedImageFormats();
    294294    for (int i = 0; i < formats.size(); ++i) {
  • trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h

    r108792 r108981  
    6565                                      // contents
    6666        };
    67 #if USE(SKIA) || (PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER))
     67#if USE(SKIA) || (PLATFORM(QT) && USE(QT_IMAGE_DECODER))
    6868        typedef uint32_t PixelData;
    6969#else
     
    141141#if USE(SKIA)
    142142            return m_bitmap.bitmap().getAddr32(x, y);
    143 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
     143#elif PLATFORM(QT) && USE(QT_IMAGE_DECODER)
    144144            m_image = m_pixmap.toImage();
    145145            m_pixmap = QPixmap();
     
    150150        }
    151151
    152 #if PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
     152#if PLATFORM(QT) && USE(QT_IMAGE_DECODER)
    153153        void setPixmap(const QPixmap& pixmap);
    154154#endif
     
    191191        ColorProfile m_colorProfile;
    192192#endif
    193 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)
     193#elif PLATFORM(QT) && USE(QT_IMAGE_DECODER)
    194194        mutable QPixmap m_pixmap;
    195195        mutable QImage m_image;
  • trunk/Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp

    r108792 r108981  
    3333namespace WebCore {
    3434
    35 #if !ENABLE(QT_IMAGE_DECODER)
    36 
    37 QPixmap* ImageFrame::asNewNativeImage() const
    38 {
    39     QImage::Format fmt;
    40     if (m_hasAlpha)
    41         fmt = m_premultiplyAlpha ?  QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32;
    42     else
    43         fmt = QImage::Format_RGB32;
    44 
    45     QImage img(reinterpret_cast<uchar*>(m_bytes), m_size.width(), m_size.height(), sizeof(PixelData) * m_size.width(), fmt);
    46 
    47     return new QPixmap(QPixmap::fromImage(img));
    48 }
    49 
    50 #else
     35#if USE(QT_IMAGE_DECODER)
    5136
    5237ImageFrame::ImageFrame()
     
    169154}
    170155
    171 #endif
     156#else
     157
     158QPixmap* ImageFrame::asNewNativeImage() const
     159{
     160    QImage::Format fmt;
     161    if (m_hasAlpha)
     162        fmt = m_premultiplyAlpha ?  QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32;
     163    else
     164        fmt = QImage::Format_RGB32;
     165
     166    QImage img(reinterpret_cast<uchar*>(m_bytes), m_size.width(), m_size.height(), sizeof(PixelData) * m_size.width(), fmt);
     167
     168    return new QPixmap(QPixmap::fromImage(img));
     169}
     170
     171#endif // USE(QT_IMAGE_DECODER)
    172172
    173173}
  • trunk/Tools/ChangeLog

    r108974 r108981  
     12012-02-27  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Use USE() macro instead of ENABLE() for using the Qt image decoder
     4
     5        Reviewed by Kenneth Rohde Christiansen..
     6
     7        * qmake/mkspecs/features/features.prf:
     8
    192012-02-27  Hao Zheng  <zhenghao@chromium.org>
    210
  • trunk/Tools/qmake/mkspecs/features/features.prf

    r108792 r108981  
    5454}
    5555
    56 
     56# Feature defines: for web-facing features only
    5757!contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=.): DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=1
    5858!contains(DEFINES, ENABLE_GAMEPAD=.): DEFINES += ENABLE_GAMEPAD=0
     
    8787!contains(DEFINES, ENABLE_TOUCH_ICON_LOADING=.): DEFINES += ENABLE_TOUCH_ICON_LOADING=0
    8888!contains(DEFINES, ENABLE_ANIMATION_API=.): DEFINES += ENABLE_ANIMATION_API=0
    89 !contains(DEFINES, ENABLE_QT_IMAGE_DECODER=.): DEFINES += ENABLE_QT_IMAGE_DECODER=1
     89
     90# Policy decisions: for using a particular third-party library or optional OS service
     91!contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=.): DEFINES += WTF_USE_QT_IMAGE_DECODER=1
    9092
    9193# Enabled in Source/JavaScriptCore/wtf/Platform.h if not set
Note: See TracChangeset for help on using the changeset viewer.