[webkit-changes] [WebKit/WebKit] cc8075: Allow ImageBitmap to be created from ImageBitmap::...
Myles C. Maxfield
noreply at github.com
Wed Apr 19 13:15:57 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cc807585594a80b0881be87386e371c7aa88f3da
https://github.com/WebKit/WebKit/commit/cc807585594a80b0881be87386e371c7aa88f3da
Author: Myles C. Maxfield <mmaxfield at apple.com>
Date: 2023-04-19 (Wed, 19 Apr 2023)
Changed paths:
M Source/WebCore/html/ImageBitmap.cpp
M Source/WebCore/html/ImageBitmap.h
Log Message:
-----------
Allow ImageBitmap to be created from ImageBitmap::Source without needing a Promise
https://bugs.webkit.org/show_bug.cgi?id=255666
rdar://108270485
Reviewed by Dean Jackson.
The shape detection API takes ImageBitmap::Sources as inputs, and we need to be able to convert those to
ImageBuffers in order to detect shapes in them. This is exactly what ImageBitmap::createPromise() does,
except that requires using a promise. This patch refactors this to use a CompletionHandler instead, so
the shape detection API can perform additional processing on the ImageBuffer once it has been created.
I had to name the type ImageBitmapCompletionHandler, instead of ImageBitmap::CompletionHandler, because
the GCC ports were giving an error about "declaration of ‘using CompletionHandler = ...’ changes meaning
of ‘CompletionHandler’".
No tests because there is no behavior change.
* Source/WebCore/html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createCompletionHandler):
(WebCore::ImageBitmap::createPromise):
(WebCore::ImageBitmap::createBlankImageBuffer):
(WebCore::ImageBitmap::createFromBuffer):
(WebCore::ImageBitmap::resolveWithBlankImageBuffer): Deleted.
* Source/WebCore/html/ImageBitmap.h:
Canonical link: https://commits.webkit.org/263143@main
More information about the webkit-changes
mailing list