]> git.saurik.com Git - wxWidgets.git/commitdiff
Handle kCGImageAlphaNoneSkipFirst correctly in wxOSX wxBitmap code.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 28 Apr 2012 22:24:40 +0000 (22:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 28 Apr 2012 22:24:40 +0000 (22:24 +0000)
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

src/osx/core/bitmap.cpp

index 20449c04a6380c0c24555610155365b8affe9519..441a85973763fccdb94d75db6ea853833c112568 100644 (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 );
             }