-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move BitmapImage format conversion to a new class name ImageAdapter #22535
Move BitmapImage format conversion to a new class name ImageAdapter #22535
Conversation
EWS run on previous version of this PR (hash 14f9381) |
14f9381
to
329c2f9
Compare
EWS run on current version of this PR (hash 329c2f9) |
EWS run on previous version of this PR (hash 329c2f9) |
329c2f9
to
3223206
Compare
EWS run on previous version of this PR (hash 3223206) |
3223206
to
12499cf
Compare
EWS run on previous version of this PR (hash 12499cf) |
12499cf
to
fc2130d
Compare
EWS run on previous version of this PR (hash fc2130d) |
RefPtr<NativeImage> nativeImageOfSize(const IntSize&); | ||
Vector<Ref<NativeImage>> allNativeImages(); | ||
|
||
Image& m_image; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about making this a WeakRef
, for safety?
// Test that there is no crash when BitmapImage::getHBITMAPOfSize() is called | ||
// for an image with empty frames (BitmapImage::frameAtIndex(i) return null), WebKit Bug 102689. | ||
|
||
TEST(WebCore, BitmapImageEmptyFrameTest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we preserve this test?
fc2130d
to
b2e2924
Compare
EWS run on previous version of this PR (hash b2e2924) |
b2e2924
to
84ddfe9
Compare
84ddfe9
to
2537a05
Compare
EWS run on previous version of this PR (hash 2537a05)
|
2537a05
to
a10f772
Compare
EWS run on previous version of this PR (hash a10f772)
|
a10f772
to
c565bc6
Compare
EWS run on previous version of this PR (hash c565bc6)
|
c565bc6
to
ad8781a
Compare
EWS run on previous version of this PR (hash ad8781a)
|
ad8781a
to
44a1c83
Compare
EWS run on current version of this PR (hash 44a1c83)
|
EWS run on previous version of this PR (hash 44a1c83)
|
44a1c83
to
ad338a9
Compare
EWS run on current version of this PR (hash ad338a9)
|
https://bugs.webkit.org/show_bug.cgi?id=267254 rdar://120690546 Reviewed by Cameron McCormack. The classes Image and BitmapImage are overloaded with many platform functions. The platform-specific format conversion is not tied to BitmapImage or Image. It relies mostly on the NativeImage. So move the format conversion to a new class named ImageAdapter. Move also BitmapImage::nativeImageOfSize() and framesNativeImages() to this new class since they are only used for image format conversion. * Source/WebCore/Headers.cmake: * Source/WebCore/PlatformWin.cmake: * Source/WebCore/Sources.txt: * Source/WebCore/SourcesCocoa.txt: * Source/WebCore/SourcesGTK.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/dom/DataTransferMac.mm: (WebCore::DataTransfer::createDragImage const): * Source/WebCore/editing/cocoa/HTMLConverter.mm: (fileWrapperForElement): * Source/WebCore/loader/cache/CachedImage.cpp: (WebCore::CachedImage::brokenImage const): * Source/WebCore/platform/ScrollView.cpp: (WebCore::ScrollView::paintPanScrollIcon): * Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::setNowPlayingInfo): * Source/WebCore/platform/cocoa/DragImageCocoa.mm: (WebCore::createDragImageFromImage): * Source/WebCore/platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::~BitmapImage): (WebCore::BitmapImage::destroyDecodedData): (WebCore::BitmapImage::nativeImageAtIndexCacheIfNeeded): (WebCore::BitmapImage::nativeImage): (WebCore::BitmapImage::nativeImageForCurrentFrame): (WebCore::BitmapImage::draw): (WebCore::BitmapImage::drawPattern): (WebCore::BitmapImage::decode): (WebCore::BitmapImage::dump const): (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded): Deleted. (WebCore::BitmapImage::nativeImageOfSize): Deleted. (WebCore::BitmapImage::framesNativeImages): Deleted. * Source/WebCore/platform/graphics/BitmapImage.h: * Source/WebCore/platform/graphics/Image.cpp: (WebCore::Image::adapter): (WebCore::Image::invalidateAdapter): (WebCore::Image::fillWithSolidColor): (WebCore::Image::drawTiled): (WebCore::operator<<): (WebCore::BitmapImage::invalidatePlatformData): Deleted. (WebCore::Image::loadPlatformResource): Deleted. * Source/WebCore/platform/graphics/Image.h: (WebCore::Image::frameCount const): (WebCore::Image::nativeImageAtIndex): (WebCore::Image::nativeImageAtIndexCacheIfNeeded): (WebCore::Image::nativeImageOfSize): Deleted. (WebCore::Image::nsImage): Deleted. (WebCore::Image::snapshotNSImage): Deleted. (WebCore::Image::tiffRepresentation): Deleted. (WebCore::Image::getHBITMAP): Deleted. (WebCore::Image::getHBITMAPOfSize): Deleted. (WebCore::Image::gdkPixbuf): Deleted. (WebCore::Image::gdkTexture): Deleted. (WebCore::Image::drawFrameMatchingSourceSize): Deleted. * Source/WebCore/platform/graphics/ImageAdapter.cpp: Renamed from Source/WebCore/platform/graphics/win/ImageWin.cpp. (WebCore::ImageAdapter::loadPlatformResource): (WebCore::ImageAdapter::invalidate): (WebCore::ImageAdapter::nativeImageOfSize): (WebCore::ImageAdapter::allNativeImages): * Source/WebCore/platform/graphics/ImageAdapter.h: Added. (WebCore::ImageAdapter::ImageAdapter): (WebCore::ImageAdapter::image const): * Source/WebCore/platform/graphics/gtk/ImageAdapterGtk.cpp: Renamed from Source/WebCore/platform/graphics/gtk/ImageGtk.cpp. (WebCore::ImageAdapter::loadPlatformResource): (WebCore::ImageAdapter::invalidate): (WebCore::ImageAdapter::gdkPixbuf): (WebCore::ImageAdapter::gdkTexture): * Source/WebCore/platform/graphics/mac/ImageAdapterMac.mm: Renamed from Source/WebCore/platform/graphics/mac/ImageMac.mm. (WebCore::ImageAdapter::loadPlatformResource): (WebCore::ImageAdapter::tiffRepresentation): (WebCore::ImageAdapter::invalidate): (WebCore::ImageAdapter::nsImage): (WebCore::ImageAdapter::snapshotNSImage): * Source/WebCore/platform/graphics/win/ImageAdapterWin.cpp: Renamed from Source/WebCore/platform/graphics/win/ImageCairoWin.cpp. (WebCore::ImageAdapter::loadPlatformResource): (WebCore::ImageAdapter::nativeImageOfHBITMAP): (WebCore::ImageAdapter::invalidate): (WebCore::ImageAdapter::getHBITMAP): (WebCore::ImageAdapter::getHBITMAPOfSize): * Source/WebCore/platform/gtk/CursorGtk.cpp: (WebCore::createCustomCursor): * Source/WebCore/platform/mac/CursorMac.mm: (WebCore::createCustomCursor): * Source/WebCore/platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::write): * Source/WebCore/platform/win/CursorWin.cpp: (WebCore::createSharedCursor): (WebCore::loadCursorByName): * Source/WebCore/platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeImage): * Source/WebCore/rendering/RenderLayerScrollableArea.cpp: (WebCore::RenderLayerScrollableArea::drawPlatformResizerImage): * Source/WebCore/rendering/RenderThemeMac.mm: (WebCore::createAttachmentPlaceholderImage): * Source/WebKit/UIProcess/API/gtk/DragSourceGtk3.cpp: (WebKit::DragSource::DragSource): * Source/WebKit/UIProcess/API/gtk/DragSourceGtk4.cpp: (WebKit::DragSource::begin): * Source/WebKit/UIProcess/gtk/ClipboardGtk3.cpp: (WebKit::Clipboard::write): * Source/WebKit/UIProcess/gtk/ClipboardGtk4.cpp: (WebKit::Clipboard::write): * Source/WebKit/UIProcess/mac/WebViewImpl.mm: (WebKit::WebViewImpl::provideDataForPasteboard): * Source/WebKitLegacy/mac/DOM/DOM.mm: (-[DOMElement image]): (-[DOMElement _imageTIFFRepresentation]): * Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm: (-[WebElementDictionary _image]): * Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::imageForCurrentSharingServicePickerItem): (WebContextMenuClient::contextMenuForEvent): * Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm: (webGetNSImage): * Source/WebKitLegacy/mac/WebView/WebHTMLView.mm: (-[WebHTMLView pasteboard:provideDataForType:]): * Tools/TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/273772@main
ad338a9
to
ab92c87
Compare
Committed 273772@main (ab92c87): https://commits.webkit.org/273772@main Reviewed commits have been landed. Closing PR #22535 and removing active labels. |
ab92c87
ad338a9
π§ͺ wpe-wk2π§ͺ ios-wk2-wpt