Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 4720cc2edd86517a19354cf49515fb03bf1d3e85 https://github.com/WebKit/WebKit/commit/4720cc2edd86517a19354cf49515fb03bf1d3e85 Author: Kimmo Kinnunen <kkinnu...@apple.com> Date: 2024-06-10 (Mon, 10 Jun 2024)
Changed paths: M LayoutTests/fast/canvas/offscreen-giant-transfer-to-imagebitmap-expected.txt M LayoutTests/fast/canvas/offscreen-giant-transfer-to-imagebitmap.html M LayoutTests/platform/ios/fast/canvas/offscreen-giant-transfer-to-imagebitmap-expected.txt A LayoutTests/platform/mac-wk2/fast/canvas/offscreen-giant-transfer-to-imagebitmap-expected.txt M Source/WebCore/html/CanvasBase.h M Source/WebCore/html/OffscreenCanvas.cpp M Source/WebCore/html/canvas/CanvasRenderingContext.cpp M Source/WebCore/html/canvas/CanvasRenderingContext.h M Source/WebCore/html/canvas/GPUCanvasContext.h M Source/WebCore/html/canvas/GPUCanvasContextCocoa.h M Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm M Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp M Source/WebCore/html/canvas/ImageBitmapRenderingContext.h M Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.cpp M Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.h M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp M Source/WebCore/html/canvas/WebGLRenderingContextBase.h Log Message: ----------- OffscreenCanvas.transferToImageBitmap() context specific code should exist in the context https://bugs.webkit.org/show_bug.cgi?id=275105 rdar://129217576 Reviewed by Antti Koivisto. OffscreenCanvas::transferToImageBitmap() has code conditionalized to different canvas rendering contexts. Move this code to the contexts, into overrides of new virtual function CanvasRenderingContext::transferToImageBuffer(). This way the contexts are able to manage the buffers themselves in future commits. Fix the error-case where the out-of-memory causes an exception instead of null ImageBitmap for all backends. The exception should be DOM UnknownError, that is used to signify out-of-memory. * Source/WebCore/html/CanvasBase.h: * Source/WebCore/html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::transferToImageBitmap): * Source/WebCore/html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::transferToImageBuffer): * Source/WebCore/html/canvas/CanvasRenderingContext.h: * Source/WebCore/html/canvas/GPUCanvasContext.h: * Source/WebCore/html/canvas/GPUCanvasContextCocoa.h: * Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm: (WebCore::GPUCanvasContextCocoa::transferToImageBuffer): (WebCore::GPUCanvasContextCocoa::getCurrentTextureAsImageBitmap): Deleted. * Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp: (WebCore::ImageBitmapRenderingContext::setOutputBitmap): (WebCore::ImageBitmapRenderingContext::setBlank): (WebCore::ImageBitmapRenderingContext::transferToImageBuffer): * Source/WebCore/html/canvas/ImageBitmapRenderingContext.h: * Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.cpp: (WebCore::OffscreenCanvasRenderingContext2D::transferToImageBuffer): * Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.h: * Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::transferToImageBuffer): (WebCore::WebGLRenderingContextBase::markDrawingBuffersDirtyAfterTransfer): Deleted. * Source/WebCore/html/canvas/WebGLRenderingContextBase.h: Canonical link: https://commits.webkit.org/279872@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes