Open
Bug 631640
Opened 14 years ago
Updated 6 months ago
add support for context options to 2D canvas context
Categories
(Core :: Graphics: Canvas2D, defect)
Core
Graphics: Canvas2D
Tracking
()
NEW
People
(Reporter: vlad, Unassigned)
References
Details
We added the notion of context options for WebGL, but we can use them for 2D as well. We have moz-opaque as an attribute, but we can also define it as a getContext option, e.g. { alpha: false }, just like WebGL.
An additional one to consider would be something like optimizeForPixelManipulation, which would optimize for getImageData/putImageData by creating an image surface instead of a d2d surface on windows.
Comment 1•11 years ago
|
||
This has happened. The second argument to getContext is declared in WebIDL as "any", but when the first argument is "2d", the second argument is treated by C++ as a "dictionary ContextAttributes2D".
Currently, the dictionary has willReadFrequently (added in bug 884226) and alpha (added in bug 982480).
The first argument is logically an enum; I don't know why it's declared as a string. The second argument is logically a "ContextAttributes2D or WebGLContextAttributes", but maybe it has to be "any" for implementation reasons.
Comment 2•10 years ago
|
||
What Jesse mentions has happened indeed.
What about implementing context.getContextAttributes() to retrieve the context's attributes here?
interface Canvas2DRenderingContext {
...
Canvas2DContextAttributes? getContextAttributes();
}
http://wiki.whatwg.org/wiki/CanvasOpaque
Inspired by WebGL: https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.2
Implemented and enabled in Chrome 32: https://code.google.com/p/chromium/issues/detail?id=234297
WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=112628
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•