[webkit-reviews] review granted: [Bug 221811] WebGL contexts do not work as source for Context2D drawImage calls in GPU process : [Attachment 420663] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 17 10:54:08 PST 2021


Darin Adler <darin at apple.com> has granted Kimmo Kinnunen
<kkinnunen at apple.com>'s request for review:
Bug 221811: WebGL contexts do not work as source for Context2D drawImage calls
in GPU process
https://bugs.webkit.org/show_bug.cgi?id=221811

Attachment 420663: Patch

https://bugs.webkit.org/attachment.cgi?id=420663&action=review




--- Comment #7 from Darin Adler <darin at apple.com> ---
Comment on attachment 420663
  --> https://bugs.webkit.org/attachment.cgi?id=420663
Patch

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

Again a few style thoughts.

> Source/WebCore/platform/graphics/cocoa/WebGLLayer.mm:115
> +    WebCore::GraphicsContextGLIOSurfaceSwapChain::present(WTFMove(buffer));

Pretty sure that you don’t need the namespace prefix "WebCore" when using the
name of a base class.

> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:226
>      // Reading premultiplied alpha would involve unpremultiplying, which is
>      // lossy.

Drives me crazy to have that orphaned word. Merging this into one line will
make me sleep better at night. (If I coded for a few years with 80 column style
like they use at Google maybe my tastes would change?)

> Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp:154
> +    // TODO: We do not have functioning read/write fences in
RemoteRenderingBackend. Thus this is synchronous,
> +    // as is the messages that call these.

Grammar mistake, "is" -> "are".

We use FIXME and not TODO on WebKit.

I am not at all familiar with how OK or not OK it is to use synchronous
messages for this, nor if this is a long term thing or a short term expedient
intermediate step.

> Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.cpp:160
> +	       // Note: here we do not try to play back pending commands for
imageBuffer. Currently this call is only made for empty

I suggest leaving out "Note:" here.

> Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGL.messages.in:40
> +    void PaintRenderingResultsToCanvas(WebCore::RenderingResourceIdentifier
renderingResourceIdentifier) -> () Synchronous
> +    void PaintCompositedResultsToCanvas(WebCore::RenderingResourceIdentifier
renderingResourceIdentifier) -> () Synchronous

Given the type name, I would be tempted to just use the word "identifier" as
the argument name.

> Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp:53
> +std::unique_ptr<RemoteGraphicsContextGL>
RemoteGraphicsContextGL::create(const WebCore::GraphicsContextGLAttributes&
attributes, GPUConnectionToWebProcess& gpuConnectionToWebProcess,
GraphicsContextGLIdentifier graphicsContextGLIdentifier,
RemoteRenderingBackend& renderingBackend)

I would name the arguments with shorter names: "connection", "identifier",
"backEnd". The type names have enough of the rest of the context.

> Source/WebKit/GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp:58
> +RemoteGraphicsContextGLCocoa::RemoteGraphicsContextGLCocoa(const
WebCore::GraphicsContextGLAttributes& attributes, GPUConnectionToWebProcess&
connection, GraphicsContextGLIdentifier identifier, RemoteRenderingBackend&
renderingBackend)

Hey, you did two of the three of those here!

> Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:47
> +RefPtr<RemoteGraphicsContextGLProxy>
RemoteGraphicsContextGLProxy::create(const GraphicsContextGLAttributes&
attributes, RenderingBackendIdentifier renderingBackendIdentifier)

Shorter name idea again.

> Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:52
>
+RemoteGraphicsContextGLProxy::RemoteGraphicsContextGLProxy(GPUProcessConnectio
n& gpuProcessConnection, const GraphicsContextGLAttributes& attrs,
RenderingBackendIdentifier renderingBackendIdentifier)

Shorter name idea again. Also would be nice to consistently use "attributes"
instead of mixing "attrs" and "attributes".

> Tools/Scripts/generate-gpup-webgl:105
> +    void PaintRenderingResultsToCanvas(WebCore::RenderingResourceIdentifier
renderingResourceIdentifier) -> () Synchronous
> +    void PaintCompositedResultsToCanvas(WebCore::RenderingResourceIdentifier
renderingResourceIdentifier) -> () Synchronous

Shorter name idea again.


More information about the webkit-reviews mailing list