Bug 34909 - Need to create an OffscreenCanvas.
Summary: Need to create an OffscreenCanvas.
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
Depends on: 35262 35322 35453 35615 35616 36906 41032
  Show dependency treegraph
Reported: 2010-02-12 15:20 PST by David Levin
Modified: 2011-02-09 15:32 PST (History)
3 users (show)

See Also:

Proposed fix. (1.05 KB, patch)
2010-02-22 15:00 PST, David Levin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 2010-02-12 15:20:19 PST
It should be usable in both Document and Worker context. To start with only 2D will be supported.

(This is the umbrella bug for the feature -- where I'll mention the general approach, etc. I'll file other bugs for each step.)
Comment 1 David Levin 2010-02-22 15:00:49 PST
Created attachment 49243 [details]
Proposed fix.
Comment 2 David Levin 2010-02-26 14:10:45 PST
Here's a basic outline of the work:
1. make HTMLCanvasElement derive from CanvsaSurface.
2. make CanvasRenderingContext2D only depend on CanvasSurface (in a future change)
   a. Move methods that CanvasRenderingContext2D depends on from  HTMLCanvasElement to CanvasSurface.
   b. Change CanvasRenderingContext2D to only use CanvasSurface.
3. Create an OffscreenCanvas which derives from CanvasSurface.
4. Expose OffscreenCanvas for document context (with layout tests).
5. Expose OffscreenCanvas for the worker context (fix threadsafety issues, idl changes, layout tests, etc.).

This result in allowing CanvasRenderingContext2D to be used with either HTMLCanvasElement or OffscreenCanvas.
Comment 3 David Levin 2010-07-01 11:29:40 PDT
This work has been suspended for now (after various bits of feedback on whatwg regarding our target scenario of image resizing).

Note that https://bugs.webkit.org/show_bug.cgi?id=41032 wasn't landed but may help in this effort if anyone pursues it.