RESOLVED FIXED 210297
First render after a process swap does not use accelerated rendering
https://bugs.webkit.org/show_bug.cgi?id=210297
Summary First render after a process swap does not use accelerated rendering
Chris Dumez
Reported 2020-04-09 13:00:50 PDT
First render after a process swap does not use accelerated rendering.
Attachments
Proof of concept fix (15.72 KB, patch)
2020-04-09 13:02 PDT, Chris Dumez
no flags
Proof of concept fix (14.64 KB, patch)
2020-04-09 13:27 PDT, Chris Dumez
no flags
Proof of concept fix (13.80 KB, patch)
2020-04-09 13:29 PDT, Chris Dumez
no flags
Proof of concept fix (13.64 KB, patch)
2020-04-09 13:31 PDT, Chris Dumez
no flags
WIP Patch (24.26 KB, patch)
2020-04-09 13:50 PDT, Chris Dumez
no flags
WIP Patch (24.68 KB, patch)
2020-04-09 14:05 PDT, Chris Dumez
no flags
Patch (29.01 KB, patch)
2020-04-09 14:22 PDT, Chris Dumez
no flags
test case for drawInContext: on hidden layer (2.85 KB, text/x-csrc)
2020-04-10 11:48 PDT, Ben Nham
no flags
Patch (29.15 KB, patch)
2020-04-10 12:14 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2020-04-09 13:01:09 PDT
Chris Dumez
Comment 2 2020-04-09 13:02:12 PDT
Created attachment 395993 [details] Proof of concept fix I have a proof of concept that seems to be the issue (would need some cleanup though). I am uploading the gather early feedback.
Chris Dumez
Comment 3 2020-04-09 13:27:39 PDT
Created attachment 395997 [details] Proof of concept fix
Chris Dumez
Comment 4 2020-04-09 13:29:56 PDT
Created attachment 395998 [details] Proof of concept fix
Chris Dumez
Comment 5 2020-04-09 13:31:02 PDT
Created attachment 395999 [details] Proof of concept fix
Chris Dumez
Comment 6 2020-04-09 13:50:12 PDT
Created attachment 396004 [details] WIP Patch
Chris Dumez
Comment 7 2020-04-09 14:05:37 PDT
Created attachment 396006 [details] WIP Patch Ok, I did a decent amount of cleanup and it appears to be working. Any early feedback?
Chris Dumez
Comment 8 2020-04-09 14:22:16 PDT
Geoffrey Garen
Comment 9 2020-04-09 17:38:56 PDT
Are the EWS crashes in viewgesturecontroller real?
Antti Koivisto
Comment 10 2020-04-10 07:31:49 PDT
Comment on attachment 396010 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=396010&action=review Good idea! > Source/WebKit/ChangeLog:26 > + 2. In the UIProcess, when we get the DrawingAreaProxy::EnterAcceleratedCompositingMode > + IPC and we already have a root layer, we add the new one behind the existing one > + instead of replacing the existing one. As a result, the new layer will get > + accelerated compositing but will not be visible on screen yet. I wonder if there are cases with transparent layers or missing tiles where this could lead to both pages being partially visible at the same time. Maybe a stronger hiding strategy is needed?
Chris Dumez
Comment 11 2020-04-10 08:06:29 PDT
(In reply to Geoffrey Garen from comment #9) > Are the EWS crashes in viewgesturecontroller real? EWS is green now so I guess not.
Chris Dumez
Comment 12 2020-04-10 08:07:06 PDT
(In reply to Antti Koivisto from comment #10) > Comment on attachment 396010 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=396010&action=review > > Good idea! > > > Source/WebKit/ChangeLog:26 > > + 2. In the UIProcess, when we get the DrawingAreaProxy::EnterAcceleratedCompositingMode > > + IPC and we already have a root layer, we add the new one behind the existing one > > + instead of replacing the existing one. As a result, the new layer will get > > + accelerated compositing but will not be visible on screen yet. > > I wonder if there are cases with transparent layers or missing tiles where > this could lead to both pages being partially visible at the same time. > > Maybe a stronger hiding strategy is needed? Tim / Simon, what do you think? Can I land as is or do you think we need a better hiding strategy?
Simon Fraser (smfr)
Comment 13 2020-04-10 10:25:03 PDT
(In reply to Chris Dumez from comment #12) > (In reply to Antti Koivisto from comment #10) > > Comment on attachment 396010 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=396010&action=review > > > > Good idea! > > > > > Source/WebKit/ChangeLog:26 > > > + 2. In the UIProcess, when we get the DrawingAreaProxy::EnterAcceleratedCompositingMode > > > + IPC and we already have a root layer, we add the new one behind the existing one > > > + instead of replacing the existing one. As a result, the new layer will get > > > + accelerated compositing but will not be visible on screen yet. > > > > I wonder if there are cases with transparent layers or missing tiles where > > this could lead to both pages being partially visible at the same time. > > > > Maybe a stronger hiding strategy is needed? > > Tim / Simon, what do you think? Can I land as is or do you think we need a > better hiding strategy? We do. WKWebViews can be transparent, which allows transparent page contents, and this hack would make your hidden views visible. Maybe move them offscreen? Or set layer.hidden (checking to see whether that cuts of painting, which we don't want).
Simon Fraser (smfr)
Comment 14 2020-04-10 10:26:13 PDT
There's a menu item in MiniBrowser to toggle on transparent web views. Navigate from a page with no root background color; you shouldn't see the new page behind the old one. Ideally this would be testable.
Ben Nham
Comment 15 2020-04-10 11:48:19 PDT
Created attachment 396111 [details] test case for drawInContext: on hidden layer Based on code inspection of CALayer.mm and this attached test case, it seems like -drawInContext: still gets called on a layer even if it's hidden. But we could ask the CA maintainer to be sure.
Chris Dumez
Comment 16 2020-04-10 12:07:54 PDT
(In reply to Ben Nham from comment #15) > Created attachment 396111 [details] > test case for drawInContext: on hidden layer > > Based on code inspection of CALayer.mm and this attached test case, it seems > like -drawInContext: still gets called on a layer even if it's hidden. But > we could ask the CA maintainer to be sure. Yes, I have also verified in Safari that marking the layer as hidden does not prevent painting or hardware acceleration.
Chris Dumez
Comment 17 2020-04-10 12:14:04 PDT
EWS
Comment 18 2020-04-10 13:30:08 PDT
Committed r259898: <https://trac.webkit.org/changeset/259898> All reviewed patches have been landed. Closing bug and clearing flags on attachment 396112 [details].
Note You need to log in before you can comment on or make changes to this bug.