Changeset 273301 in webkit


Ignore:
Timestamp:
Feb 23, 2021 12:58:30 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

HTMLCanvasElement::copiedImage() contains old image with GPU Process on
https://bugs.webkit.org/show_bug.cgi?id=222101

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-02-23
Reviewed by Simon Fraser.

Source/WebKit:

Implement RemoteImageBufferProxy::copyImage and
RemoteImageBufferProxy::copyNativeImage.
Implement by asking the data from the GPU process.

Previously, with AcceleratedImageBufferShareableMappedBackend
the HTMLCanvasElement::copiedImage() would construct the copy
by copying the CGContext backed by the IOSurface that is accessible
by both processes. This would succeed. After a draw to the image,
the second copy would not reflect the draw but contain the same
image as the first copy.

Fix by not using the fact that the IOSurface is accessible by both
processes. In the end, IOSurfaces will not be available in
Web process.

Converts NativeImage to ShareableBitmap with WebCore::CompositeOperator::Copy
since the ImageBuffers might have unpremultiplied contents. Also, ShareableBitmap
does not have contents, so blending is overhead.

No new tests, enables ~150 tests.

  • GPUProcess/graphics/RemoteGraphicsContextGL.cpp:

(WebKit::RemoteGraphicsContextGL::copyTextureFromMedia):

  • GPUProcess/graphics/RemoteRenderingBackend.cpp:

(WebKit::RemoteRenderingBackend::getShareableBitmapForImageBuffer):

  • GPUProcess/graphics/RemoteRenderingBackend.h:
  • GPUProcess/graphics/RemoteRenderingBackend.messages.in:
  • WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
  • WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:

(WebKit::RemoteRenderingBackendProxy::getShareableBitmap):

  • WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:

