Changeset 282189 in webkit
- Timestamp:
- Sep 8, 2021, 7:46:01 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 1 added
- 12 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/Cocoa/PageClientImplCocoa.h (modified) (1 diff)
-
UIProcess/Cocoa/PageClientImplCocoa.mm (modified) (1 diff)
-
UIProcess/DrawingAreaProxy.h (modified) (1 diff)
-
UIProcess/PageClient.h (modified) (2 diffs)
-
UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h (modified) (3 diffs)
-
UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm (modified) (1 diff)
-
UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h (modified) (1 diff)
-
UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm (modified) (2 diffs)
-
UIProcess/WebPageProxy.cpp (modified) (1 diff)
-
UIProcess/WebPageProxy.h (modified) (3 diffs)
-
UIProcess/WindowKind.h (added)
-
WebKit.xcodeproj/project.pbxproj (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r282177 r282189 1 2021-09-08 Tim Horton <timothy_horton@apple.com> 2 3 WKWebView specific bug: WKWebView as the contents of a SceneKit/ARKit node doesn't work (UIWebView works) 4 https://bugs.webkit.org/show_bug.cgi?id=203060 5 <rdar://problem/82899923> 6 7 Reviewed by Dean Jackson. 8 9 SceneKit's snapshotter cannot handle CAMachPort-as-layer-contents. 10 11 If we get parented in a SceneKit snapshotting window, map all existing 12 surfaces, and prefer using actual IOSurfaces instead of CAMachPort from then on. 13 14 * UIProcess/Cocoa/PageClientImplCocoa.h: 15 * UIProcess/Cocoa/PageClientImplCocoa.mm: 16 (WebKit::PageClientImplCocoa::windowKind): 17 * UIProcess/WebPageProxy.cpp: 18 (WebKit::WebPageProxy::webViewDidMoveToWindow): 19 * UIProcess/WebPageProxy.h: 20 * UIProcess/WindowKind.h: Added. 21 Keep track of the kind of window we're currently in (the only special 22 case at the moment is the SceneKit snapshotting window, but you could 23 easily imagine us caring about others). 24 25 * UIProcess/DrawingAreaProxy.h: 26 (WebKit::DrawingAreaProxy::windowKindDidChange): 27 * UIProcess/PageClient.h: 28 (WebKit::PageClient::windowKind): 29 * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: 30 * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: 31 (WebKit::RemoteLayerTreeDrawingAreaProxy::windowKindDidChange): 32 Map CAMachPorts to IOSurfaces when we move into a SceneKit snapshotting window. 33 34 * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: 35 * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: 36 (WebKit::RemoteLayerTreeHost::layerContentsType const): 37 (WebKit::RemoteLayerTreeHost::updateLayerTree): 38 Prefer IOSurface if we're already in a SceneKit snapshotting window. 39 Also factor this code out and improve the comments. 40 1 41 2021-09-08 Fujii Hironori <Hironori.Fujii@sony.com> 2 42 -
trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h
r277505 r282189 88 88 void cameraCaptureChanged() final; 89 89 90 WindowKind windowKind() final; 91 90 92 protected: 91 93 WeakObjCPtr<WKWebView> m_webView; -
trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
r277505 r282189 194 194 } 195 195 196 } 196 WindowKind PageClientImplCocoa::windowKind() 197 { 198 auto window = [m_webView window]; 199 if (!window) 200 return WindowKind::Unparented; 201 if ([window isKindOfClass:NSClassFromString(@"_SCNSnapshotWindow")]) 202 return WindowKind::InProcessSnapshotting; 203 return WindowKind::Normal; 204 } 205 206 } -
trunk/Source/WebKit/UIProcess/DrawingAreaProxy.h
r278253 r282189 85 85 virtual void minimumSizeForAutoLayoutDidChange() { } 86 86 virtual void sizeToContentAutoSizeMaximumSizeDidChange() { } 87 virtual void windowKindDidChange() { } 87 88 88 89 virtual void adjustTransientZoom(double, WebCore::FloatPoint) { } -
trunk/Source/WebKit/UIProcess/PageClient.h
r281279 r282189 37 37 #include "WebDateTimePicker.h" 38 38 #include "WebPopupMenuProxy.h" 39 #include "WindowKind.h" 39 40 #include <WebCore/ActivityState.h> 40 41 #include <WebCore/AlternativeTextClient.h> … … 245 246 // Return the layer hosting mode for the view. 246 247 virtual LayerHostingMode viewLayerHostingMode() { return LayerHostingMode::InProcess; } 248 249 virtual WindowKind windowKind() { return isViewInWindow() ? WindowKind::Normal : WindowKind::Unparented; } 247 250 248 251 virtual void processDidExit() = 0; -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h
r278799 r282189 62 62 63 63 private: 64 void sizeDidChange() override; 65 void deviceScaleFactorDidChange() override; 66 void didUpdateGeometry() override; 64 void sizeDidChange() final; 65 void deviceScaleFactorDidChange() final; 66 void windowKindDidChange() final; 67 void didUpdateGeometry() final; 67 68 68 69 // For now, all callbacks are called before committing changes, because that's what the only client requires. 69 70 // Once we have other callbacks, it may make sense to have a before-commit/after-commit option. 70 void dispatchAfterEnsuringDrawing(WTF::Function<void (CallbackBase::Error)>&&) override;71 void dispatchAfterEnsuringDrawing(WTF::Function<void (CallbackBase::Error)>&&) final; 71 72 72 73 #if PLATFORM(MAC) 73 void didChangeViewExposedRect() override;74 void didChangeViewExposedRect() final; 74 75 #endif 75 76 … … 79 80 80 81 float indicatorScale(WebCore::IntSize contentsSize) const; 81 void updateDebugIndicator() override;82 void updateDebugIndicator() final; 82 83 void updateDebugIndicator(WebCore::IntSize contentsSize, bool rootLayerChanged, float scale, const WebCore::IntPoint& scrollPosition); 83 84 void updateDebugIndicatorPosition(); 84 85 void initializeDebugIndicator(); 85 86 86 void waitForDidUpdateActivityState(ActivityStateChangeID) override;87 void hideContentUntilPendingUpdate() override;88 void hideContentUntilAnyUpdate() override;89 bool hasVisibleContent() const override;87 void waitForDidUpdateActivityState(ActivityStateChangeID) final; 88 void hideContentUntilPendingUpdate() final; 89 void hideContentUntilAnyUpdate() final; 90 bool hasVisibleContent() const final; 90 91 91 92 void prepareForAppSuspension() final; … … 94 95 95 96 // IPC::MessageReceiver 96 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;97 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final; 97 98 98 99 // Message handlers -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
r278799 r282189 508 508 } 509 509 510 void RemoteLayerTreeDrawingAreaProxy::windowKindDidChange() 511 { 512 if (m_webPageProxy.windowKind() == WindowKind::InProcessSnapshotting) 513 m_remoteLayerTreeHost->mapAllIOSurfaceBackingStore(); 514 } 515 510 516 } // namespace WebKit -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h
r266342 r282189 82 82 void layerWillBeRemoved(WebCore::GraphicsLayer::PlatformLayerID); 83 83 84 RemoteLayerBackingStore::LayerContentsType layerContentsType() const; 85 84 86 RemoteLayerTreeDrawingAreaProxy* m_drawingArea { nullptr }; 85 87 RemoteLayerTreeNode* m_rootNode { nullptr }; -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm
r278799 r282189 65 65 } 66 66 67 RemoteLayerBackingStore::LayerContentsType RemoteLayerTreeHost::layerContentsType() const 68 { 69 #if PLATFORM(MAC) || PLATFORM(MACCATALYST) 70 // CAMachPort currently does not work on macOS (or macCatalyst): rdar://problem/31247730 71 return RemoteLayerBackingStore::LayerContentsType::IOSurface; 72 #else 73 // If a surface will be referenced by multiple layers (as in the tile debug indicator), CAMachPort cannot be used. 74 if (m_drawingArea->hasDebugIndicator()) 75 return RemoteLayerBackingStore::LayerContentsType::IOSurface; 76 77 // If e.g. SceneKit will be doing an in-process snapshot of the layer tree, CAMachPort cannot be used: rdar://problem/47481972 78 if (m_drawingArea->page().windowKind() == WindowKind::InProcessSnapshotting) 79 return RemoteLayerBackingStore::LayerContentsType::IOSurface; 80 81 return RemoteLayerBackingStore::LayerContentsType::CAMachPort; 82 #endif 83 } 84 67 85 bool RemoteLayerTreeHost::updateLayerTree(const RemoteLayerTreeTransaction& transaction, float indicatorScaleFactor) 68 86 { … … 90 108 Vector<LayerAndClone> clonesToUpdate; 91 109 92 #if PLATFORM(MAC) || PLATFORM(MACCATALYST) 93 // Can't use the iOS code on macOS yet: rdar://problem/31247730 94 auto layerContentsType = RemoteLayerBackingStore::LayerContentsType::IOSurface; 95 #else 96 auto layerContentsType = m_drawingArea->hasDebugIndicator() ? RemoteLayerBackingStore::LayerContentsType::IOSurface : RemoteLayerBackingStore::LayerContentsType::CAMachPort; 97 #endif 98 110 auto layerContentsType = this->layerContentsType(); 99 111 for (auto& [layerID, propertiesPointer] : transaction.changedLayerProperties()) { 100 112 const RemoteLayerTreeTransaction::LayerProperties& properties = *propertiesPointer; -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r281964 r282189 10577 10577 observer.value->webViewDidMoveToWindow(); 10578 10578 } 10579 10580 auto newWindowKind = pageClient().windowKind(); 10581 if (m_windowKind != newWindowKind) { 10582 m_windowKind = newWindowKind; 10583 if (m_drawingArea) 10584 m_drawingArea->windowKindDidChange(); 10585 } 10579 10586 } 10580 10587 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r281964 r282189 80 80 #include "WebUndoStepID.h" 81 81 #include "WebsitePoliciesData.h" 82 #include "WindowKind.h" 82 83 #include <WebCore/ActivityState.h> 83 84 #include <WebCore/AutoplayEvent.h> … … 729 730 bool isViewFocused() const { return m_activityState.contains(WebCore::ActivityState::IsFocused); } 730 731 bool isViewWindowActive() const { return m_activityState.contains(WebCore::ActivityState::WindowIsActive); } 732 733 WindowKind windowKind() const { return m_windowKind; }; 731 734 732 735 void addMIMETypeWithCustomContentProvider(const String& mimeType); … … 3099 3102 3100 3103 bool m_needsSiteSpecificViewportQuirks { true }; 3104 3105 WindowKind m_windowKind { WindowKind::Unparented }; 3101 3106 }; 3102 3107 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r282130 r282189 3466 3466 2D8949EE182044F600E898AA /* PlatformCALayerRemoteTiledBacking.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformCALayerRemoteTiledBacking.cpp; sourceTree = "<group>"; }; 3467 3467 2D8949EF182044F600E898AA /* PlatformCALayerRemoteTiledBacking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCALayerRemoteTiledBacking.h; sourceTree = "<group>"; }; 3468 2D922D8A26E990FC00EC1A59 /* WindowKind.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WindowKind.h; sourceTree = "<group>"; }; 3468 3469 2D9CD5EB21FA503F0029ACFA /* TextCheckingControllerProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = TextCheckingControllerProxy.messages.in; sourceTree = "<group>"; }; 3469 3470 2D9CD5EC21FA503F0029ACFA /* TextCheckingControllerProxy.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TextCheckingControllerProxy.mm; sourceTree = "<group>"; }; … … 10290 10291 51D124271E6D3F1F002B2820 /* WebURLSchemeTask.h */, 10291 10292 572FD44122265CE200A1ECC3 /* WebViewDidMoveToWindowObserver.h */, 10293 2D922D8A26E990FC00EC1A59 /* WindowKind.h */, 10292 10294 ); 10293 10295 path = UIProcess;
Note:
See TracChangeset
for help on using the changeset viewer.