From f01b70d09896e11130036877a33ce280748f2597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 15 Jul 2008 18:18:07 +0000 Subject: [PATCH] mmlr + stippi: Found an incompatibility with BeOS, where Haiku behaves correctly, though, after our changes: The alpha channel of B_RGB32 bitmaps is ignored, but B_TRANSPARENT_MAGIC_RGBA32 pixels are considered fully transparent. In BeOS, B_RGB32 are simply treated as B_RGBA32, but only in B_OP_ALPHA. We have added a comment as well as the code that would enabled the BeOS behavior. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26436 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/drawing/Painter/Painter.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index 0c8cdd9039..2a5d8e5738 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -1430,8 +1430,20 @@ Painter::_DrawBitmap(agg::rendering_buffer& srcBuffer, color_space format, BBitmap* temp = NULL; ObjectDeleter tempDeleter; + + if ((format != B_RGBA32 && format != B_RGB32) - || (format == B_RGB32 && fDrawingMode != B_OP_COPY)) { + || (format == B_RGB32 && fDrawingMode != B_OP_COPY +#if 0 +// Enabling this would make the behavior compatible to BeOS, which +// treats B_RGB32 bitmaps as B_RGB*A*32 bitmaps in B_OP_ALPHA - unlike in +// all other drawing modes, where B_TRANSPARENT_MAGIC_RGBA32 is handled. +// B_RGB32 bitmaps therefore don't draw correctly on BeOS if they actually +// use this color, unless the alpha channel contains 255 for all other +// pixels, which is inconsistent. + && fDrawingMode != B_OP_ALPHA) +#endif + ) { temp = new (nothrow) BBitmap(actualBitmapRect, B_BITMAP_NO_SERVER_LINK, B_RGBA32); if (temp == NULL) {