LayoutTests:

  • gpu-process/TestExpectations:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r273291 r273301  
     12021-02-23  Kimmo Kinnunen  <kkinnunen@apple.com>
     2
     3        HTMLCanvasElement::copiedImage() contains old image with GPU Process on
     4        https://bugs.webkit.org/show_bug.cgi?id=222101
     5
     6        Reviewed by Simon Fraser.
     7
     8        * gpu-process/TestExpectations:
     9
    1102021-02-22  Said Abou-Hallawa  <said@apple.com>
    211
  • trunk/LayoutTests/gpu-process/TestExpectations

    r273291 r273301  
    1010fast/canvas/canvas-arc-connecting-line.html [ Failure ]
    1111fast/canvas/canvas-arc-zero-lineto.html [ Failure ]
    12 fast/canvas/canvas-bezier-same-endpoint.html [ Failure ]
    13 fast/canvas/canvas-blend-image.html [ Failure ]
    14 fast/canvas/canvas-blend-solid.html [ Failure ]
    15 fast/canvas/canvas-blending-clipping.html [ Failure ]
    16 fast/canvas/canvas-blending-color-over-color.html [ Failure ]
    17 fast/canvas/canvas-blending-color-over-gradient.html [ Failure ]
     12fast/canvas/canvas-bezier-same-endpoint.html [ Failure Pass ]
     13fast/canvas/canvas-blend-image.html [ Failure Pass ]
     14fast/canvas/canvas-blend-solid.html [ Failure Pass ]
    1815fast/canvas/canvas-drawImage-composite-copy.html [ ImageOnlyFailure ]
    1916fast/canvas/canvas-large-dimensions.html [ Failure ]
    2017fast/canvas/canvas-render-layer.html [ Failure ]
    2118fast/canvas/hidpi-repaint-on-retina-leaves-bits-behind.html [ ImageOnlyFailure ]
    22 fast/canvas/webgl/canvas-2d-webgl-texture.html [ Failure ]
    2319fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565.html [ Failure ]
    2420fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444.html [ Failure ]
    2521fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba5551.html [ Failure ]
    2622fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html [ Failure ]
    27 fast/canvas/webgl/tex-image-webgl.html [ Failure ]
    28 fast/canvas/webgl/texImage2D-mse-flipY-false.html [ Failure ]
    29 fast/canvas/webgl/texImage2D-mse-flipY-true.html [ Failure ]
    30 fast/canvas/webgl/texImage2D-video-flipY-true.html [ Failure ]
    31 fast/canvas/webgl/texture-active-bind.html [ Failure ]
    3223
    3324# webkit.org/b/220806
    34 fast/canvas/canvas-blending-color-over-image.html [ Timeout ]
    3525fast/canvas/webgl/context-update-on-display-configuration.html [ Timeout ]
    3626fast/canvas/webgl/texImage2D-video-flipY-false.html [ Timeout ]
     
    167157
    168158# webkit.org/b/220333
    169 webgl/1.0.3/conformance/extensions/oes-texture-float-with-canvas.html [ Failure ]
    170159webgl/1.0.3/conformance/extensions/oes-texture-float-with-video.html [ Failure ]
    171 webgl/1.0.3/conformance/extensions/oes-texture-half-float-with-canvas.html [ Failure ]
    172160webgl/1.0.3/conformance/extensions/oes-texture-half-float-with-video.html [ Failure ]
    173161webgl/1.0.3/conformance/state/gl-object-get-calls.html [ Timeout ]
    174 webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html [ Failure ]
    175 webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html [ Failure ]
    176 webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html [ Failure ]
    177 webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html [ Failure ]
    178162webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html [ Failure ]
    179163webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html [ Failure ]
    180164webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html [ Failure ]
    181165webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video.html [ Failure ]
    182 webgl/1.0.3/conformance/textures/tex-image-webgl.html [ Failure ]
    183 webgl/1.0.3/conformance/textures/texparameter-test.html [ Failure ]
    184 webgl/1.0.3/conformance/textures/texture-active-bind-2.html [ Failure ]
    185 webgl/1.0.3/conformance/textures/texture-active-bind.html [ Failure ]
    186166webgl/1.0.3/conformance/uniforms/uniform-samplers-test.html [ Slow ]
    187 webgl/2.0.0/conformance/extensions/oes-texture-float-with-canvas.html [ Failure ]
    188167webgl/2.0.0/conformance/extensions/oes-texture-float-with-video.html [ Failure ]
    189 webgl/2.0.0/conformance/extensions/oes-texture-half-float-with-canvas.html [ Failure ]
    190168webgl/2.0.0/conformance/extensions/oes-texture-half-float-with-video.html [ Failure ]
    191169webgl/2.0.0/conformance/reading/read-pixels-test.html [ Failure ]
    192170webgl/2.0.0/conformance/state/gl-object-get-calls.html [ Timeout ]
    193 webgl/2.0.0/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html [ Failure ]
    194 webgl/2.0.0/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html [ Failure ]
    195 webgl/2.0.0/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html [ Failure ]
    196 webgl/2.0.0/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html [ Failure ]
    197 webgl/2.0.0/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html [ Failure ]
    198 webgl/2.0.0/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html [ Failure ]
    199 webgl/2.0.0/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html [ Failure ]
    200 webgl/2.0.0/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html [ Failure ]
    201 webgl/2.0.0/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html [ Failure ]
    202 webgl/2.0.0/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html [ Failure ]
    203 webgl/2.0.0/conformance/textures/misc/tex-image-webgl.html [ Failure ]
    204 webgl/2.0.0/conformance/textures/misc/texture-active-bind-2.html [ Failure ]
    205 webgl/2.0.0/conformance/textures/misc/texture-active-bind.html [ Failure ]
    206171webgl/2.0.0/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html [ Failure ]
    207172webgl/2.0.0/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html [ Failure ]
     
    212177webgl/2.0.0/conformance2/reading/read-pixels-pack-parameters.html [ Failure ]
    213178webgl/2.0.0/conformance2/state/gl-object-get-calls.html [ Timeout ]
    214 webgl/2.0.0/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-float.html [ Failure ]
    215 webgl/2.0.0/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-half_float.html [ Failure ]
    216 webgl/2.0.0/conformance2/textures/canvas/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html [ Failure ]
    217 webgl/2.0.0/conformance2/textures/canvas/tex-2d-r16f-red-float.html [ Failure ]
    218 webgl/2.0.0/conformance2/textures/canvas/tex-2d-r16f-red-half_float.html [ Failure ]
    219 webgl/2.0.0/conformance2/textures/canvas/tex-2d-r32f-red-float.html [ Failure ]
    220 webgl/2.0.0/conformance2/textures/canvas/tex-2d-r8-red-unsigned_byte.html [ Failure ]
    221 webgl/2.0.0/conformance2/textures/canvas/tex-2d-r8ui-red_integer-unsigned_byte.html [ Failure ]
    222 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rg16f-rg-float.html [ Failure ]
    223 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rg16f-rg-half_float.html [ Failure ]
    224 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rg32f-rg-float.html [ Failure ]
    225 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rg8-rg-unsigned_byte.html [ Failure ]
    226 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rg8ui-rg_integer-unsigned_byte.html [ Failure ]
    227 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgb16f-rgb-float.html [ Failure ]
    228 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgb16f-rgb-half_float.html [ Failure ]
    229 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgb32f-rgb-float.html [ Failure ]
    230 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_byte.html [ Failure ]
    231 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html [ Failure ]
    232 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_byte.html [ Failure ]
    233 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html [ Failure ]
    234 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgb8-rgb-unsigned_byte.html [ Failure ]
    235 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html [ Failure ]
    236 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgba16f-rgba-float.html [ Failure ]
    237 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgba16f-rgba-half_float.html [ Failure ]
    238 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgba32f-rgba-float.html [ Failure ]
    239 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_byte.html [ Failure ]
    240 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html [ Failure ]
    241 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgba8-rgba-unsigned_byte.html [ Failure ]
    242 webgl/2.0.0/conformance2/textures/canvas/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html [ Failure ]
    243 webgl/2.0.0/conformance2/textures/canvas/tex-2d-srgb8-rgb-unsigned_byte.html [ Failure ]
    244 webgl/2.0.0/conformance2/textures/canvas/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html [ Failure ]
    245 webgl/2.0.0/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-float.html [ Failure ]
    246 webgl/2.0.0/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-half_float.html [ Failure ]
    247 webgl/2.0.0/conformance2/textures/canvas/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html [ Failure ]
    248 webgl/2.0.0/conformance2/textures/canvas/tex-3d-r16f-red-float.html [ Failure ]
    249 webgl/2.0.0/conformance2/textures/canvas/tex-3d-r16f-red-half_float.html [ Failure ]
    250 webgl/2.0.0/conformance2/textures/canvas/tex-3d-r32f-red-float.html [ Failure ]
    251 webgl/2.0.0/conformance2/textures/canvas/tex-3d-r8-red-unsigned_byte.html [ Failure ]
    252 webgl/2.0.0/conformance2/textures/canvas/tex-3d-r8ui-red_integer-unsigned_byte.html [ Failure ]
    253 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rg16f-rg-float.html [ Failure ]
    254 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rg16f-rg-half_float.html [ Failure ]
    255 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rg32f-rg-float.html [ Failure ]
    256 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rg8-rg-unsigned_byte.html [ Failure ]
    257 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rg8ui-rg_integer-unsigned_byte.html [ Failure ]
    258 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgb16f-rgb-float.html [ Failure ]
    259 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgb16f-rgb-half_float.html [ Failure ]
    260 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgb32f-rgb-float.html [ Failure ]
    261 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_byte.html [ Failure ]
    262 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html [ Failure ]
    263 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_byte.html [ Failure ]
    264 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html [ Failure ]
    265 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgb8-rgb-unsigned_byte.html [ Failure ]
    266 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html [ Failure ]
    267 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgba16f-rgba-float.html [ Failure ]
    268 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgba16f-rgba-half_float.html [ Failure ]
    269 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgba32f-rgba-float.html [ Failure ]
    270 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_byte.html [ Failure ]
    271 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html [ Failure ]
    272 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgba8-rgba-unsigned_byte.html [ Failure ]
    273 webgl/2.0.0/conformance2/textures/canvas/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html [ Failure ]
    274 webgl/2.0.0/conformance2/textures/canvas/tex-3d-srgb8-rgb-unsigned_byte.html [ Failure ]
    275 webgl/2.0.0/conformance2/textures/canvas/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html [ Failure ]
    276 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-float.html [ Failure ]
    277 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-half_float.html [ Failure ]
    278 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html [ Failure ]
    279 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-float.html [ Failure ]
    280 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r16f-red-half_float.html [ Failure ]
    281 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r32f-red-float.html [ Failure ]
    282 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8-red-unsigned_byte.html [ Failure ]
    283 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-r8ui-red_integer-unsigned_byte.html [ Failure ]
    284 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-float.html [ Failure ]
    285 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg16f-rg-half_float.html [ Failure ]
    286 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg32f-rg-float.html [ Failure ]
    287 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8-rg-unsigned_byte.html [ Failure ]
    288 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rg8ui-rg_integer-unsigned_byte.html [ Failure ]
    289 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-float.html [ Failure ]
    290 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb16f-rgb-half_float.html [ Failure ]
    291 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb32f-rgb-float.html [ Failure ]
    292 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_byte.html [ Failure ]
    293 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb565-rgb-unsigned_short_5_6_5.html [ Failure ]
    294 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_byte.html [ Failure ]
    295 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html [ Failure ]
    296 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8-rgb-unsigned_byte.html [ Failure ]
    297 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb8ui-rgb_integer-unsigned_byte.html [ Failure ]
    298 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-float.html [ Failure ]
    299 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgb9_e5-rgb-half_float.html [ Failure ]
    300 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-float.html [ Failure ]
    301 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba16f-rgba-half_float.html [ Failure ]
    302 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba32f-rgba-float.html [ Failure ]
    303 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_byte.html [ Failure ]
    304 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba4-rgba-unsigned_short_4_4_4_4.html [ Failure ]
    305 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8-rgba-unsigned_byte.html [ Failure ]
    306 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-rgba8ui-rgba_integer-unsigned_byte.html [ Failure ]
    307 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8-rgb-unsigned_byte.html [ Failure ]
    308 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html [ Failure ]
    309 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-float.html [ Failure ]
    310 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-half_float.html [ Failure ]
    311 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r11f_g11f_b10f-rgb-unsigned_int_10f_11f_11f_rev.html [ Failure ]
    312 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-float.html [ Failure ]
    313 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r16f-red-half_float.html [ Failure ]
    314 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r32f-red-float.html [ Failure ]
    315 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8-red-unsigned_byte.html [ Failure ]
    316 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-r8ui-red_integer-unsigned_byte.html [ Failure ]
    317 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-float.html [ Failure ]
    318 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg16f-rg-half_float.html [ Failure ]
    319 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg32f-rg-float.html [ Failure ]
    320 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8-rg-unsigned_byte.html [ Failure ]
    321 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rg8ui-rg_integer-unsigned_byte.html [ Failure ]
    322 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-float.html [ Failure ]
    323 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb16f-rgb-half_float.html [ Failure ]
    324 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb32f-rgb-float.html [ Failure ]
    325 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_byte.html [ Failure ]
    326 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb565-rgb-unsigned_short_5_6_5.html [ Failure ]
    327 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_byte.html [ Failure ]
    328 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb5_a1-rgba-unsigned_short_5_5_5_1.html [ Failure ]
    329 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8-rgb-unsigned_byte.html [ Failure ]
    330 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb8ui-rgb_integer-unsigned_byte.html [ Failure ]
    331 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-float.html [ Failure ]
    332 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgb9_e5-rgb-half_float.html [ Failure ]
    333 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-float.html [ Failure ]
    334 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba16f-rgba-half_float.html [ Failure ]
    335 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba32f-rgba-float.html [ Failure ]
    336 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_byte.html [ Failure ]
    337 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba4-rgba-unsigned_short_4_4_4_4.html [ Failure ]
    338 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8-rgba-unsigned_byte.html [ Failure ]
    339 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-rgba8ui-rgba_integer-unsigned_byte.html [ Failure ]
    340 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8-rgb-unsigned_byte.html [ Failure ]
    341 webgl/2.0.0/conformance2/textures/image_bitmap_from_image_bitmap/tex-3d-srgb8_alpha8-rgba-unsigned_byte.html [ Failure ]
    342179webgl/2.0.0/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-float.html [ Failure ]
    343180webgl/2.0.0/conformance2/textures/video/tex-2d-r11f_g11f_b10f-rgb-half_float.html [ Failure ]
     
    419256webrtc/video-rotation-no-cvo.html [ Timeout ]
    420257imported/w3c/web-platform-tests/webrtc/RTCRtpSender-replaceTrack.https.html [ Timeout ]
     258
     259webkit.org/b/221825 fast/canvas/webgl/texImage2D-video-flipY-true.html [ Pass ]
     260webkit.org/b/221791 fast/canvas/webgl/texImage2D-mse-flipY-false.html [ Pass ]
     261webkit.org/b/221791 fast/canvas/webgl/texImage2D-mse-flipY-true.html [ Pass ]
  • trunk/Source/WebKit/ChangeLog

    r273299 r273301  
     12021-02-23  Kimmo Kinnunen  <kkinnunen@apple.com>
     2
     3        HTMLCanvasElement::copiedImage() contains old image with GPU Process on
     4        https://bugs.webkit.org/show_bug.cgi?id=222101
     5
     6        Reviewed by Simon Fraser.
     7
     8        Implement RemoteImageBufferProxy::copyImage and
     9        RemoteImageBufferProxy::copyNativeImage.
     10        Implement by asking the data from the GPU process.
     11
     12        Previously, with AcceleratedImageBufferShareableMappedBackend
     13        the HTMLCanvasElement::copiedImage() would construct the copy
     14        by copying the CGContext backed by the IOSurface that is accessible
     15        by both processes. This would succeed. After a draw to the image,
     16        the second copy would not reflect the draw but contain the same
     17        image as the first copy.
     18
     19        Fix by not using the fact that the IOSurface is accessible by both
     20        processes. In the end, IOSurfaces will not be available in
     21        Web process.
     22
     23        Converts NativeImage to ShareableBitmap with WebCore::CompositeOperator::Copy
     24        since the ImageBuffers might have unpremultiplied contents. Also, ShareableBitmap
     25        does not have contents, so blending is overhead.
     26
     27        No new tests, enables ~150 tests.
     28
     29        * GPUProcess/graphics/RemoteGraphicsContextGL.cpp:
     30        (WebKit::RemoteGraphicsContextGL::copyTextureFromMedia):
     31        * GPUProcess/graphics/RemoteRenderingBackend.cpp:
     32        (WebKit::RemoteRenderingBackend::getShareableBitmapForImageBuffer):
     33        * GPUProcess/graphics/RemoteRenderingBackend.h:
     34        * GPUProcess/graphics/RemoteRenderingBackend.messages.in:
     35        * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
     36        * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
     37        (WebKit::RemoteRenderingBackendProxy::getShareableBitmap):
     38        * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
     39
    1402021-02-22  Don Olmstead  <don.olmstead@sony.com>
    241
  • trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp

    r273299 r273301  
    348348        data = imageBuffer->toBGRAData();
    349349    completionHandler(WTFMove(data));
     350}
     351
     352void RemoteRenderingBackend::getShareableBitmapForImageBuffer(WebCore::RenderingResourceIdentifier identifier, WebCore::PreserveResolution preserveResolution, CompletionHandler<void(ShareableBitmap::Handle&&)>&& completionHandler)
     353{
     354    ASSERT(!RunLoop::isMain());
     355
     356    ShareableBitmap::Handle handle;
     357    [&]() {
     358        auto imageBuffer = m_remoteResourceCache.cachedImageBuffer(identifier);
     359        if (!imageBuffer)
     360            return;
     361        auto image = imageBuffer->copyNativeImage(WebCore::BackingStoreCopy::DontCopyBackingStore);
     362        if (!image)
     363            return;
     364        auto backendSize = imageBuffer->backendSize();
     365        auto resultSize = preserveResolution == WebCore::PreserveResolution::Yes ? backendSize : imageBuffer->logicalSize();
     366        auto bitmap = ShareableBitmap::createShareable(resultSize, { });
     367        if (!bitmap)
     368            return;
     369        auto context = bitmap->createGraphicsContext();
     370        if (!context)
     371            return;
     372        context->drawNativeImage(*image, resultSize, FloatRect { { }, resultSize }, FloatRect { { }, backendSize }, { WebCore::CompositeOperator::Copy });
     373        bitmap->createHandle(handle);
     374    }();
     375    completionHandler(WTFMove(handle));
    350376}
    351377
  • trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h

    r273204 r273301  
    119119    void getDataForImageBuffer(const String& mimeType, Optional<double> quality, WebCore::RenderingResourceIdentifier, CompletionHandler<void(Vector<uint8_t>&&)>&&);
    120120    void getBGRADataForImageBuffer(WebCore::RenderingResourceIdentifier, CompletionHandler<void(Vector<uint8_t>&&)>&&);
     121    void getShareableBitmapForImageBuffer(WebCore::RenderingResourceIdentifier, WebCore::PreserveResolution, CompletionHandler<void(ShareableBitmap::Handle&&)>&&);
    121122    void cacheNativeImage(const ShareableBitmap::Handle&, WebCore::RenderingResourceIdentifier);
    122123    void cacheFont(Ref<WebCore::Font>&&);
  • trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.messages.in

    r272786 r273301  
    3030    GetDataForImageBuffer(String mimeType, Optional<double> quality, WebCore::RenderingResourceIdentifier renderingResourceIdentifier) -> (Vector<uint8_t> data) Synchronous
    3131    GetBGRADataForImageBuffer(WebCore::RenderingResourceIdentifier renderingResourceIdentifier) -> (Vector<uint8_t> data) Synchronous
     32    GetShareableBitmapForImageBuffer(WebCore::RenderingResourceIdentifier imageBuffer, enum:uint8_t WebCore::PreserveResolution preserveResolution) -> (WebKit::ShareableBitmap::Handle handle) Synchronous
    3233    CacheNativeImage(WebKit::ShareableBitmap::Handle handle, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
    3334    CacheFont(IPC::FontReference font)
  • trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h

    r273291 r273301  
    172172
    173173        return m_remoteRenderingBackendProxy->getBGRADataForImageBuffer(m_renderingResourceIdentifier);
     174    }
     175    RefPtr<WebCore::NativeImage> copyNativeImage(WebCore::BackingStoreCopy = WebCore::BackingStoreCopy::CopyBackingStore) const override
     176    {
     177        if (UNLIKELY(!m_remoteRenderingBackendProxy))
     178            return { };
     179        const_cast<RemoteImageBufferProxy*>(this)->flushDrawingContext();
     180        auto bitmap = m_remoteRenderingBackendProxy->getShareableBitmap(m_renderingResourceIdentifier, WebCore::PreserveResolution::Yes);
     181        if (!bitmap)
     182            return { };
     183        return WebCore::NativeImage::create(bitmap->createPlatformImage());
     184    }
     185
     186    RefPtr<WebCore::Image> copyImage(WebCore::BackingStoreCopy = WebCore::BackingStoreCopy::CopyBackingStore, WebCore::PreserveResolution preserveResolution = WebCore::PreserveResolution::No) const override
     187    {
     188        if (UNLIKELY(!m_remoteRenderingBackendProxy))
     189            return { };
     190        const_cast<RemoteImageBufferProxy*>(this)->flushDrawingContext();
     191        auto bitmap = m_remoteRenderingBackendProxy->getShareableBitmap(m_renderingResourceIdentifier, preserveResolution);
     192        if (!bitmap)
     193            return { };
     194        return bitmap->createImage();
    174195    }
    175196
  • trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp

    r273299 r273301  
    180180}
    181181
     182RefPtr<ShareableBitmap> RemoteRenderingBackendProxy::getShareableBitmap(RenderingResourceIdentifier imageBuffer, PreserveResolution preserveResolution)
     183{
     184    sendDeferredWakeupMessageIfNeeded();
     185
     186    ShareableBitmap::Handle handle;
     187    auto sendResult = sendSync(Messages::RemoteRenderingBackend::GetShareableBitmapForImageBuffer(imageBuffer, preserveResolution), Messages::RemoteRenderingBackend::GetShareableBitmapForImageBuffer::Reply(handle), m_renderingBackendIdentifier, 1_s);
     188    if (handle.isNull())
     189        return { };
     190    ASSERT_UNUSED(sendResult, sendResult);
     191    return ShareableBitmap::create(handle);
     192}
     193
    182194void RemoteRenderingBackendProxy::cacheNativeImage(const ShareableBitmap::Handle& handle, RenderingResourceIdentifier renderingResourceIdentifier)
    183195{
  • trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h

    r273080 r273301  
    8787    Vector<uint8_t> getBGRADataForImageBuffer(WebCore::RenderingResourceIdentifier);
    8888    WebCore::DisplayList::FlushIdentifier flushDisplayListAndCommit(const WebCore::DisplayList::DisplayList&, WebCore::RenderingResourceIdentifier);
     89    RefPtr<ShareableBitmap> getShareableBitmap(WebCore::RenderingResourceIdentifier, WebCore::PreserveResolution);
    8990    void cacheNativeImage(const ShareableBitmap::Handle&, WebCore::RenderingResourceIdentifier);
    9091    void cacheFont(Ref<WebCore::Font>&&);
  • trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp

    r270725 r273301  
    7474        return nullptr;
    7575
    76     context->drawNativeImage(image, imageSize, FloatRect({ }, imageSize), FloatRect({ }, imageSize));
     76    context->drawNativeImage(image, imageSize, FloatRect({ }, imageSize), FloatRect({ }, imageSize), { WebCore::CompositeOperator::Copy });
    7777    return bitmap;
    7878}
Note: See TracChangeset for help on using the changeset viewer.