[Qt] Change NativeImagePtr from QPixmap* to QImage*
authorzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2012 13:50:14 +0000 (13:50 +0000)
committerzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2012 13:50:14 +0000 (13:50 +0000)
commitddf6e30fcc660a9e059c6a1f4888858c06de69c5
tree3d132f4c22ad9fbd1334a881c36eaa9fbedffdb2
parent67017459d567e3ba2f1fb85d3c24b1446930933d
[Qt] Change NativeImagePtr from QPixmap* to QImage*
https://bugs.webkit.org/show_bug.cgi?id=88785

Reviewed by Simon Hausmann.

Since we use raster engine there is no difference between QPixmap and QImage, so we are going
to use QImage everywhere where it is possible. This refactoring contains the change of the
NativeImagePtr typedef from QPixmap* to QImage* and covers the related modifications.

Part of the change is similar to Viatcheslav Ostapenko's internal work.

Covered by existing tests.

Source/WebCore:

* bridge/qt/qt_pixmapruntime.cpp:
(JSC::Bindings::QtPixmapAssignToElementMethod::invoke):
(JSC::Bindings::QtPixmapInstance::variantFromObject):
* platform/DragImage.h:
(WebCore):
* platform/graphics/GraphicsContext.h:
(GraphicsContext):
* platform/graphics/Image.h:
(Image):
* platform/graphics/ImageSource.h:
(WebCore):
* platform/graphics/gstreamer/ImageGStreamer.h:
* platform/graphics/gstreamer/ImageGStreamerQt.cpp:
(ImageGStreamer::ImageGStreamer):
* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3D::getImageData):
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::pushTransparencyLayerInternal):
(WebCore::GraphicsContext::beginPlatformTransparencyLayer):
(WebCore::GraphicsContext::endPlatformTransparencyLayer):
* platform/graphics/qt/ImageBufferDataQt.h:
(ImageBufferData):
* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::ImageBufferData::ImageBufferData):
(WebCore::ImageBuffer::copyImage):
(WebCore::ImageBuffer::clip):
(WebCore::ImageBuffer::platformTransformColorSpace):
(WebCore::getImageData):
(WebCore::ImageBuffer::putByteArray):
(WebCore::encodeImage):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/qt/ImageDecoderQt.cpp:
(WebCore::ImageFrame::asNewNativeImage):
* platform/graphics/qt/ImageQt.cpp:
(graphics):
(loadResourceImage):
(WebCore::Image::loadPlatformResource):
(WebCore::Image::setPlatformResource):
(WebCore::Image::drawPattern):
(WebCore::BitmapImage::BitmapImage):
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::checkForSolidColor):
(WebCore::BitmapImage::create):
* platform/graphics/qt/NativeImageQt.h: Added.
(WebCore):
(NativeImageQt):
(WebCore::NativeImageQt::defaultFormatForAlphaEnabledImages):
(WebCore::NativeImageQt::defaultFormatForOpaqueImages):
 * platform/graphics/qt/PatternQt.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/qt/StillImageQt.cpp:
(WebCore::StillImage::StillImage):
(WebCore::StillImage::~StillImage):
(WebCore::StillImage::currentFrameHasAlpha):
(WebCore::StillImage::size):
(WebCore::StillImage::nativeImageForCurrentFrame):
(WebCore::StillImage::draw):
* platform/graphics/qt/StillImageQt.h:
(WebCore::StillImage::create):
(WebCore::StillImage::createForRendering):
(StillImage):
* platform/graphics/qt/TransparencyLayer.h:
(WebCore::TransparencyLayer::TransparencyLayer):
(TransparencyLayer):
* platform/graphics/texmap/TextureMapperGL.cpp:
* platform/graphics/surfaces/qt/GraphicsSurfaceQt.cpp:
(WebCore::GraphicsSurface::createReadOnlyImage):
 * platform/qt/ClipboardQt.cpp:
(WebCore::ClipboardQt::createDragImage):
(WebCore::ClipboardQt::declareAndWriteDragImage):
* platform/qt/CursorQt.cpp:
(WebCore::createCustomCursor):
* platform/qt/DragImageQt.cpp:
(WebCore::createDragImageFromImage):
* platform/qt/PasteboardQt.cpp:
(WebCore::Pasteboard::writeImage):

Source/WebKit/qt:

* Api/qwebframe.cpp:
(QWebHitTestResultPrivate::QWebHitTestResultPrivate):
* Api/qwebhistory.cpp:
(QWebHistoryItem::icon):
* Api/qwebsettings.cpp:
(QWebSettings::iconForUrl):
(QWebSettings::setWebGraphic):
(QWebSettings::webGraphic):
* WebCoreSupport/DragClientQt.cpp:
(WebCore::DragClientQt::startDrag):
* WebCoreSupport/InitWebCoreQt.cpp:
(WebCore::initializeWebCoreQt):

Source/WebKit2:

* Shared/qt/ShareableBitmapQt.cpp:
(WebKit::ShareableBitmap::createImage):
* UIProcess/qt/QtWebIconDatabaseClient.cpp:
(WebKit::QtWebIconDatabaseClient::iconImageForPageURL):
* WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp:
(WebKit::convertQImageToShareableBitmap):
(WebKit::WebDragClient::startDrag):
* WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::adoptImageBackingStore):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
36 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Target.pri
Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
Source/WebCore/platform/DragImage.h
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/ImageSource.h [changed mode: 0644->0755]
Source/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
Source/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp
Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
Source/WebCore/platform/graphics/qt/ImageBufferDataQt.h
Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp [changed mode: 0644->0755]
Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp [changed mode: 0644->0755]
Source/WebCore/platform/graphics/qt/ImageQt.cpp [changed mode: 0644->0755]
Source/WebCore/platform/graphics/qt/NativeImageQt.h [new file with mode: 0644]
Source/WebCore/platform/graphics/qt/PatternQt.cpp
Source/WebCore/platform/graphics/qt/StillImageQt.cpp
Source/WebCore/platform/graphics/qt/StillImageQt.h [changed mode: 0644->0755]
Source/WebCore/platform/graphics/qt/TransparencyLayer.h [changed mode: 0644->0755]
Source/WebCore/platform/graphics/surfaces/qt/GraphicsSurfaceQt.cpp
Source/WebCore/platform/qt/ClipboardQt.cpp
Source/WebCore/platform/qt/CursorQt.cpp
Source/WebCore/platform/qt/DragImageQt.cpp
Source/WebCore/platform/qt/PasteboardQt.cpp
Source/WebKit/qt/Api/qwebframe.cpp
Source/WebKit/qt/Api/qwebhistory.cpp
Source/WebKit/qt/Api/qwebsettings.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp
Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp
Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/qt/WebDragClientQt.cpp
Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp