Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add ImageBitmapRenderingContext support to OffscreenCanvas
https://bugs.webkit.org/show_bug.cgi?id=197421 Reviewed by Chris Lord. * LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.nocrash-expected.txt: * LayoutTests/platform/glib/TestExpectations: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-expected.txt: Added. * LayoutTests/platform/glib/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/context-creation-offscreen-with-alpha-expected.txt: Added. * LayoutTests/platform/glib/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/toBlob-origin-clean-offscreen.sub-expected.txt: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-ToBlob-offscreen-expected.txt: Added. * LayoutTests/platform/glib/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-TransferToImageBitmap-offscreen-expected.txt: Added. * LayoutTests/platform/glib/imported/w3c/web-platform-tests/imagebitmap-renderingcontext/tranferFromImageBitmap-null-offscreen-expected.txt: Added. * Source/WebCore/html/CanvasBase.h: (WebCore::CanvasBase::setImageBufferAndMarkDirty): * Source/WebCore/html/HTMLCanvasElement.h: * Source/WebCore/html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::getContext): (WebCore::OffscreenCanvas::transferToImageBitmap): (WebCore::OffscreenCanvas::setImageBufferAndMarkDirty): * Source/WebCore/html/OffscreenCanvas.h: * Source/WebCore/html/OffscreenCanvas.idl: * Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp: (WebCore::ImageBitmapRenderingContext::canvas): (WebCore::ImageBitmapRenderingContext::setOutputBitmap): (WebCore::ImageBitmapRenderingContext::canvas const): Deleted. * Source/WebCore/html/canvas/ImageBitmapRenderingContext.h: * Source/WebCore/html/canvas/ImageBitmapRenderingContext.idl: Canonical link: https://commits.webkit.org/254697@main
- Loading branch information
Showing
16 changed files
with
98 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Tests that an ImageBitmap in Offscreen without content does not crash. | ||
|
||
|
||
FAIL offscreencanvas Argument 1 ('contextType') to OffscreenCanvas.getContext must be one of: "2d", "webgl", "webgl2" | ||
PASS offscreencanvas | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS Test that canvas.getContext('bitmaprenderer') returns an instance of ImageBitmapRenderingContext and ctx.canvas on a ImageBitmapRenderingContext returns the original OffscreenCanvas | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
PASS Test that an ImageBitmapRenderingContext with alpha disabled makes the canvas opaque | ||
PASS Test that an ImageBitmapRenderingContext with alpha enabled preserves the alpha | ||
PASS Test that the 'alpha' context creation attribute is true by default | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL Test that call convertToBlob on a tainted OffscreenCanvas throws exception Argument 1 ('contextType') to OffscreenCanvas.getContext must be one of: "2d", "webgl", "webgl2" | ||
PASS Test that call convertToBlob on a tainted OffscreenCanvas throws exception | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS Test that convertToBlob works and produce the expected image | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS Test that transferToImageBitmap works and that resets the imagebitmap to black | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS Test that transferFromImageBitmap(null) discards the previously transferred image | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters