Title: [256505] trunk
Revision
256505
Author
[email protected]
Date
2020-02-13 07:51:50 -0800 (Thu, 13 Feb 2020)

Log Message

Implement OffscreenCanvas.copiedImage
https://bugs.webkit.org/show_bug.cgi?id=206220

Patch by Chris Lord <[email protected]> on 2020-02-13
Reviewed by Žan Doberšek.

Source/WebCore:

No new tests. Covered by existing tests.

* html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::didDraw):
(WebCore::OffscreenCanvas::copiedImage const):
(WebCore::OffscreenCanvas::clearCopiedImage const):
(WebCore::OffscreenCanvas::takeImageBuffer const):
(WebCore::OffscreenCanvas::reset):
* html/OffscreenCanvas.h:

LayoutTests:

* platform/gtk/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt:
* platform/wpe/TestExpectations:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (256504 => 256505)


--- trunk/LayoutTests/ChangeLog	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/ChangeLog	2020-02-13 15:51:50 UTC (rev 256505)
@@ -1,3 +1,22 @@
+2020-02-13  Chris Lord  <[email protected]>
+
+        Implement OffscreenCanvas.copiedImage
+        https://bugs.webkit.org/show_bug.cgi?id=206220
+
+        Reviewed by Žan Doberšek.
+
+        * platform/gtk/TestExpectations:
+        * platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
+        * platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt:
+        * platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
+        * platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt:
+        * platform/wpe/TestExpectations:
+        * platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
+        * platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt:
+        * platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
+        * platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt:
+        * platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer-expected.txt:
+
 2020-02-13  Diego Pino Garcia  <[email protected]>
 
         [GTK] Gardening, update TestExpectations and rebaselines

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (256504 => 256505)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2020-02-13 15:51:50 UTC (rev 256505)
@@ -4127,24 +4127,7 @@
 
 webkit.org/b/206264 imported/w3c/web-platform-tests/css/css-multicol/multicol-gap-percentage-001.html [ Failure ]
 
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/compositing/2d.composite.globalAlpha.canvaspattern.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/compositing/2d.composite.globalAlpha.canvaspattern.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.canvas.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.canvas.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.nocontext.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.modify.canvas1.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.modify.canvas1.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.modify.canvas2.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.modify.canvas2.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.repeat.null.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.repeat.null.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/image-smoothing/image.smoothing.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/image-smoothing/image.smoothing.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/the-offscreen-canvas/initial.reset.pattern.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/the-offscreen-canvas/initial.reset.pattern.worker.html [ Failure ]
+webkit.org/b/207016 http/tests/misc/form-submit-file-cross-site-redirect.html [ Failure ]
 
 webkit.org/b/206692 fast/canvas/canvas-fillPath-shadow.html [ Failure ]
 

Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt (256504 => 256505)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2020-02-13 15:51:50 UTC (rev 256505)
@@ -34,11 +34,11 @@
 FAIL createImageBitmap from a vector SVGImageElement scaled up, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL createImageBitmap from a vector SVGImageElement resized, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL createImageBitmap from a vector SVGImageElement with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL createImageBitmap from an OffscreenCanvas, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas scaled down, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas scaled up, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas resized, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
+PASS createImageBitmap from an OffscreenCanvas, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an OffscreenCanvas scaled down, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an OffscreenCanvas scaled up, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an OffscreenCanvas resized, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an OffscreenCanvas with negative sw/sh, and drawImage on the created ImageBitmap 
 FAIL createImageBitmap from an ImageData, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 FAIL createImageBitmap from an ImageData scaled down, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 FAIL createImageBitmap from an ImageData scaled up, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"

Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt (256504 => 256505)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt	2020-02-13 15:51:50 UTC (rev 256505)
@@ -13,8 +13,8 @@
 FAIL createImageBitmap from a bitmap SVGImageElement imageOrientation: "flipY", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL createImageBitmap from a vector SVGImageElement imageOrientation: "none", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL createImageBitmap from a vector SVGImageElement imageOrientation: "flipY", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL createImageBitmap from an OffscreenCanvas imageOrientation: "none", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas imageOrientation: "flipY", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
