Skip to content

Commit 5e19624

Browse files
authored
Merge pull request #5739 from xtermjs/anthonykim1/addressPerfxterm
Remove redundant bitmask in RGB->RGBA conversion
2 parents f4166a8 + 0cea95d commit 5e19624

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

addons/addon-image/src/kitty/KittyGraphicsHandler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -752,10 +752,10 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos
752752
const b1 = src32[srcOffset++];
753753
const b2 = src32[srcOffset++];
754754
// Little-endian: pixel bytes are [R,G,B] → uint32 ABGR layout
755-
dst32[dstOffset++] = (b0 & 0x00FFFFFF) | 0xFF000000;
756-
dst32[dstOffset++] = ((b0 >>> 24) | (b1 << 8)) & 0x00FFFFFF | 0xFF000000;
757-
dst32[dstOffset++] = ((b1 >>> 16) | (b2 << 16)) & 0x00FFFFFF | 0xFF000000;
758-
dst32[dstOffset++] = (b2 >>> 8) | 0xFF000000;
755+
dst32[dstOffset++] = 0xFF000000 | b0;
756+
dst32[dstOffset++] = 0xFF000000 | (b0 >>> 24) | (b1 << 8);
757+
dst32[dstOffset++] = 0xFF000000 | (b1 >>> 16) | (b2 << 16);
758+
dst32[dstOffset++] = 0xFF000000 | (b2 >>> 8);
759759
}
760760

761761
// Handle remaining 1–3 pixels

0 commit comments

Comments
 (0)