-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid going back to the GPU process for canvas ImageData when possible #16028
Conversation
EWS run on previous version of this PR (hash 9a09fc1) |
9a09fc1
to
d710d27
Compare
EWS run on previous version of this PR (hash d710d27) |
I think there's still a bit more to do here, even if EWS is green:
|
d710d27
to
918c1f5
Compare
EWS run on previous version of this PR (hash 918c1f5) |
And the conversion to premultiplied alpha and back. |
918c1f5
to
4bfd474
Compare
EWS run on previous version of this PR (hash 4bfd474) |
This is not ready yet. When you get/put image data, the data is presented as unpremultiplied, but needs to round-trip through premultiplied, back to unpremultiplied. This isn't actually the identity function, because it's slightly lossy (consider round-tripping the color [0, 131, 0, 32] -> it ends up becoming [0, 128, 0, 32]) |
4bfd474
to
59629b5
Compare
EWS run on previous version of this PR (hash 59629b5) |
59629b5
to
3b419c8
Compare
This leads to a 4.53% performance improvement on MotionMark. |
(Since GitHub thinks I am still the PR owner I'm unable to r+ or r- the PR.) |
3b419c8
to
478d2f2
Compare
EWS run on previous version of this PR (hash 478d2f2)
|
478d2f2
to
2a4beec
Compare
EWS run on previous version of this PR (hash 2a4beec)
|
2a4beec
to
be9ac84
Compare
EWS run on current version of this PR (hash be9ac84)
|
https://bugs.webkit.org/show_bug.cgi?id=259436 rdar://problem/112746729 Reviewed by Cameron McCormack and Myles C. Maxfield. On a 2D canvas, if a recent putImageData() was made with no other intervening drawing commands, we can use its data to fulfill a subsequent getImageData(). Start with some simple conditions for ImageData size and drawing dimensions, which can be extended later if it proves useful. * LayoutTests/fast/canvas/canvas-ImageData-cache-expected.txt: Added. * LayoutTests/fast/canvas/canvas-ImageData-cache.html: Added. * Source/WebCore/html/ImageData.cpp: (WebCore::ImageData::clone const): * Source/WebCore/html/ImageData.h: * Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::reset): (WebCore::CanvasRenderingContext2DBase::didDraw): (WebCore::CanvasRenderingContext2DBase::cacheImageDataIfPossible): (WebCore::CanvasRenderingContext2DBase::takeCachedImageDataIfPossible const): (WebCore::CanvasRenderingContext2DBase::getImageData const): (WebCore::CanvasRenderingContext2DBase::putImageData): * Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h: Canonical link: https://commits.webkit.org/266632@main
be9ac84
to
5466cd2
Compare
Committed 266632@main (5466cd2): https://commits.webkit.org/266632@main Reviewed commits have been landed. Closing PR #16028 and removing active labels. |
5466cd2
be9ac84
π§ͺ wpe-wk2π§ͺ gtk-wk2