fixing pict export under coregraphics with quicktime, using tiger functions for faster conversion where possible
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -646,6 +646,7 @@ PicHandle wxBitmapRefData::GetPictHandle()
|
||||
if ( clipRgn )
|
||||
DisposeRgn( clipRgn ) ;
|
||||
#else
|
||||
#ifndef __LP64__
|
||||
GraphicsExportComponent exporter = 0;
|
||||
OSStatus err = OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypePicture, &exporter);
|
||||
if (noErr == err)
|
||||
@@ -656,9 +657,17 @@ PicHandle wxBitmapRefData::GetPictHandle()
|
||||
err = GraphicsExportSetInputCGBitmapContext( exporter, m_hBitmap);
|
||||
err = GraphicsExportSetOutputHandle(exporter, (Handle)m_pictHandle);
|
||||
err = GraphicsExportDoExport(exporter, NULL);
|
||||
size_t handleSize = GetHandleSize( (Handle) m_pictHandle );
|
||||
// the 512 bytes header is only needed for pict files, but not in memory
|
||||
if ( handleSize >= 512 )
|
||||
{
|
||||
memmove( *m_pictHandle , (char*)(*m_pictHandle)+512, handleSize - 512 );
|
||||
SetHandleSize( (Handle) m_pictHandle, handleSize - 512 );
|
||||
}
|
||||
}
|
||||
CloseComponent( exporter );
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -681,6 +690,14 @@ CGImageRef wxBitmapRefData::CGImageCreate() const
|
||||
wxASSERT( m_rawAccessCount >= 0 ) ;
|
||||
CGImageRef image ;
|
||||
if ( m_rawAccessCount > 0 || m_cgImageRef == NULL )
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
|
||||
if ( UMAGetSystemVersion() >= 0x1040 && m_depth != 1 && m_bitmapMask == NULL )
|
||||
{
|
||||
image = CGBitmapContextCreateImage( m_hBitmap );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
size_t imageSize = m_height * m_bytesPerRow ;
|
||||
void * dataBuffer = m_memBuf.GetData() ;
|
||||
@@ -754,6 +771,7 @@ CGImageRef wxBitmapRefData::CGImageCreate() const
|
||||
}
|
||||
CGDataProviderRelease( dataProvider);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
image = m_cgImageRef ;
|
||||
|
Reference in New Issue
Block a user