Bug 224271 - [Cairo][GPUP] GraphicsContextGLOpenGL::paintToCanvas can't paint into a remote canvas
Summary: [Cairo][GPUP] GraphicsContextGLOpenGL::paintToCanvas can't paint into a remot...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-07 00:26 PDT by Fujii Hironori
Modified: 2021-04-09 15:10 PDT (History)
10 users (show)

See Also:


Attachments
WIP patch (2.63 KB, patch)
2021-04-07 00:27 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (3.86 KB, patch)
2021-04-07 14:08 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (3.57 KB, patch)
2021-04-08 17:13 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2021-04-07 00:26:11 PDT
[Cairo][GPUP] GraphicsContextGLOpenGL::paintToCanvas can't paint into a remote canvas

WebGL canvas tests are failing in WinCairo WK2 layout tests since r274327 enabled GPU process mode for WebKitTestRunner.

  webgl/1.0.3/conformance/canvas/canvas-test.html [ Failure ]
  webgl/1.0.3/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html [ Failure ]
  webgl/1.0.3/conformance/canvas/draw-webgl-to-canvas-test.html [ Failure ]
  webgl/1.0.3/conformance/canvas/to-data-url-test.html [ Failure ]
  webgl/1.0.3/conformance/context/context-attribute-preserve-drawing-buffer.html [ Failure ]
  webgl/1.0.3/conformance/textures/gl-pixelstorei.html [ Failure ]
  webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-webgl-canvas-rgb565.html [ Failure ]
  webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-webgl-canvas-rgba4444.html [ Failure ]
  webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-webgl-canvas-rgba5551.html [ Failure ]
  webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-webgl-canvas.html [ Failure ]
  webgl/1.0.3/conformance/textures/tex-image-canvas-corruption.html [ Failure ]
  webgl/1.0.3/conformance/textures/tex-image-webgl.html [ Failure ]
  webgl/2.0.0/conformance/canvas/canvas-test.html [ Failure ]
  webgl/2.0.0/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html [ Failure ]
  webgl/2.0.0/conformance/canvas/draw-webgl-to-canvas-test.html [ Failure ]
  webgl/2.0.0/conformance/canvas/to-data-url-test.html [ Failure ]
  webgl/2.0.0/conformance/context/context-attribute-preserve-drawing-buffer.html [ Failure ]
  webgl/2.0.0/conformance/textures/misc/gl-pixelstorei.html [ Failure ]
  webgl/2.0.0/conformance/textures/misc/tex-image-canvas-corruption.html [ Failure ]
  webgl/2.0.0/conformance/textures/misc/tex-image-webgl.html [ Failure ]
  webgl/2.0.0/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html [ Failure ]
  webgl/2.0.0/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html [ Failure ]
  webgl/2.0.0/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html [ Failure ]
  webgl/2.0.0/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html [ Failure ]
  webgl/2.0.0/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html [ Failure ]
  webgl/2.0.0/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-float.html [ Failure ]
  webgl/2.0.0/conformance2/textures/canvas_sub_rectangle/tex-2d-r11f_g11f_b10f-rgb-half_float.html [ Failure ]
  (snipped)
Comment 1 Fujii Hironori 2021-04-07 00:27:01 PDT
Created attachment 425360 [details]
WIP patch
Comment 2 Fujii Hironori 2021-04-07 14:08:11 PDT
Created attachment 425436 [details]
Patch
Comment 3 Kimmo Kinnunen 2021-04-08 00:27:11 PDT
Comment on attachment 425436 [details]
Patch

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

Makes sense to me

> Source/WebCore/platform/graphics/cairo/GraphicsContextGLCairo.cpp:136
> +    // CSS styling may cause the canvas's content to be resized on

Not sure this comment is valuable enough to copy from CG, it appears to be pointless..

> Source/WebCore/platform/graphics/cairo/GraphicsContextGLCairo.cpp:140
> +    // We want to completely overwrite the previous frame's

Maybe you don't need to duplicate this from CG, it appears to be a bit wrong. (there's no previous frame)

> Source/WebCore/platform/graphics/cairo/GraphicsContextGLCairo.cpp:147
> +    context.drawNativeImage(*image, imageSize, canvasRect, FloatRect(FloatPoint(), imageSize), { CompositeOperator::Copy });

I know you copied CG, but I think this could also be :
context.drawNativeImage(*image, imageSize, FloatRect{{}, canvasSize }, FloatRect{{}, imageSize}, { CompositeOperator::Copy });
(e.g. no need to declare canvasRect if you don't anyway declare imageRect either.
Comment 4 Fujii Hironori 2021-04-08 14:49:38 PDT
Yup, I just copied the CG port code thoughtlessly. Will fix. Thank you very much.
Comment 5 Fujii Hironori 2021-04-08 17:13:07 PDT
Created attachment 425563 [details]
Patch
Comment 6 Fujii Hironori 2021-04-09 15:09:32 PDT
Comment on attachment 425563 [details]
Patch

Clearing flags on attachment: 425563

Committed r275780 (236353@main): <https://commits.webkit.org/236353@main>
Comment 7 Fujii Hironori 2021-04-09 15:09:36 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2021-04-09 15:10:31 PDT
<rdar://problem/76472277>