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

RESOLVED FIXED in Firefox 50

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: nical, Assigned: nical)

Tracking

(Blocks: 1 bug)

unspecified
mozilla50
Points:
---

Firefox Tracking Flags

(firefox50 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
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.
(Assignee)

Comment 1

2 years ago
Created attachment 8775555 [details] [diff] [review]
Use a ReadLock instead of sync transactions.

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)

Updated

2 years ago
Attachment #8775555 - Flags: review?(sotaro.ikeda.g) → review+

Comment 2

2 years ago
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/67cb195b1b45
Make canvas layer transactions asynchronous. r=sotaro
(Assignee)

Comment 4

2 years ago
The failures were caused by bug 1289816.
Flags: needinfo?(nical.bugzilla)

Comment 5

2 years ago
Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e46e53dfb22b
Make canvas layer transactions asynchronous. r=sotaro

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/e46e53dfb22b
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox50: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.