starting blend modes for Core Graphics
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
489d2dd393
commit
01b5ab3367
@ -37,6 +37,10 @@
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||
|
||||
#ifndef wxMAC_USE_CORE_GRAPHICS_BLEND_MODES
|
||||
#define wxMAC_USE_CORE_GRAPHICS_BLEND_MODES 0
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -1194,6 +1198,15 @@ void wxDC::SetLogicalFunction( int function )
|
||||
return;
|
||||
|
||||
m_logicalFunction = function ;
|
||||
#if wxMAC_USE_CORE_GRAPHICS_BLEND_MODES
|
||||
CGContextRef cgContext = ((wxMacCGContext*)(m_graphicContext))->GetNativeContext() ;
|
||||
if ( m_logicalFunction == wxCOPY )
|
||||
CGContextSetBlendMode( cgContext, kCGBlendModeNormal ) ;
|
||||
else if ( m_logicalFunction == wxINVERT )
|
||||
CGContextSetBlendMode( cgContext, kCGBlendModeExclusion ) ;
|
||||
else
|
||||
CGContextSetBlendMode( cgContext, kCGBlendModeNormal ) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
|
||||
@ -1227,8 +1240,10 @@ void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("wxDC(cg)::DoDrawLine - invalid DC") );
|
||||
|
||||
#if !wxMAC_USE_CORE_GRAPHICS_BLEND_MODES
|
||||
if ( m_logicalFunction != wxCOPY )
|
||||
return ;
|
||||
#endif
|
||||
|
||||
wxCoord xx1 = XLOG2DEVMAC(x1) ;
|
||||
wxCoord yy1 = YLOG2DEVMAC(y1) ;
|
||||
@ -1382,8 +1397,10 @@ void wxDC::DoDrawLines(int n, wxPoint points[],
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("wxDC(cg)::DoDrawLines - invalid DC") );
|
||||
|
||||
#if !wxMAC_USE_CORE_GRAPHICS_BLEND_MODES
|
||||
if ( m_logicalFunction != wxCOPY )
|
||||
return ;
|
||||
#endif
|
||||
|
||||
wxCoord x1, x2 , y1 , y2 ;
|
||||
x1 = XLOG2DEVMAC(points[0].x + xoffset);
|
||||
|
Loading…
Reference in New Issue
Block a user