From e02bbb90656fdd4c9cd4fe0b3c58d1c8816fede0 Mon Sep 17 00:00:00 2001 From: waddlesplash Date: Tue, 12 Nov 2024 22:03:33 +0000 Subject: [PATCH] BBitmap: Restore special-casing for B_RGB32 in SetBits. This reverts commit 6211ae257544d7a1453bc34297c8eac3e2b0435d. It breaks multiple applications that worked fine on BeOS, so clearly this tweak was correct after all, or at least mostly correct. Change-Id: I3b228ba2119dd33067b8defedd6db4ae9ead9124 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8537 Reviewed-by: waddlesplash Haiku-Format: Haiku-format Bot Tested-by: Commit checker robot (cherry picked from commit 8500b11c43e9565053ad1fa1b1cb7fd54d780763) Reviewed-on: https://review.haiku-os.org/c/haiku/+/8597 --- src/kits/interface/Bitmap.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/Bitmap.cpp b/src/kits/interface/Bitmap.cpp index ca484ae152..e5bdfe2bcb 100644 --- a/src/kits/interface/Bitmap.cpp +++ b/src/kits/interface/Bitmap.cpp @@ -665,7 +665,11 @@ BBitmap::SetBits(const void* data, int32 length, int32 offset, int32 inBPR = -1; // tweaks to mimic R5 behavior if (error == B_OK) { - if (colorSpace == B_CMAP8 && fColorSpace != B_CMAP8) { + if (colorSpace == B_RGB32) { + // B_RGB32 means actually unpadded B_RGB24_BIG + colorSpace = B_RGB24_BIG; + inBPR = width * 3; + } else if (colorSpace == B_CMAP8 && fColorSpace != B_CMAP8) { // If in color space is B_CMAP8, but the bitmap's is another one, // ignore source data row padding. inBPR = width;