wip Use QImage instead of QImage in NativeImagePtr and DragImageRef
commit997993c422d19ac18542a9cc0df1a46f9a489f96
authorKonstantin Tokarev <annulen@yandex.ru>
Fri, 13 Sep 2019 19:13:45 +0000 (13 22:13 +0300)
committerKonstantin Tokarev <annulen@yandex.ru>
Mon, 21 Sep 2020 19:34:22 +0000 (21 22:34 +0300)
tree917e8b78ee4e8714be60c7aad7b362045be42552
parent66cc3534870bf40b34c8681b1e897cd9cdf89c26
wip Use QImage instead of QImage in NativeImagePtr and DragImageRef

QImage is internally a pointer to data with shared ownership, which makes
its behavior close to RefPtr<cairo_surface_t> and RetainPtr<NSImage>.

OTOH, this change a) breaks source compatibility with nullptr and boolean
conversions; b) can lead to unexpected detaches and writing image changes
to object's copy.

For some reason, this change fixes existing issues with image decoding.

TODO: Implement wrapper object for QImage, check ownership model, make
sure that QPixmap::fromImage is called with QImage&& where appropriate

Change-Id: I7e9f8e69f4fdcb335dd7b055b659b7d8b36a2e89
25 files changed:
Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
Source/WebCore/dom/DataTransfer.cpp
Source/WebCore/platform/DragImage.cpp
Source/WebCore/platform/DragImage.h
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/ImageFrame.cpp
Source/WebCore/platform/graphics/ImageSource.cpp
Source/WebCore/platform/graphics/NativeImage.h
Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
Source/WebCore/platform/graphics/qt/ImageBufferDataQt.cpp
Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
Source/WebCore/platform/graphics/qt/NativeImageQt.cpp
Source/WebCore/platform/graphics/qt/PatternQt.cpp
Source/WebCore/platform/graphics/qt/StillImageQt.cpp
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Source/WebCore/platform/image-decoders/ScalableImageDecoder.cpp
Source/WebCore/platform/image-decoders/qt/ImageBackingStoreQt.cpp
Source/WebCore/platform/qt/CursorQt.cpp
Source/WebCore/platform/qt/DragImageQt.cpp
Source/WebCore/platform/qt/PasteboardQt.cpp
Source/WebKitLegacy/qt/Api/qwebsettings.cpp
Source/WebKitLegacy/qt/WebCoreSupport/DragClientQt.cpp
Source/WebKitLegacy/qt/WebCoreSupport/QWebFrameAdapter.cpp