Don't premultiply pixels from wxBitmapBundle::FromSVG() on wxGTK.
See #24064.
This commit is contained in:
parent
8ea22b5e92
commit
17c34d41ba
1 changed files with 15 additions and 1 deletions
|
|
@ -189,11 +189,25 @@ wxBitmap wxBitmapBundleImplSVG::DoRasterize(const wxSize& size)
|
|||
for ( int x = 0; x < size.x; ++x )
|
||||
{
|
||||
const unsigned char a = src[3];
|
||||
#if defined (__WXMSW__) || defined(__WXOSX__) || defined(__WXQT__)
|
||||
// MSW, OSX, and Qt bitmaps require premultiplication by alpha.
|
||||
dst.Red() = src[0] * a / 255;
|
||||
dst.Green() = src[1] * a / 255;
|
||||
dst.Blue() = src[2] * a / 255;
|
||||
dst.Alpha() = a;
|
||||
|
||||
#else
|
||||
// Other platforms (esp. GTK) store bitmaps with straight alpha.
|
||||
dst.Alpha() = a;
|
||||
if ( a )
|
||||
{
|
||||
dst.Red() = src[0];
|
||||
dst.Green() = src[1];
|
||||
dst.Blue() = src[2];
|
||||
}
|
||||
else
|
||||
// A more canonical form for completely transparent pixels
|
||||
dst.Red() = dst.Green() = dst.Blue() = 0;
|
||||
#endif
|
||||
++dst;
|
||||
src += 4;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue