bool wxDFBDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxRasterOperationMode rop, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) { wxCHECK_MSG( IsOk(), false, "invalid dc" ); wxCHECK_MSG( source, false, "invalid source dc" ); // NB: we could also support XOR here (via DSBLIT_XOR) // and possibly others via SetSrc/DstBlendFunction() wxCHECK_MSG( rop == wxCOPY, false, "only wxCOPY function supported" ); // transform the source DC coords to the device ones xsrc = source->LogicalToDeviceX(xsrc); ysrc = source->LogicalToDeviceY(ysrc); // FIXME_DFB: use the mask origin when drawing transparently wxASSERT_MSG( xsrcMask == -1 && ysrcMask == -1, "non-default source mask offset not implemented" ); #if 0 if (xsrcMask == -1 && ysrcMask == -1) { xsrcMask = xsrc; ysrcMask = ysrc; } else { xsrcMask = source->LogicalToDeviceX(xsrcMask); ysrcMask = source->LogicalToDeviceY(ysrcMask); } #endif wxMemoryDC *sourceAsMemDC = wxDynamicCast(source, wxMemoryDC); if ( sourceAsMemDC ) { DoDrawSubBitmap(sourceAsMemDC->GetSelectedBitmap(), xsrc, ysrc, width, height, xdest, ydest, rop, useMask); } else { return DoBlitFromSurface ( static_cast<wxDFBDCImpl *>(source->GetImpl()) ->GetDirectFBSurface(), xsrc, ysrc, width, height, xdest, ydest ); } return true; }
void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask) { wxCHECK_RET( Ok(), wxT("invalid dc") ); wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") ); DoDrawSubBitmap(bmp, 0, 0, bmp.GetWidth(), bmp.GetHeight(), x, y, m_logicalFunction, useMask); }