Bug 233925
Summary: | Cocoa UI-side compositing compositor does not hold use count of layer contents before CA commits | ||
---|---|---|---|
Product: | WebKit | Reporter: | Kimmo Kinnunen <kkinnunen> |
Component: | Compositing | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | heycam, simon.fraser, thorton, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Kimmo Kinnunen
Cocoa compositor does not hold use count of layer contents before CA commits
When IOSurface is put as the contents of a CALayer, CA will increment the use count. However, this only happens during CA transaction commit.
UI-side compositing, WP part will reuse backing stores that are not in use by CA. This is done by checking the use count.
However, this check is not entirely correct, as it can happen that backing store being reused has not entered the transaction commit in the UI process.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Kimmo Kinnunen
Something along the lines of:
UI-side compositing, WP part should:
1) increase the use count when iosurface is marked to belong to a ImageBuffer (during image buffer construction)
2) draw to the image buffer
3) convert the image buffer to a insurance by marking the image buffer as "not in use" (e.g. transfer the use-count to the holder of the iosurface reference)
2) send the iosurface to the UI process
UI-side compositing, UI part should:
1) convert the iosurface reference to iosurface, adopting the use count
2) put the iosurface to CALayer
3) commit the transaction
4) destroy all iosurfaces, releasing the adopted use count
When recycling the spare image buffers to new display buffers, WP part should:
1) check if use count == 0, e.g. that the image buffer is not in use anymore
2) convert the image buffer to in-use image buffer (e.g. increment the use count)
Radar WebKit Bug Importer
<rdar://problem/86152460>