问题
I can't seem to get a definite answer to this via searching. Are the Win32 blitting operations hardware accelerated (GDI, not GDI+). I don't know how these functions interface with the graphics driver. Is there any function call to verify this functionality, like ?GetCaps? for a specific graphics device (win32 graphics device) to see if these functions are receiving hardware acceleration?
回答1:
According to this, GDI is only hardware accelerated on windows 7 onwards.
This lists how to specify which operations are to be hardware accelerated. included in the list is BitBlt
and StretchBlt
, so yes they are hardware accelerated, but you need to have a system supporting it, and you need to enable it.
回答2:
If GDI operations are hardware accelerated depends on the driver but all versions of Windows except Vista* support it.
- Vista added a new driver model called Windows Display Driver Model (WDDM)
- WDDM v1.1 was added in Windows 7, this included the return of GDI hardware acceleration.
*: It is possible to use a XP driver on Vista, what happens to GDI in that setup I do not know. (Maybe you can detect this by checking for D3DCAPS2_CANSHARERESOURCE ?) Edit: According to this, it works with XPDM.
There are some kernel caps you could check on Win7 but I don't know if it is possible to check in usermode.
来源:https://stackoverflow.com/questions/9347532/are-the-gdi-functions-bitblt-and-stretchblt-hardware-accelerated-in-win32