Bug 224927

Summary: Handle rotation correctly in WebRTC GPUProcess rendering pipeline
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, koivisto, peng.liu6, simon.fraser, thorton, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description youenn fablet 2021-04-22 06:03:58 PDT
Handle rotation correctly in WebRTC GPUProcess rendering pipeline
Comment 1 youenn fablet 2021-04-22 06:06:06 PDT
<rdar://76915991>
Comment 2 youenn fablet 2021-04-22 06:08:47 PDT
Created attachment 426802 [details]
Patch
Comment 3 Eric Carlson 2021-04-22 11:37:18 PDT
Comment on attachment 426802 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426802&action=review

> Source/WebKit/GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:81
> -    m_sampleBufferDisplayLayer->updateAffineTransform(transform);
> +    m_sampleBufferDisplayLayer->updateRootLayerAffineTransform(transform);

Why don't we have to do this in the web process? 

What happens in the web process if `updateAffineTransform`to rotates the root layer?
Comment 4 youenn fablet 2021-04-23 07:11:08 PDT
(In reply to Eric Carlson from comment #3)
> Comment on attachment 426802 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=426802&action=review
> 
> > Source/WebKit/GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:81
> > -    m_sampleBufferDisplayLayer->updateAffineTransform(transform);
> > +    m_sampleBufferDisplayLayer->updateRootLayerAffineTransform(transform);
> 
> Why don't we have to do this in the web process? 
> 
> What happens in the web process if `updateAffineTransform`to rotates the
> root layer?

I am not quite sure why doing it in the root layer and not the sample layer fixes the rotation issue in GPUProcess.
If I use the root layer in WebProcess, rotation is fine but the internal sample buffer layer is being cropped.

I asked around and it would be good to have additional analysis in that area.
In the meantime, I am landing this patch now since it fixes the issue.
Comment 5 youenn fablet 2021-04-23 07:11:37 PDT
iOS-wk2 failure is unrelated.
Comment 6 EWS 2021-04-23 07:32:48 PDT
Committed r276497 (236956@main): <https://commits.webkit.org/236956@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 426802 [details].