Changeset 116105 in webkit
- Timestamp:
- May 4, 2012 8:27:44 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116104 r116105 1 2012-05-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r116085, r116091, and r116095. 4 http://trac.webkit.org/changeset/116085 5 http://trac.webkit.org/changeset/116091 6 http://trac.webkit.org/changeset/116095 7 https://bugs.webkit.org/show_bug.cgi?id=85628 8 9 We are not ready with dependencies on all platform yet (mac) + 10 problems with debug builds. (Requested by Zoltan on #webkit). 11 12 * Target.pri: 13 * WebCore.pri: 14 * platform/MIMETypeRegistry.cpp: 15 (WebCore::initializeSupportedImageMIMETypes): 16 (WebCore::initializeSupportedImageMIMETypesForEncoding): 17 * platform/graphics/ImageSource.cpp: 18 * platform/graphics/ImageSource.h: 19 (WebCore): 20 * platform/graphics/qt/ImageDecoderQt.cpp: 21 (WebCore::ImageDecoder::create): 22 (WebCore): 23 (WebCore::ImageDecoderQt::filenameExtension): 24 (WebCore::ImageDecoderQt::internalHandleCurrentImage): 25 (WebCore::ImageDecoderQt::clearPointers): 26 * platform/image-decoders/ImageDecoder.cpp: 27 (WebCore::ImageDecoder::create): 28 * platform/image-decoders/ImageDecoder.h: 29 (WebCore::ImageFrame::getAddr): 30 (ImageFrame): 31 * platform/image-decoders/qt/ImageFrameQt.cpp: Added. 32 (WebCore): 33 (WebCore::ImageFrame::ImageFrame): 34 (WebCore::ImageFrame::operator=): 35 (WebCore::ImageFrame::clearPixelData): 36 (WebCore::ImageFrame::zeroFillPixelData): 37 (WebCore::ImageFrame::copyBitmapData): 38 (WebCore::ImageFrame::setSize): 39 (WebCore::ImageFrame::asNewNativeImage): 40 (WebCore::ImageFrame::hasAlpha): 41 (WebCore::ImageFrame::setHasAlpha): 42 (WebCore::ImageFrame::setColorProfile): 43 (WebCore::ImageFrame::setStatus): 44 (WebCore::ImageFrame::setPixmap): 45 (WebCore::ImageFrame::width): 46 (WebCore::ImageFrame::height): 47 1 48 2012-05-04 Ilya Tikhonovsky <loislo@chromium.org> 2 49 -
trunk/Source/WebCore/Target.pri
r116102 r116105 1086 1086 platform/FileSystem.cpp \ 1087 1087 platform/HistogramSupport.cpp \ 1088 platform/image-decoders/qt/ImageFrameQt.cpp \ 1088 1089 platform/graphics/FontDescription.cpp \ 1089 1090 platform/graphics/FontFallbackList.cpp \ … … 1138 1139 platform/graphics/transforms/TransformState.cpp \ 1139 1140 platform/graphics/transforms/TranslateTransformOperation.cpp \ 1140 platform/image-decoders/ImageDecoder.cpp \1141 platform/image-decoders/bmp/BMPImageDecoder.cpp \1142 platform/image-decoders/bmp/BMPImageReader.cpp \1143 platform/image-decoders/gif/GIFImageDecoder.cpp \1144 platform/image-decoders/gif/GIFImageReader.cpp\1145 platform/image-decoders/ico/ICOImageDecoder.cpp \1146 platform/image-decoders/jpeg/JPEGImageDecoder.cpp \1147 platform/image-decoders/png/PNGImageDecoder.cpp \1148 1141 platform/KillRingNone.cpp \ 1149 1142 platform/KURL.cpp \ … … 2292 2285 platform/graphics/transforms/TransformState.h \ 2293 2286 platform/graphics/transforms/TranslateTransformOperation.h \ 2294 platform/image-decoders/bmp/BMPImageDecoder.h \2295 platform/image-decoders/bmp/BMPImageReader.h \2296 platform/image-decoders/gif/GIFImageDecoder.h \2297 platform/image-decoders/gif/GIFImageReader.h\2298 platform/image-decoders/ico/ICOImageDecoder.h \2299 platform/image-decoders/jpeg/JPEGImageDecoder.h \2300 platform/image-decoders/png/PNGImageDecoder.h \2301 2287 platform/KillRing.h \ 2302 2288 platform/KURL.h \ … … 2872 2858 platform/graphics/qt/IconQt.cpp \ 2873 2859 platform/graphics/qt/ImageBufferQt.cpp \ 2874 platform/graphics/qt/ImageDecoderQt.cpp \2875 2860 platform/graphics/qt/ImageQt.cpp \ 2876 2861 platform/graphics/qt/IntPointQt.cpp \ … … 4044 4029 } 4045 4030 4046 contains(DEFINES, WTF_USE_WEBP=1) { 4047 INCLUDEPATH += platform/image-decoders/webp 4048 HEADERS += platform/image-decoders/webp/WEBPImageDecoder.h 4049 SOURCES += platform/image-decoders/webp/WEBPImageDecoder.cpp 4031 contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=1) { 4032 HEADERS += platform/graphics/qt/ImageDecoderQt.h 4033 SOURCES += platform/graphics/qt/ImageDecoderQt.cpp 4034 } else { 4035 HEADERS += \ 4036 platform/image-decoders/bmp/BMPImageDecoder.h \ 4037 platform/image-decoders/bmp/BMPImageReader.h \ 4038 platform/image-decoders/gif/GIFImageDecoder.h \ 4039 platform/image-decoders/gif/GIFImageReader.h\ 4040 platform/image-decoders/ico/ICOImageDecoder.h \ 4041 platform/image-decoders/jpeg/JPEGImageDecoder.h \ 4042 platform/image-decoders/png/PNGImageDecoder.h 4043 4044 SOURCES += \ 4045 platform/image-decoders/ImageDecoder.cpp \ 4046 platform/image-decoders/bmp/BMPImageDecoder.cpp \ 4047 platform/image-decoders/bmp/BMPImageReader.cpp \ 4048 platform/image-decoders/gif/GIFImageDecoder.cpp \ 4049 platform/image-decoders/gif/GIFImageReader.cpp\ 4050 platform/image-decoders/ico/ICOImageDecoder.cpp \ 4051 platform/image-decoders/jpeg/JPEGImageDecoder.cpp \ 4052 platform/image-decoders/png/PNGImageDecoder.cpp 4053 4054 contains(DEFINES, WTF_USE_WEBP=1) { 4055 HEADERS += platform/image-decoders/webp/WEBPImageDecoder.h 4056 SOURCES += platform/image-decoders/webp/WEBPImageDecoder.cpp 4057 } 4050 4058 } 4051 4059 -
trunk/Source/WebCore/WebCore.pri
r116095 r116105 65 65 $$SOURCE_DIR/platform/graphics/transforms \ 66 66 $$SOURCE_DIR/platform/image-decoders \ 67 $$SOURCE_DIR/platform/image-decoders/bmp \68 $$SOURCE_DIR/platform/image-decoders/gif \69 $$SOURCE_DIR/platform/image-decoders/ico \70 $$SOURCE_DIR/platform/image-decoders/jpeg \71 $$SOURCE_DIR/platform/image-decoders/png \72 67 $$SOURCE_DIR/platform/leveldb \ 73 68 $$SOURCE_DIR/platform/mock \ … … 228 223 } 229 224 230 contains(DEFINES, WTF_USE_WEBP=1) { 231 INCLUDEPATH += $$SOURCE_DIR/platform/image-decoders/webp 232 LIBS += -lwebp 233 } 234 235 haveQt(5) { 236 # Qt5 allows us to use config tests to check for the presence of these libraries 237 !contains(config_test_libjpeg, yes): error("JPEG library not found!") 238 !contains(config_test_libpng, yes): error("PNG library not found!") 239 } 240 241 LIBS += -ljpeg -lpng 225 contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=0) { 226 INCLUDEPATH += \ 227 $$SOURCE_DIR/platform/image-decoders/bmp \ 228 $$SOURCE_DIR/platform/image-decoders/gif \ 229 $$SOURCE_DIR/platform/image-decoders/ico \ 230 $$SOURCE_DIR/platform/image-decoders/jpeg \ 231 $$SOURCE_DIR/platform/image-decoders/png 232 233 haveQt(5) { 234 # Qt5 allows us to use config tests to check for the presence of these libraries 235 !contains(config_test_libjpeg, yes): error("JPEG library not found!") 236 !contains(config_test_libpng, yes): error("PNG 1.2 library not found!") 237 } 238 239 LIBS += -ljpeg -lpng12 240 241 contains(DEFINES, WTF_USE_WEBP=1) { 242 INCLUDEPATH += $$SOURCE_DIR/platform/image-decoders/webp 243 LIBS += -lwebp 244 } 245 } 242 246 243 247 win32-*|wince* { -
trunk/Source/WebCore/platform/MIMETypeRegistry.cpp
r116085 r116105 40 40 #include <wtf/RetainPtr.h> 41 41 #endif 42 #if PLATFORM(QT) 43 #include < QImageReader>44 #include < QImageWriter>42 #if PLATFORM(QT) && USE(QT_IMAGE_DECODER) 43 #include <qimagereader.h> 44 #include <qimagewriter.h> 45 45 #endif 46 46 … … 228 228 supportedImageMIMETypes->remove("application/postscript"); 229 229 230 #elif PLATFORM(QT) && USE(QT_IMAGE_DECODER) 231 QList<QByteArray> formats = QImageReader::supportedImageFormats(); 232 for (size_t i = 0; i < static_cast<size_t>(formats.size()); ++i) { 233 #if ENABLE(SVG) 234 /* 235 * Qt has support for SVG, but we want to use KSVG2 236 */ 237 if (formats.at(i).toLower().startsWith("svg")) 238 continue; 239 #endif 240 String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData()); 241 if (!mimeType.isEmpty()) { 242 supportedImageMIMETypes->add(mimeType); 243 supportedImageResourceMIMETypes->add(mimeType); 244 } 245 } 230 246 #else 231 247 // assume that all implementations at least support the following standard … … 244 260 supportedImageResourceMIMETypes->add(types[i]); 245 261 } 246 #if PLATFORM(QT)247 QList<QByteArray> formats = QImageReader::supportedImageFormats();248 for (size_t i = 0; i < static_cast<size_t>(formats.size()); ++i) {249 #if ENABLE(SVG)250 // Qt has support for SVG, but we want to use KSVG2251 if (formats.at(i).toLower().startsWith("svg"))252 continue;253 #endif // ENABLE(SVG)254 String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());255 if (!mimeType.isEmpty()) {256 supportedImageMIMETypes->add(mimeType);257 supportedImageResourceMIMETypes->add(mimeType);258 }259 }260 #endif // PLATFORM(QT)261 262 #if PLATFORM(BLACKBERRY) 262 263 supportedImageMIMETypes->add("image/pjpeg"); … … 287 288 supportedImageMIMETypesForEncoding->add("image/gif"); 288 289 #endif 289 #elif PLATFORM(QT) 290 #elif PLATFORM(QT) && USE(QT_IMAGE_DECODER) 290 291 QList<QByteArray> formats = QImageWriter::supportedImageFormats(); 291 292 for (int i = 0; i < formats.size(); ++i) { … … 294 295 supportedImageMIMETypesForEncoding->add(mimeType); 295 296 } 296 #elif PLATFORM(GTK) 297 #elif PLATFORM(GTK) || (PLATFORM(QT) && !USE(QT_IMAGE_DECODER)) 297 298 supportedImageMIMETypesForEncoding->add("image/png"); 298 299 supportedImageMIMETypesForEncoding->add("image/jpeg"); -
trunk/Source/WebCore/platform/graphics/ImageSource.cpp
r116086 r116105 30 30 #include "ImageSource.h" 31 31 32 #if PLATFORM(QT) 33 #include "ImageDecoderQt.h" 34 #else 32 35 #include "ImageDecoder.h" 36 #endif 33 37 34 38 #include "ImageOrientation.h" -
trunk/Source/WebCore/platform/graphics/ImageSource.h
r116086 r116105 76 76 typedef ImageDecoder* NativeImageSourcePtr; 77 77 typedef TiledImageOpenVG* NativeImagePtr; 78 #elif PLATFORM(QT) 79 class ImageDecoderQt; 80 typedef ImageDecoderQt* NativeImageSourcePtr; 81 typedef QPixmap* NativeImagePtr; 78 82 #else 79 83 class ImageDecoder; … … 95 99 typedef ImageDecoder* NativeImageSourcePtr; 96 100 typedef void* NativeImagePtr; 97 #elif PLATFORM(QT)98 typedef QPixmap* NativeImagePtr;99 101 #endif 100 102 #endif -
trunk/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
r116086 r116105 32 32 #include <QtCore/QByteArray> 33 33 #include <QtCore/QBuffer> 34 34 35 #include <QtGui/QImageReader> 36 #include <qdebug.h> 35 37 36 38 namespace WebCore { 39 40 ImageDecoder* ImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption) 41 { 42 // We need at least 4 bytes to figure out what kind of image we're dealing with. 43 if (data.size() < 4) 44 return 0; 45 46 return new ImageDecoderQt(alphaOption, gammaAndColorProfileOption); 47 } 37 48 38 49 ImageDecoderQt::ImageDecoderQt(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption) … … 119 130 { 120 131 return String(m_format.constData(), m_format.length()); 121 } 132 }; 122 133 123 134 ImageFrame* ImageDecoderQt::frameBufferAtIndex(size_t index) … … 184 195 bool ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex) 185 196 { 186 ImageFrame* const buffer = &m_frameBufferCache[frameIndex]; 187 QSize imageSize = m_reader->size(); 188 189 if (!buffer->setSize(imageSize.width(), imageSize.height())) 190 return false; 191 192 QImage image(reinterpret_cast<uchar*>(buffer->getAddr(0, 0)), imageSize.width(), imageSize.height(), sizeof(ImageFrame::PixelData) * imageSize.width(), m_reader->imageFormat()); 193 194 buffer->setDuration(m_reader->nextImageDelay()); 195 m_reader->read(&image); 196 197 if (image.isNull()) { 197 QPixmap pixmap = QPixmap::fromImageReader(m_reader.get()); 198 199 if (pixmap.isNull()) { 198 200 frameCount(); 199 201 repetitionCount(); … … 202 204 } 203 205 204 buffer->setOriginalFrameRect(image.rect()); 205 buffer->setHasAlpha(image.hasAlphaChannel()); 206 // now into the ImageFrame - even if the image is not 207 ImageFrame* const buffer = &m_frameBufferCache[frameIndex]; 208 buffer->setOriginalFrameRect(m_reader->currentImageRect()); 206 209 buffer->setStatus(ImageFrame::FrameComplete); 207 210 buffer->setDuration(m_reader->nextImageDelay()); 211 buffer->setPixmap(pixmap); 208 212 return true; 209 213 } … … 242 246 m_buffer.clear(); 243 247 } 244 245 NativeImagePtr ImageFrame::asNewNativeImage() const246 {247 QImage::Format format;248 if (m_hasAlpha)249 format = m_premultiplyAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32;250 else251 format = QImage::Format_RGB32;252 253 QImage img(reinterpret_cast<uchar*>(m_bytes), m_size.width(), m_size.height(), sizeof(PixelData) * m_size.width(), format);254 255 return new QPixmap(QPixmap::fromImage(img));256 }257 258 248 } 259 249 -
trunk/Source/WebCore/platform/image-decoders/ImageDecoder.cpp
r116086 r116105 21 21 22 22 #include "config.h" 23 23 24 #include "ImageDecoder.h" 25 26 #include <algorithm> 27 #include <cmath> 24 28 25 29 #include "BMPImageDecoder.h" 26 30 #include "GIFImageDecoder.h" 27 31 #include "ICOImageDecoder.h" 28 #if PLATFORM(QT)29 #include "ImageDecoderQt.h"30 #endif31 32 #include "JPEGImageDecoder.h" 32 33 #include "PNGImageDecoder.h" 33 #include "SharedBuffer.h"34 34 #if USE(WEBP) 35 35 #include "WEBPImageDecoder.h" 36 36 #endif 37 38 #include <algorithm> 39 #include <cmath> 37 #include "SharedBuffer.h" 40 38 41 39 using namespace std; … … 127 125 return new ICOImageDecoder(alphaOption, gammaAndColorProfileOption); 128 126 129 #if PLATFORM(QT)130 return new ImageDecoderQt(alphaOption, gammaAndColorProfileOption);131 #endif132 127 return 0; 133 128 } -
trunk/Source/WebCore/platform/image-decoders/ImageDecoder.h
r116086 r116105 41 41 #include "NativeImageSkia.h" 42 42 #include "SkColorPriv.h" 43 #elif PLATFORM(QT) 44 #include <QPixmap> 45 #include <QImage> 43 46 #endif 44 47 … … 62 65 // contents 63 66 }; 64 #if USE(SKIA) 67 #if USE(SKIA) || (PLATFORM(QT) && USE(QT_IMAGE_DECODER)) 65 68 typedef uint32_t PixelData; 66 69 #else … … 138 141 #if USE(SKIA) 139 142 return m_bitmap.bitmap().getAddr32(x, y); 143 #elif PLATFORM(QT) && USE(QT_IMAGE_DECODER) 144 m_image = m_pixmap.toImage(); 145 m_pixmap = QPixmap(); 146 return reinterpret_cast_ptr<QRgb*>(m_image.scanLine(y)) + x; 140 147 #else 141 148 return m_bytes + (y * width()) + x; 142 149 #endif 143 150 } 151 152 #if PLATFORM(QT) && USE(QT_IMAGE_DECODER) 153 void setPixmap(const QPixmap& pixmap); 154 #endif 155 144 156 private: 145 157 #if USE(CG) … … 179 191 ColorProfile m_colorProfile; 180 192 #endif 193 #elif PLATFORM(QT) && USE(QT_IMAGE_DECODER) 194 mutable QPixmap m_pixmap; 195 mutable QImage m_image; 196 bool m_hasAlpha; 197 IntSize m_size; 181 198 #else 182 199 NativeBackingStore m_backingStore; -
trunk/Source/WebKit/blackberry/ChangeLog
r116085 r116105 1 2012-05-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r116085, r116091, and r116095. 4 http://trac.webkit.org/changeset/116085 5 http://trac.webkit.org/changeset/116091 6 http://trac.webkit.org/changeset/116095 7 https://bugs.webkit.org/show_bug.cgi?id=85628 8 9 We are not ready with dependencies on all platform yet (mac) + 10 problems with debug builds. (Requested by Zoltan on #webkit). 11 12 * WebCoreSupport/AboutDataEnableFeatures.in: 13 1 14 2012-05-04 Zoltan Horvath <zoltan@webkit.org> 2 15 -
trunk/Source/WebKit/blackberry/WebCoreSupport/AboutDataEnableFeatures.in
r116085 r116105 108 108 PROGRESS_TAG 109 109 PURGEABLE_MEMORY 110 QT_IMAGE_DECODER 110 111 QUOTA 111 112 REGEXP_TRACING -
trunk/Tools/ChangeLog
r116097 r116105 1 2012-05-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r116085, r116091, and r116095. 4 http://trac.webkit.org/changeset/116085 5 http://trac.webkit.org/changeset/116091 6 http://trac.webkit.org/changeset/116095 7 https://bugs.webkit.org/show_bug.cgi?id=85628 8 9 We are not ready with dependencies on all platform yet (mac) + 10 problems with debug builds. (Requested by Zoltan on #webkit). 11 12 * qmake/mkspecs/features/features.prf: 13 1 14 2012-05-04 Christophe Dumez <christophe.dumez@intel.com> 2 15 -
trunk/Tools/qmake/mkspecs/features/features.prf
r116089 r116105 115 115 !contains(DEFINES, ENABLE_FAST_MOBILE_SCROLLING=.): DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1 116 116 !contains(DEFINES, ENABLE_PAGE_VISIBILITY_API=.): DEFINES += ENABLE_PAGE_VISIBILITY_API=1 117 118 # Policy decisions: for using a particular third-party library or optional OS service 119 !contains(DEFINES, WTF_USE_QT_IMAGE_DECODER=.): DEFINES += WTF_USE_QT_IMAGE_DECODER=1 117 120 118 121 # Enabled in Source/JavaScriptCore/wtf/Platform.h if not set
Note: See TracChangeset
for help on using the changeset viewer.