]>
git.saurik.com Git - wxWidgets.git/blob - src/dfb/dc.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/dfb/dc.cpp
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2006 REA Elektronik GmbH
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // ===========================================================================
13 // ===========================================================================
15 // ---------------------------------------------------------------------------
17 // ---------------------------------------------------------------------------
19 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
31 #include "wx/dfb/private.h"
33 // these values are used to initialize newly created DC
34 #define DEFAULT_FONT (*wxNORMAL_FONT)
35 #define DEFAULT_PEN (*wxBLACK_PEN)
36 #define DEFAULT_BRUSH (*wxWHITE_BRUSH)
38 // ===========================================================================
40 // ===========================================================================
42 //-----------------------------------------------------------------------------
44 //-----------------------------------------------------------------------------
46 IMPLEMENT_ABSTRACT_CLASS(wxDC
, wxDCBase
)
48 // Default constructor
54 wxDC::wxDC(const wxIDirectFBSurfacePtr
& surface
)
59 void wxDC::Init(const wxIDirectFBSurfacePtr
& surface
)
61 m_ok
= (surface
!= NULL
);
62 wxCHECK_RET( surface
!= NULL
, _T("invalid surface") );
66 m_mm_to_pix_x
= (double)wxGetDisplaySize().GetWidth() /
67 (double)wxGetDisplaySizeMM().GetWidth();
68 m_mm_to_pix_y
= (double)wxGetDisplaySize().GetHeight() /
69 (double)wxGetDisplaySizeMM().GetHeight();
71 SetFont(DEFAULT_FONT
);
73 SetBrush(DEFAULT_BRUSH
);
77 // ---------------------------------------------------------------------------
79 // ---------------------------------------------------------------------------
82 #define DO_SET_CLIPPING_BOX(rg) \
84 wxRect rect = rg.GetBox(); \
85 m_clipX1 = (wxCoord) XDEV2LOG(rect.GetLeft()); \
86 m_clipY1 = (wxCoord) YDEV2LOG(rect.GetTop()); \
87 m_clipX2 = (wxCoord) XDEV2LOG(rect.GetRight()); \
88 m_clipY2 = (wxCoord) YDEV2LOG(rect.GetBottom()); \
91 void wxDC::DoSetClippingRegion(wxCoord cx
, wxCoord cy
, wxCoord cw
, wxCoord ch
)
93 wxCHECK_RET( Ok(), wxT("invalid dc") );
98 r
.x2
= r
.x1
+ XLOG2DEVREL(cw
) - 1;
99 r
.y2
= r
.y1
+ XLOG2DEVREL(ch
) - 1;
101 if ( !m_surface
->SetClip(&r
) )
106 m_clipX2
= cx
+ cw
- 1;
107 m_clipY2
= cy
+ ch
-1;
111 void wxDC::DoSetClippingRegionAsRegion(const wxRegion
& region
)
113 // NB: this can be done because wxDFB only supports
114 // rectangular regions
115 SetClippingRegion(region
.AsRect());
118 void wxDC::DestroyClippingRegion()
120 wxCHECK_RET( Ok(), wxT("invalid dc") );
122 m_surface
->SetClip(NULL
);
127 // ---------------------------------------------------------------------------
128 // query capabilities
129 // ---------------------------------------------------------------------------
131 int wxDC::GetDepth() const
133 return wxDfbGetSurfaceDepth(m_surface
);
136 // ---------------------------------------------------------------------------
138 // ---------------------------------------------------------------------------
142 wxCHECK_RET( Ok(), wxT("invalid dc") );
144 if ( m_backgroundBrush
.GetStyle() == wxTRANSPARENT
)
147 wxColour clr
= m_backgroundBrush
.GetColour();
148 m_surface
->Clear(clr
.Red(), clr
.Green(), clr
.Blue(), clr
.Alpha());
151 extern bool wxDoFloodFill(wxDC
*dc
, wxCoord x
, wxCoord y
,
152 const wxColour
& col
, int style
);
154 bool wxDC::DoFloodFill(wxCoord x
, wxCoord y
,
155 const wxColour
& col
, int style
)
157 return wxDoFloodFill(this, x
, y
, col
, style
);
160 bool wxDC::DoGetPixel(wxCoord x
, wxCoord y
, wxColour
*col
) const
162 wxCHECK_MSG( col
, false, _T("NULL colour parameter in wxDC::GetPixel"));
164 wxFAIL_MSG( _T("GetPixel not implemented") );
168 void wxDC::DoCrossHair(wxCoord x
, wxCoord y
)
170 wxCHECK_RET( Ok(), wxT("invalid dc") );
172 wxFAIL_MSG( _T("CrossHair not implemented") );
175 void wxDC::DoDrawLine(wxCoord x1
, wxCoord y1
, wxCoord x2
, wxCoord y2
)
177 wxCHECK_RET( Ok(), wxT("invalid dc") );
179 if ( m_pen
.GetStyle() == wxTRANSPARENT
)
182 m_surface
->DrawLine(XLOG2DEV(x1
), YLOG2DEV(y1
),
183 XLOG2DEV(x2
), YLOG2DEV(y2
));
185 CalcBoundingBox(x1
, y1
);
186 CalcBoundingBox(x2
, y2
);
189 // Draws an arc of a circle, centred on (xc, yc), with starting point (x1, y1)
190 // and ending at (x2, y2)
191 void wxDC::DoDrawArc(wxCoord x1
, wxCoord y1
,
192 wxCoord x2
, wxCoord y2
,
193 wxCoord xc
, wxCoord yc
)
195 wxCHECK_RET( Ok(), wxT("invalid dc") );
197 wxFAIL_MSG( _T("DrawArc not implemented") );
200 void wxDC::DoDrawPoint(wxCoord x
, wxCoord y
)
202 wxCHECK_RET( Ok(), wxT("invalid dc") );
204 wxFAIL_MSG( _T("DrawPoint not implemented") );
207 void wxDC::DoDrawPolygon(int n
, wxPoint points
[], wxCoord xoffset
, wxCoord yoffset
,int WXUNUSED(fillStyle
))
209 wxCHECK_RET( Ok(), wxT("invalid dc") );
211 wxFAIL_MSG( _T("DrawPolygon not implemented") );
214 void wxDC::DoDrawLines(int n
, wxPoint points
[], wxCoord xoffset
, wxCoord yoffset
)
216 wxCHECK_RET( Ok(), wxT("invalid dc") );
218 // TODO: impl. using DirectDB's DrawLines
219 wxFAIL_MSG( _T("DrawLines not implemented") );
222 void wxDC::DoDrawRectangle(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
)
224 wxCHECK_RET( Ok(), wxT("invalid dc") );
226 wxCoord xx
= XLOG2DEV(x
);
227 wxCoord yy
= YLOG2DEV(y
);
228 wxCoord ww
= m_signX
* XLOG2DEVREL(width
);
229 wxCoord hh
= m_signY
* YLOG2DEVREL(height
);
231 if ( ww
== 0 || hh
== 0 ) return;
244 if ( m_brush
.GetStyle() != wxTRANSPARENT
)
246 SelectColour(m_brush
.GetColour());
247 m_surface
->FillRectangle(xx
, yy
, ww
, hh
);
248 // restore pen's colour
249 SelectColour(m_pen
.GetColour());
252 if ( m_pen
.GetStyle() != wxTRANSPARENT
)
254 m_surface
->DrawRectangle(xx
, yy
, ww
, hh
);
257 CalcBoundingBox(x
, y
);
258 CalcBoundingBox(x
+ width
, y
+ height
);
261 void wxDC::DoDrawRoundedRectangle(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
, double radius
)
263 wxCHECK_RET( Ok(), wxT("invalid dc") );
265 wxFAIL_MSG( _T("DrawRoundedRectangle not implemented") );
268 void wxDC::DoDrawEllipse(wxCoord x
, wxCoord y
, wxCoord width
, wxCoord height
)
270 wxCHECK_RET( Ok(), wxT("invalid dc") );
272 wxFAIL_MSG( _T("DrawElipse not implemented") );
275 void wxDC::DoDrawEllipticArc(wxCoord x
,wxCoord y
,wxCoord w
,wxCoord h
,double sa
,double ea
)
277 wxCHECK_RET( Ok(), wxT("invalid dc") );
279 wxFAIL_MSG( _T("DrawElipticArc not implemented") );
282 void wxDC::DoDrawText(const wxString
& text
, wxCoord x
, wxCoord y
)
284 wxCHECK_RET( Ok(), wxT("invalid dc") );
286 wxCoord xx
= XLOG2DEV(x
);
287 wxCoord yy
= XLOG2DEV(y
);
289 // update the bounding box
291 CalcBoundingBox(x
, y
);
292 GetTextExtent(text
, &w
, &h
);
293 CalcBoundingBox(x
+ w
, y
+ h
);
295 // if background mode is solid, DrawText must paint text's background:
296 if ( m_backgroundMode
== wxSOLID
)
298 wxCHECK_RET( m_backgroundBrush
.Ok(), wxT("invalid background brush") );
300 SelectColour(m_backgroundBrush
.GetColour());
301 m_surface
->FillRectangle(xx
, yy
, XLOG2DEVREL(w
), YLOG2DEVREL(h
));
302 // restore pen's colour
303 SelectColour(m_pen
.GetColour());
306 // finally draw the text itself:
307 m_surface
->DrawString(wxSTR_TO_DFB(text
), -1, xx
, yy
, DSTF_LEFT
| DSTF_TOP
);
310 void wxDC::DoDrawRotatedText(const wxString
& text
,
311 wxCoord x
, wxCoord y
,
314 wxCHECK_RET( Ok(), wxT("invalid dc") );
316 wxFAIL_MSG( _T("DrawRotatedText not implemented") );
319 // ---------------------------------------------------------------------------
321 // ---------------------------------------------------------------------------
323 void wxDC::SetPen(const wxPen
& pen
)
325 m_pen
= pen
.Ok() ? pen
: DEFAULT_PEN
;
327 SelectColour(m_pen
.GetColour());
330 void wxDC::SetBrush(const wxBrush
& brush
)
332 m_brush
= brush
.Ok() ? brush
: DEFAULT_BRUSH
;
335 void wxDC::SelectColour(const wxColour
& clr
)
337 m_surface
->SetColor(clr
.Red(), clr
.Green(), clr
.Blue(), clr
.Alpha());
338 #warning "use SetColorIndex?"
342 void wxDC::SetPalette(const wxPalette
& WXUNUSED(palette
))
344 wxCHECK_RET( Ok(), wxT("invalid dc") );
346 wxFAIL_MSG( _T("SetPalette not implemented") );
348 #endif // wxUSE_PALETTE
350 void wxDC::SetFont(const wxFont
& font
)
352 wxCHECK_RET( Ok(), wxT("invalid dc") );
354 wxFont
f(font
.Ok() ? font
: DEFAULT_FONT
);
356 if ( !m_surface
->SetFont(f
.GetDirectFBFont()) )
362 void wxDC::SetBackground(const wxBrush
& brush
)
364 wxCHECK_RET( Ok(), wxT("invalid dc") );
366 if (!brush
.Ok()) return;
368 m_backgroundBrush
= brush
;
371 void wxDC::SetBackgroundMode(int mode
)
373 m_backgroundMode
= mode
;
376 void wxDC::SetLogicalFunction(int function
)
378 wxCHECK_RET( Ok(), wxT("invalid dc") );
380 wxFAIL_MSG( _T("SetLogicalFunction not implemented") );
382 m_logicalFunction
= function
;
385 bool wxDC::StartDoc(const wxString
& WXUNUSED(message
))
387 // We might be previewing, so return true to let it continue.
395 void wxDC::StartPage()
403 // ---------------------------------------------------------------------------
405 // ---------------------------------------------------------------------------
407 wxCoord
wxDC::GetCharHeight() const
409 wxCHECK_MSG( Ok(), -1, wxT("invalid dc") );
410 wxCHECK_MSG( m_font
.Ok(), -1, wxT("no font selected") );
413 m_font
.GetDirectFBFont()->GetHeight(&h
);
414 return YDEV2LOGREL(h
);
417 wxCoord
wxDC::GetCharWidth() const
419 wxCHECK_MSG( Ok(), -1, wxT("invalid dc") );
420 wxCHECK_MSG( m_font
.Ok(), -1, wxT("no font selected") );
423 m_font
.GetDirectFBFont()->GetStringWidth("H", 1, &w
);
424 // VS: YDEV is corrent, it should *not* be XDEV, because font's are only
425 // scaled according to m_scaleY
426 return YDEV2LOGREL(w
);
429 void wxDC::DoGetTextExtent(const wxString
& string
, wxCoord
*x
, wxCoord
*y
,
430 wxCoord
*descent
, wxCoord
*externalLeading
,
431 wxFont
*theFont
) const
433 wxCHECK_RET( Ok(), wxT("invalid dc") );
434 wxCHECK_RET( m_font
.Ok(), wxT("no font selected") );
435 wxCHECK_RET( !theFont
|| theFont
->Ok(), wxT("invalid font") );
438 if ( theFont
!= NULL
)
441 wxConstCast(this, wxDC
)->SetFont(*theFont
);
444 wxCoord xx
= 0, yy
= 0;
446 wxIDirectFBFontPtr f
= m_font
.GetDirectFBFont();
448 if ( f
->GetStringExtents(wxSTR_TO_DFB(string
), -1, &rect
, NULL
) )
450 // VS: YDEV is corrent, it should *not* be XDEV, because font's are
451 // only scaled according to m_scaleY
452 xx
= YDEV2LOGREL(rect
.w
);
453 yy
= YDEV2LOGREL(rect
.h
);
458 if ( f
->GetDescender(&d
) )
459 *descent
= YDEV2LOGREL(-d
);
467 if ( externalLeading
) *externalLeading
= 0;
469 if ( theFont
!= NULL
)
470 wxConstCast(this, wxDC
)->SetFont(oldFont
);
475 // ---------------------------------------------------------------------------
477 // ---------------------------------------------------------------------------
479 void wxDC::ComputeScaleAndOrigin()
481 m_scaleX
= m_logicalScaleX
* m_userScaleX
;
482 m_scaleY
= m_logicalScaleY
* m_userScaleY
;
484 // FIXME_DFB: scaling affects pixel size of font, pens, brushes, which
485 // is not currently implemented here; probably makes sense to
486 // switch to Cairo instead of implementing everything for DFB
487 wxASSERT_MSG( m_scaleX
== 1.0 && m_scaleY
== 1.0,
488 _T("scaling is not implemented in wxDFB") );
491 void wxDC::SetMapMode(int mode
)
493 #warning "move this to common code, it's shared by almost all ports!"
497 SetLogicalScale(twips2mm
*m_mm_to_pix_x
, twips2mm
*m_mm_to_pix_y
);
500 SetLogicalScale(pt2mm
*m_mm_to_pix_x
, pt2mm
*m_mm_to_pix_y
);
503 SetLogicalScale(m_mm_to_pix_x
, m_mm_to_pix_y
);
506 SetLogicalScale(m_mm_to_pix_x
/10.0, m_mm_to_pix_y
/10.0);
510 SetLogicalScale(1.0, 1.0);
513 m_mappingMode
= mode
;
516 void wxDC::SetUserScale(double x
, double y
)
518 #warning "move this to common code?"
519 // allow negative ? -> no
522 ComputeScaleAndOrigin();
525 void wxDC::SetLogicalScale(double x
, double y
)
527 #warning "move this to common code?"
531 ComputeScaleAndOrigin();
534 void wxDC::SetLogicalOrigin( wxCoord x
, wxCoord y
)
536 #warning "move this to common code?"
537 m_logicalOriginX
= x
* m_signX
; // is this still correct ?
538 m_logicalOriginY
= y
* m_signY
;
539 ComputeScaleAndOrigin();
542 void wxDC::SetDeviceOrigin( wxCoord x
, wxCoord y
)
544 #warning "move this to common code?"
545 // only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there
548 ComputeScaleAndOrigin();
551 void wxDC::SetAxisOrientation( bool xLeftRight
, bool yBottomUp
)
553 #warning "move this to common code?"
554 // only wxPostScripDC has m_signX = -1, we override SetAxisOrientation there
555 m_signX
= (xLeftRight
? 1 : -1);
556 m_signY
= (yBottomUp
? -1 : 1);
557 ComputeScaleAndOrigin();
560 // ---------------------------------------------------------------------------
561 // coordinates transformations
562 // ---------------------------------------------------------------------------
564 wxCoord
wxDCBase::DeviceToLogicalX(wxCoord x
) const
566 return ((wxDC
*)this)->XDEV2LOG(x
);
569 wxCoord
wxDCBase::DeviceToLogicalY(wxCoord y
) const
571 return ((wxDC
*)this)->YDEV2LOG(y
);
574 wxCoord
wxDCBase::DeviceToLogicalXRel(wxCoord x
) const
576 return ((wxDC
*)this)->XDEV2LOGREL(x
);
579 wxCoord
wxDCBase::DeviceToLogicalYRel(wxCoord y
) const
581 return ((wxDC
*)this)->YDEV2LOGREL(y
);
584 wxCoord
wxDCBase::LogicalToDeviceX(wxCoord x
) const
586 return ((wxDC
*)this)->XLOG2DEV(x
);
589 wxCoord
wxDCBase::LogicalToDeviceY(wxCoord y
) const
591 return ((wxDC
*)this)->YLOG2DEV(y
);
594 wxCoord
wxDCBase::LogicalToDeviceXRel(wxCoord x
) const
596 return ((wxDC
*)this)->XLOG2DEVREL(x
);
599 wxCoord
wxDCBase::LogicalToDeviceYRel(wxCoord y
) const
601 return ((wxDC
*)this)->YLOG2DEVREL(y
);
605 void wxDC::DoGetSize(int *w
, int *h
) const
607 wxCHECK_RET( Ok(), wxT("invalid dc") );
609 m_surface
->GetSize(w
, h
);
612 void wxDC::DoGetSizeMM(int *width
, int *height
) const
614 #warning "move this to common code?"
618 if ( width
) *width
= int(double(w
) / (m_userScaleX
*m_mm_to_pix_x
));
619 if ( height
) *height
= int(double(h
) / (m_userScaleY
*m_mm_to_pix_y
));
622 wxSize
wxDC::GetPPI() const
624 #warning "move this to common code?"
625 return wxSize(int(double(m_mm_to_pix_x
) * inches2mm
),
626 int(double(m_mm_to_pix_y
) * inches2mm
));
630 // ---------------------------------------------------------------------------
632 // ---------------------------------------------------------------------------
634 bool wxDC::DoBlit(wxCoord xdest
, wxCoord ydest
,
635 wxCoord width
, wxCoord height
,
636 wxDC
*source
, wxCoord xsrc
, wxCoord ysrc
,
637 int rop
, bool useMask
,
638 wxCoord xsrcMask
, wxCoord ysrcMask
)
643 wxCHECK_MSG( Ok(), false, wxT("invalid dc") );
644 wxCHECK_MSG( source
, false, wxT("invalid source dc") );
646 // transform the source DC coords to the device ones
647 xsrc
= source
->LogicalToDeviceX(xsrc
);
648 ysrc
= source
->LogicalToDeviceY(ysrc
);
650 /* FIXME_MGL: use the mask origin when drawing transparently */
651 if (xsrcMask
== -1 && ysrcMask
== -1)
653 xsrcMask
= xsrc
; ysrcMask
= ysrc
;
657 xsrcMask
= source
->LogicalToDeviceX(xsrcMask
);
658 ysrcMask
= source
->LogicalToDeviceY(ysrcMask
);
661 CalcBoundingBox(xdest
, ydest
);
662 CalcBoundingBox(xdest
+ width
, ydest
+ height
);
664 /* scale/translate size and position */
665 wxCoord xx
= XLOG2DEV(xdest
);
666 wxCoord yy
= YLOG2DEV(ydest
);
667 wxCoord ww
= XLOG2DEVREL(width
);
668 wxCoord hh
= YLOG2DEVREL(height
);
670 if ( source
->m_isMemDC
)
672 wxMemoryDC
*memDC
= (wxMemoryDC
*) source
;
673 DoDrawSubBitmap(memDC
->GetSelectedObject(), xsrc
, ysrc
, ww
, hh
,
674 xdest
, ydest
, rop
, useMask
);
678 m_MGLDC
->makeCurrent(); // will go away with MGL6.0
679 m_MGLDC
->bitBlt(*source
->GetMGLDC(),
680 xsrc
, ysrc
, xsrc
+ ww
, ysrc
+ hh
,
681 xx
, yy
, LogicalFunctionToMGLRop(rop
));
688 void wxDC::DoDrawBitmap(const wxBitmap
&bmp
, wxCoord x
, wxCoord y
, bool useMask
)
690 wxCHECK_RET( Ok(), wxT("invalid dc") );
691 wxCHECK_RET( bmp
.Ok(), wxT("invalid bitmap") );
693 wxCoord w
= bmp
.GetWidth();
694 wxCoord h
= bmp
.GetHeight();
696 DoDrawSubBitmap(bmp
, 0, 0, w
, h
, x
, y
, m_logicalFunction
, useMask
);
699 void wxDC::DoDrawIcon(const wxIcon
& icon
, wxCoord x
, wxCoord y
)
701 // VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
702 DoDrawBitmap((const wxBitmap
&)icon
, x
, y
, true);
705 void wxDC::DoDrawSubBitmap(const wxBitmap
&bmp
,
706 wxCoord x
, wxCoord y
, wxCoord w
, wxCoord h
,
707 wxCoord destx
, wxCoord desty
, int rop
, bool useMask
)
710 wxCHECK_RET( Ok(), wxT("invalid dc") );
711 wxCHECK_RET( bmp
.Ok(), wxT("invalid bitmap") );
713 CalcBoundingBox(x
, y
);
714 CalcBoundingBox(x
+ w
, y
+ h
);
716 wxCoord dx
= XLOG2DEV(destx
);
717 wxCoord dy
= YLOG2DEV(desty
);
718 wxCoord dw
= XLOG2DEVREL(w
);
719 wxCoord dh
= YLOG2DEVREL(h
);
721 m_MGLDC
->makeCurrent(); // will go away with MGL6.0
723 bool useStretching
= ((w
!= dw
) || (h
!= dh
));
724 bool putSection
= (w
!= bmp
.GetWidth() || h
!= bmp
.GetHeight());
725 MGL_writeModeType mglRop
= (MGL_writeModeType
)LogicalFunctionToMGLRop(rop
);
727 if ( bmp
.GetDepth() == 1 )
729 // Mono bitmaps are handled in special way -- all 1s are drawn in
730 // foreground colours, all 0s in background colour.
732 ((wxBitmap
&)bmp
).SetMonoPalette(m_textForegroundColour
, m_textBackgroundColour
);
735 if ( useMask
&& bmp
.GetMask() )
737 // Since MGL does not support masks directly (in MGL, mask is handled
738 // in same way as in wxImage, i.e. there is one "key" color), we
739 // simulate masked bitblt in 6 steps (same as in MSW):
741 // 1. Create a temporary bitmap and copy the destination area into it.
742 // 2. Copy the source area into the temporary bitmap using the
743 // specified logical function.
744 // 3. Set the masked area in the temporary bitmap to BLACK by ANDing
745 // the mask bitmap with the temp bitmap with the foreground colour
746 // set to WHITE and the bg colour set to BLACK.
747 // 4. Set the unmasked area in the destination area to BLACK by
748 // ANDing the mask bitmap with the destination area with the
749 // foreground colour set to BLACK and the background colour set
751 // 5. OR the temporary bitmap with the destination area.
752 // 6. Delete the temporary bitmap.
754 // This sequence of operations ensures that the source's transparent
755 // area need not be black, and logical functions are supported.
757 wxBitmap
*mask
= bmp
.GetMask()->GetBitmap();
761 if ( GetDepth() <= 8 )
763 temp
= new MGLMemoryDC(dw
, dh
, GetDepth(), NULL
);
765 tempdc
.SetMGLDC(temp
, false);
766 tempdc
.SetPalette(m_palette
);
771 m_MGLDC
->getPixelFormat(pf
);
772 temp
= new MGLMemoryDC(dw
, dh
, GetDepth(), &pf
);
775 wxCHECK_RET( temp
->isValid(), wxT("cannot create temporary dc") );
777 temp
->bitBlt(*m_MGLDC
, dx
, dy
, dx
+ dw
, dy
+ dh
, 0, 0, MGL_REPLACE_MODE
);
779 DoBitBlt(bmp
, temp
, x
, y
, w
, h
, 0, 0, dw
, dh
, mglRop
,
780 useStretching
, putSection
);
782 mask
->SetMonoPalette(wxColour(0,0,0), wxColour(255,255,255));
783 DoBitBlt(*mask
, temp
, x
, y
, w
, h
, 0, 0, dw
, dh
, MGL_R2_MASKSRC
,
784 useStretching
, putSection
);
785 DoBitBlt(*mask
, m_MGLDC
, x
, y
, w
, h
, dx
, dy
, dw
, dh
, MGL_R2_MASKNOTSRC
,
786 useStretching
, putSection
);
788 m_MGLDC
->bitBlt(*temp
, 0, 0, dw
, dh
, dx
, dy
, MGL_OR_MODE
);
795 DoBitBlt(bmp
, m_MGLDC
, x
, y
, w
, h
, dx
, dy
, dw
, dh
, mglRop
,
796 useStretching
, putSection
);