RFR: 8185862: AWT Assertion Failure in ::GetDIBits(hBMDC, hBM, 0, 1, 0, gpBitmapInfo, 0) 'awt_Win32GraphicsDevice.cpp', at line 185 [v8]

Christoph Langer clanger at openjdk.org
Wed Mar 6 07:52:48 UTC 2024


On Tue, 5 Mar 2024 18:20:39 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> It looks good to me.
> 
> The only question I have is for the fallback in `awt_Win32GraphicsDevice.cpp`.
> 
> Bailing out quickly makes the code cleaner. In this case, if `::GetDIBits` fails, we can bail out too.
> 
> If the fallback is needed, the code below the first call to `::GetDIBits` should be executed even if `GetDC` and `CreateCompatibleBitmap` fail.
> 
> Since testing didn't reveal any problems, the fallback is probably not as important, or not critical for a headless system.

I think the bailout is unlikely to happen after this fix. At least not for the headless environment where we won't jump into AwtWin32GraphicsDevice::Initialize() at all any more. And in headless environments with working monitors, we would never bail out, I guess. However, the method could be cleaned up I guess. But that should also be done in another issue and by somebody who is more into the details of what's going on there.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17614#issuecomment-1980271374


More information about the client-libs-dev mailing list