QWindowsNativeImage: Output parameters when CreateDIBSection() fails
This helps to identify bugs in the backing store. Change-Id: Ib15946c8dbdc6f0a5bebe9ca9e6fea5668eb499b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
parent
550b8c342b
commit
7b72810801
@ -101,8 +101,10 @@ static inline HBITMAP createDIB(HDC hdc, int width, int height,
|
|||||||
uchar *bits = nullptr;
|
uchar *bits = nullptr;
|
||||||
HBITMAP bitmap = CreateDIBSection(hdc, reinterpret_cast<BITMAPINFO *>(&bmi),
|
HBITMAP bitmap = CreateDIBSection(hdc, reinterpret_cast<BITMAPINFO *>(&bmi),
|
||||||
DIB_RGB_COLORS, reinterpret_cast<void **>(&bits), 0, 0);
|
DIB_RGB_COLORS, reinterpret_cast<void **>(&bits), 0, 0);
|
||||||
if (Q_UNLIKELY(!bitmap || !bits))
|
if (Q_UNLIKELY(!bitmap || !bits)) {
|
||||||
qFatal("%s: CreateDIBSection failed.", __FUNCTION__);
|
qFatal("%s: CreateDIBSection failed (%dx%d, format: %d)", __FUNCTION__,
|
||||||
|
width, height, int(format));
|
||||||
|
}
|
||||||
|
|
||||||
*bitsIn = bits;
|
*bitsIn = bits;
|
||||||
return bitmap;
|
return bitmap;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user