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:
@@ -37,6 +37,10 @@
|
|||||||
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||||
|
|
||||||
|
#ifndef wxMAC_USE_CORE_GRAPHICS_BLEND_MODES
|
||||||
|
#define wxMAC_USE_CORE_GRAPHICS_BLEND_MODES 0
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// constants
|
// constants
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -1194,6 +1198,15 @@ void wxDC::SetLogicalFunction( int function )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_logicalFunction = function ;
|
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,
|
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") );
|
wxCHECK_RET( Ok(), wxT("wxDC(cg)::DoDrawLine - invalid DC") );
|
||||||
|
|
||||||
|
#if !wxMAC_USE_CORE_GRAPHICS_BLEND_MODES
|
||||||
if ( m_logicalFunction != wxCOPY )
|
if ( m_logicalFunction != wxCOPY )
|
||||||
return ;
|
return ;
|
||||||
|
#endif
|
||||||
|
|
||||||
wxCoord xx1 = XLOG2DEVMAC(x1) ;
|
wxCoord xx1 = XLOG2DEVMAC(x1) ;
|
||||||
wxCoord yy1 = YLOG2DEVMAC(y1) ;
|
wxCoord yy1 = YLOG2DEVMAC(y1) ;
|
||||||
@@ -1382,8 +1397,10 @@ void wxDC::DoDrawLines(int n, wxPoint points[],
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("wxDC(cg)::DoDrawLines - invalid DC") );
|
wxCHECK_RET( Ok(), wxT("wxDC(cg)::DoDrawLines - invalid DC") );
|
||||||
|
|
||||||
|
#if !wxMAC_USE_CORE_GRAPHICS_BLEND_MODES
|
||||||
if ( m_logicalFunction != wxCOPY )
|
if ( m_logicalFunction != wxCOPY )
|
||||||
return ;
|
return ;
|
||||||
|
#endif
|
||||||
|
|
||||||
wxCoord x1, x2 , y1 , y2 ;
|
wxCoord x1, x2 , y1 , y2 ;
|
||||||
x1 = XLOG2DEVMAC(points[0].x + xoffset);
|
x1 = XLOG2DEVMAC(points[0].x + xoffset);
|
||||||
|
Reference in New Issue
Block a user