WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 231009
Cocoa WebGL should support UI side compositing
https://bugs.webkit.org/show_bug.cgi?id=231009
Summary
Cocoa WebGL should support UI side compositing
Kimmo Kinnunen
Reported
2021-09-30 01:00:02 PDT
Cocoa WebGL support UI side compositing Currently WebGL needs IOKit in WP
Attachments
Patch for feedback
(99.42 KB, patch)
2021-10-14 07:34 PDT
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch for feedback
(95.56 KB, patch)
2021-10-14 07:42 PDT
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(103.39 KB, patch)
2021-11-18 10:51 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(105.69 KB, patch)
2021-11-19 01:36 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(105.21 KB, patch)
2021-11-19 05:10 PST
,
Kimmo Kinnunen
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(105.14 KB, patch)
2021-11-19 05:31 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(106.37 KB, patch)
2021-11-22 06:09 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(106.85 KB, patch)
2021-11-22 10:36 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(107.07 KB, patch)
2021-11-22 23:44 PST
,
Kimmo Kinnunen
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(107.07 KB, patch)
2021-11-23 00:50 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(107.28 KB, patch)
2021-11-23 03:32 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(107.24 KB, patch)
2021-11-23 22:34 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(107.28 KB, patch)
2021-11-24 04:57 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(109.62 KB, patch)
2021-12-01 00:30 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(112.05 KB, patch)
2021-12-01 04:24 PST
,
Kimmo Kinnunen
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(114.22 KB, patch)
2021-12-01 05:04 PST
,
Kimmo Kinnunen
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(114.09 KB, patch)
2021-12-01 06:26 PST
,
Kimmo Kinnunen
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(114.24 KB, patch)
2021-12-01 08:22 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(115.00 KB, patch)
2021-12-01 11:20 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(115.85 KB, patch)
2021-12-02 00:43 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(116.40 KB, patch)
2021-12-02 02:10 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(116.40 KB, patch)
2021-12-02 03:56 PST
,
Kimmo Kinnunen
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(116.59 KB, patch)
2021-12-02 05:07 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(116.59 KB, patch)
2021-12-02 06:41 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(116.56 KB, patch)
2021-12-02 06:45 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(119.82 KB, patch)
2021-12-03 05:30 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(117.96 KB, patch)
2021-12-03 10:46 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(117.87 KB, patch)
2021-12-05 13:23 PST
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
Patch for landing
(117.87 KB, patch)
2021-12-07 03:13 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch for landing
(117.87 KB, patch)
2021-12-07 03:37 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(120.43 KB, patch)
2021-12-10 05:27 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch
(120.57 KB, patch)
2021-12-10 07:17 PST
,
Kimmo Kinnunen
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(120.57 KB, patch)
2021-12-10 07:29 PST
,
Kimmo Kinnunen
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(120.56 KB, patch)
2021-12-10 08:02 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch for landing
(120.61 KB, patch)
2021-12-10 13:00 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Patch for landing
(116.86 KB, patch)
2021-12-13 01:38 PST
,
Kimmo Kinnunen
no flags
Details
Formatted Diff
Diff
Show Obsolete
(35)
View All
Add attachment
proposed patch, testcase, etc.
Kimmo Kinnunen
Comment 1
2021-09-30 01:01:08 PDT
<
rdar://83437059
>
Kimmo Kinnunen
Comment 2
2021-10-14 07:34:42 PDT
Created
attachment 441214
[details]
Patch for feedback
Kimmo Kinnunen
Comment 3
2021-10-14 07:42:29 PDT
Created
attachment 441215
[details]
Patch for feedback
Simon Fraser (smfr)
Comment 4
2021-10-14 21:23:59 PDT
I like the idea of a "content provider". Can it be a function on GraphicsLayerClient?
Kimmo Kinnunen
Comment 5
2021-10-15 06:29:53 PDT
> I like the idea of a "content provider". Can it be a function on GraphicsLayerClient?
In a way "yes", considering that current GraphicsLayerClient can provide contents via painting via "draws content". However, in practice "no", as the GraphicsLayerClient is general purpose and closed, the "content provider" is platform-specific and open-ended. I'd view it the other way, in that eventually GraphicsLayerClient::paintContents could be expressed as a "content provider", and RenderLayerBacking (or RenderLayers?) could be the instance that returns "paintContents content provider". RenderLayerBacking does now: m_layer->setDrawsContent(true) Instead it would do: m_layer->setContentFromProvider(this); RenderLayerBacking does now: m_layer->setDrawsContent(false); Instead it would do: m_layer->setContentFromProvider(nullptr); (or ->setNoContents()); However, it's probably not within my expertise to implement that part, and it'd be a refactor without much benefit..
Kimmo Kinnunen
Comment 6
2021-11-18 10:51:02 PST
Created
attachment 444701
[details]
Patch
Fujii Hironori
Comment 7
2021-11-18 22:35:07 PST
Comment on
attachment 444701
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=444701&action=review
> Source/WebCore/platform/graphics/GraphicsLayer.h:525 > virtual void setContentsToPlatformLayer(PlatformLayer*, ContentsLayerPurpose) { }
Do you have a plan to remove setContentsToPlatformLayer?
> Source/WebCore/platform/graphics/GraphicsLayer.h:526 > + virtual void setContentsFromDisplayDelegate(RefPtr<GraphicsLayerContentsDisplayDelegate>&&, ContentsLayerPurpose);
This name sounds inconsistent to me. Other methods setting the contents layer are named setContentsTo*. I prefer setContentsToDisplayDelegate.
Fujii Hironori
Comment 8
2021-11-18 22:39:24 PST
(In reply to Kimmo Kinnunen from
comment #5
)
> RenderLayerBacking does now: m_layer->setDrawsContent(true) > Instead it would do: m_layer->setContentFromProvider(this);
setDrawsContent makes the primary layer paintable, not the content layer. I think it should be setPrimaryProvider or setPrimaryToProvider for the consistency.
Kimmo Kinnunen
Comment 9
2021-11-19 01:36:42 PST
Created
attachment 444791
[details]
Patch
Kimmo Kinnunen
Comment 10
2021-11-19 05:10:22 PST
Created
attachment 444804
[details]
Patch
Kimmo Kinnunen
Comment 11
2021-11-19 05:31:54 PST
Created
attachment 444807
[details]
Patch
Kimmo Kinnunen
Comment 12
2021-11-22 06:09:38 PST
Created
attachment 444961
[details]
Patch
Kimmo Kinnunen
Comment 13
2021-11-22 10:36:11 PST
Created
attachment 444976
[details]
Patch
Kimmo Kinnunen
Comment 14
2021-11-22 23:44:46 PST
Created
attachment 445007
[details]
Patch
Kimmo Kinnunen
Comment 15
2021-11-23 00:50:11 PST
Created
attachment 445014
[details]
Patch
Kimmo Kinnunen
Comment 16
2021-11-23 03:32:16 PST
Created
attachment 445021
[details]
Patch
Kimmo Kinnunen
Comment 17
2021-11-23 22:34:59 PST
Created
attachment 445067
[details]
Patch
Kimmo Kinnunen
Comment 18
2021-11-24 04:57:12 PST
Created
attachment 445089
[details]
Patch
Kimmo Kinnunen
Comment 19
2021-12-01 00:30:26 PST
Created
attachment 445537
[details]
Patch
Kimmo Kinnunen
Comment 20
2021-12-01 04:24:47 PST
Created
attachment 445550
[details]
Patch
Kimmo Kinnunen
Comment 21
2021-12-01 05:04:32 PST
Created
attachment 445561
[details]
Patch
Kimmo Kinnunen
Comment 22
2021-12-01 06:26:19 PST
Created
attachment 445569
[details]
Patch
Kimmo Kinnunen
Comment 23
2021-12-01 08:22:15 PST
Created
attachment 445576
[details]
Patch
Kimmo Kinnunen
Comment 24
2021-12-01 11:20:02 PST
Created
attachment 445594
[details]
Patch
Kimmo Kinnunen
Comment 25
2021-12-02 00:43:30 PST
Created
attachment 445686
[details]
Patch
Kimmo Kinnunen
Comment 26
2021-12-02 02:10:35 PST
Created
attachment 445695
[details]
Patch
Kimmo Kinnunen
Comment 27
2021-12-02 03:56:28 PST
Created
attachment 445702
[details]
Patch
Kimmo Kinnunen
Comment 28
2021-12-02 05:07:24 PST
Created
attachment 445713
[details]
Patch
Kimmo Kinnunen
Comment 29
2021-12-02 06:41:40 PST
Created
attachment 445716
[details]
Patch
Kimmo Kinnunen
Comment 30
2021-12-02 06:45:04 PST
Created
attachment 445717
[details]
Patch
Simon Fraser (smfr)
Comment 31
2021-12-02 09:48:57 PST
Comment on
attachment 445717
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=445717&action=review
> Source/WebCore/platform/graphics/GraphicsLayer.h:526 > + virtual void setContentsToDisplayDelegate(RefPtr<GraphicsLayerContentsDisplayDelegate>&&, ContentsLayerPurpose);
The name is a bit odd. Maybe setContentsDisplayDelegate? Does calling setContentsToSolidColor() or setContentsToPlatformLayer() remove the delegate?
> Source/WebCore/platform/graphics/GraphicsLayerContentsDisplayDelegate.h:47 > + virtual void willDelegateDisplay(PlatformCALayer&);
This name is ambiguous. On first reading I expect it to return a bool. Does it mean "prepare to render a frame"?
> Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:1363 > + m_contentsLayer = createPlatformCALayer(PlatformCALayer::LayerTypeContentsProvidedLayer, this);
Naively I would expect that the GraphicsLayerContentsDisplayDelegate would do the layer creation?
> Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:1369 > + m_contentsLayer->setBackingStoreAttached(true); > + m_contentsLayer->setAcceleratesDrawing(true);
I feel like these should be under delegate control too?
> Source/WebCore/platform/graphics/cocoa/WebProcessGraphicsContextGLCocoa.mm:49 > + } > + void display(PlatformCALayer& layer) final
Blank lines between functions please.
> Source/WebCore/platform/graphics/mac/WebLayer.mm:86 > + if (!layer->owner()->platformCALayerDrawsContent() && !layer->owner()->platformCALayerDelegatesDisplay(layer.get()))
Maybe we should add a function that does both these checks.
> Source/WebKit/WebProcess/GPU/graphics/cocoa/RemoteGraphicsContextGLProxyCocoa.mm:56 > + } > + void display(WebCore::PlatformCALayer& layer) final
Blank lines please
Fujii Hironori
Comment 32
2021-12-02 16:59:46 PST
Comment on
attachment 445717
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=445717&action=review
>> Source/WebCore/platform/graphics/GraphicsLayer.h:526 >> + virtual void setContentsToDisplayDelegate(RefPtr<GraphicsLayerContentsDisplayDelegate>&&, ContentsLayerPurpose); > > The name is a bit odd. Maybe setContentsDisplayDelegate? > > Does calling setContentsToSolidColor() or setContentsToPlatformLayer() remove the delegate?
Just a idea. What about using overloading for the methods? virtual void setContents(Image*) { } virtual void setContents(const Color&) { } virtual void setContents(RefPtr<GraphicsLayerContentsDisplayDelegate>&&, ContentsLayerPurpose); virtual void setContents(RefPtr<Model>&&) { }
> Source/WebKit/WebProcess/GPU/graphics/wc/RemoteGraphicsContextGLProxyWC.cpp:73 > + , m_layerContentsDisplayDelegate(PlatformLayerDisplayDelegate::create(makeUnique<WCPlatformLayerGCGL>(m_graphicsContextGLIdentifier)))
We no longer need WCPlatformLayerGCGL. I will remove it in follow-up patch.
Kimmo Kinnunen
Comment 33
2021-12-03 05:30:07 PST
Created
attachment 445846
[details]
Patch
Kimmo Kinnunen
Comment 34
2021-12-03 10:46:39 PST
Created
attachment 445872
[details]
Patch
Fujii Hironori
Comment 35
2021-12-05 13:23:39 PST
Created
attachment 445990
[details]
Patch * Fixed WinCairo build
Kimmo Kinnunen
Comment 36
2021-12-06 10:10:53 PST
Thanks Fujii!
Kimmo Kinnunen
Comment 37
2021-12-07 03:13:12 PST
Created
attachment 446150
[details]
Patch for landing
Kimmo Kinnunen
Comment 38
2021-12-07 03:37:10 PST
Created
attachment 446151
[details]
Patch for landing
EWS
Comment 39
2021-12-07 04:22:35 PST
Committed
r286596
(?): <
https://commits.webkit.org/r286596
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 446151
[details]
.
Truitt Savell
Comment 40
2021-12-08 13:03:28 PST
I believe the changes in
https://trac.webkit.org/changeset/286596/webkit
Caused these two tests to timeout on iOS: compositing/tiling/tiled-reflection-inwindow.html fast/forms/ios/focus-select-and-switch-tabs.html I don't think EWS caught this because it was considered flaky during the run. current history shows a very clear regression point though History:
https://results.webkit.org/?suite=layout-tests&suite=layout-tests&test=editing%2Fpasteboard%2Fdom-paste%2Fdom-paste-requires-user-gesture.html&test=fast%2Fforms%2Fios%2Ffocus-select-and-switch-tabs.html&platform=ios
Tracking in:
https://bugs.webkit.org/show_bug.cgi?id=234032
Truitt Savell
Comment 41
2021-12-08 13:07:16 PST
Reverted
r286596
for reason: broke 2 tests on iOS Committed
r286709
(
244986@trunk
): <
https://commits.webkit.org/244986@trunk
>
Kimmo Kinnunen
Comment 42
2021-12-10 05:27:24 PST
Created
attachment 446713
[details]
Patch
Kimmo Kinnunen
Comment 43
2021-12-10 07:17:31 PST
Created
attachment 446723
[details]
Patch
Kimmo Kinnunen
Comment 44
2021-12-10 07:29:00 PST
Created
attachment 446726
[details]
Patch
Kimmo Kinnunen
Comment 45
2021-12-10 08:02:20 PST
Created
attachment 446730
[details]
Patch
Simon Fraser (smfr)
Comment 46
2021-12-10 08:34:58 PST
Comment on
attachment 446730
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=446730&action=review
> Source/WebCore/platform/graphics/cocoa/WebProcessGraphicsContextGLCocoa.mm:89 > + const bool m_isOpaque; > + const float m_contentsScale; > + std::unique_ptr<IOSurface> m_displayBuffer;
Doesn't really matter but I would flip the ordering to avoid padding.
> Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:140 > + // FIXME: This should be removed and m_bufferHandle should be used to ref the buffer once ShareableBitmap::Handle > + // can be encoded multiple times.
File a bug to track?
> Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:117 > + // FIXME: For simplicity this should be moved to the end of display() once the buffer handles can be created once > + // and stored in m_bufferHandle.
Reference the same bug.
> Source/WebKit/WebProcess/GPU/graphics/cocoa/RemoteGraphicsContextGLProxyCocoa.mm:91 > + const bool m_isOpaque; > + const float m_contentsScale; > + MachSendRight m_displayBuffer;
Ditto.
Kimmo Kinnunen
Comment 47
2021-12-10 13:00:38 PST
Created
attachment 446789
[details]
Patch for landing
EWS
Comment 48
2021-12-13 01:35:25 PST
Tools/Scripts/svn-apply failed to apply
attachment 446789
[details]
to trunk. Please resolve the conflicts and upload a new patch.
Kimmo Kinnunen
Comment 49
2021-12-13 01:38:45 PST
Created
attachment 446976
[details]
Patch for landing
EWS
Comment 50
2021-12-13 02:38:52 PST
Committed
r286943
(
245168@main
): <
https://commits.webkit.org/245168@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 446976
[details]
.
Simon Fraser (smfr)
Comment 51
2021-12-14 21:15:33 PST
Comment on
attachment 446976
[details]
Patch for landing View in context:
https://bugs.webkit.org/attachment.cgi?id=446976&action=review
> Source/WebCore/WebCore.xcodeproj/project.pbxproj:33104 > + 7B582DD82716F55B004B92D0 /* (null) in Headers */,
What?
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