gdiplus: GdipGetDC doesn't set the alpha channel for a 32-bit dib.
This commit is contained in:
parent
069406fe94
commit
e9d9ef591b
@ -5713,7 +5713,7 @@ GpStatus WINGDIPAPI GdipGetDC(GpGraphics *graphics, HDC *hdc)
|
|||||||
{
|
{
|
||||||
stat = METAFILE_GetDC((GpMetafile*)graphics->image, hdc);
|
stat = METAFILE_GetDC((GpMetafile*)graphics->image, hdc);
|
||||||
}
|
}
|
||||||
else if (!graphics->hdc || graphics->alpha_hdc ||
|
else if (!graphics->hdc ||
|
||||||
(graphics->image && graphics->image->type == ImageTypeBitmap && ((GpBitmap*)graphics->image)->format & PixelFormatAlpha))
|
(graphics->image && graphics->image->type == ImageTypeBitmap && ((GpBitmap*)graphics->image)->format & PixelFormatAlpha))
|
||||||
{
|
{
|
||||||
/* Create a fake HDC and fill it with a constant color. */
|
/* Create a fake HDC and fill it with a constant color. */
|
||||||
|
@ -4445,12 +4445,13 @@ static void test_measured_extra_space(void)
|
|||||||
static void test_alpha_hdc(void)
|
static void test_alpha_hdc(void)
|
||||||
{
|
{
|
||||||
GpStatus status;
|
GpStatus status;
|
||||||
HDC hdc;
|
HDC hdc, gp_hdc;
|
||||||
HBITMAP hbm, old_hbm;
|
HBITMAP hbm, old_hbm;
|
||||||
GpGraphics *graphics;
|
GpGraphics *graphics;
|
||||||
ULONG *bits;
|
ULONG *bits;
|
||||||
BITMAPINFO bmi;
|
BITMAPINFO bmi;
|
||||||
GpRectF bounds;
|
GpRectF bounds;
|
||||||
|
COLORREF colorref;
|
||||||
|
|
||||||
hdc = CreateCompatibleDC(0);
|
hdc = CreateCompatibleDC(0);
|
||||||
ok(hdc != NULL, "CreateCompatibleDC failed\n");
|
ok(hdc != NULL, "CreateCompatibleDC failed\n");
|
||||||
@ -4484,6 +4485,21 @@ static void test_alpha_hdc(void)
|
|||||||
|
|
||||||
expect(0xffaaaaaa, bits[0]);
|
expect(0xffaaaaaa, bits[0]);
|
||||||
|
|
||||||
|
bits[0] = 0xdeadbeef;
|
||||||
|
|
||||||
|
status = GdipGetDC(graphics, &gp_hdc);
|
||||||
|
expect(Ok, status);
|
||||||
|
|
||||||
|
colorref = GetPixel(gp_hdc, 0, 4);
|
||||||
|
expect(0xefbead, colorref);
|
||||||
|
|
||||||
|
SetPixel(gp_hdc, 0, 4, 0xffffff);
|
||||||
|
|
||||||
|
expect(0xffffff, bits[0]);
|
||||||
|
|
||||||
|
status = GdipReleaseDC(graphics, gp_hdc);
|
||||||
|
expect(Ok, status);
|
||||||
|
|
||||||
SelectObject(hdc, old_hbm);
|
SelectObject(hdc, old_hbm);
|
||||||
|
|
||||||
bits[0] = 0xdeadbeef;
|
bits[0] = 0xdeadbeef;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user