[cairo] Cairo and wxWidgets Crash
Hakki Dogusan
hakki at dogusan.net
Wed Jan 29 03:45:29 PST 2014
Hi,
29-01-2014 10:51 tarihinde, WC Black yazdı:
> I just did. Although it appeared promising, I'm afraid that it did not
> solve the issue.
>
> [snip]
I'm using wxWidgets-3.0 with Cairo-1.12.16 via wxGraphicsContext
(previously was using Cairo directly).
My OnPaint() function is below, maybe it helps you.
void pxCanvas::OnPaint(wxPaintEvent& event)
{
#if pxUSE_GDIPLUS
wxBufferedPaintDC pdc(this, bufferBitmap_, wxBUFFER_CLIENT_AREA);
#else
wxPaintDC pdc(this);
#endif
// shifts the device origin so we don't have to worry
// about the current scroll position ourselves
// NOP! makes our drawings faulty!
// PrepareDC(pdc);
ComputeViewport();
wxGCDC gdc;
wxGraphicsRenderer* const renderer =
#ifdef __WXMSW__
wxGraphicsRenderer::GetCairoRenderer();
#else
wxGraphicsRenderer::GetDefaultRenderer();
#endif // __WXMSW__
wxGraphicsContext* context = renderer->CreateContext(pdc);
gdc.SetGraphicsContext(context);
wxDC &dc = (wxDC&) gdc;
// Erase the entire virtual area, not just the client area.
// dc.SetPen(*wxTRANSPARENT_PEN);
// dc.SetBrush(GetBackgroundColour());
// dc.DrawRectangle(GetVirtualSize());
pxCanvasRenderer impl(this);
impl.Render(dc);
}
--
Regards,
Hakki Dogusan
http://www.dynaset.org/dogusanh
More information about the cairo
mailing list