Closed
Bug 580784
Opened 15 years ago
Closed 12 years ago
Efficiently share 2D BasicCanvasLayer data with BasicShadowCanvasLayer
Categories
(Core :: Graphics, defect, P2)
Core
Graphics
Tracking
()
RESOLVED
WORKSFORME
blocking-kilimanjaro | + |
People
(Reporter: cjones, Assigned: nical)
References
Details
(Whiteboard: [soft][tech-p1])
This bug is about canvas 2D *only*. WebGL is a whole 'nother can of worms.
With bug 570294, on Paint()s we copy the canvas's surface into a
shmem back buffer, then swap that with the old front buffer. This is
inefficient both in CPU and memory usage. We need to make it better.
This should be relatively straightforward --- CanvasRenderingContext2D needs to draw into shmem firstly, and secondly we need to sync data from back buffer to front buffer on IPC layer transactions. There are various knobs available to tune the second part here.
Yes, we do have shmem canvas drawing currently implemented, but I lean towards ripping that out (after bug 570620 obsoletes it) and starting from scratch.
Reporter | ||
Comment 1•13 years ago
|
||
Many games will be using 2d canvas. We need to optimize this path; the current one sucks rocks.
With direct texturing, we can have content draw into a canvas "back buffer" that's backed by pmem. When we get ready to forward a layers txn, we can asynchronously send the back buffer to the compositor to be textured and composited, and then asynchronously in the content process (after the txn), copy from the new-front-buffer to new-back-buffer. Then we set the canvas draw target to the new back buffer without disturbing context state.
The full memcpy will be a little hurty, but last I looked canvas doesn't track dirty regions, and doing that might be hard. Most games probably refresh each frame anyway.
Blocks: b2g-e10s-work
Reporter | ||
Updated•13 years ago
|
Reporter | ||
Comment 2•13 years ago
|
||
Joe, this is the work we discussed on Thursday.
blocking-basecamp: --- → ?
blocking-kilimanjaro: --- → ?
Reporter | ||
Comment 3•13 years ago
|
||
Nico, if you're poking at this can you assign the bug to yourself? Thanks!
Assignee | ||
Updated•13 years ago
|
QA Contact: nsilva
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → nsilva
QA Contact: nsilva
Assignee | ||
Comment 4•13 years ago
|
||
oops
Updated•13 years ago
|
blocking-basecamp: ? → +
Whiteboard: [soft]
Updated•13 years ago
|
Priority: -- → P2
Comment 5•13 years ago
|
||
Really want it, but will survive without it.
blocking-basecamp: + → ---
blocking-kilimanjaro: ? → +
Comment 6•13 years ago
|
||
Per IRC conversations with a few other folks, I think the best course of action if there is disagreement on whether this blocks or not is to do the following:
- Move the blocking-basecamp flag to ? for re-evaluation
- Indicate a rationale for why you disagree
blocking-basecamp: --- → ?
Updated•13 years ago
|
blocking-basecamp: ? → ---
Reporter | ||
Updated•13 years ago
|
Blocks: b2g-v-next
Reporter | ||
Comment 7•13 years ago
|
||
Needed for competitive parity in memory usage and probably raw perf on major canvas uses like games, but I don't think we know how far away we are on the latter. (We skip a copy to a window "back buffer" that most other OSes incur.)
Whiteboard: [soft] → [soft][tech-p1]
Assignee | ||
Comment 8•12 years ago
|
||
Things have changed a lot in this area, now canvas 2D uses surface streams to composite efficiently in most cases. closing the bug.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Resolution: FIXED → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•