WxGraphicsContext is terribly slow on Windows

I used a plotter using wxGraphicsContext. Development was done using wxGTK, and the graphics were very fast.

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

I tried to implement some parts using wxDC and compared the difference. Using wxDC, the code runs about 100 times faster.

As far as I know, Cairo and GDI + are implemented in the software at the moment, so there is no real reason why Cairo should be much faster than GDI +.

Am I doing something wrong? Or is the GDI + implementation simply not the same as Cairo?

One small note: now I am passing wxBitmap, with wxGraphicsContext created from wxMemoryDC. This is done in order to avoid flickering on XP, since double buffering does not work there.

+3
source share
1 answer

Excerpt from cairo homepage :

Cairo is designed to provide consistent output across all output media, while taking advantage of display hardware acceleration when available (for example, through the X Render extension).

0
source

Source: https://habr.com/ru/post/1723248/


All Articles