Skip to content
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

ImageBufferBackend::clearContents() is redundant function #10787

Conversation

kkinnunen-apple
Copy link
Contributor

@kkinnunen-apple kkinnunen-apple commented Feb 28, 2023

433f175

ImageBufferBackend::clearContents() is redundant function
https://bugs.webkit.org/show_bug.cgi?id=253065
rdar://problem/106020763

Reviewed by Antti Koivisto.

Remove ImageBuffer{,Backend}::clearContents(), it is only implemented
for CG display list -backed ImageBuffers.

Use ImageBuffer::releaseGraphicsContext() to remove all commands to
CG display list -backed ImageBuffer. This should stay consistent with the
abstraction that the caller expects: For the purposes of the call, e.g.
ensuring that the list does not grow indefinitively, it is expected that
the relevant draw commands are part of the context.

* Source/WebCore/platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::clearContents): Deleted.
* Source/WebCore/platform/graphics/ImageBuffer.h:
* Source/WebCore/platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::clearContents): Deleted.
* Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h:
* Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.mm:
(WebKit::CGDisplayListImageBufferBackend::releaseGraphicsContext):
(WebKit::CGDisplayListImageBufferBackend::clearContents): Deleted.
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):

Canonical link: https://commits.webkit.org/261057@main

ab3d05a

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ›  gtk
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1 ❌ πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@kkinnunen-apple kkinnunen-apple self-assigned this Feb 28, 2023
@kkinnunen-apple kkinnunen-apple added the Canvas Bugs related to the canvas element. label Feb 28, 2023
@kkinnunen-apple kkinnunen-apple added the merge-queue Applied to send a pull request to merge-queue label Mar 2, 2023
https://bugs.webkit.org/show_bug.cgi?id=253065
rdar://problem/106020763

Reviewed by Antti Koivisto.

Remove ImageBuffer{,Backend}::clearContents(), it is only implemented
for CG display list -backed ImageBuffers.

Use ImageBuffer::releaseGraphicsContext() to remove all commands to
CG display list -backed ImageBuffer. This should stay consistent with the
abstraction that the caller expects: For the purposes of the call, e.g.
ensuring that the list does not grow indefinitively, it is expected that
the relevant draw commands are part of the context.

* Source/WebCore/platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::clearContents): Deleted.
* Source/WebCore/platform/graphics/ImageBuffer.h:
* Source/WebCore/platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::clearContents): Deleted.
* Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h:
* Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.mm:
(WebKit::CGDisplayListImageBufferBackend::releaseGraphicsContext):
(WebKit::CGDisplayListImageBufferBackend::clearContents): Deleted.
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):

Canonical link: https://commits.webkit.org/261057@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the imagebufferbackend-remove-clearcontents branch from ab3d05a to 433f175 Compare March 2, 2023 09:42
@webkit-commit-queue
Copy link
Collaborator

Committed 261057@main (433f175): https://commits.webkit.org/261057@main

Reviewed commits have been landed. Closing PR #10787 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 2, 2023
@webkit-early-warning-system webkit-early-warning-system merged commit 433f175 into WebKit:main Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Canvas Bugs related to the canvas element.
Projects
None yet
4 participants