+PASS createImageBitmap from an OffscreenCanvas imageOrientation: "none", and drawImage on the created ImageBitmap 
+FAIL createImageBitmap from an OffscreenCanvas imageOrientation: "flipY", and drawImage on the created ImageBitmap assert_approx_equals: Red channel of the pixel at (5, 15) expected 255 +/- 10 but got 0
 FAIL createImageBitmap from an ImageData imageOrientation: "none", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 FAIL createImageBitmap from an ImageData imageOrientation: "flipY", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 PASS createImageBitmap from an ImageBitmap imageOrientation: "none", and drawImage on the created ImageBitmap 

Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt (256504 => 256505)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2020-02-13 15:51:50 UTC (rev 256505)
@@ -31,7 +31,7 @@
 FAIL createImageBitmap with a vector SVGImageElement source and oversized (unallocatable) crop region assert_throws: function "() => { throw e }" threw object "TypeError: Type error" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
 PASS createImageBitmap with an OffscreenCanvas source and sw set to 0 
 PASS createImageBitmap with an OffscreenCanvas source and sh set to 0 
-PASS createImageBitmap with an OffscreenCanvas source and oversized (unallocatable) crop region 
+FAIL createImageBitmap with an OffscreenCanvas source and oversized (unallocatable) crop region assert_equals: expected 100000000 but got 20
 PASS createImageBitmap with an ImageData source and sw set to 0 
 PASS createImageBitmap with an ImageData source and sh set to 0 
 FAIL createImageBitmap with an ImageData source and oversized (unallocatable) crop region assert_throws: function "() => { throw e }" threw object "TypeError: createImageBitmap with ImageData is not implemented" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11

Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt (256504 => 256505)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt	2020-02-13 15:51:50 UTC (rev 256505)
@@ -6,7 +6,7 @@
 PASS Serialize ImageBitmap created from a vector HTMLImageElement 
 FAIL Serialize ImageBitmap created from a bitmap SVGImageElement promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Serialize ImageBitmap created from a vector SVGImageElement promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL Serialize ImageBitmap created from an OffscreenCanvas promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
+PASS Serialize ImageBitmap created from an OffscreenCanvas 
 FAIL Serialize ImageBitmap created from an ImageData promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 PASS Serialize ImageBitmap created from an ImageBitmap 
 PASS Serialize ImageBitmap created from a Blob 

Modified: trunk/LayoutTests/platform/wpe/TestExpectations (256504 => 256505)


--- trunk/LayoutTests/platform/wpe/TestExpectations	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/wpe/TestExpectations	2020-02-13 15:51:50 UTC (rev 256505)
@@ -2215,26 +2215,6 @@
 webkit.org/b/203677 imported/w3c/web-platform-tests/svg/import/painting-stroke-08-t-manual.svg [ Failure ]
 webkit.org/b/203677 svg/W3C-SVG-1.1/painting-fill-05-b.svg [ Failure ]
 
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/compositing/2d.composite.globalAlpha.canvaspattern.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/compositing/2d.composite.globalAlpha.canvaspattern.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/convert-to-blob/offscreencanvas.convert.to.blob.w.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.canvas.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.canvas.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.nocontext.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.modify.canvas1.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.modify.canvas1.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.modify.canvas2.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.modify.canvas2.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.repeat.null.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/fill-and-stroke-styles/2d.pattern.repeat.null.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/image-smoothing/image.smoothing.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/image-smoothing/image.smoothing.worker.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/the-offscreen-canvas/initial.reset.pattern.html [ Failure ]
-webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/the-offscreen-canvas/initial.reset.pattern.worker.html [ Failure ]
-
 webkit.org/b/194933 http/tests/cookies/same-site/user-load-cross-site-redirect.php [ Failure ]
 
 webkit.org/b/207678 imported/w3c/web-platform-tests/url/a-element-origin-xhtml.xhtml [ Failure ]

Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt (256504 => 256505)


--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt	2020-02-13 15:51:50 UTC (rev 256505)
@@ -34,11 +34,11 @@
 FAIL createImageBitmap from a vector SVGImageElement scaled up, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL createImageBitmap from a vector SVGImageElement resized, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL createImageBitmap from a vector SVGImageElement with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL createImageBitmap from an OffscreenCanvas, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas scaled down, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas scaled up, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas resized, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas with negative sw/sh, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
