|
|
@ -1243,8 +1243,8 @@ bool QPixmap::convertFromImage( const QImage &img, int conversion_flags )
|
|
|
|
bool trucol = (visual->c_class == TrueColor || visual->c_class == DirectColor);
|
|
|
|
bool trucol = (visual->c_class == TrueColor || visual->c_class == DirectColor);
|
|
|
|
int nbytes = image.numBytes();
|
|
|
|
int nbytes = image.numBytes();
|
|
|
|
uchar *newbits= 0;
|
|
|
|
uchar *newbits= 0;
|
|
|
|
int newbits_size = 0;
|
|
|
|
|
|
|
|
#ifdef QT_MITSHM_CONVERSIONS
|
|
|
|
#ifdef QT_MITSHM_CONVERSIONS
|
|
|
|
|
|
|
|
int newbits_size = 0;
|
|
|
|
bool mitshm_ximage = false;
|
|
|
|
bool mitshm_ximage = false;
|
|
|
|
XShmSegmentInfo shminfo;
|
|
|
|
XShmSegmentInfo shminfo;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1615,7 +1615,9 @@ bool QPixmap::convertFromImage( const QImage &img, int conversion_flags )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
newbits = (uchar *)malloc( nbytes ); // copy image into newbits
|
|
|
|
newbits = (uchar *)malloc( nbytes ); // copy image into newbits
|
|
|
|
|
|
|
|
#ifdef QT_MITSHM_CONVERSIONS
|
|
|
|
newbits_size = nbytes;
|
|
|
|
newbits_size = nbytes;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
Q_CHECK_PTR( newbits );
|
|
|
|
Q_CHECK_PTR( newbits );
|
|
|
|
if ( !newbits ) // no memory
|
|
|
|
if ( !newbits ) // no memory
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
@ -1744,7 +1746,9 @@ bool QPixmap::convertFromImage( const QImage &img, int conversion_flags )
|
|
|
|
ushort *p2;
|
|
|
|
ushort *p2;
|
|
|
|
int p2inc = xi->bytes_per_line/sizeof(ushort);
|
|
|
|
int p2inc = xi->bytes_per_line/sizeof(ushort);
|
|
|
|
ushort *newerbits = (ushort *)malloc( xi->bytes_per_line * h );
|
|
|
|
ushort *newerbits = (ushort *)malloc( xi->bytes_per_line * h );
|
|
|
|
|
|
|
|
#ifdef QT_MITSHM_CONVERSIONS
|
|
|
|
newbits_size = xi->bytes_per_line * h;
|
|
|
|
newbits_size = xi->bytes_per_line * h;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
Q_CHECK_PTR( newerbits );
|
|
|
|
Q_CHECK_PTR( newerbits );
|
|
|
|
if ( !newerbits ) // no memory
|
|
|
|
if ( !newerbits ) // no memory
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
|