Use a TextureReadLock instead of immediate uploads + sync transactions in CanvasClient2D

RESOLVED FIXED in Firefox 50

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: nical, Assigned: nical)

Tracking

(Blocks 1 bug)

unspecified
mozilla50
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox50 fixed)

Details

Attachments

(1 attachment)

Currently CanvasClient relies on synchronous layer transactions to avoid copying the canvas in a texture that the compositor is currently using.
Now that TextureReadLock works with all layer types we can use it to make sure that the canvas does not overwrite data that the compositor is reading.

The tradeoff is: if we are over-producing, we may allocate more textures, but we'll be able to render faster since we don't cause the transaction to be synchronous. Synchronous transactions are quite expensive because the main thread wastes time doing nothing until the compositor has received the transaction and uploaded all textures. In particular, canvas games or animations may benefit from this since they tend to cause a lot of main thread activity.
This patch only makes a difference if PersistentBufferProviderShared is disabled, I hope to enable it soon in most configurations, but in the mean time this optimization is simple enough to be worth taking.
Assignee: nobody → nical.bugzilla
Attachment #8775555 - Flags: review?(sotaro.ikeda.g)
Attachment #8775555 - Flags: review?(sotaro.ikeda.g) → review+
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/67cb195b1b45
Make canvas layer transactions asynchronous. r=sotaro
The failures were caused by bug 1289816.
Flags: needinfo?(nical.bugzilla)
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e46e53dfb22b
Make canvas layer transactions asynchronous. r=sotaro
https://hg.mozilla.org/mozilla-central/rev/e46e53dfb22b
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.