Re: Cairo and wxWidgets Crash

Hakki Dogusan <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
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


-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.