简体   繁体   English

Windows 7是使用GDI还是新的DWM / WDDM渲染旧程序的控件?

[英]Does Windows 7 render old programs' controls with GDI or the new DWM/WDDM?

In Windows XP the Win32 API renders the controls using GDI/GDI+. 在Windows XP中,Win32 API使用GDI / GDI +呈现控件。 Now I'm on 7, so if I use the API's functions, will the rendering automatically be handled by the DWM/WDDM (so by DirectX)? 现在我已经7了,所以如果我使用API​​的功能,渲染会自动由DWM / WDDM处理(所以DirectX)? or will it continue to render with GDI? 还是会继续用GDI呈现?

Or likewise, will an old app written with WinAPI, be rendered with GDI also in Windows 7? 或者同样,用WinAPI编写的旧应用程序是否也将在Windows 7中使用GDI进行渲染?

Thank you in advance for the help :) 提前谢谢你的帮助:)

In my experience, if the Aero display is on everything will render via that system, it just won't be obvious to your application. 根据我的经验,如果Aero显示器已经打开,那么所有内容都将通过该系统呈现,这对您的应用程序来说并不明显。 You'll still render in GDI, but it will be to a back buffer and not directly to the screen buffer (in fact it's more complicated then that). 你仍然会在GDI中渲染,但它将是一个后台缓冲区,而不是直接到屏幕缓冲区(实际上它比那更复杂)。 That way your older app can get the benefits of the new features, like the live preview effects, without having to be aware of them. 这样,您的旧应用程序可以获得新功能的好处,例如实时预览效果,而无需了解它们。

Really though, your application doesn't really notice a difference. 实际上,您的应用程序并没有真正注意到差异。 The API is still the same API as before and works as you expect it. API仍然与以前的API相同,并且按预期工作。 There are ways to take advantage of this, but you have to opt in to really use it. 有办法利用这一点,但你必须选择真正使用它。

If your application is written to use GDI, then it will continue to use GDI. 如果您的应用程序被编写为使用GDI,那么它将继续使用GDI。 The underlying implementation has changed quite a bit (as I recall, most hardware acceleration was removed in Vista, and put back in, in a new form, in Win7) 底层实现已经发生了很大的变化(我记得,大多数硬件加速已经在Vista中删除,并以新的形式重新安装在Win7中)

But it won't magically be transferred to Direct2D, no. 但它不会神奇地转移到Direct2D,没有。

On performance front, it is the same old farce and as per usual 'Do Your Own Benchmarking' across OS-es. 在性能方面,它与整个操作系统中通常的“自己做基准测试”是一样的古老闹剧。 But, almost a decade old OS for anything GDI still slams Windows7 and plenty of apps will be incredibly more responsive on XP.. Sadness.. especially when you consider that translation of such an old API (as a compatible interface) should be trivial to any new driver or display tech. 但是,几乎十年前的操作系统,任何GDI仍然会抨击Windows7,而且很多应用程序对XP的响应速度会非常快......悲伤......尤其是当你认为翻译这样一个旧的API (作为兼容接口)应该是微不足道的任何新的驱动程序或显示技术。

Apparently some ops like blitting are supported but look at the result of your target 2D GDI app and judge for yourself.. 显然,支持blitting的一些操作,但看看你的目标2D GDI应用程序的结果,并自己判断..

Here are some observations, but please do your own for a dozen scenarios and compare, especially if it is GDI intensive like a million audio/video apps out there (no wonder iFruit boys are gaining share). 这里有一些观察,但请你自己做十几个场景并进行比较,特别是如果它是GDI密集的像一百万个音频/视频应用程序那里(难怪iFruit男孩正在获得份额)。

http://www.passmark.com/forum/showthread.php?t=2233 http://www.passmark.com/forum/showthread.php?t=2233

And while you will find all the typical and fluffy MSDN blog explanations that get 'technical' (ie. surface-style nonsense) the reason is very simple: buy a new OS, pull the carpet on old API and complicate it further by allowing new APIs to work with it (but not benefit the old one, easily doable by providing a new dll and .lib ). 虽然你会发现所有典型和蓬松的MSDN博客解释都是“技术性的”(即表面风格的废话),原因很简单:买一个新的操作系统,在旧的API上拉上地毯,并通过允许新的API进一步复杂化使用它的API(但不利于旧的,通过提供新的dll和.lib可以轻松实现)。

For one history lesson and how hard it was to translate GDI calls to Direct2D or use libgdiplus from Mono and derive ideas etc, here is the propaganda: 对于一个历史课程以及将GDI调用转换为Direct2D或使用来自Mono的libgdiplus并获得想法等有多难,这里是宣传:

http://blogs.msdn.com/directx/archive/2009/05/12/2d-drawing-apis-in-windows.aspx http://blogs.msdn.com/directx/archive/2009/05/12/2d-drawing-apis-in-windows.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM