X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a8db3cddacf2c3fc244f109fdecbba3b0dfc386..a8d2fb31cbf09dcc4683c9566ff4bc89580f268c:/src/cocoa/bitmap.mm diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index 97d7712b1e..2e18c0ae2b 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -299,7 +299,8 @@ bool wxBitmap::Create(int w, int h, int d) hasAlpha: NO isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace - bytesPerRow: 0 + bytesPerRow: 0 // NOTE: Contrary to Apple documentation Mac OS + // 10.4 will add padding bytes when 0 is used here bitsPerPixel: 0]; wxLogTrace(wxTRACE_COCOA,wxT("M_BITMAPDATA=%p NSBitmapImageRep bitmapData=%p"), M_BITMAPDATA, [M_BITMAPDATA->m_cocoaNSBitmapImageRep bitmapData]); @@ -447,9 +448,11 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth) hasAlpha: NO isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace - bytesPerRow: 0 + bytesPerRow: image.GetWidth()*3 bitsPerPixel: 0]; + // TODO: Specify bytesPerRow:0 and then use [bitmapImage bytesPerRow] + // so that the rows are aligned suitably for altivec by the OS (Tiger) const int numBytes = image.GetWidth()*image.GetHeight()*3; memcpy([bitmapImage bitmapData], image.GetData(), numBytes); // TODO: Alpha and convert to desired depth