wxGraphicsContext 在 Windows 上慢得可怕
我已经使用 wxGraphicsContext 实现了一个绘图仪。开发是使用wxGTK完成的,图形处理速度非常快。
然后我使用 wxWidgets 2.9.0 切换到 Windows (XP)。而且同样的代码速度极其慢。渲染一帧大约需要 350 毫秒。由于用户可以用鼠标拖动绘图仪进行导航,因此更新速度如此之慢,感觉非常缓慢。
我尝试使用 wxDC 实现一些部分,并对差异进行基准测试。使用 wxDC,代码的运行速度大约提高了 100 倍。
据我所知,Cairo 和 GDI+ 目前都是在软件中实现的,因此没有真正的理由 Cairo 应该比 GDI+ 快得多。
我做错了什么吗?还是 GDI+ 的实现无法与开罗相提并论?
一个小注意事项:我现在正在渲染到 wxBitmap,并使用从 wxMemoryDC 创建的 wxGraphicsContext。这是为了避免 XP 上的闪烁,因为双缓冲在 XP 上不起作用。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
摘自开罗主页:
Excerpt from the cairo homepage: