Closed
Bug 583844
Opened 14 years ago
Closed 14 years ago
ReadPixels fixes for PACK_ALIGNMENT and EXT_bgra
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | beta4+ |
People
(Reporter: vlad, Assigned: vlad)
Details
Attachments
(1 file)
7.16 KB,
patch
|
bjacob
:
review+
|
Details | Diff | Splinter Review |
For WebGL especially, GL_PACK_ALIGNMENT is under content control; we need to force it to be what we expect when calling glReadPixels. Also fix correct usage of BGRA format and byte swap where needed.
Attachment #462165 -
Flags: review?(bjacob)
Assignee | ||
Updated•14 years ago
|
blocking2.0: --- → beta4+
Comment 1•14 years ago
|
||
Comment on attachment 462165 [details] [diff] [review] fix readpixels calls OK, just 1 argh, - // XXX byteswap + + // swap B and R bytes + for (int j = 0; j < mBounds.height; ++j) { + PRUint32 *row = (PRUint32*) (isurf->Data() + isurf->Stride() * j); + for (int i = 0; i < mBounds.width; ++i) { + *row = (*row & 0xff00ff00) | ((*row & 0xff) << 16) | ((*row & 0xff0000) >> 16); + row++; + } + } Argh, one more place where we have to loop over all pixels in the CPU...
Attachment #462165 -
Flags: review?(bjacob) → review+
Assignee | ||
Comment 2•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/09a07cc60743 part of this ended up going in inside http://hg.mozilla.org/mozilla-central/rev/d879bb244890
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•