Changeset 108685 in webkit
- Timestamp:
- Feb 23, 2012 3:37:48 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r108678 r108685 1 2012-02-23 Zoltan Horvath <zoltan@webkit.org> 2 3 [Qt] Allow to use WebCore imagedecoders 4 https://bugs.webkit.org/show_bug.cgi?id=32410 5 6 Add ENABLE(QT_IMAGE_DECODER) guards around Qt imagedecoders and set it to default. 7 By passing ENABLE_QT_IMAGE_DECODER=0 define to the build system WebKit will build 8 with WebCore's imagedecoders. 9 10 I added NO_RETURN attribute to 2 functions of PNG and JPEG decoders to avoid compiler warnings 11 because in Qt-port we treat warning as errors (-Werror). 12 13 I'm continuing the refactoring of this area and try to use Qt imagedecoders only in 14 cases when WebCore doesn't support the image format. 15 16 Reviewed by Simon Hausmann. 17 18 No behavior change, no need new tests. 19 20 * Target.pri: 21 * WebCore.pri: 22 * platform/MIMETypeRegistry.cpp: 23 (WebCore::initializeSupportedImageMIMETypes): 24 (WebCore::initializeSupportedImageMIMETypesForEncoding): 25 * platform/image-decoders/ImageDecoder.h: 26 (WebCore::ImageFrame::getAddr): 27 (ImageFrame): 28 * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: 29 NO_RETURN has been added to a function to avoid warning message. 30 * platform/image-decoders/png/PNGImageDecoder.cpp: 31 NO_RETURN has been added to a function to avoid warning message. 32 (WebCore): 33 * platform/image-decoders/qt/ImageFrameQt.cpp: 34 (WebCore): 35 (WebCore::ImageFrame::asNewNativeImage): 36 1 37 2012-02-23 Dana Jansens <danakj@chromium.org> 2 38 -
trunk/Source/WebCore/Target.pri
r108561 r108685 2192 2192 platform/graphics/RoundedRect.h \ 2193 2193 platform/graphics/qt/FontCustomPlatformData.h \ 2194 platform/graphics/qt/ImageDecoderQt.h \2195 2194 platform/graphics/qt/StillImageQt.h \ 2196 2195 platform/graphics/qt/TransparencyLayer.h \ … … 2803 2802 platform/graphics/qt/IconQt.cpp \ 2804 2803 platform/graphics/qt/ImageBufferQt.cpp \ 2805 platform/graphics/qt/ImageDecoderQt.cpp \2806 2804 platform/graphics/qt/ImageQt.cpp \ 2807 2805 platform/graphics/qt/IntPointQt.cpp \ … … 3939 3937 } 3940 3938 3939 contains(DEFINES, ENABLE_QT_IMAGE_DECODER=1) { 3940 HEADERS += platform/graphics/qt/ImageDecoderQt.h 3941 SOURCES += platform/graphics/qt/ImageDecoderQt.cpp 3942 } else { 3943 HEADERS += \ 3944 platform/image-decoders/bmp/BMPImageDecoder.h \ 3945 platform/image-decoders/bmp/BMPImageReader.h \ 3946 platform/image-decoders/gif/GIFImageDecoder.h \ 3947 platform/image-decoders/gif/GIFImageReader.h\ 3948 platform/image-decoders/ico/ICOImageDecoder.h \ 3949 platform/image-decoders/jpeg/JPEGImageDecoder.h \ 3950 platform/image-decoders/png/PNGImageDecoder.h 3951 3952 SOURCES += \ 3953 platform/image-decoders/ImageDecoder.cpp \ 3954 platform/image-decoders/bmp/BMPImageDecoder.cpp \ 3955 platform/image-decoders/bmp/BMPImageReader.cpp \ 3956 platform/image-decoders/gif/GIFImageDecoder.cpp \ 3957 platform/image-decoders/gif/GIFImageReader.cpp\ 3958 platform/image-decoders/ico/ICOImageDecoder.cpp \ 3959 platform/image-decoders/jpeg/JPEGImageDecoder.cpp \ 3960 platform/image-decoders/png/PNGImageDecoder.cpp 3961 3962 contains(DEFINES, WTF_USE_WEBP=1) { 3963 HEADERS += platform/image-decoders/webp/WEBPImageDecoder.h 3964 SOURCES += platform/image-decoders/webp/WEBPImageDecoder.cpp 3965 } 3966 } 3967 3941 3968 !system-sqlite:exists( $${SQLITE3SRCDIR}/sqlite3.c ) { 3942 3969 # Build sqlite3 into WebCore from source -
trunk/Source/WebCore/WebCore.pri
r108428 r108685 204 204 } 205 205 206 contains(DEFINES, ENABLE_QT_IMAGE_DECODER=0) { 207 INCLUDEPATH += \ 208 $$SOURCE_DIR/platform/image-decoders/bmp \ 209 $$SOURCE_DIR/platform/image-decoders/gif \ 210 $$SOURCE_DIR/platform/image-decoders/ico \ 211 $$SOURCE_DIR/platform/image-decoders/jpeg \ 212 $$SOURCE_DIR/platform/image-decoders/png 213 214 LIBS += -ljpeg -lpng12 215 216 contains(DEFINES, WTF_USE_WEBP=1) { 217 INCLUDEPATH += $$SOURCE_DIR/platform/image-decoders/webp 218 LIBS += -lwebp 219 } 220 } 221 206 222 win32-*|wince* { 207 223 DLLDESTDIR = $${ROOT_BUILD_DIR}/bin -
trunk/Source/WebCore/platform/MIMETypeRegistry.cpp
r105406 r108685 40 40 #include <wtf/RetainPtr.h> 41 41 #endif 42 #if PLATFORM(QT) 42 #if PLATFORM(QT) && ENABLE(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) 232 #elif PLATFORM(QT) && ENABLE(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) 292 #elif PLATFORM(QT) && ENABLE(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
r106097 r108685 65 65 // contents 66 66 }; 67 #if USE(SKIA) || PLATFORM(QT)67 #if USE(SKIA) || (PLATFORM(QT) && ENABLE(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) 143 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER) 144 144 m_image = m_pixmap.toImage(); 145 145 m_pixmap = QPixmap(); … … 150 150 } 151 151 152 #if PLATFORM(QT) 152 #if PLATFORM(QT) && ENABLE(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) 193 #elif PLATFORM(QT) && ENABLE(QT_IMAGE_DECODER) 194 194 mutable QPixmap m_pixmap; 195 195 mutable QImage m_image; -
trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
r107389 r108685 104 104 void skip_input_data(j_decompress_ptr jd, long num_bytes); 105 105 void term_source(j_decompress_ptr jd); 106 void error_exit(j_common_ptr cinfo) ;106 void error_exit(j_common_ptr cinfo) NO_RETURN; 107 107 108 108 // Implementation of a JPEG src object that understands our state machine -
trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
r105709 r108685 65 65 66 66 // Called if the decoding of the image fails. 67 static void PNGAPI decodingFailed(png_structp png, png_const_charp) NO_RETURN; 67 68 static void PNGAPI decodingFailed(png_structp png, png_const_charp) 68 69 { -
trunk/Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp
r101610 r108685 31 31 #include "NotImplemented.h" 32 32 33 #include <QPixmap> 34 #include <stdio.h> 33 namespace WebCore { 35 34 36 namespace WebCore { 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 37 51 38 52 ImageFrame::ImageFrame() … … 155 169 } 156 170 171 #endif 172 157 173 } -
trunk/Tools/ChangeLog
r108684 r108685 1 2012-02-23 Zoltan Horvath <zoltan@webkit.org> 2 3 [Qt] Allow to use WebCore imagedecoders 4 https://bugs.webkit.org/show_bug.cgi?id=32410 5 6 Add ENABLE_QT_IMAGE_DECODER macro, it's enabled by default. 7 8 Reviewed by Simon Hausmann. 9 10 * qmake/mkspecs/features/features.prf: 11 1 12 2012-02-23 Eric Seidel <eric@webkit.org> 2 13 -
trunk/Tools/qmake/mkspecs/features/features.prf
r107656 r108685 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 90 91 # Enabled in Source/JavaScriptCore/wtf/Platform.h if not set
Note: See TracChangeset
for help on using the changeset viewer.