+PASS createImageBitmap from an OffscreenCanvas, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an OffscreenCanvas scaled down, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an OffscreenCanvas scaled up, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an OffscreenCanvas resized, and drawImage on the created ImageBitmap 
+PASS createImageBitmap from an OffscreenCanvas with negative sw/sh, and drawImage on the created ImageBitmap 
 FAIL createImageBitmap from an ImageData, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 FAIL createImageBitmap from an ImageData scaled down, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 FAIL createImageBitmap from an ImageData scaled up, and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"

Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt (256504 => 256505)


--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-flipY-expected.txt	2020-02-13 15:51:50 UTC (rev 256505)
@@ -13,8 +13,8 @@
 FAIL createImageBitmap from a bitmap SVGImageElement imageOrientation: "flipY", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL createImageBitmap from a vector SVGImageElement imageOrientation: "none", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL createImageBitmap from a vector SVGImageElement imageOrientation: "flipY", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL createImageBitmap from an OffscreenCanvas imageOrientation: "none", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
-FAIL createImageBitmap from an OffscreenCanvas imageOrientation: "flipY", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
+PASS createImageBitmap from an OffscreenCanvas imageOrientation: "none", and drawImage on the created ImageBitmap 
+FAIL createImageBitmap from an OffscreenCanvas imageOrientation: "flipY", and drawImage on the created ImageBitmap assert_approx_equals: Red channel of the pixel at (5, 15) expected 255 +/- 10 but got 0
 FAIL createImageBitmap from an ImageData imageOrientation: "none", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 FAIL createImageBitmap from an ImageData imageOrientation: "flipY", and drawImage on the created ImageBitmap promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 PASS createImageBitmap from an ImageBitmap imageOrientation: "none", and drawImage on the created ImageBitmap 

Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt (256504 => 256505)


--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt	2020-02-13 15:51:50 UTC (rev 256505)
@@ -31,7 +31,7 @@
 FAIL createImageBitmap with a vector SVGImageElement source and oversized (unallocatable) crop region assert_throws: function "() => { throw e }" threw object "TypeError: Type error" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
 PASS createImageBitmap with an OffscreenCanvas source and sw set to 0 
 PASS createImageBitmap with an OffscreenCanvas source and sh set to 0 
-PASS createImageBitmap with an OffscreenCanvas source and oversized (unallocatable) crop region 
+FAIL createImageBitmap with an OffscreenCanvas source and oversized (unallocatable) crop region assert_equals: expected 100000000 but got 20
 PASS createImageBitmap with an ImageData source and sw set to 0 
 PASS createImageBitmap with an ImageData source and sh set to 0 
 FAIL createImageBitmap with an ImageData source and oversized (unallocatable) crop region assert_throws: function "() => { throw e }" threw object "TypeError: createImageBitmap with ImageData is not implemented" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11

Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt (256504 => 256505)


--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt	2020-02-13 15:51:50 UTC (rev 256505)
@@ -6,7 +6,7 @@
 PASS Serialize ImageBitmap created from a vector HTMLImageElement 
 FAIL Serialize ImageBitmap created from a bitmap SVGImageElement promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Serialize ImageBitmap created from a vector SVGImageElement promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL Serialize ImageBitmap created from an OffscreenCanvas promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
+PASS Serialize ImageBitmap created from an OffscreenCanvas 
 FAIL Serialize ImageBitmap created from an ImageData promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 PASS Serialize ImageBitmap created from an ImageBitmap 
 PASS Serialize ImageBitmap created from a Blob 

Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer-expected.txt (256504 => 256505)


--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer-expected.txt	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer-expected.txt	2020-02-13 15:51:50 UTC (rev 256505)
@@ -6,7 +6,7 @@
 PASS Transfer ImageBitmap created from a vector HTMLImageElement 
 FAIL Transfer ImageBitmap created from a bitmap SVGImageElement promise_test: Unhandled rejection with value: object "TypeError: Type error"
 FAIL Transfer ImageBitmap created from a vector SVGImageElement promise_test: Unhandled rejection with value: object "TypeError: Type error"
-FAIL Transfer ImageBitmap created from an OffscreenCanvas promise_test: Unhandled rejection with value: object "InvalidStateError: Cannot create ImageBitmap from canvas that can't be rendered"
+PASS Transfer ImageBitmap created from an OffscreenCanvas 
 FAIL Transfer ImageBitmap created from an ImageData promise_test: Unhandled rejection with value: object "TypeError: createImageBitmap with ImageData is not implemented"
 PASS Transfer ImageBitmap created from an ImageBitmap 
 PASS Transfer ImageBitmap created from a Blob 

