ROP changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2000-02-04 14:16:17 +00:00
parent 8712c6e799
commit 71fe5c01eb
4 changed files with 50 additions and 72 deletions

View File

@ -1361,24 +1361,22 @@ enum {
// Logical ops
typedef enum
{
wxCLEAR, // 0
wxXOR, // src XOR dst
wxINVERT, // NOT dst
wxOR_REVERSE, // src OR (NOT dst)
wxAND_REVERSE,// src AND (NOT dst)
wxCOPY, // src
wxAND, // src AND dst
wxAND_INVERT, // (NOT src) AND dst
wxNO_OP, // dst
wxNOR, // (NOT src) AND (NOT dst)
wxEQUIV, // (NOT src) XOR dst
wxSRC_INVERT, // (NOT src)
wxOR_INVERT, // (NOT src) OR dst
wxNAND, // (NOT src) OR (NOT dst)
wxOR, // src OR dst
wxSET, // 1
wxSRC_OR, // source _bitmap_ OR destination
wxSRC_AND // source _bitmap_ AND destination
wxCLEAR, wxROP_BLACK = wxCLEAR, wxBLIT_BLACKNESS = wxCLEAR, // 0
wxXOR, wxROP_XORPEN = wxXOR, wxBLIT_SRCINVERT = wxXOR, // src XOR dst
wxINVERT, wxROP_NOT = wxINVERT, wxBLIT_DSTINVERT = wxINVERT, // NOT dst
wxOR_REVERSE, wxROP_MERGEPENNOT = wxOR_REVERSE, wxBLIT_00DD0228 = wxOR_REVERSE, // src OR (NOT dst)
wxAND_REVERSE, wxROP_MASKPENNOT = wxAND_REVERSE, wxBLIT_SRCERASE = wxAND_REVERSE, // src AND (NOT dst)
wxCOPY, wxROP_COPYPEN = wxCOPY, wxBLIT_SRCCOPY = wxCOPY, // src
wxAND, wxROP_MASKPEN = wxAND, wxBLIT_SRCAND = wxAND, // src AND dst
wxAND_INVERT, wxROP_MASKNOTPEN = wxAND_INVERT, wxBLIT_00220326 = wxAND_INVERT, // (NOT src) AND dst
wxNO_OP, wxROP_NOP = wxNO_OP, wxBLIT_00AA0029 = wxNO_OP, // dst
wxNOR, wxROP_NOTMERGEPEN = wxNOR, wxBLIT_NOTSRCERASE = wxNOR, // (NOT src) AND (NOT dst)
wxEQUIV, wxROP_NOTXORPEN = wxEQUIV, wxBLIT_00990066 = wxEQUIV, // (NOT src) XOR dst
wxSRC_INVERT, wxROP_NOTCOPYPEN = wxSRC_INVERT, wxBLIT_NOTSCRCOPY = wxSRC_INVERT, // (NOT src)
wxOR_INVERT, wxROP_MERGENOTPEN = wxOR_INVERT, wxBLIT_MERGEPAINT = wxOR_INVERT, // (NOT src) OR dst
wxNAND, wxROP_NOTMASKPEN = wxNAND, wxBLIT_007700E6 = wxNAND, // (NOT src) OR (NOT dst)
wxOR, wxROP_MERGEPEN = wxOR, wxBLIT_SRCPAINT = wxOR, // src OR dst
wxSET, wxROP_WHITE = wxSET, wxBLIT_WHITENESS = wxSET // 1
} form_ops_t;
/* Flood styles */

View File

@ -1284,10 +1284,6 @@ void wxWindowDC::SetLogicalFunction( int function )
// unsupported by GTK
case wxNOR: mode = GDK_COPY; break;
// these are actually ternary ROPs
case wxSRC_AND: mode = GDK_AND; break;
case wxSRC_OR: mode = GDK_OR; break;
#endif
default:
{

View File

@ -1284,10 +1284,6 @@ void wxWindowDC::SetLogicalFunction( int function )
// unsupported by GTK
case wxNOR: mode = GDK_COPY; break;
// these are actually ternary ROPs
case wxSRC_AND: mode = GDK_AND; break;
case wxSRC_OR: mode = GDK_OR; break;
#endif
default:
{

View File

@ -1002,34 +1002,14 @@ void wxDC::SetRop(WXHDC dc)
int c_rop;
// These may be wrong
switch (m_logicalFunction)
{
// case wxXOR: c_rop = R2_XORPEN; break;
case wxXOR: c_rop = R2_NOTXORPEN; break;
case wxINVERT: c_rop = R2_NOT; break;
case wxOR_REVERSE: c_rop = R2_MERGEPENNOT; break;
case wxAND_REVERSE: c_rop = R2_MASKPENNOT; break;
case wxCLEAR: c_rop = R2_WHITE; break;
case wxSET: c_rop = R2_BLACK; break;
case wxSRC_INVERT: c_rop = R2_NOTCOPYPEN; break;
case wxOR_INVERT: c_rop = R2_MERGENOTPEN; break;
case wxAND: c_rop = R2_MASKPEN; break;
case wxOR: c_rop = R2_MERGEPEN; break;
case wxAND_INVERT: c_rop = R2_MASKNOTPEN; break;
case wxEQUIV:
case wxNAND:
case wxCOPY:
#if 0
// these probably wouldn't be wrong, RR
case wxXOR: c_rop = R2_XORPEN; break;
case wxINVERT: c_rop = R2_NOT; break;
case wxOR_REVERSE: c_rop = R2_MERGEPENNOT; break;
case wxAND_REVERSE: c_rop = R2_MASKPENNOT; break;
case wxCLEAR: c_rop = R2_BLACK; break;
case wxSET: c_rop = R2_WHITE; break;
case wxCLEAR: c_rop = R2_WHITE; break;
case wxSET: c_rop = R2_BLACK; break;
case wxOR_INVERT: c_rop = R2_MERGENOTPEN; break;
case wxAND: c_rop = R2_MASKPEN; break;
case wxOR: c_rop = R2_MERGEPEN; break;
@ -1039,17 +1019,12 @@ void wxDC::SetRop(WXHDC dc)
case wxCOPY: c_rop = R2_COPYPEN; break;
case wxNO_OP: c_rop = R2_NOP; break;
case wxSRC_INVERT: c_rop = R2_NOTCOPYPEN; break;
// what is this one?
case wxNOR: c_rop = R2_COPYPEN; break;
// these are actually ternary ROPs
case wxSRC_AND: c_rop = R2_MASKPEN; break;
case wxSRC_OR: c_rop = R2_MERGEPEN; break;
#endif
default:
c_rop = R2_COPYPEN; break;
case wxNOR: c_rop = R2_NOTMERGEPEN; break;
default:
{
wxFAIL_MSG( wxT("unsupported logical function") );
break;
}
}
SetROP2((HDC) dc, c_rop);
}
@ -1300,19 +1275,32 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
::SetBkColor(GetHdc(), m_textBackgroundColour.GetPixel() );
}
DWORD dwRop = rop == wxCOPY ? SRCCOPY :
rop == wxCLEAR ? WHITENESS :
rop == wxSET ? BLACKNESS :
rop == wxINVERT ? DSTINVERT :
rop == wxAND ? MERGECOPY :
rop == wxOR ? MERGEPAINT :
rop == wxSRC_INVERT ? NOTSRCCOPY :
rop == wxXOR ? SRCINVERT :
rop == wxOR_REVERSE ? MERGEPAINT :
rop == wxAND_REVERSE ? SRCERASE :
rop == wxSRC_OR ? SRCPAINT :
rop == wxSRC_AND ? SRCAND :
SRCCOPY;
DWORD dwRop = SRCCOPY;
switch (rop)
{
case wxXOR: dwRop = SRCINVERT; break;
case wxINVERT: dwRop = DSTINVERT; break;
case wxOR_REVERSE: dwRop = 0x00DD0228; break;
case wxAND_REVERSE: dwRop = SRCERASE; break;
case wxCLEAR: dwRop = BLACKNESS; break;
case wxSET: dwRop = WHITENESS; break;
case wxOR_INVERT: dwRop = MERGEPAINT; break;
case wxAND: dwRop = SRCAND; break;
case wxOR: dwRop = SRCPAINT; break;
case wxEQUIV: dwRop = 0x00990066; break;
case wxNAND: dwRop = 0x007700E6; break;
case wxAND_INVERT: dwRop = 0x00220326; break;
case wxCOPY: dwRop = SRCCOPY; break;
case wxNO_OP: dwRop = 0x00AA0029; break;
case wxSRC_INVERT: dwRop = NOTSRCCOPY; break;
case wxNOR: dwRop = NOTSRCCOPY; break;
default:
{
wxFAIL_MSG( wxT("unsupported logical function") );
break;
}
}
bool success;