-// ::ClipRect(&m_macClipRect);
- CopyBits( &GrafPtr( sourcePort )->portBits , &GrafPtr( m_macPort )->portBits ,
- &srcrect, &dstrect, srcCopy, NULL ) ;
-/*
- if ( m_clipping )
- {
- long x1 = XLOG2DEV(m_clipX1);
- long y1 = YLOG2DEV(m_clipY1);
- long x2 = XLOG2DEV(m_clipX2);
- long y2 = YLOG2DEV(m_clipY2);
-
- Rect clip = { y1 , x1 , y2 , x2 } ;
- ::ClipRect(&clip);
- }
-*/
+
+ short mode = (logical_func == wxCOPY ? srcCopy :
+ // logical_func == wxCLEAR ? WHITENESS :
+ // logical_func == wxSET ? BLACKNESS :
+ logical_func == wxINVERT ? hilite :
+ // logical_func == wxAND ? MERGECOPY :
+ logical_func == wxOR ? srcOr :
+ logical_func == wxSRC_INVERT ? notSrcCopy :
+ logical_func == wxXOR ? srcXor :
+ // logical_func == wxOR_REVERSE ? MERGEPAINT :
+ // logical_func == wxAND_REVERSE ? SRCERASE :
+ // logical_func == wxSRC_OR ? srcOr :
+ // logical_func == wxSRC_AND ? SRCAND :
+ srcCopy );
+
+ if ( useMask && source->m_macMask )
+ {
+ wxASSERT( mode == srcCopy ) ;
+ if ( LockPixels( GetGWorldPixMap( source->m_macMask ) ) )
+ {
+ CopyMask( GetPortBitMapForCopyBits( sourcePort ) , GetPortBitMapForCopyBits( source->m_macMask ) ,
+ GetPortBitMapForCopyBits( m_macPort ) ,
+ &srcrect, &srcrect , &dstrect ) ;
+ UnlockPixels( GetGWorldPixMap( source->m_macMask ) ) ;
+ }
+ }
+ else
+ {
+ CopyBits( GetPortBitMapForCopyBits( sourcePort ) , GetPortBitMapForCopyBits( m_macPort ) ,
+ &srcrect, &dstrect, mode, NULL ) ;
+ }