Bug 240639
Summary: | Canvas.toDataURL causes excessive GPUP memory use on Cocoa | ||
---|---|---|---|
Product: | WebKit | Reporter: | Kimmo Kinnunen <kkinnunen> |
Component: | Canvas | Assignee: | Nikos Mouchtaris <nmouchtaris> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | csaavedra, dino, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 15 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=292651 | ||
Bug Depends on: | 240866, 241127 | ||
Bug Blocks: |
Kimmo Kinnunen
Canvas.toDataURL causes excessive GPUP memory use on Cocoa
IOSurface -backed image -> CGBitmap copy -> compressed data string
1 (61.0M) CONTENT: VM: CG raster data
+ 1 (61.0M) mmap (in libsystem_kernel.dylib) + 0 [0x1dfc92c84]
.....
+ 1 (61.0M) CGBitmapContextCreateImage (in CoreGraphics) + 172 [0x1a6b6d444]
+ 1 (61.0M) WebKit::ShareableBitmap::makeCGImageCopy() (in WebKit) + 84 [0x10544eb60]
+ 1 (61.0M) WebKit::ImageBufferShareableBitmapBackend::copyNativeImage(WebCore::BackingStoreCopy) const (in WebKit) + 40 [0x105a7e1a4]
+ 1 (61.0M) WebCore::ImageBufferCGBackend::copyCGImageForEncoding(__CFString const*, WebCore::PreserveResolution) const (in WebCore) + 568 [0x113f87f34]
+ 1 (61.0M) WebCore::ImageBufferCGBackend::toDataURL(WTF::String const&, std::__1::optional<double>, WebCore::PreserveResolution) const (in WebCore) + 124 [0x113f883a0]
+ 1 (61.0M) WebKit::RemoteRenderingBackend::getDataURLForImageBufferWithQualifiedIdentifier(WTF::String const&, std::__1::optional<double>, WebCore::PreserveResolution, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::RenderingResourceIdentifierType> >, WTF::CompletionHandler<void (WTF::String&&)>&&) (in WebKit) + 124 [0x1057ac384]
+ 1 (61.0M) void IPC::handleMessageSynchronous<Messages::RemoteRenderingBackend::GetDataURLForImageBuffer, WebKit::RemoteRenderingBackend, void (WebKit::RemoteRenderingBackend::*)(WTF::String const&, std::__1::optional<double>, WebCore::PreserveResolution, WTF::ObjectIdentifier<WebCore::RenderingResourceIdentifierType>, WTF::CompletionHandler<void (WTF::String&&)>&&)>(IPC::StreamServerConnection&, IPC::Decoder&, WebKit::RemoteRenderingBackend*, void (WebKit::RemoteRenderingBackend::*)(WTF::String const&, std::__1::optional<double>, WebCore::PreserveResolution, WTF::ObjectIdentifier<WebCore::RenderingResourceIdentifierType>, WTF::CompletionHandler<void (WTF::String&&)>&&)) (in WebKit) + 232 [0x10579cdf0]
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/93567863>
Kimmo Kinnunen
Should probably be fixed by removing ImageBuffer::toData / ImageBuffer::toDataURL and using data(), dataURL(),
String dataURL(ImageBuffer&, const String& mimeType, std::optional<double> quality = std::nullopt, PreserveResolution preserveResolution)
Vector<uint8_t> toData(ImageBuffer&, const String& mimeType, std::optional<double> quality = std::nullopt)
Kimmo Kinnunen
Pull request: https://github.com/WebKit/WebKit/pull/1407
Nikos Mouchtaris
Pull request: https://github.com/WebKit/WebKit/pull/1528
Nikos Mouchtaris
Pull request: https://github.com/WebKit/WebKit/pull/1741
EWS
Committed 251974@main (bc684eeb57fb): <https://commits.webkit.org/251974@main>
Reviewed commits have been landed. Closing PR #1741 and removing active labels.
Claudio Saavedra
Reopening as the change was reverted, see https://github.com/WebKit/WebKit/pull/1940
Nikos Mouchtaris
Pull request: https://github.com/WebKit/WebKit/pull/1951
EWS
Committed 252032@main (55390aa216e4): <https://commits.webkit.org/252032@main>
Reviewed commits have been landed. Closing PR #1951 and removing active labels.