Windows 7 GDI 加速之谜:我们可以通过编程方式启用它吗?是的,我们(有点)可以!但如何呢?
注意:乍一看,这可能看起来像一个超级用户问题,但请完整阅读它 - 这是一个编程问题。
因此他们从 Windows 7 中删除了 GDI 加速,现在经典的主题动画看起来很糟糕。因为这是一个根本性的设计变更,所以没有办法修复它,对吗?
错了!
今天当我在 VLC 媒体播放器运行时切换到经典视图(关闭了 Aero)时,我感到非常惊讶。通常,最大化/最小化动画看起来很糟糕(它们几乎不显示),但是当 VLC 运行时,动画非常完美,就像在 XP 上一样!我一关闭 VLC,它们就又变得可怕了。 (播放媒体时的效果比播放器闲置时的效果更好。)
之前的某个时候,当我启动 3D 游戏并注意到动画有所改进时,我曾重现过这一点,但我认为它已经是这样了与 DirectX 相关的问题。我试图找出哪些函数调用导致了改进,但没有成功。因此,今天当我注意到 VLC 的相同行为时,我感到非常惊讶,因为它不播放视频,只播放音频(甚至不播放可视化!) - 然而播放音频提高了我的 GDI 图形性能,使得我认为也许,只是也许,Windows 7 确实有某种 GDI 加速功能。 (?)
在这种情况下,我的显卡是 NVIDIA GT 330M,并且 PowerMizer 已关闭。除了 VLC 是否正在运行之外,我已经控制了我能想到的每一个变量,因此我几乎可以排除与显卡功能相关的任何因素。
那么,现在我的问题是:
有谁知道哪些 API 调用可能会导致这种改进,以及它们是否实际上与图形相关?
我尝试过编写一个程序,调用 IDirectDraw::CreateSurface
并简单地在后台运行(希望它能做与我的 3D 游戏相同的事情),但没有;没有任何区别。我什至不确定是否是图形相关的 API 调用可能导致此问题,因为正如我所说,VLC 正在播放音乐,而不是视频。对我来说,这是一个谜,为什么多媒体应用程序运行时性能会提高,因此任何了解其中发生情况的人都将不胜感激。 :)
Note: This might seem like a Super User question at first, but please read it completely -- it's a programming question.
So they removed GDI acceleration from Windows 7, and now the classic theme animations look horrible. And because it was a fundamental design change, there's no way to fix it, right?
Wrong!
I was really surprised today when I switched to Classic view (which turned off Aero) when VLC media player was running. Normally, the maximize/minimize animations look horrible (they barely even show up), but while VLC was running, the animations were perfect, just like on XP! As soon as I closed VLC, they became horrible again. (They were better when media was playing than when the player was idle.)
I'd reproduced this sometime before when I'd fired up a 3D game and noticed that the animations had improved, but I'd assumed that it it had been a DirectX-related issue. I'd tried to figure out which function calls had caused the improvement, but with no luck. So I was really surprised today when I noticed the same behavior with VLC, because it was not playing video, only audio (not even visualizations!) -- and yet playing audio improved my GDI graphics performance, making me think that maybe, just maybe, Windows 7 does have some sort of GDI acceleration after all. (?)
In the case this makes a difference, my graphics card is an NVIDIA GT 330M, and PowerMizer is off. I've controlled for every variable I can think of except for whether or not VLC was running, so I can pretty much rule out anything related to features of the graphics card.
So, now for my question:
Does anyone have any idea which API call(s) might be causing this improvement, and whether they are actually related to graphics or not?
I've tried making a program that calls IDirectDraw::CreateSurface
and simply runs in the background (hoping that it would do the same thing as my 3D game did), but no; there wasn't any difference. I'm not even sure if it's a graphics-related API call that might be causing this, since like I said, VLC was playing music, not video. It's a mystery to me why the performance would improve when a multimedia app is running, so any insight to what's going on inside this would be appreciated. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可能只是系统时钟滴答周期的一个因素。运行 VLC 可能会将时钟周期更改为每 1 毫秒,从而使动画运行得更加流畅。
使用 Clockres 检查 VLC 运行和不运行时的系统计时器分辨率,以查看如果它有所作为的话。
请参阅
timeBeginPeriod
函数了解如何设置自己的时间段。请记住,周期越短,CPU 在时钟周期之间的睡眠时间就越少,并且运行温度越高。It could just be a factor of the system clock tick period. Running VLC probably changes the clock tick to every 1ms, causing the animations to run more smoothly.
Use Clockres to check the system timer resolution with and without VLC running to see if it's making a difference.
See the
timeBeginPeriod
function for how to set the time period yourself. Keep in mind that the shorter the period, the less time your CPU will be able to sleep between ticks, and the hotter it will run.