wxGraphicsContext dreadfully slow on Windows

Posted by Jonatan on Stack Overflow See other posts from Stack Overflow or by Jonatan
Published on 2009-11-18T16:36:48Z Indexed on 2010/04/22 19:03 UTC
Read the original article Hit count: 277

Filed under:
|
|
|

I've implemented a plotter using wxGraphicsContext. The development was done using wxGTK, and the graphics was very fast.

Then I switched to Windows (XP) using wxWidgets 2.9.0. And the same code is extremely slow. It takes about 350 ms to render a frame. Since the user is able to drag the plotter with the mouse to navigate it feels very sluggish with such a slow update rate.

I've tried to implement some parts using wxDC and benchmarked the difference. With wxDC the code runs just about 100 times faster.

As far as I know both Cairo and GDI+ are implemented in software at this point, so there's no real reason Cairo should be so much faster than GDI+.

Am I doing something wrong? Or is the GDI+ implementation just not up on par with Cairo?

One small note: I'm rendering to a wxBitmap now, with the wxGraphicsContext created from a wxMemoryDC. This is to avoid flicker on XP, since double buffering doesn't work there.

© Stack Overflow or respective owner

Related posts about wxwidgets

Related posts about gdi+