Bug 237891

Summary: RemoteGraphicsContextGLProxy omits context lost checks for back and front buffer access functions
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebGLAssignee: Kimmo Kinnunen <kkinnunen>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, kbr, kkinnunen, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=237893
Attachments:
Description Flags
Patch
none
Patch none

Description Kimmo Kinnunen 2022-03-15 07:02:30 PDT
RemoteGraphicsContextGLProxy omits context lost checks for back and front buffer access functions
Comment 1 Kimmo Kinnunen 2022-03-15 07:03:09 PDT
<rdar://90245766>
Comment 2 Kimmo Kinnunen 2022-03-15 07:19:10 PDT
Created attachment 454704 [details]
Patch
Comment 3 Myles C. Maxfield 2022-03-15 09:34:09 PDT
Comment on attachment 454704 [details]
Patch

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

> Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:142
> +        buffer.context().clearRect({ IntPoint(), buffer.backendSize() });

I’m a little confused. If the context is lost, how can you use the context to clearRect()?
Comment 4 Kimmo Kinnunen 2022-03-15 12:03:08 PDT
Created attachment 454739 [details]
Patch
Comment 5 Kimmo Kinnunen 2022-03-15 12:08:23 PDT
(In reply to Myles C. Maxfield from comment #3)
> 
> > Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:142
> > +        buffer.context().clearRect({ IntPoint(), buffer.backendSize() });
> 
> I’m a little confused. If the context is lost, how can you use the context
> to clearRect()?

It's different context (graphics context of the image buffer, vs graphicscontextgl of webgl)
However, that's a good point -- if the context is lost, the GPU Process is unreliable and will be shut down, so the image buffer drawing does not make sense either. I'll remove this for now.
Comment 6 EWS 2022-03-15 14:31:15 PDT
Committed r291314 (248453@main): <https://commits.webkit.org/248453@main>

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