Modified: trunk/Source/WebCore/ChangeLog (256504 => 256505)


--- trunk/Source/WebCore/ChangeLog	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/Source/WebCore/ChangeLog	2020-02-13 15:51:50 UTC (rev 256505)
@@ -1,3 +1,20 @@
+2020-02-13  Chris Lord  <[email protected]>
+
+        Implement OffscreenCanvas.copiedImage
+        https://bugs.webkit.org/show_bug.cgi?id=206220
+
+        Reviewed by Žan Doberšek.
+
+        No new tests. Covered by existing tests.
+
+        * html/OffscreenCanvas.cpp:
+        (WebCore::OffscreenCanvas::didDraw):
+        (WebCore::OffscreenCanvas::copiedImage const):
+        (WebCore::OffscreenCanvas::clearCopiedImage const):
+        (WebCore::OffscreenCanvas::takeImageBuffer const):
+        (WebCore::OffscreenCanvas::reset):
+        * html/OffscreenCanvas.h:
+
 2020-02-12  Yoshiaki Jitsukawa  <[email protected]>
 
         [WebCrypto][CommonCrypto] Incorrect AES-CTR with counterLength longer than 64

Modified: trunk/Source/WebCore/html/OffscreenCanvas.cpp (256504 => 256505)


--- trunk/Source/WebCore/html/OffscreenCanvas.cpp	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/Source/WebCore/html/OffscreenCanvas.cpp	2020-02-13 15:51:50 UTC (rev 256505)
@@ -257,9 +257,28 @@
 
 void OffscreenCanvas::didDraw(const FloatRect& rect)
 {
+    clearCopiedImage();
     notifyObserversCanvasChanged(rect);
 }
 
+Image* OffscreenCanvas::copiedImage() const
+{
+    if (m_detached)
+        return nullptr;
+
+    if (!m_copiedImage && buffer()) {
+        if (m_context)
+            m_context->paintRenderingResultsToCanvas();
+        m_copiedImage = buffer()->copyImage(CopyBackingStore, PreserveResolution::Yes);
+    }
+    return m_copiedImage.get();
+}
+
+void OffscreenCanvas::clearCopiedImage() const
+{
+    m_copiedImage = nullptr;
+}
+
 SecurityOrigin* OffscreenCanvas::securityOrigin() const
 {
     auto& context = *canvasBaseScriptExecutionContext();
@@ -316,6 +335,7 @@
     if (size().isEmpty())
         return nullptr;
 
+    clearCopiedImage();
     return setImageBuffer(m_detached ? nullptr : ImageBuffer::create(size(), RenderingMode::Unaccelerated));
 }
 
@@ -327,6 +347,7 @@
 
     m_hasCreatedImageBuffer = false;
     setImageBuffer(nullptr);
+    clearCopiedImage();
 
     notifyObserversCanvasResized();
 }

Modified: trunk/Source/WebCore/html/OffscreenCanvas.h (256504 => 256505)


--- trunk/Source/WebCore/html/OffscreenCanvas.h	2020-02-13 11:14:57 UTC (rev 256504)
+++ trunk/Source/WebCore/html/OffscreenCanvas.h	2020-02-13 15:51:50 UTC (rev 256505)
@@ -103,7 +103,7 @@
 
     void didDraw(const FloatRect&) final;
 
-    Image* copiedImage() const final { return nullptr; }
+    Image* copiedImage() const final;
     bool hasCreatedImageBuffer() const final { return m_hasCreatedImageBuffer; }
 
     SecurityOrigin* securityOrigin() const final;
@@ -138,6 +138,8 @@
 
     void reset();
 
+    void clearCopiedImage() const;
+
     std::unique_ptr<CanvasRenderingContext> m_context;
 
     // m_hasCreatedImageBuffer means we tried to malloc the buffer. We didn't necessarily get it.
@@ -144,6 +146,8 @@
     mutable bool m_hasCreatedImageBuffer { false };
 
     bool m_detached { false };
+
+    mutable RefPtr<Image> m_copiedImage;
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to