Are the GDI functions BitBlt and StretchBlt hardware accelerated in Win32?
Asked Answered
C

2

8

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?

Current answered 19/2, 2012 at 7:33 Comment(0)
S
5

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.

Sanguinaria answered 19/2, 2012 at 8:28 Comment(1)
Mostly right. GDI has been hardware accelerated for a very long time. Windows Vista was just a dark time for GDI; it lost its hardware acceleration and users complained incessantly. As a result (or perhaps it was the plan all along), Windows 7 brought hardware acceleration back to GDI and all was well with the universe again.Gerald
R
4

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.

Rossini answered 19/2, 2012 at 8:44 Comment(2)
Note: one thing which seems to prevent acceleration on Win7 based on my testing is using SetStretchBltMode (dc, HALFTONE) to enable linear filtering during Stretch (I am not sure if this was accelerated on XP).Serge
@Serge Yes, and I wonder why as hardware does that very well. In fact it is there where the gain would be significant.Dachia

© 2022 - 2024 — McMap. All rights reserved.