Closed
Bug 480305
Opened 15 years ago
Closed 14 years ago
[c3d] glReadPixels support
Categories
(Core :: Graphics: CanvasWebGL, enhancement)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: ilmari.heikkinen, Unassigned)
Details
Attachments
(2 files, 2 obsolete files)
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2a1pre) Gecko/20090226 Minefield/3.2a1pre Build Identifier: There's no gl.readPixels in the canvas3d extension. readPixels is useful for reading from the currently bound framebuffer (not necessarily the visible image), which makes it useful for things like picking by unique color and reading back results of off-screen computation. Reproducible: Always Steps to Reproduce: 1. gl.readPixels(0,0,1,1, gl.RGBA, gl.UNSIGNED_BYTE) Actual Results: Error, no method named readPixels. Expected Results: Should return an ImageData object {width: 1, height: 1, data: [r,g,b,a]}.
Reporter | ||
Comment 1•15 years ago
|
||
Reporter | ||
Comment 2•15 years ago
|
||
Renders to an FBO, reads from it and uses putImageData to draw the read image on a 2D canvas. Should have a large blank canvas on the left and a small canvas with a clipped downwards-pointing green rectangle on a yellow field.
Reporter | ||
Comment 3•15 years ago
|
||
s/rectangle/triangle
Reporter | ||
Comment 4•15 years ago
|
||
The above patch copies PRBool IsCallerTrustedForRead() over from nsContentUtils.cpp, as I had no luck with #include "nsContentUtils.h". If someone more familiar with the system manages to make the include work, they shall be praised, and the copied implementation removed. Another issue is that glReadPixels returns an y-flipped image. I don't know if it should be flipped or left to user. And I don't know if the data array pixel component order remains r,g,b,a on big-endian, so that should be tested.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 5•15 years ago
|
||
Attachment #364311 -
Attachment is obsolete: true
Attachment #365145 -
Flags: review?(vladimir)
Reporter | ||
Comment 6•15 years ago
|
||
Attachment #364312 -
Attachment is obsolete: true
Component: Canvas: 2D → Canvas: WebGL
Comment 7•14 years ago
|
||
Closing FIXED as the WebGL support in Gecko does support a readPixels function.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Resolution: FIXED → WORKSFORME
Updated•13 years ago
|
Attachment #365145 -
Flags: review?(vladimir)
You need to log in
before you can comment on or make changes to this bug.
Description
•