fixing potential alignment error
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@50307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -769,8 +769,16 @@ CGImageRef wxBitmapRefData::CGImageCreate() const
|
||||
unsigned char * maskBufData = (unsigned char *) maskBuf->GetData();
|
||||
unsigned char * bufData = (unsigned char *) membuf->GetData() ;
|
||||
// copy one color component
|
||||
for( int i = 0 ; i < m_width * m_height ; ++i )
|
||||
maskBufData[i] = bufData[i*4+3];
|
||||
size_t i = 0;
|
||||
for( int y = 0 ; y < m_height ; bufData+= m_bytesPerRow, ++y )
|
||||
{
|
||||
unsigned char *bufDataIter = bufData+3;
|
||||
for ( int x = 0 ; x < m_width ; bufDataIter += 4, ++x, ++i )
|
||||
{
|
||||
maskBufData[i] = *bufDataIter;
|
||||
}
|
||||
}
|
||||
|
||||
dataProvider =
|
||||
CGDataProviderCreateWithData(
|
||||
maskBuf , (const void *) maskBufData , m_width * m_height,
|
||||
|
Reference in New Issue
Block a user