Open Bug 1161636 Opened 6 years ago Updated 4 years ago

Avoid Copying canvas 2d into a new TextureClient each frame.

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

People

(Reporter: nical, Assigned: bas.schouten)

References

(Blocks 2 open bugs)

Details

(Keywords: feature)

Currently CanvasRenderingContext2D keeps its own DrawTarget which it draws into and copies the whole thing in a TextureClient after each frame to share it with the Compositor.

We should do the following things:
 * draw directly into a TextureClient
 * share this TextureClient with the compositor without copying it at the end of the frame
 * use a new TextureClient for each frame and only copy from the previous TextureClient if the first drawing operation does not overwrite all of the canvas' pixels

Eventually use a pool to reduce the overhead of creating and destroying textures each frame, but we already pay that cost so we can track the pool as an orthogonal improvement (could be done in bug 1008221).
Blocks: 1161818
Assignee: nobody → bas
Blocks: 1181006
No longer blocks: 1181006
Keywords: feature
Blocks: 1290072
You need to log in before you can comment on or make changes to this bug.