Fixing creation from CGContextRef

Our native buffer must be updated as well, otherwise RawAccess will fail
This commit is contained in:
Stefan Csomor
2018-09-03 09:34:03 +02:00
committed by Vadim Zeitlin
parent efb52e7078
commit 87e9b3963e

View File

@@ -340,6 +340,12 @@ bool wxBitmapRefData::Create(CGContextRef context)
// our own contexts conform to this, always.
wxASSERT( m_depth == 32 );
size_t size = m_bytesPerRow * m_height ;
void* data = m_memBuf.GetWriteBuf( size ) ;
memcpy( data , CGBitmapContextGetData(context) , size ) ;
m_memBuf.UngetWriteBuf( size ) ;
// determine content scale
CGRect userrect = CGRectMake(0, 0, 10, 10);
CGRect devicerect;