WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
211660
Adapt LocalCurrentGraphicsContext for iOS
https://bugs.webkit.org/show_bug.cgi?id=211660
Summary
Adapt LocalCurrentGraphicsContext for iOS
David Kilzer (:ddkilzer)
Reported
2020-05-08 21:09:35 PDT
Adapt LocalCurrentGraphicsContext for iOS. The original motivation was a small clean up in UIProcess/Cocoa/WebPageProxyCocoa.mm, but this resulted in a really nice cleanup in WebProcess/WebCoreSupport/mac/WebDragClientMac.mm.
Attachments
Patch v1
(32.37 KB, patch)
2020-05-08 21:14 PDT
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Interesting changes to WebCore/platform
(6.11 KB, patch)
2020-05-08 21:16 PDT
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch for landing
(32.15 KB, patch)
2020-05-09 14:02 PDT
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch for landing v2
(32.01 KB, patch)
2020-05-09 14:33 PDT
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
David Kilzer (:ddkilzer)
Comment 1
2020-05-08 21:14:38 PDT
Created
attachment 398915
[details]
Patch v1
David Kilzer (:ddkilzer)
Comment 2
2020-05-08 21:16:54 PDT
Created
attachment 398916
[details]
Interesting changes to WebCore/platform
Darin Adler
Comment 3
2020-05-09 07:28:59 PDT
Comment on
attachment 398915
[details]
Patch v1 View in context:
https://bugs.webkit.org/attachment.cgi?id=398915&action=review
> Source/WebCore/platform/cocoa/LocalCurrentGraphicsContext.h:60 > +class ContextContainer { > + WTF_MAKE_NONCOPYABLE(ContextContainer); > +public: > + ContextContainer(GraphicsContext& graphicsContext) > + : m_graphicsContext(graphicsContext.platformContext()) > + { > + } > + > + CGContextRef context() { return m_graphicsContext; } > +private: > + PlatformGraphicsContext* m_graphicsContext; > +};
This class is not new, but it seems pointless. Should be removed. The two places that use it should just be calling the platformContext function. Also, the use of both CGContextRef and PlatformGraphicsContext* in the implementation of the class is puzzling.
> Source/WebCore/platform/ios/LocalCurrentGraphicsContextIOS.mm:58 > +CGContextRef LocalCurrentGraphicsContext::cgContext() > +{ > + return m_savedGraphicsContext.platformContext(); > +}
Should be inlined in the header. And not have separate versions for macOS and iOS.
> Source/WebCore/platform/mac/LocalCurrentGraphicsContextMac.mm:60 > +CGContextRef LocalCurrentGraphicsContext::cgContext() > +{ > + return m_savedGraphicsContext.platformContext(); > +}
Should be inlined in the header. And not have separate versions for macOS and iOS.
> Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:56 > +using PlatformDragImage = NSImage *;
Not a big fan of the word "Platform" in the class name here, but I don’t have a better idea.
> Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:60 > #import "UIKitSPI.h" > + > +using PlatformDragImage = CGImageRef;
Not a big fan of combining the "using" and the include like this. I would do the include in a separate paragraph above.
David Kilzer (:ddkilzer)
Comment 4
2020-05-09 13:31:11 PDT
Comment on
attachment 398915
[details]
Patch v1 View in context:
https://bugs.webkit.org/attachment.cgi?id=398915&action=review
>> Source/WebCore/platform/cocoa/LocalCurrentGraphicsContext.h:60 >> +}; > > This class is not new, but it seems pointless. Should be removed. The two places that use it should just be calling the platformContext function. Also, the use of both CGContextRef and PlatformGraphicsContext* in the implementation of the class is puzzling.
Will do in a separate patch.
>> Source/WebCore/platform/ios/LocalCurrentGraphicsContextIOS.mm:58 >> +} > > Should be inlined in the header. And not have separate versions for macOS and iOS.
Will fix.
>> Source/WebCore/platform/mac/LocalCurrentGraphicsContextMac.mm:60 >> +} > > Should be inlined in the header. And not have separate versions for macOS and iOS.
Will fix.
>> Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:56 >> +using PlatformDragImage = NSImage *; > > Not a big fan of the word "Platform" in the class name here, but I don’t have a better idea.
How about just "DragImage"? I guess we need to be careful about defining this in unified sources, but it's probably fine for now. We could have reused CocoaImage if the iOS code has used UIImage instead of CGImageRef. Not sure it's worth a FIXME, though.
>> Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:60 >> +using PlatformDragImage = CGImageRef; > > Not a big fan of combining the "using" and the include like this. I would do the include in a separate paragraph above.
Will separate before landing.
David Kilzer (:ddkilzer)
Comment 5
2020-05-09 14:01:34 PDT
Comment on
attachment 398915
[details]
Patch v1 View in context:
https://bugs.webkit.org/attachment.cgi?id=398915&action=review
>>> Source/WebCore/platform/cocoa/LocalCurrentGraphicsContext.h:60 >>> +}; >> >> This class is not new, but it seems pointless. Should be removed. The two places that use it should just be calling the platformContext function. Also, the use of both CGContextRef and PlatformGraphicsContext* in the implementation of the class is puzzling. > > Will do in a separate patch.
(Will change PlatformGraphicsContext* to CGContextRef in this patch, though.)
David Kilzer (:ddkilzer)
Comment 6
2020-05-09 14:02:58 PDT
Created
attachment 398940
[details]
Patch for landing
David Kilzer (:ddkilzer)
Comment 7
2020-05-09 14:33:04 PDT
Created
attachment 398941
[details]
Patch for landing v2
David Kilzer (:ddkilzer)
Comment 8
2020-05-09 14:33:32 PDT
Comment on
attachment 398940
[details]
Patch for landing View in context:
https://bugs.webkit.org/attachment.cgi?id=398940&action=review
> Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:57 > -#if PLATFORM(IOS_FAMILY) > +#if USE(APPKIT) > #import "UIKitSPI.h" > #endif
That's...not correct.
EWS
Comment 9
2020-05-09 16:10:45 PDT
Committed
r261442
: <
https://trac.webkit.org/changeset/261442
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 398941
[details]
.
Radar WebKit Bug Importer
Comment 10
2020-05-09 16:11:17 PDT
<
rdar://problem/63057667
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug