mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Issue #2033 - Temporary fix of R<->B channel swap.
We have a BGR/RGB channel ordering mismatch here. to at least provide proper display, a quick&dirty byte swap on the output buffer will fix this for now, but we should look into seeing where the surface mismatch is caused. std::swap() should optimize pretty well in any of the used compilers, but if necessary, a full buffer ASM routine can be slotted in (although on current hardware I doubt this will be even noticeable as it is)
This commit is contained in:
parent
7f87cc1276
commit
77ca4ae9db
1 changed files with 5 additions and 0 deletions
|
|
@ -141,6 +141,11 @@ nsJXLDecoder::ReadJXLData(const char* aData, size_t aLength)
|
|||
Nothing(), SurfacePipeFlags());
|
||||
for (uint8_t* rowPtr = mOutBuffer.begin(); rowPtr < mOutBuffer.end();
|
||||
rowPtr += mInfo.xsize * 4) {
|
||||
// FIXME: Quick and dirty BGRA to RGBA conversion.
|
||||
// We currently have a channel ordering mis-match here.
|
||||
for (uint8_t* pixPtr = rowPtr; pixPtr < rowPtr + mInfo.xsize * 4; pixPtr+=4){
|
||||
std::swap(pixPtr[0], pixPtr[2]);
|
||||
}
|
||||
pipe->WriteBuffer(reinterpret_cast<uint32_t*>(rowPtr));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue