[Webkit-unassigned] [Bug 210974] New: Use CocoaImage platform abstraction for NSImage/UIImage

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 24 09:36:25 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=210974

            Bug ID: 210974
           Summary: Use CocoaImage platform abstraction for
                    NSImage/UIImage
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit2
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ddkilzer at webkit.org
                CC: beidson at apple.com, darin at apple.com, thorton at apple.com
        Depends on: 210814

Use CocoaImage platform abstraction for NSImage/UIImage.

Following on from comments in Bug 210814, move CocoaImage into its own header for reuse in other classes.

There aren't as many opportunities for this as you might think, though:

$ grep -l NSImage `grep -l -r UIImage Source | grep -v ChangeLog | grep -v .order` 
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/mac/WebView/WebViewData.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebView.h
Source/WebKit/UIProcess/API/Cocoa/_WKActivatedElementInfo.h
Source/WebKit/UIProcess/QuickLookThumbnailLoader.h
Source/WebKit/UIProcess/QuickLookThumbnailLoader.mm
Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h
Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm
Source/WebCore/editing/cocoa/HTMLConverter.mm

The uses in WebCore and WebKitLegacy aren't really cross-platform, so all of the interesting use cases are in WebKit.

However, the initial version of the patch doesn't use CocoaImage in public headers as I wasn't sure if we were okay with doing things like this in Source/WebKit/UIProcess/API/Cocoa/WKWebView.h:

-#if TARGET_OS_IPHONE
-- (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(UIImage * _Nulla
ble snapshotImage, NSError * _Nullable error))completionHandler WK_API_AVAILABLE(ios(11.0));
-#else
-- (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(NSImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_API_AVAILABLE(macos(10.13));
-#endif

+- (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(CocoaImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_API_AVAILABLE(macos(10.13), ios(11.0));


Referenced Bugs:

https://bugs.webkit.org/show_bug.cgi?id=210814
[Bug 210814] Clean up QuickLookThumbnailLoader
-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200424/7e9cf4da/attachment-0001.htm>


More information about the webkit-unassigned mailing list