On Tue Mar 10 03:19:34 2026 +0000, Yeshun Ye wrote:
There is a minor issue with using a temporary HDC directly. The `gdi_transform_acquire` function also contains a `has_gdi_dc` check and a call to `gdi_dc_acquire`, which will cause an error and output an ERR message in `gdi_transform_release`. I see. We only really need `gdi_transform_acquire` and `gdi_transform_release` if we're using an HDC from the Graphics object, so in theory we could skip them or pass some flag around. It feels messy, though.
I had been wondering if we could use a compatible DC for all cases, but wineps and winex11 both override some font-related functions. I was worried that hinting/anti-aliasing might change measurements slightly depending on the device. But it would mean we don't have to call either variety of acquire/release function, which would simplify things a lot. @huw Would you expect text measurements to change depending on the HDC device, assuming identical HFONT objects and transforms? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10235#note_131863