X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29c829ba84c29a33f5fac69de94513bc174e35c2..11716cbe14313011016472f56edb51c55aabe852:/src/osx/core/bitmap.cpp diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 72226536d8..8da61b8420 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -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 ); } @@ -315,7 +315,7 @@ bool wxBitmapRefData::Create(CGImageRef image) m_hasAlpha = true; m_hBitmap = CGBitmapContextCreate((char*) data, m_width, m_height, 8, m_bytesPerRow, wxMacGetGenericRGBColorSpace(), kCGImageAlphaPremultipliedFirst ); } - CGRect rect = {{0,0},{m_width,m_height}}; + CGRect rect = CGRectMake(0,0,m_width,m_height); CGContextDrawImage(m_hBitmap, rect, image); wxASSERT_MSG( m_hBitmap , wxT("Unable to create CGBitmapContext context") ) ; @@ -747,7 +747,6 @@ void wxBitmapRefData::Free() #ifndef __LP64__ if ( m_pictHandle ) { - KillPicture( m_pictHandle ) ; m_pictHandle = NULL ; } #endif @@ -1730,65 +1729,8 @@ bool wxBundleResourceHandler::LoadFile(wxBitmap *bitmap, return false ; } -#if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__) - -class WXDLLEXPORT wxPICTResourceHandler: public wxBitmapHandler -{ - DECLARE_DYNAMIC_CLASS(wxPICTResourceHandler) - -public: - inline wxPICTResourceHandler() - { - SetName(wxT("Macintosh Pict resource")); - SetExtension(wxEmptyString); - SetType(wxBITMAP_TYPE_PICT_RESOURCE); - }; - - virtual bool LoadFile(wxBitmap *bitmap, - const wxString& name, - wxBitmapType type, - int desiredWidth, - int desiredHeight); -}; - -IMPLEMENT_DYNAMIC_CLASS(wxPICTResourceHandler, wxBitmapHandler) - - -bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, - const wxString& name, - wxBitmapType WXUNUSED(type), - int WXUNUSED(desiredWidth), - int WXUNUSED(desiredHeight)) -{ -#if wxUSE_METAFILE - Str255 theName ; - wxMacStringToPascal( name , theName ) ; - - PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ; - if ( thePict ) - { - wxMetafile mf ; - - mf.SetPICT( thePict ) ; - bitmap->Create( mf.GetWidth() , mf.GetHeight() ) ; - wxMemoryDC dc ; - dc.SelectObject( *bitmap ) ; - mf.Play( &dc ) ; - dc.SelectObject( wxNullBitmap ) ; - - return true ; - } -#endif - - return false ; -} -#endif - void wxBitmap::InitStandardHandlers() { -#if !defined( __LP64__ ) && !defined(__WXOSX_IPHONE__) - AddHandler( new wxPICTResourceHandler ) ; -#endif #if wxOSX_USE_COCOA_OR_CARBON AddHandler( new wxICONResourceHandler ) ; #endif