diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-20 15:59:33 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-20 15:59:33 +0100 |
commit | 8e024693674da7f298339a31d7483f1ec8c9a549 (patch) | |
tree | 1de2cea56f4594b1cb4ec11233b510daaa733cf9 | |
parent | 3a3681158677f319bce88eee75d2696b8231eb1f (diff) | |
parent | c1fbe1875c0f31faaac604cd861766a7c14e3cdf (diff) | |
download | qtwebkit-8e024693674da7f298339a31d7483f1ec8c9a549.tar.gz |
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
.qmake.conf
Change-Id: Ic900e9207ae48520c99894345fe0b4d0ab58ec44
31 files changed, 248 insertions, 74 deletions
diff --git a/Source/WTF/WTF.pri b/Source/WTF/WTF.pri index 696e4962e..bb130f6a4 100644 --- a/Source/WTF/WTF.pri +++ b/Source/WTF/WTF.pri @@ -14,7 +14,17 @@ mac { INCLUDEPATH = $${ROOT_WEBKIT_DIR}/Source/WTF/icu $$INCLUDEPATH LIBS += -licucore } else:!use?(wchar_unicode): { - win32: LIBS += -licuin -licuuc -licudt + win32 { + CONFIG(static, static|shared) { + CONFIG(debug, debug|release) { + LIBS += -lsicuind -lsicuucd -lsicudtd + } else { + LIBS += -lsicuin -lsicuuc -lsicudt + } + } else { + LIBS += -licuin -licuuc -licudt + } + } else:!contains(QT_CONFIG,no-pkg-config):packagesExist("icu-i18n"): PKGCONFIG *= icu-i18n else:android: LIBS += -licui18n -licuuc else: LIBS += -licui18n -licuuc -licudata diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri index b9167d13b..d1aad9f9b 100644 --- a/Source/WebCore/Target.pri +++ b/Source/WebCore/Target.pri @@ -2232,7 +2232,6 @@ HEADERS += \ platform/graphics/RoundedRect.h \ platform/graphics/qt/FontCustomPlatformData.h \ platform/graphics/qt/NativeImageQt.h \ - platform/graphics/qt/QFramebufferPaintDevice.h \ platform/graphics/qt/StillImageQt.h \ platform/graphics/qt/TransparencyLayer.h \ platform/graphics/SegmentedFontData.h \ @@ -2886,7 +2885,6 @@ SOURCES += \ platform/graphics/qt/IntPointQt.cpp \ platform/graphics/qt/IntRectQt.cpp \ platform/graphics/qt/IntSizeQt.cpp \ - platform/graphics/qt/QFramebufferPaintDevice.cpp \ platform/graphics/qt/PathQt.cpp \ platform/graphics/qt/PatternQt.cpp \ platform/graphics/qt/StillImageQt.cpp \ @@ -4146,6 +4144,7 @@ use?(3D_GRAPHICS) { platform/graphics/gpu/Texture.h \ platform/graphics/gpu/TilingData.h \ platform/graphics/opengl/Extensions3DOpenGL.h \ + platform/graphics/qt/QFramebufferPaintDevice.h \ platform/graphics/texmap/TextureMapperGL.h \ platform/graphics/texmap/TextureMapperShaderProgram.h \ platform/graphics/texmap/coordinated/AreaAllocator.h \ @@ -4182,6 +4181,7 @@ use?(3D_GRAPHICS) { platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp \ platform/graphics/opengl/Extensions3DOpenGLCommon.cpp \ platform/graphics/qt/GraphicsContext3DQt.cpp \ + platform/graphics/qt/QFramebufferPaintDevice.cpp \ platform/graphics/texmap/TextureMapperGL.cpp \ platform/graphics/texmap/TextureMapperShaderProgram.cpp \ platform/graphics/texmap/coordinated/AreaAllocator.cpp \ diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri index 2a4dd3d2d..915a1a468 100644 --- a/Source/WebCore/WebCore.pri +++ b/Source/WebCore/WebCore.pri @@ -125,7 +125,11 @@ enable?(XSLT) { } use?(ZLIB) { - LIBS += -lz + if(unix|mingw):LIBS += -lz + else { + isEmpty(ZLIB_LIBS): LIBS += zdll.lib + else: LIBS += $$ZLIB_LIBS + } } enable?(NETSCAPE_PLUGIN_API) { @@ -248,8 +252,14 @@ have?(sqlite3) { use?(system_leveldb): LIBS += -lleveldb -lmemenv -use?(libjpeg): LIBS += -ljpeg -use?(libpng): LIBS += -lpng +use?(libjpeg) { + msvc: LIBS += libjpeg.lib + else: LIBS += -ljpeg +} +use?(libpng) { + if(unix|mingw): LIBS += -lpng + else:win32: LIBS += libpng.lib +} use?(webp): LIBS += -lwebp enable?(opencl) { diff --git a/Source/WebCore/html/HTMLCanvasElement.cpp b/Source/WebCore/html/HTMLCanvasElement.cpp index b856234b1..ae399596a 100644 --- a/Source/WebCore/html/HTMLCanvasElement.cpp +++ b/Source/WebCore/html/HTMLCanvasElement.cpp @@ -586,7 +586,7 @@ void HTMLCanvasElement::createImageBuffer() const return; RenderingMode renderingMode = shouldAccelerate(bufferSize) ? Accelerated : Unaccelerated; -#if PLATFORM(QT) +#if PLATFORM(QT) && ENABLE(ACCELERATED_2D_CANVAS) if (renderingMode == Accelerated) { QWebPageClient* client = document()->page()->chrome().platformPageClient(); // The WebKit2 Chrome does not have a pageclient. diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp index 395aabe80..ea0fe4c4c 100644 --- a/Source/WebCore/html/HTMLMediaElement.cpp +++ b/Source/WebCore/html/HTMLMediaElement.cpp @@ -265,6 +265,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum , m_readyState(HAVE_NOTHING) , m_readyStateMaximum(HAVE_NOTHING) , m_volume(1.0f) + , m_volumeInitialized(false) , m_lastSeekTime(0) , m_previousProgressTime(numeric_limits<double>::max()) , m_lastTimeUpdateEventWallTime(0) @@ -2736,6 +2737,7 @@ void HTMLMediaElement::setVolume(double vol, ExceptionCode& ec) if (m_volume != vol) { m_volume = vol; + m_volumeInitialized = true; updateVolume(); scheduleEvent(eventNames().volumechangeEvent); } @@ -5104,6 +5106,11 @@ void HTMLMediaElement::mediaPlayerPlay() play(); } +bool HTMLMediaElement::mediaPlayerPlatformVolumeConfigurationRequired() const +{ + return !m_volumeInitialized; +} + bool HTMLMediaElement::mediaPlayerIsPaused() const { return paused(); diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h index 66bd638b5..be8a7b1e8 100644 --- a/Source/WebCore/html/HTMLMediaElement.h +++ b/Source/WebCore/html/HTMLMediaElement.h @@ -504,6 +504,7 @@ private: virtual void mediaPlayerSetSize(const IntSize&) OVERRIDE; virtual void mediaPlayerPause() OVERRIDE; virtual void mediaPlayerPlay() OVERRIDE; + virtual bool mediaPlayerPlatformVolumeConfigurationRequired() const OVERRIDE; virtual bool mediaPlayerIsPaused() const OVERRIDE; virtual bool mediaPlayerIsLooping() const OVERRIDE; virtual HostWindow* mediaPlayerHostWindow() OVERRIDE; @@ -640,6 +641,7 @@ private: RefPtr<MediaError> m_error; double m_volume; + bool m_volumeInitialized; double m_lastSeekTime; unsigned m_previousProgress; diff --git a/Source/WebCore/html/ImageDocument.cpp b/Source/WebCore/html/ImageDocument.cpp index 444bdb76a..7d9bcc589 100644 --- a/Source/WebCore/html/ImageDocument.cpp +++ b/Source/WebCore/html/ImageDocument.cpp @@ -152,8 +152,8 @@ void ImageDocumentParser::finish() if (document()->frame()->loader()->documentLoader()->isLoadingMultipartContent()) data = data->copy(); - cachedImage->finishLoading(data.get()); cachedImage->finish(); + cachedImage->finishLoading(data.get()); cachedImage->setResponse(document()->frame()->loader()->documentLoader()->response()); diff --git a/Source/WebCore/platform/graphics/ImageBuffer.h b/Source/WebCore/platform/graphics/ImageBuffer.h index 7addde9d5..a30d0523c 100644 --- a/Source/WebCore/platform/graphics/ImageBuffer.h +++ b/Source/WebCore/platform/graphics/ImageBuffer.h @@ -95,7 +95,7 @@ namespace WebCore { } static PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, float resolutionScale, ColorSpace, const GraphicsContext*, bool hasAlpha); -#if PLATFORM(QT) +#if PLATFORM(QT) && ENABLE(ACCELERATED_2D_CANVAS) static PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, float resolutionScale, ColorSpace, QOpenGLContext*); #endif @@ -165,7 +165,7 @@ namespace WebCore { // This constructor will place its success into the given out-variable // so that create() knows when it should return failure. ImageBuffer(const IntSize&, float resolutionScale, ColorSpace, RenderingMode, bool& success); -#if PLATFORM(QT) +#if PLATFORM(QT) && ENABLE(ACCELERATED_2D_CANVAS) ImageBuffer(const IntSize&, float resolutionScale, ColorSpace, QOpenGLContext*, bool& success); #endif }; diff --git a/Source/WebCore/platform/graphics/MediaPlayer.h b/Source/WebCore/platform/graphics/MediaPlayer.h index 92734cab5..df9d2a108 100644 --- a/Source/WebCore/platform/graphics/MediaPlayer.h +++ b/Source/WebCore/platform/graphics/MediaPlayer.h @@ -213,6 +213,7 @@ public: virtual void mediaPlayerSetSize(const IntSize&) { } virtual void mediaPlayerPause() { } virtual void mediaPlayerPlay() { } + virtual bool mediaPlayerPlatformVolumeConfigurationRequired() const { return false; } virtual bool mediaPlayerIsPaused() const { return true; } virtual bool mediaPlayerIsLooping() const { return false; } virtual HostWindow* mediaPlayerHostWindow() { return 0; } @@ -327,6 +328,7 @@ public: double volume() const; void setVolume(double); + bool platformVolumeConfigurationRequired() const { return m_mediaPlayerClient->mediaPlayerPlatformVolumeConfigurationRequired(); } bool muted() const; void setMuted(bool); diff --git a/Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h index 8b46cd688..87d3f95ba 100644 --- a/Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h +++ b/Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h @@ -60,7 +60,7 @@ class ImageGStreamer : public RefCounted<ImageGStreamer> { RefPtr<BitmapImage> m_image; FloatRect m_cropRect; -#if USE(CAIRO) && defined(GST_API_VERSION_1) +#if defined(GST_API_VERSION_1) GRefPtr<GstBuffer> m_buffer; GstMapInfo m_mapInfo; #endif diff --git a/Source/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp b/Source/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp index 375026d1f..ece3c3f27 100644 --- a/Source/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp @@ -30,11 +30,12 @@ #include <wtf/gobject/GOwnPtr.h> -using namespace std; using namespace WebCore; ImageGStreamer::ImageGStreamer(GstBuffer* buffer, GstCaps* caps) - : m_image(0) +#ifdef GST_API_VERSION_1 + : m_buffer(buffer) +#endif { GstVideoFormat format; IntSize size; @@ -42,40 +43,26 @@ ImageGStreamer::ImageGStreamer(GstBuffer* buffer, GstCaps* caps) getVideoSizeAndFormatFromCaps(caps, size, format, pixelAspectRatioNumerator, pixelAspectRatioDenominator, stride); #ifdef GST_API_VERSION_1 - GstMapInfo info; - gst_buffer_map(buffer, &info, GST_MAP_READ); - uchar* bufferData = reinterpret_cast<uchar*>(info.data); + gst_buffer_map(buffer, &m_mapInfo, GST_MAP_READ); + uchar* bufferData = reinterpret_cast<uchar*>(m_mapInfo.data); #else uchar* bufferData = reinterpret_cast<uchar*>(GST_BUFFER_DATA(buffer)); #endif QImage::Format imageFormat; - QImage::InvertMode invertMode; #if G_BYTE_ORDER == G_LITTLE_ENDIAN - if (format == GST_VIDEO_FORMAT_BGRA) { - imageFormat = QImage::Format_ARGB32; - invertMode = QImage::InvertRgba; - } else { - imageFormat = QImage::Format_RGB32; - invertMode = QImage::InvertRgb; - } + imageFormat = (format == GST_VIDEO_FORMAT_BGRA) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32; #else - imageFormat = (format == GST_VIDEO_FORMAT_ARGB) ? QImage::Format_ARGB32 : QImage::Format_RGB32; + imageFormat = (format == GST_VIDEO_FORMAT_ARGB) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32; #endif QImage image(bufferData, size.width(), size.height(), imageFormat); -#if G_BYTE_ORDER == G_LITTLE_ENDIAN - image.invertPixels(invertMode); -#endif - QPixmap* surface = new QPixmap; - surface->convertFromImage(image); + QPixmap *surface = new QPixmap(QPixmap::fromImage(qMove(image), Qt::NoFormatConversion)); m_image = BitmapImage::create(surface); #ifdef GST_API_VERSION_1 if (GstVideoCropMeta* cropMeta = gst_buffer_get_video_crop_meta(buffer)) setCropRect(FloatRect(cropMeta->x, cropMeta->y, cropMeta->width, cropMeta->height)); - - gst_buffer_unmap(buffer, &info); #endif } @@ -85,6 +72,12 @@ ImageGStreamer::~ImageGStreamer() m_image.clear(); m_image = 0; + +#ifdef GST_API_VERSION_1 + // We keep the buffer memory mapped until the image is destroyed because the internal + // QImage/QPixmap was created using the buffer data directly. + gst_buffer_unmap(m_buffer.get(), &m_mapInfo); +#endif } #endif // USE(GSTREAMER) diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp index 8f6077de1..83c896c39 100644 --- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp @@ -76,6 +76,7 @@ static int greatestCommonDivisor(int a, int b) static void mediaPlayerPrivateVolumeChangedCallback(GObject*, GParamSpec*, MediaPlayerPrivateGStreamerBase* player) { // This is called when m_volumeElement receives the notify::volume signal. + LOG_MEDIA_MESSAGE("Volume changed to: %f", player->volume()); player->volumeChanged(); } @@ -234,6 +235,7 @@ void MediaPlayerPrivateGStreamerBase::setVolume(float volume) if (!m_volumeElement) return; + LOG_MEDIA_MESSAGE("Setting volume: %f", volume); gst_stream_volume_set_volume(m_volumeElement.get(), GST_STREAM_VOLUME_FORMAT_CUBIC, static_cast<double>(volume)); } @@ -618,7 +620,16 @@ void MediaPlayerPrivateGStreamerBase::setStreamVolumeElement(GstStreamVolume* vo ASSERT(!m_volumeElement); m_volumeElement = volume; - g_object_set(m_volumeElement.get(), "mute", m_player->muted(), "volume", m_player->volume(), NULL); + // We don't set the initial volume because we trust the sink to keep it for us. See + // https://bugs.webkit.org/show_bug.cgi?id=118974 for more information. + if (!m_player->platformVolumeConfigurationRequired()) { + LOG_MEDIA_MESSAGE("Setting stream volume to %f", m_player->volume()); + g_object_set(m_volumeElement.get(), "volume", m_player->volume(), NULL); + } else + LOG_MEDIA_MESSAGE("Not setting stream volume, trusting system one"); + + LOG_MEDIA_MESSAGE("Setting stream muted %d", m_player->muted()); + g_object_set(m_volumeElement.get(), "mute", m_player->muted(), NULL); m_volumeSignalHandler = g_signal_connect(m_volumeElement.get(), "notify::volume", G_CALLBACK(mediaPlayerPrivateVolumeChangedCallback), this); m_muteSignalHandler = g_signal_connect(m_volumeElement.get(), "notify::mute", G_CALLBACK(mediaPlayerPrivateMuteChangedCallback), this); diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp index edb7636d4..0c9fddc83 100644 --- a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp +++ b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp @@ -100,6 +100,7 @@ public: void createGraphicsSurfaces(const IntSize&); bool isOpenGLES() const; + bool isValid() const; GraphicsContext3D* m_context; HostWindow* m_hostWindow; @@ -123,6 +124,13 @@ bool GraphicsContext3DPrivate::isOpenGLES() const #endif } +bool GraphicsContext3DPrivate::isValid() const +{ + if (!m_platformContext || !m_platformContext->isValid()) + return false; + return m_platformContext->isOpenGLES() || m_platformContext->format().majorVersion() >= 2; +} + bool GraphicsContext3D::isGLES2Compliant() const { if (m_private) @@ -408,12 +416,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi m_functions = m_private.get(); validateAttributes(); - static bool initialized = false; - static bool success = true; - if (!initialized) { - initialized = true; - } - if (!success) { + if (!m_private->isValid()) { m_private = nullptr; return; } diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp index 4a1651548..1235ce690 100644 --- a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp +++ b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp @@ -34,7 +34,6 @@ #include "GraphicsSurface.h" #include "ImageData.h" #include "StillImageQt.h" -#include "QFramebufferPaintDevice.h" #include <QImage> #include <QPaintEngine> @@ -42,6 +41,7 @@ #include <QPixmap> #if ENABLE(ACCELERATED_2D_CANVAS) +#include "QFramebufferPaintDevice.h" #include "TextureMapper.h" #include "TextureMapperPlatformLayer.h" #include "TextureMapperGL.h" @@ -483,16 +483,12 @@ ImageBufferData::ImageBufferData(const IntSize& size) initPainter(); } +#if ENABLE(ACCELERATED_2D_CANVAS) ImageBufferData::ImageBufferData(const IntSize& size, QOpenGLContext* compatibleContext) { m_painter = new QPainter; -#if ENABLE(ACCELERATED_2D_CANVAS) m_impl = new ImageBufferDataPrivateAccelerated(size, compatibleContext); -#else - Q_UNUSED(compatibleContext); - m_impl = new ImageBufferDataPrivateUnaccelerated(size); -#endif if (!m_impl->paintDevice()) return; @@ -501,11 +497,14 @@ ImageBufferData::ImageBufferData(const IntSize& size, QOpenGLContext* compatible initPainter(); } +#endif ImageBufferData::~ImageBufferData() { +#if ENABLE(ACCELERATED_2D_CANVAS) if (m_impl->isAccelerated()) static_cast<QFramebufferPaintDevice*>(m_impl->paintDevice())->ensureActiveTarget(); +#endif m_painter->end(); delete m_painter; delete m_impl; diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h index 486b0d576..fcad887d3 100644 --- a/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h +++ b/Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h @@ -29,10 +29,13 @@ #include "Image.h" #include <QImage> -#include <QOpenGLContext> #include <QPainter> #include <QPaintDevice> +#if ENABLE(ACCELERATED_2D_CANVAS) +#include <QOpenGLContext> +#endif + #include <wtf/RefPtr.h> namespace WebCore { @@ -61,7 +64,9 @@ class ImageBufferData { public: ImageBufferData(const IntSize&); +#if ENABLE(ACCELERATED_2D_CANVAS) ImageBufferData(const IntSize&, QOpenGLContext*); +#endif ~ImageBufferData(); QPainter* m_painter; ImageBufferDataPrivate* m_impl; diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp index 400743df2..09c90a6a0 100644 --- a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp +++ b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp @@ -47,6 +47,7 @@ namespace WebCore { +#if ENABLE(ACCELERATED_2D_CANVAS) ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, QOpenGLContext* compatibleContext, bool& success) : m_data(size, compatibleContext) , m_size(size) @@ -58,6 +59,7 @@ ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, Color m_context = adoptPtr(new GraphicsContext(m_data.m_painter)); } +#endif ImageBuffer::ImageBuffer(const IntSize& size, float /* resolutionScale */, ColorSpace, RenderingMode /*renderingMode*/, bool& success) : m_data(size) @@ -75,6 +77,7 @@ ImageBuffer::~ImageBuffer() { } +#if ENABLE(ACCELERATED_2D_CANVAS) PassOwnPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const IntSize& size, float resolutionScale, ColorSpace colorSpace, QOpenGLContext* context) { bool success = false; @@ -83,6 +86,7 @@ PassOwnPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const IntSize& size, return nullptr; return buf.release(); } +#endif GraphicsContext* ImageBuffer::context() const { diff --git a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp index d15dce2da..7da75c874 100644 --- a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp +++ b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp @@ -104,11 +104,7 @@ void init_source(j_decompress_ptr jd); boolean fill_input_buffer(j_decompress_ptr jd); void skip_input_data(j_decompress_ptr jd, long num_bytes); void term_source(j_decompress_ptr jd); -#if PLATFORM(QT) -void error_exit(j_common_ptr) NO_RETURN; -#else -void error_exit(j_common_ptr cinfo); -#endif +NO_RETURN void error_exit(j_common_ptr cinfo); // Implementation of a JPEG src object that understands our state machine struct decoder_source_mgr { diff --git a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp index 776acce2b..b17d681f9 100644 --- a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp +++ b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp @@ -67,9 +67,7 @@ const double cInverseGamma = 0.45455; const unsigned long cMaxPNGSize = 1000000UL; // Called if the decoding of the image fails. -#if PLATFORM(QT) -static void PNGAPI decodingFailed(png_structp, png_const_charp) NO_RETURN; -#endif +static NO_RETURN void PNGAPI decodingFailed(png_structp, png_const_charp); static void PNGAPI decodingFailed(png_structp png, png_const_charp) { longjmp(JMPBUF(png), 1); diff --git a/Source/WebCore/platform/qt/PasteboardQt.cpp b/Source/WebCore/platform/qt/PasteboardQt.cpp index 2bcdd5ffa..9114fd571 100644 --- a/Source/WebCore/platform/qt/PasteboardQt.cpp +++ b/Source/WebCore/platform/qt/PasteboardQt.cpp @@ -58,6 +58,19 @@ static bool isHtmlMimeType(const String& type) return type == "text/html" || type.startsWith("text/html;"); } +static String normalizeMimeType(const String& type) +{ + // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dom-datatransfer-setdata + String qType = type.lower(); + + if (qType == "text") + qType = ASCIILiteral("text/plain"); + else if (qType == "url") + qType = ASCIILiteral("text/uri-list"); + + return qType; +} + PassOwnPtr<Pasteboard> Pasteboard::create(const QMimeData* readableClipboard, bool isForDragAndDrop) { return adoptPtr(new Pasteboard(readableClipboard, isForDragAndDrop)); @@ -313,13 +326,15 @@ String Pasteboard::readString(const String& type) if (!data) return String(); - if (isHtmlMimeType(type) && data->hasHtml()) + String mimeType = normalizeMimeType(type); + + if (isHtmlMimeType(mimeType) && data->hasHtml()) return data->html(); - if (isTextMimeType(type) && data->hasText()) + if (isTextMimeType(mimeType) && data->hasText()) return data->text(); - QByteArray rawData = data->data(type); + QByteArray rawData = data->data(mimeType); QString stringData = QTextCodec::codecForName("UTF-16")->toUnicode(rawData); return stringData; } @@ -329,13 +344,15 @@ bool Pasteboard::writeString(const String& type, const String& data) if (!m_writableData) m_writableData = new QMimeData; - if (isTextMimeType(type)) + String mimeType = normalizeMimeType(type); + + if (isTextMimeType(mimeType)) m_writableData->setText(QString(data)); - else if (isHtmlMimeType(type)) + else if (isHtmlMimeType(mimeType)) m_writableData->setHtml(QString(data)); else { QByteArray array(reinterpret_cast<const char*>(data.characters()), data.length() * 2); - m_writableData->setData(QString(type), array); + m_writableData->setData(QString(mimeType), array); } return true; diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index 2d0b56e79..7d65190b4 100644 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -330,6 +330,8 @@ bool RenderLayer::canRender3DTransforms() const { #if USE(ACCELERATED_COMPOSITING) return compositor()->canRender3DTransforms(); +#elif PLATFORM(QT) && ENABLE(3D_RENDERING) + return true; #else return false; #endif @@ -3999,7 +4001,11 @@ void RenderLayer::paintLayerByApplyingTransform(GraphicsContext* context, const // Apply the transform. GraphicsContextStateSaver stateSaver(*context); +#if PLATFORM(QT) && ENABLE(3D_RENDERING) + context->concat3DTransform(transform); +#else context->concatCTM(transform.toAffineTransform()); +#endif // Now do a paint with the root layer shifted to be us. LayerPaintingInfo transformedPaintingInfo(this, enclosingIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect)), paintingInfo.paintBehavior, @@ -4373,7 +4379,11 @@ void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsCo transform.translateRight(roundToInt(childOffset.x() + offset.width()), roundToInt(childOffset.y() + offset.height())); // Apply the transform. +#if PLATFORM(QT) && ENABLE(3D_RENDERING) + context->concat3DTransform(transform); +#else context->concatCTM(transform.toAffineTransform()); +#endif // Now do a paint with the root layer shifted to be the next multicol block. LayerPaintingInfo columnPaintingInfo(paintingInfo); diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp index da390cb75..91ee28ae7 100644 --- a/Source/WebCore/rendering/RenderLayerCompositor.cpp +++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp @@ -325,7 +325,13 @@ void RenderLayerCompositor::cacheAcceleratedCompositingFlags() bool RenderLayerCompositor::canRender3DTransforms() const { +#if !ENABLE(3D_RENDERING) + return false; +#elif PLATFORM(QT) + return true; +#else return hasAcceleratedCompositing() && (m_compositingTriggers & ChromeClient::ThreeDTransformTrigger); +#endif } void RenderLayerCompositor::setCompositingLayersNeedRebuild(bool needRebuild) diff --git a/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp index dafb0e287..f4d7f0572 100644 --- a/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp +++ b/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp @@ -837,7 +837,7 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult innerNode->ref(); innerNonSharedNode = hitTest.innerNonSharedNode(); innerNonSharedNode->ref(); - boundingRect = innerNonSharedNode ? innerNonSharedNode->renderer()->absoluteBoundingBoxRect() : IntRect(); + boundingRect = (innerNonSharedNode && innerNonSharedNode->renderer())? innerNonSharedNode->renderer()->absoluteBoundingBoxRect() : IntRect(); WebCore::Image *img = hitTest.image(); if (img) { QPixmap* pix = img->nativeImageForCurrentFrame(); diff --git a/Source/WebKit/qt/WidgetApi/qwebpage.cpp b/Source/WebKit/qt/WidgetApi/qwebpage.cpp index f798aff3b..613c1ac56 100644 --- a/Source/WebKit/qt/WidgetApi/qwebpage.cpp +++ b/Source/WebKit/qt/WidgetApi/qwebpage.cpp @@ -949,13 +949,14 @@ QPalette QWebPage::palette() const void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event) { - if (handleShortcutOverrideEvent(event)) - return; + if (handleShortcutOverrideEvent(event)) { + if (event->isAccepted()) + return; #ifndef QT_NO_SHORTCUT - if (editorActionForKeyEvent(event) != QWebPage::NoWebAction) - event->accept(); + else if (editorActionForKeyEvent(event) != QWebPage::NoWebAction) + event->accept(); #endif - + } } bool QWebPagePrivate::gestureEvent(QGestureEvent* event) @@ -1213,6 +1214,48 @@ QWebInspector* QWebPagePrivate::getOrCreateInspector() \value WebModalDialog The window acts as modal dialog. */ +/*! + \enum QWebPage::PermissionPolicy + + This enum describes the permission policies that the user may set for data or device access. + + \value PermissionUnknown It is unknown whether the user grants or denies permission. + \value PermissionGrantedByUser The user has granted permission. + \value PermissionDeniedByUser The user has denied permission. + + \sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), Feature +*/ + +/*! + \enum QWebPage::Feature + + This enum describes the platform feature access categories that the user may be asked to grant or deny access to. + + \value Notifications Access to notifications + \value Geolocation Access to location hardware or service + + \sa featurePermissionRequested(), featurePermissionRequestCanceled(), setFeaturePermission(), PermissionPolicy + +*/ + +/*! + \fn void QWebPage::featurePermissionRequested(QWebFrame* frame, QWebPage::Feature feature); + + This is signal is emitted when the given \a frame requests to make use of + the resource or device identified by \a feature. + + \sa featurePermissionRequestCanceled(), setFeaturePermission() +*/ + +/*! + \fn void QWebPage::featurePermissionRequestCanceled(QWebFrame* frame, QWebPage::Feature feature); + + This is signal is emitted when the given \a frame cancels a previously issued + request to make use of \a feature. + + \sa featurePermissionRequested(), setFeaturePermission() + +*/ /*! \class QWebPage::ViewportAttributes @@ -1614,6 +1657,13 @@ bool QWebPage::shouldInterruptJavaScript() #endif } +/*! + \fn void QWebPage::setFeaturePermission(QWebFrame* frame, Feature feature, PermissionPolicy policy) + + Sets the permission for the given \a frame to use \a feature to \a policy. + + \sa featurePermissionRequested(), featurePermissionRequestCanceled() +*/ void QWebPage::setFeaturePermission(QWebFrame* frame, Feature feature, PermissionPolicy policy) { #if !ENABLE(NOTIFICATIONS) && !ENABLE(LEGACY_NOTIFICATIONS) && !ENABLE(GEOLOCATION) diff --git a/Source/WebKit/qt/examples/platformplugin/platformplugin.pro b/Source/WebKit/qt/examples/platformplugin/platformplugin.pro index fc533d3bb..bf8fc5b94 100644 --- a/Source/WebKit/qt/examples/platformplugin/platformplugin.pro +++ b/Source/WebKit/qt/examples/platformplugin/platformplugin.pro @@ -3,6 +3,7 @@ TARGET = platformplugin QT += core gui widgets CONFIG += plugin +use?(QT_MULTIMEDIA): QT += multimedia multimediawidgets ## load mobilityconfig if mobility is available load(mobilityconfig, true) diff --git a/Tools/QtTestBrowser/launcherwindow.cpp b/Tools/QtTestBrowser/launcherwindow.cpp index e2dcef39f..d2933979b 100644 --- a/Tools/QtTestBrowser/launcherwindow.cpp +++ b/Tools/QtTestBrowser/launcherwindow.cpp @@ -177,9 +177,9 @@ void LauncherWindow::initializeView() #ifndef QT_NO_OPENGL if (!m_windowOptions.useQOpenGLWidgetViewport) toggleQGLWidgetViewport(m_windowOptions.useQGLWidgetViewport); -#endif if (!m_windowOptions.useQGLWidgetViewport) toggleQOpenGLWidgetViewport(m_windowOptions.useQOpenGLWidgetViewport); +#endif view->setPage(page()); connect(view, SIGNAL(currentFPSUpdated(int)), this, SLOT(updateFPS(int))); @@ -407,7 +407,6 @@ void LauncherWindow::createChrome() toggleQGLWidgetViewport->setChecked(m_windowOptions.useQGLWidgetViewport); toggleQGLWidgetViewport->setEnabled(isGraphicsBased()); toggleQGLWidgetViewport->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool))); -#endif #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) QAction* toggleQOpenGLWidgetViewport = graphicsViewMenu->addAction("Toggle use of QOpenGLWidget Viewport", this, SLOT(toggleQOpenGLWidgetViewport(bool))); toggleQOpenGLWidgetViewport->setCheckable(true); @@ -415,6 +414,7 @@ void LauncherWindow::createChrome() toggleQOpenGLWidgetViewport->setEnabled(isGraphicsBased()); toggleQOpenGLWidgetViewport->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool))); #endif +#endif QMenu* viewportUpdateMenu = graphicsViewMenu->addMenu("Change Viewport Update Mode"); viewportUpdateMenu->setEnabled(isGraphicsBased()); @@ -802,9 +802,9 @@ void LauncherWindow::screenshot() #ifndef QT_NO_OPENGL if (!m_windowOptions.useQOpenGLWidgetViewport) toggleQGLWidgetViewport(m_windowOptions.useQGLWidgetViewport); -#endif if (!m_windowOptions.useQGLWidgetViewport) toggleQOpenGLWidgetViewport(m_windowOptions.useQOpenGLWidgetViewport); +#endif } void LauncherWindow::setEditable(bool on) @@ -997,7 +997,6 @@ void LauncherWindow::toggleQGLWidgetViewport(bool enable) WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view); view->setViewport(enable ? new QGLWidget() : 0); } -#endif void LauncherWindow::toggleQOpenGLWidgetViewport(bool enable) { @@ -1013,6 +1012,7 @@ void LauncherWindow::toggleQOpenGLWidgetViewport(bool enable) view->setViewport(enable ? new QOpenGLWidget() : 0); #endif } +#endif void LauncherWindow::changeViewportUpdateMode(int mode) { diff --git a/Tools/QtTestBrowser/launcherwindow.h b/Tools/QtTestBrowser/launcherwindow.h index c470a5adc..5cee7e5c7 100644 --- a/Tools/QtTestBrowser/launcherwindow.h +++ b/Tools/QtTestBrowser/launcherwindow.h @@ -180,8 +180,8 @@ protected Q_SLOTS: #endif #ifndef QT_NO_OPENGL void toggleQGLWidgetViewport(bool enable); -#endif void toggleQOpenGLWidgetViewport(bool enable); +#endif void changeViewportUpdateMode(int mode); void animatedFlip(); diff --git a/Tools/qmake/config.tests/icu/icu.pro b/Tools/qmake/config.tests/icu/icu.pro index 0486c531a..ce3780a33 100644 --- a/Tools/qmake/config.tests/icu/icu.pro +++ b/Tools/qmake/config.tests/icu/icu.pro @@ -4,6 +4,7 @@ CONFIG -= qt dylib win32 { CONFIG(static, static|shared) { + LIBS += $$QMAKE_LIBS_CORE CONFIG(debug, debug|release) { LIBS += -lsicuind -lsicuucd -lsicudtd } else { diff --git a/Tools/qmake/config.tests/libzlib/libzlib.pro b/Tools/qmake/config.tests/libzlib/libzlib.pro index 816a455c4..2ffc15930 100644 --- a/Tools/qmake/config.tests/libzlib/libzlib.pro +++ b/Tools/qmake/config.tests/libzlib/libzlib.pro @@ -1,3 +1,10 @@ SOURCES = libzlib.cpp OBJECTS_DIR = obj -LIBS += -lz +CONFIG += console +if(unix|mingw):LIBS += -lz +else { + isEmpty(ZLIB_LIBS): LIBS += zdll.lib + else: LIBS += $$ZLIB_LIBS +} + +load(qt_build_config) diff --git a/Tools/qmake/mkspecs/features/configure.prf b/Tools/qmake/mkspecs/features/configure.prf index 2ec8212f3..0df5ee49e 100644 --- a/Tools/qmake/mkspecs/features/configure.prf +++ b/Tools/qmake/mkspecs/features/configure.prf @@ -126,7 +126,7 @@ defineTest(finalizeConfigure) { production_build:blackberry { addReasonForSkippingBuild("Build not supported on BB10 yet.") } - !gnu_thin_archives:contains(QT_CONFIG, static) { + !gnu_thin_archives:!win32-msvc2013:!mingw:contains(QT_CONFIG, static) { addReasonForSkippingBuild("QtWebKit cannot be built as a static library on this platform. Check your configuration in qtbase/config.summary.") } winrt: addReasonForSkippingBuild("QtWebKit is not supported on Windows Phone/Windows RT") diff --git a/Tools/qmake/mkspecs/features/webkit_modules.prf b/Tools/qmake/mkspecs/features/webkit_modules.prf index 005a1bd3d..7040cbbc3 100644 --- a/Tools/qmake/mkspecs/features/webkit_modules.prf +++ b/Tools/qmake/mkspecs/features/webkit_modules.prf @@ -34,7 +34,7 @@ for(library, WEBKIT) { # Anything not linking dynamically to QtWebKit should make sure to have its export # macros synchronized with the code that it will be linked with statically. - !contains(QT, webkit): DEFINES += STATICALLY_LINKED_WITH_$$library + CONFIG(static)|!contains(QT, webkit): DEFINES += STATICALLY_LINKED_WITH_$$library } creating_module { diff --git a/dist/changes-5.4.1 b/dist/changes-5.4.1 new file mode 100644 index 000000000..600ddead9 --- /dev/null +++ b/dist/changes-5.4.1 @@ -0,0 +1,42 @@ +Qt 5.4.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.4.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://doc.qt.io/qt-5.4 + +The Qt version 5.4 series is binary compatible with the 5.3.x series. +Applications compiled for 5.3 will continue to run with 5.4. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Library * +**************************************************************************** + +QtWebkit +-------- + - [QTBUG-43149] Support for MSIE compatible pasteboard types. + - [QTBUG-44024] Fixed memory leak when opening webviews on images. + + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Windows +------- + - Fixed various build issues with MSVC. + - [QTBUG-43831] Avoid crash if a too old version of OpenGL is being used. + +Linux +------- + - [QTBUG-43520] Optimized HTML5 video by avoiding an unnecessary image transform on every frame. + - [QTBUG-43479] Fixed setting system volume to 100% on HTML5 video if channel and system volume have been tied. |