Closed Bug 528042 Opened 10 years ago Closed 9 years ago
[webgl] missing To
ToDataURL does not work on WebGL canvases. Which means that the "View Image" and "Save Image As..." context menu items for the canvas do not work either. Try "View Image" on a WebGL canvas, e.g. on http://learningwebgl.com/lessons/lesson06/index.html The reason why ToDataURL does not work is because WebGLContext::GetInputStream in WebGLContext.cpp is commented out as broken and nsHTMLCanvasElement::ToDataURLImpl in nsHTMLCanvasElement.cpp does rv = GetContext(NS_LITERAL_STRING("2d"), getter_AddRefs(context)); instead of rv = GetContext(mCurrentContextId, getter_AddRefs(context)); (though what happens when mCurrentContextId is not set?) Attached patch makes ToDataURL work on WebGL canvases by implementing WebGLContext::GetInputStream and making nsHTMLCanvasElement::ToDataURLImpl use mCurrentContextId or "2d" when current context id is empty (which is bad as it fixes an unused canvas to 2D context on toDataURL.)
10 years ago
Duplicate of this bug: 537648
Comment on attachment 411797 [details] [diff] [review] Make ToDataURL work on WebGL contexts Asking Vlad to review this... i'm not competent ;-)
Attachment #411797 - Flags: review?(vladimir)
Comment on attachment 411797 [details] [diff] [review] Make ToDataURL work on WebGL contexts This is quite old and needs to be completely changed for the current code; will get to it at some point.
Attachment #411797 - Flags: review?(vladimir) → review-
Attachment #489557 - Flags: review?(bjacob) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
9 years ago
Duplicate of this bug: 578349
You need to log in before you can comment on or make changes to this bug.