Handle kCGImageAlphaNoneSkipFirst correctly in wxOSX wxBitmap code.

The code tested twice for kCGImageAlphaNoneSkipLast which was clearly wrong.
The original intention was probably to check for both it and
kCGImageAlphaNoneSkipFirst, so fix it to this now.

Closes #14019.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71299 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2012-04-28 22:24:40 +00:00
parent 93be446f3a
commit 4fbb421ba9

View File

@ -306,7 +306,7 @@ bool wxBitmapRefData::Create(CGImageRef image)
memset( data , 0 , size ) ;
m_memBuf.UngetWriteBuf( size ) ;
CGImageAlphaInfo alpha = CGImageGetAlphaInfo(image);
if ( alpha == kCGImageAlphaNone || alpha == kCGImageAlphaNoneSkipLast || alpha == kCGImageAlphaNoneSkipLast )
if ( alpha == kCGImageAlphaNone || alpha == kCGImageAlphaNoneSkipFirst || alpha == kCGImageAlphaNoneSkipLast )
{
m_hBitmap = CGBitmapContextCreate((char*) data, m_width, m_height, 8, m_bytesPerRow, wxMacGetGenericRGBColorSpace(), kCGImageAlphaNoneSkipFirst );
}