Changeset 108981 in webkit
- Timestamp:
- Feb 27, 2012 3:30:29 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r108980 r108981 1 2012-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 1 19 2012-02-27 MORITA Hajime <morrita@google.com> 2 20 -
trunk/Source/WebCore/Target.pri
r108976 r108981 3942 3942 } 3943 3943 3944 contains(DEFINES, ENABLE_QT_IMAGE_DECODER=1) {3944 contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=1) { 3945 3945 HEADERS += platform/graphics/qt/ImageDecoderQt.h 3946 3946 SOURCES += platform/graphics/qt/ImageDecoderQt.cpp -
trunk/Source/WebCore/WebCore.pri
r108930 r108981 205 205 } 206 206 207 contains(DEFINES, ENABLE_QT_IMAGE_DECODER=0) {207 contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=0) { 208 208 INCLUDEPATH += \ 209 209 $$SOURCE_DIR/platform/image-decoders/bmp \ -
trunk/Source/WebCore/platform/MIMETypeRegistry.cpp
r108792 r108981 40 40 #include <wtf/RetainPtr.h> 41 41 #endif 42 #if PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)42 #if PLATFORM(QT) && USE(QT_IMAGE_DECODER) 43 43 #include <qimagereader.h> 44 44 #include <qimagewriter.h> … … 230 230 supportedImageMIMETypes->remove("application/postscript"); 231 231 232 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)232 #elif PLATFORM(QT) && USE(QT_IMAGE_DECODER) 233 233 QList<QByteArray> formats = QImageReader::supportedImageFormats(); 234 234 for (size_t i = 0; i < static_cast<size_t>(formats.size()); ++i) { … … 290 290 supportedImageMIMETypesForEncoding->add("image/gif"); 291 291 #endif 292 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)292 #elif PLATFORM(QT) && USE(QT_IMAGE_DECODER) 293 293 QList<QByteArray> formats = QImageWriter::supportedImageFormats(); 294 294 for (int i = 0; i < formats.size(); ++i) { -
trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h
r108792 r108981 65 65 // contents 66 66 }; 67 #if USE(SKIA) || (PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER))67 #if USE(SKIA) || (PLATFORM(QT) && USE(QT_IMAGE_DECODER)) 68 68 typedef uint32_t PixelData; 69 69 #else … … 141 141 #if USE(SKIA) 142 142 return m_bitmap.bitmap().getAddr32(x, y); 143 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)143 #elif PLATFORM(QT) && USE(QT_IMAGE_DECODER) 144 144 m_image = m_pixmap.toImage(); 145 145 m_pixmap = QPixmap(); … … 150 150 } 151 151 152 #if PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)152 #if PLATFORM(QT) && USE(QT_IMAGE_DECODER) 153 153 void setPixmap(const QPixmap& pixmap); 154 154 #endif … … 191 191 ColorProfile m_colorProfile; 192 192 #endif 193 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER)193 #elif PLATFORM(QT) && USE(QT_IMAGE_DECODER) 194 194 mutable QPixmap m_pixmap; 195 195 mutable QImage m_image; -
trunk/Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp
r108792 r108981 33 33 namespace WebCore { 34 34 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) 51 36 52 37 ImageFrame::ImageFrame() … … 169 154 } 170 155 171 #endif 156 #else 157 158 QPixmap* 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) 172 172 173 173 } -
trunk/Tools/ChangeLog
r108974 r108981 1 2012-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 1 9 2012-02-27 Hao Zheng <zhenghao@chromium.org> 2 10 -
trunk/Tools/qmake/mkspecs/features/features.prf
r108792 r108981 54 54 } 55 55 56 56 # Feature defines: for web-facing features only 57 57 !contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=.): DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=1 58 58 !contains(DEFINES, ENABLE_GAMEPAD=.): DEFINES += ENABLE_GAMEPAD=0 … … 87 87 !contains(DEFINES, ENABLE_TOUCH_ICON_LOADING=.): DEFINES += ENABLE_TOUCH_ICON_LOADING=0 88 88 !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 90 92 91 93 # Enabled in Source/JavaScriptCore/wtf/Platform.h if not set
Note: See TracChangeset
for help on using the changeset viewer.