[Cairo] Fix canvas drawing of SVG-based patterns and remove NativeImageCairo
authorch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Apr 2013 17:59:37 +0000 (17:59 +0000)
committerch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Apr 2013 17:59:37 +0000 (17:59 +0000)
commitc5d11550431bd99849200b0a18a744d2097107ad
treec886369b52dcab8a5ea907c4bda4732163ffa8b3
parent14a46e916dbb637b2e2b44cb5c2cf33d004f6ae5
[Cairo] Fix canvas drawing of SVG-based patterns and remove NativeImageCairo
https://bugs.webkit.org/show_bug.cgi?id=113929

Reviewed by Martin Robinson.

Source/WebCore:

Make (Pass)NativeImagePtr typedefs to (Pass)RefPtr<cairo_surface_t> instead
of NativeImageCairo*. Now that we switch to using smart pointers,
NativeImageCairo is removed as it made no sense to make it ref counted when
it merely held a single ref counted member.

Now that Cairo is using smart pointers for (Pass)NativeImagePtr, this patch
also enables the implementation of SVGImage::nativeImageForCurrentFrame()
for USE(CAIRO) as well. This effectively fixes canvas drawing of SVG-based
patterns for Cairo-based ports.

No new tests, covered by svg/canvas/canvas-pattern-svg.html.

* GNUmakefile.list.am: Remove NativeImageCairo.* for GTK.

* PlatformEfl.cmake: Remove NativeImageCairo.* for EFL.

* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
Remove NativeImageCairo.* for Win.

* platform/graphics/BitmapImage.cpp:
(WebCore::FrameData::reportMemoryUsage):
Update MemoryClassInfo::addRawBuffer() call now that m_frame is a RefPtr
for USE(CAIRO).

* platform/graphics/BitmapImage.h:
(BitmapImage):
Remove factory method taking a cairo_surface_t* in argument. This is useless
now that PassNativeImagePtr is a typedef to PassRefPtr<cairo_surface_t> and
there is already a factory method taking a PassNativeImagePtr in argument.

* platform/graphics/NativeImagePtr.h:
(WebCore):
Make PassNativeImagePtr a typedef to PassRefPtr<cairo_surface_t> and
NativeImagePtr a typedef to RefPtr<cairo_surface_t>, instead of
NativeImageCairo*. Moving to smart pointers is needed to enable implementation
of SVGImage::nativeImageForCurrentFrame() for Cairo.

* platform/graphics/cairo/BitmapImageCairo.cpp:
(WebCore::BitmapImage::BitmapImage):
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::checkForSolidColor):
(WebCore::FrameData::clear):
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::Image::drawPattern):
Update Cairo graphics code to reflect the (Pass)NativeImagePtr type changes.

* platform/graphics/cairo/NativeImageCairo.cpp: Removed.
* platform/graphics/cairo/NativeImageCairo.h: Removed.

* platform/graphics/cairo/PatternCairo.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
* platform/graphics/efl/ImageEfl.cpp:
(WebCore::BitmapImage::getEvasObject):
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::BitmapImage::getGdkPixbuf):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::BitmapTextureGL::updateContents):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::create):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/gtk/DragImageGtk.cpp:
(WebCore::createDragImageFromImage):
* platform/image-decoders/cairo/ImageDecoderCairo.cpp:
(WebCore::ImageFrame::asNewNativeImage):
* platform/win/DragImageCairoWin.cpp:
(WebCore::createDragImageFromImage):
Update code to reflect the (Pass)NativeImagePtr type changes.

* svg/graphics/SVGImage.cpp:
(WebCore):
* svg/graphics/SVGImage.h:
Enable SVGImage::nativeImageForCurrentFrame() for USE(CAIRO).

Source/WebKit:

Remove outdated symbols now that NativeImageCairo was removed.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

Source/WebKit/efl:

Update code now that PassNativeImagePtr is now a typedef to PassRefPtr<cairo_surface_t>
instead of NativeImageCairo*.

* ewk/ewk_history.cpp:
(ewk_history_item_icon_surface_get):
(ewk_history_item_icon_object_add):
* ewk/ewk_settings.cpp:
(ewk_settings_icon_database_icon_surface_get):
(ewk_settings_icon_database_icon_object_get):

Source/WebKit/gtk:

Update code now that PassNativeImagePtr is now a typedef to PassRefPtr<cairo_surface_t>
instead of NativeImageCairo*.

* webkit/webkitfavicondatabase.cpp:
(getIconPixbufSynchronously):

Source/WebKit/win:

Remove outdated symbols now that NativeImageCairo was removed.

* WebKit.vcproj/WebKitExports.def.in:

Source/WebKit2:

Update code now that PassNativeImagePtr is now a typedef to PassRefPtr<cairo_surface_t>
instead of NativeImageCairo*.

* Shared/gtk/ArgumentCodersGtk.cpp:
(CoreIPC::decodeImage):
* UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp:
(WKIconDatabaseTryGetCairoSurfaceForURL):
* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
(getIconSurfaceSynchronously):

LayoutTests:

Add EFL / GTK pixels results for svg/canvas/canvas-pattern-svg.html now that
the test passes for cairo-based ports.

* platform/efl/svg/canvas/canvas-pattern-svg-expected.png: Added.
* platform/gtk/svg/canvas/canvas-pattern-svg-expected.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
41 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/efl/svg/canvas/canvas-pattern-svg-expected.png [new file with mode: 0644]
LayoutTests/platform/gtk/svg/canvas/canvas-pattern-svg-expected.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/PlatformEfl.cmake
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/NativeImagePtr.h
Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp
Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
Source/WebCore/platform/graphics/cairo/ImageCairo.cpp
Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp [deleted file]
Source/WebCore/platform/graphics/cairo/NativeImageCairo.h [deleted file]
Source/WebCore/platform/graphics/cairo/PatternCairo.cpp
Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
Source/WebCore/platform/graphics/efl/ImageEfl.cpp
Source/WebCore/platform/graphics/gtk/ImageGtk.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/win/ImageCairoWin.cpp
Source/WebCore/platform/gtk/DragImageGtk.cpp
Source/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
Source/WebCore/platform/win/DragImageCairoWin.cpp
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/svg/graphics/SVGImage.h
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_history.cpp
Source/WebKit/efl/ewk/ewk_settings.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/gtk/ArgumentCodersGtk.cpp
Source/WebKit2/UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp