27#define WIN32_NO_STATUS
34#include "wine/winternl.h"
36#include "wine/ddk/d3dkmthk.h"
42static NTSTATUS (
WINAPI *pD3DKMTDestroyDCFromMemory)(
const D3DKMT_DESTROYDCFROMMEMORY *
desc );
44static BOOL (
WINAPI *pGdiAlphaBlend)(
HDC,
int,
int,
int,
int,
HDC,
int,
int,
int,
int,
BLENDFUNCTION);
50 return ((
width *
bpp + 15) >> 3) & ~1;
55 return ((
width *
bpp + 31) >> 3) & ~3;
61 *
abs(
info->bmiHeader.biHeight );
73 ok(
ret ==
sizeof(bm),
"GetObject returned %d\n",
ret);
75 ok(bm.bmType == 0,
"wrong bm.bmType %d\n", bm.bmType);
76 ok(bm.bmWidth == bmih->
biWidth,
"wrong bm.bmWidth %d\n", bm.bmWidth);
77 ok(bm.bmHeight == bmih->
biHeight,
"wrong bm.bmHeight %d\n", bm.bmHeight);
80 ok(bm.bmPlanes == bmih->
biPlanes,
"wrong bm.bmPlanes %d\n", bm.bmPlanes);
81 ok(bm.bmBitsPixel == expected_depth,
"wrong bm.bmBitsPixel %d != %d\n", bm.bmBitsPixel, expected_depth);
82 ok(bm.bmBits ==
NULL,
"wrong bm.bmBits %p\n", bm.bmBits);
84 assert(
sizeof(
buf) >= bm.bmWidthBytes * bm.bmHeight);
88 test_size[0] = bm.bmWidthBytes * bm.bmHeight;
93 ok(
ret == bm.bmWidthBytes * bm.bmHeight,
"%d != %d\n",
ret, bm.bmWidthBytes * bm.bmHeight);
96 memset(buf_cmp, 0xAA,
sizeof(buf_cmp));
97 memset(buf_cmp, 0, bm.bmWidthBytes * bm.bmHeight);
102 int expect =
i == 1 ? 0 : bm.bmWidthBytes * bm.bmHeight;
108 "Test[%d]: buffers do not match, depth %d\n",
i, bmih->
biBitCount);
113 ok(
ret ==
sizeof(*bma),
"wrong size %d\n",
ret);
125 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
139 memset(&bmih, 0,
sizeof(bmih));
140 bmih.
biSize =
sizeof(bmih);
148 ok(
hbm ==
NULL,
"CreateDIBitmap should fail\n");
150 ok(
hbm ==
NULL,
"CreateDIBitmap should fail\n");
158 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
165 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
172 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
182 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
189 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
196 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
209 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
216 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
223 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
233 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
243 memset(&bm, 0,
sizeof(bm));
252 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
257 ok(pixel == 0x00ffffff,
"Reading a 32 bit pixel from a DDB returned %08x\n", pixel);
269 INT ret, bm_width_bytes, dib_width_bytes;
273 ok(
ret ==
sizeof(bm),
"GetObject returned %d\n",
ret);
275 ok(bm.bmType == 0,
"wrong bm.bmType %d\n", bm.bmType);
276 ok(bm.bmWidth == bmih->
biWidth,
"wrong bm.bmWidth %d\n", bm.bmWidth);
277 ok(bm.bmHeight ==
abs(bmih->
biHeight),
"wrong bm.bmHeight %d\n", bm.bmHeight);
280 if (bm.bmWidthBytes != dib_width_bytes)
281 ok(bm.bmWidthBytes == bm_width_bytes,
"wrong bm.bmWidthBytes %d != %d\n", bm.bmWidthBytes, bm_width_bytes);
283 ok(bm.bmWidthBytes == dib_width_bytes,
"wrong bm.bmWidthBytes %d != %d\n", bm.bmWidthBytes, dib_width_bytes);
284 ok(bm.bmPlanes == bmih->
biPlanes,
"wrong bm.bmPlanes %d\n", bm.bmPlanes);
286 ok(bm.bmBits ==
bits,
"wrong bm.bmBits %p != %p\n", bm.bmBits,
bits);
293 ok(
ret == bm_width_bytes * bm.bmHeight,
294 "%d != %d\n",
ret, bm_width_bytes * bm.bmHeight);
296 memset(
buf, 0xAA, bm.bmWidthBytes * bm.bmHeight + 4096);
298 ok(
ret == bm_width_bytes * bm.bmHeight,
"%d != %d\n",
ret, bm_width_bytes * bm.bmHeight);
305 ok(
ret ==
sizeof(*bma),
"wrong size %d\n",
ret);
306 ok(bm.bmWidth == bmih->
biWidth,
"wrong bm.bmWidth %d\n", bm.bmWidth);
307 ok(bm.bmHeight ==
abs(bmih->
biHeight),
"wrong bm.bmHeight %d\n", bm.bmHeight);
308 ok(bm.bmBits ==
bits,
"wrong bm.bmBits %p != %p\n", bm.bmBits,
bits);
321 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
324 ok(
ret ==
sizeof(*dsa),
"wrong size %d\n",
ret);
328 ok(
ret ==
sizeof(
ds),
"wrong size %d\n",
ret);
330 ok(
ds.dsBm.bmBits ==
bits,
"wrong bm.bmBits %p != %p\n",
ds.dsBm.bmBits,
bits);
331 if (
ds.dsBm.bmWidthBytes != bm_width_bytes)
332 ok(
ds.dsBmih.biSizeImage ==
ds.dsBm.bmWidthBytes *
ds.dsBm.bmHeight,
"%u != %u\n",
333 ds.dsBmih.biSizeImage,
ds.dsBm.bmWidthBytes *
ds.dsBm.bmHeight);
335 ds.dsBmih.biSizeImage = 0;
351 ok(
ret ==
sizeof(
ds.dsBm),
"wrong size %d\n",
ret);
367 ok_(__FILE__,
line)(
c ==
exp,
"SetPixel failed: got 0x%06x expected 0x%06x\n",
c,
exp);
369 ok_(__FILE__,
line)(
c ==
exp,
"GetPixel failed: got 0x%06x expected 0x%06x\n",
c,
exp);
371 ok_(__FILE__,
line)(
c ==
exp,
"GetNearestColor failed: got 0x%06x expected 0x%06x\n",
c,
exp);
373#define test_color(hdc, color, exp) _test_color( __LINE__, hdc, color, exp )
389 "VirtualQuery failed\n");
409 ok(
ret == 16,
"SetDIBits failed: expected 16 got %d\n",
ret);
414 "VirtualQuery failed\n");
430 if (
ret)
ok( written == 8192,
"only wrote %u bytes\n", written );
438 HBITMAP hdib, oldbm, hdib2, oldbm2;
455 HPALETTE hpal, oldpal;
477 ok(hdib ==
NULL &&
bits ==
NULL,
"CreateDIBSection failed for invalid parameter: bmi == 0x0\n");
486 "VirtualQuery failed\n");
490 ok(
info.RegionSize == 0x26000,
"0x%lx != 0x26000\n",
info.RegionSize);
512 ok(hdib ==
NULL,
"CreateDIBSection should fail when asked to create a compressed DIB section\n");
526 "VirtualQuery failed\n");
530 ok(
info.RegionSize == 0x19000,
"0x%lx != 0x19000\n",
info.RegionSize);
545 colors[0].rgbRed = 0xff;
546 colors[0].rgbGreen = 0;
547 colors[0].rgbBlue = 0;
548 colors[1].rgbRed = 0;
549 colors[1].rgbGreen = 0;
550 colors[1].rgbBlue = 0xff;
553 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
556 "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.
dsBmih.
biClrUsed, 2);
564 ok(
ret,
"GetDIBits doesn't work with a BITMAPCOREHEADER\n");
567 "GetDIBits didn't fill in the BITMAPCOREHEADER structure properly\n");
570 ok(
ret,
"GetDIBits doesn't work with a BITMAPCOREHEADER\n");
571 ok((ccolors[0].rgbtRed == 0xff) && (ccolors[0].rgbtGreen == 0) &&
572 (ccolors[0].rgbtBlue == 0) && (ccolors[1].rgbtRed == 0) &&
573 (ccolors[1].rgbtGreen == 0) && (ccolors[1].rgbtBlue == 0xff),
574 "The color table has not been translated to the old BITMAPCOREINFO format\n");
577 ok(hcoredib !=
NULL,
"CreateDIBSection failed with a BITMAPCOREINFO\n");
581 ok(
ret,
"GetDIBits doesn't work with a BITMAPCOREHEADER\n");
582 ok((ccolors[0].rgbtRed == 0xff) && (ccolors[0].rgbtGreen == 0) &&
583 (ccolors[0].rgbtBlue == 0) && (ccolors[1].rgbtRed == 0) &&
584 (ccolors[1].rgbtGreen == 0) && (ccolors[1].rgbtBlue == 0xff),
585 "The color table has not been translated to the old BITMAPCOREINFO format\n");
593 ok(
ret == 2,
"GetDIBColorTable returned %d\n",
ret);
595 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
596 rgb[0].rgbRed,
rgb[0].rgbGreen,
rgb[0].rgbBlue,
rgb[0].rgbReserved,
597 rgb[1].rgbRed,
rgb[1].rgbGreen,
rgb[1].rgbBlue,
rgb[1].rgbReserved);
599 c0 =
RGB(colors[0].rgbRed, colors[0].rgbGreen, colors[0].rgbBlue);
600 c1 =
RGB(colors[1].rgbRed, colors[1].rgbGreen, colors[1].rgbBlue);
617 colors[0].rgbRed = 0xff;
618 colors[0].rgbGreen = 0xff;
619 colors[0].rgbBlue = 0xff;
620 colors[1].rgbRed = 0;
621 colors[1].rgbGreen = 0;
622 colors[1].rgbBlue = 0;
625 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
632 ok(
ret == 2,
"GetDIBColorTable returned %d\n",
ret);
634 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
635 rgb[0].rgbRed,
rgb[0].rgbGreen,
rgb[0].rgbBlue,
rgb[0].rgbReserved,
636 rgb[1].rgbRed,
rgb[1].rgbGreen,
rgb[1].rgbBlue,
rgb[1].rgbReserved);
643 for (
i = 0;
i < 16;
i++) {
644 colors[
i].rgbRed =
i;
645 colors[
i].rgbGreen = 16-
i;
646 colors[
i].rgbBlue = 0;
649 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
652 "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.
dsBmih.
biClrUsed, 16);
658 for (
i = 0;
i < 128;
i++) {
659 colors[
i].rgbRed = 255 -
i * 2;
660 colors[
i].rgbGreen =
i * 2;
661 colors[
i].rgbBlue = 0;
662 colors[255 -
i].rgbRed = 0;
663 colors[255 -
i].rgbGreen =
i * 2;
664 colors[255 -
i].rgbBlue = 255 -
i * 2;
667 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
670 "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.
dsBmih.
biClrUsed, 256);
674 for (
i = 0;
i < 256;
i++) {
677 RGB(colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue));
687 memset(plogpal, 0,
sizeof(logpalbuf));
690 palent[0].
peRed = 0xff;
698 ok(hpal !=
NULL,
"CreatePalette failed\n");
701 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
713 ok(
ret == 2,
"GetDIBColorTable returned %d\n",
ret);
714 ok(
rgb[0].rgbRed == 0xff &&
rgb[0].rgbBlue == 0xff &&
rgb[0].rgbGreen == 0 &&
715 rgb[1].rgbRed == 0 &&
rgb[1].rgbBlue == 0 &&
rgb[1].rgbGreen == 0xff,
716 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
717 rgb[0].rgbRed,
rgb[0].rgbGreen,
rgb[0].rgbBlue,
rgb[0].rgbReserved,
718 rgb[1].rgbRed,
rgb[1].rgbGreen,
rgb[1].rgbBlue,
rgb[1].rgbReserved);
720 c0 =
RGB(palent[0].peRed, palent[0].peGreen, palent[0].peBlue);
721 c1 =
RGB(palent[1].peRed, palent[1].peGreen, palent[1].peBlue);
740 bits[13 * 4] =
bits[13*4 + 1] = 0xff;
747 ok(hdib2 !=
NULL,
"CreateDIBSection failed\n");
753 ok(bits32[0] == 0xff00,
"lower left pixel is %08x\n", bits32[0]);
754 ok(bits32[17] == 0xff00ff,
"bottom but one, left pixel is %08x\n", bits32[17]);
768 memset(plogpal, 0,
sizeof(logpalbuf));
772 for (
i = 0;
i < 128;
i++) {
776 palent[255 -
i].
peRed = 0;
778 palent[255 -
i].
peBlue = 255 -
i * 2;
782 for (
i = 0;
i < 256;
i++) {
787 ok(hpal !=
NULL,
"CreatePalette failed\n");
790 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
801 ok(
ret == 256,
"GetDIBColorTable returned %d\n",
ret);
802 for (
i = 0;
i < 256;
i++) {
803 ok(
rgb[
i].rgbRed == palent[
i].peRed &&
804 rgb[
i].rgbBlue == palent[
i].peBlue &&
805 rgb[
i].rgbGreen == palent[
i].peGreen,
806 "GetDIBColorTable returns table %d: r%02x g%02x b%02x res%02x\n",
810 for (
i = 0;
i < 256;
i++) {
814 RGB(palent[
i].peRed, palent[
i].peGreen, palent[
i].peBlue));
824 ok(hpal !=
NULL,
"CreatePalette failed\n");
828 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
839 ok(
ret == 256,
"GetDIBColorTable returned %d\n",
ret);
840 for (
i = 0;
i < 256;
i++)
842 if (i < pbmi->bmiHeader.biClrUsed)
844 ok(
rgb[
i].rgbRed == palent[
i % 37].peRed &&
845 rgb[
i].rgbBlue == palent[
i % 37].peBlue &&
846 rgb[
i].rgbGreen == palent[
i % 37].peGreen,
847 "GetDIBColorTable returns table %d: r %02x g %02x b %02x res%02x\n",
850 RGB(palent[
i % 37].peRed, palent[
i % 37].peGreen, palent[
i % 37].peBlue));
854 ok(
rgb[
i].rgbRed == 0 &&
rgb[
i].rgbBlue == 0 &&
rgb[
i].rgbGreen == 0,
855 "GetDIBColorTable returns table %d: r %02x g %02x b %02x res%02x\n",
864 for (
i = 0;
i < 256;
i++)
867 ok(colors[
i].rgbRed == palent[
i % 37].peRed &&
868 colors[
i].rgbBlue == palent[
i % 37].peBlue &&
869 colors[
i].rgbGreen == palent[
i % 37].peGreen,
870 "GetDIBits returns table %d: r %02x g %02x b %02x res%02x\n",
871 i, colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
873 ok(colors[
i].rgbRed == 0 && colors[
i].rgbBlue == 0 && colors[
i].rgbGreen == 0,
874 "GetDIBits returns table %d: r %02x g %02x b %02x res%02x\n",
875 i, colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
881 rgb[0].rgbReserved = 123;
883 ok(
ret == 1,
"SetDIBColorTable returned unexpected result %u\n",
ret );
884 ok(
rgb[0].rgbReserved == 123,
"Expected rgbReserved = 123, got %u\n",
rgb[0].rgbReserved );
886 rgb[0].rgbRed =
rgb[0].rgbGreen =
rgb[0].rgbBlue =
rgb[0].rgbReserved = -1;
888 ok(
ret == 1,
"GetDIBColorTable returned unexpected result %u\n",
ret );
889 ok(
rgb[0].rgbRed == 1,
"Expected rgbRed = 1, got %u\n",
rgb[0].rgbRed );
890 ok(
rgb[0].rgbGreen == 2,
"Expected rgbGreen = 2, got %u\n",
rgb[0].rgbGreen );
891 ok(
rgb[0].rgbBlue == 3,
"Expected rgbBlue = 3, got %u\n",
rgb[0].rgbBlue );
892 ok(
rgb[0].rgbReserved == 0,
"Expected rgbReserved = 0, got %u\n",
rgb[0].rgbReserved );
902 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
907 ok(
ret == 0,
"GetDIBColorTable returned %d\n",
ret);
925 BOOL format_ok, expect_ok;
935 skip(
"ROSTESTS-152: Skipping loop in test_dib_formats because it's too big and causes too many failures\n");
939 for (planes = 0; planes <= 64; planes++)
953 default: expect_ok =
FALSE;
break;
971 "GetDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
974 format_ok = expect_ok;
975 if (!planes) expect_ok =
FALSE;
987 if (expect_ok && (planes == 1 || planes *
bpp <= 16) &&
998 "CreateDIBitmap succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1011 "SetDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1012 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
format );
1018 "SetDIBitsToDevice succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1019 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
format,
SRCCOPY );
1025 "StretchDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1051 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
format );
1056 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
format,
SRCCOPY );
1064 if (expect_ok || !
bpp)
1068 "GetDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1087 ok( hdib ==
NULL,
"CreateDIBSection succeeded with null bitfields\n" );
1089 ok( !
ret,
"SetDIBits succeeded with null bitfields\n" );
1092 ok( hdib !=
NULL,
"CreateDIBitmap failed with null bitfields\n" );
1094 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1095 ok(
ret,
"SetDIBitsToDevice failed with null bitfields\n" );
1096 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1097 ok(
ret,
"StretchDIBits failed with null bitfields\n" );
1099 ok(
ret,
"GetDIBits failed with null bitfields\n" );
1108 ok(
ret,
"GetDIBits failed with null bitfields\n" );
1115 ok( hdib ==
NULL,
"CreateDIBSection succeeded with null bitfields\n" );
1117 ok( !
ret,
"SetDIBits succeeded with null bitfields\n" );
1124 ok( hdib !=
NULL,
"CreateDIBSection failed with bad bitfields\n" );
1127 ok(
ret,
"SetDIBits failed with bad bitfields\n" );
1134 ok( hdib ==
NULL,
"CreateDIBSection succeeded with negative width\n" );
1136 ok( hdib ==
NULL,
"CreateDIBitmap succeeded with negative width\n" );
1138 ok( !
ret,
"SetDIBits succeeded with negative width\n" );
1139 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1140 ok( !
ret,
"SetDIBitsToDevice succeeded with negative width\n" );
1141 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1142 ok( !
ret,
"StretchDIBits succeeded with negative width\n" );
1144 ok( !
ret,
"GetDIBits succeeded with negative width\n" );
1150 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with negative width\n" );
1157 ok( hdib ==
NULL,
"CreateDIBSection succeeded with zero width\n" );
1159 ok( hdib !=
NULL,
"CreateDIBitmap failed with zero width\n" );
1162 ok( !
ret ||
broken(
ret),
"SetDIBits succeeded with zero width\n" );
1163 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1164 ok( !
ret ||
broken(
ret),
"SetDIBitsToDevice succeeded with zero width\n" );
1165 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1166 ok( !
ret ||
broken(
ret),
"StretchDIBits succeeded with zero width\n" );
1168 ok( !
ret,
"GetDIBits succeeded with zero width\n" );
1174 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with zero width\n" );
1181 ok( hdib ==
NULL,
"CreateDIBSection succeeded with zero height\n" );
1183 ok( hdib !=
NULL,
"CreateDIBitmap failed with zero height\n" );
1186 ok( !
ret,
"SetDIBits succeeded with zero height\n" );
1187 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1188 ok( !
ret,
"SetDIBitsToDevice succeeded with zero height\n" );
1189 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1190 ok( !
ret,
"StretchDIBits succeeded with zero height\n" );
1192 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with zero height\n" );
1198 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with zero height\n" );
1207 ok( hdib ==
NULL,
"CreateDIBSection succeeded with DIB_PAL_COLORS+1\n" );
1209 ok( hdib !=
NULL,
"CreateDIBitmap failed with DIB_PAL_COLORS+1\n" );
1212 ok( !
ret,
"SetDIBits succeeded with DIB_PAL_COLORS+1\n" );
1213 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_PAL_COLORS+1 );
1214 ok(
ret,
"SetDIBitsToDevice failed with DIB_PAL_COLORS+1\n" );
1215 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_PAL_COLORS+1,
SRCCOPY );
1216 ok(
ret,
"StretchDIBits failed with DIB_PAL_COLORS+1\n" );
1218 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+1\n" );
1224 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+1\n" );
1231 ok( hdib ==
NULL,
"CreateDIBSection succeeded with DIB_PAL_COLORS+2\n" );
1233 ok( hdib ==
NULL,
"CreateDIBitmap succeeded with DIB_PAL_COLORS+2\n" );
1236 ok( !
ret,
"SetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1237 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_PAL_COLORS+2 );
1238 ok( !
ret,
"SetDIBitsToDevice succeeded with DIB_PAL_COLORS+2\n" );
1239 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_PAL_COLORS+2,
SRCCOPY );
1240 ok( !
ret,
"StretchDIBits succeeded with DIB_PAL_COLORS+2\n" );
1242 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1248 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1255 ok( hdib !=
NULL,
"CreateDIBSection failed with large size\n" );
1263 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1270 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1277 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1284 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1291 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1321 colors[0].rgbRed = 0xff;
1322 colors[0].rgbGreen = 0xff;
1323 colors[0].rgbBlue = 0xff;
1324 colors[1].rgbRed = 0x0;
1325 colors[1].rgbGreen = 0x0;
1326 colors[1].rgbBlue = 0x0;
1333 ok(mono_ds !=
NULL,
"CreateDIBSection rets NULL\n");
1338 ok(ds_bits[0] == 0xff,
"out_bits %02x\n", ds_bits[0]);
1339 ok(ds_bits[4] == 0x80,
"out_bits %02x\n", ds_bits[4]);
1346 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1347 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1351 colors[0].rgbRed = 0x0;
1352 colors[0].rgbGreen = 0x0;
1353 colors[0].rgbBlue = 0x0;
1354 colors[1].rgbRed = 0xff;
1355 colors[1].rgbGreen = 0xff;
1356 colors[1].rgbBlue = 0xff;
1358 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1359 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1368 colors[0].rgbRed = 0x0;
1369 colors[0].rgbGreen = 0x0;
1370 colors[0].rgbBlue = 0x0;
1371 colors[1].rgbRed = 0xff;
1372 colors[1].rgbGreen = 0xff;
1373 colors[1].rgbBlue = 0xff;
1376 ok(mono_ds !=
NULL,
"CreateDIBSection rets NULL\n");
1381 ok(ds_bits[0] == 0x00,
"out_bits %02x\n", ds_bits[0]);
1382 ok(ds_bits[4] == 0x7f,
"out_bits %02x\n", ds_bits[4]);
1386 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1387 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1391 colors[0].rgbRed = 0xff;
1392 colors[0].rgbGreen = 0xff;
1393 colors[0].rgbBlue = 0xff;
1394 colors[1].rgbRed = 0x0;
1395 colors[1].rgbGreen = 0x0;
1396 colors[1].rgbBlue = 0x0;
1398 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1399 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1405 colors[0].rgbRed = 0xff;
1406 colors[0].rgbGreen = 0xff;
1407 colors[0].rgbBlue = 0xff;
1408 colors[1].rgbRed = 0x0;
1409 colors[1].rgbGreen = 0x0;
1410 colors[1].rgbBlue = 0x0;
1416 ok(ds_bits[0] == 0xff,
"out_bits %02x\n", ds_bits[0]);
1417 ok(ds_bits[4] == 0x80,
"out_bits %02x\n", ds_bits[4]);
1424 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1425 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1429 colors[0].rgbRed = 0x0;
1430 colors[0].rgbGreen = 0x0;
1431 colors[0].rgbBlue = 0x0;
1432 colors[1].rgbRed = 0xff;
1433 colors[1].rgbGreen = 0xff;
1434 colors[1].rgbBlue = 0xff;
1436 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1437 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1446 colors[0].rgbRed = 0xff;
1447 colors[0].rgbGreen = 0x0;
1448 colors[0].rgbBlue = 0x0;
1449 colors[1].rgbRed = 0xfe;
1450 colors[1].rgbGreen = 0x0;
1451 colors[1].rgbBlue = 0x0;
1454 ok(mono_ds !=
NULL,
"CreateDIBSection rets NULL\n");
1459 ok(ds_bits[0] == 0xff,
"out_bits %02x\n", ds_bits[0]);
1460 ok(ds_bits[4] == 0x80,
"out_bits %02x\n", ds_bits[4]);
1464 colors[0].rgbRed = 0x0;
1465 colors[0].rgbGreen = 0x0;
1466 colors[0].rgbBlue = 0x0;
1467 colors[1].rgbRed = 0xff;
1468 colors[1].rgbGreen = 0xff;
1469 colors[1].rgbBlue = 0xff;
1471 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1472 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1476 colors[0].rgbRed = 0xff;
1477 colors[0].rgbGreen = 0xff;
1478 colors[0].rgbBlue = 0xff;
1479 colors[1].rgbRed = 0x0;
1480 colors[1].rgbGreen = 0x0;
1481 colors[1].rgbBlue = 0x0;
1483 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1484 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1495 char buf[256], buf_cmp[256];
1511 "expected ERROR_NOT_ENOUGH_MEMORY, got %u\n",
GetLastError());
1522 "expected ERROR_NOT_ENOUGH_MEMORY, got %u\n",
GetLastError());
1529 ok(!
hbmp,
"CreateBitmap should fail\n");
1532 "expected ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
1540 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
1542 ok(bm.bmType == 0,
"wrong bm.bmType %d\n", bm.bmType);
1543 ok(bm.bmWidth == 15,
"wrong bm.bmWidth %d\n", bm.bmWidth);
1544 ok(bm.bmHeight == 15,
"wrong bm.bmHeight %d\n", bm.bmHeight);
1545 ok(bm.bmWidthBytes == 2,
"wrong bm.bmWidthBytes %d\n", bm.bmWidthBytes);
1546 ok(bm.bmPlanes == 1,
"wrong bm.bmPlanes %d\n", bm.bmPlanes);
1547 ok(bm.bmBitsPixel == 1,
"wrong bm.bmBitsPixel %d\n", bm.bmBitsPixel);
1548 ok(bm.bmBits ==
NULL,
"wrong bm.bmBits %p\n", bm.bmBits);
1550 assert(
sizeof(
buf) >= bm.bmWidthBytes * bm.bmHeight);
1554 ok(
ret == bm.bmWidthBytes * bm.bmHeight,
"%d != %d\n",
ret, bm.bmWidthBytes * bm.bmHeight);
1556 memset(buf_cmp, 0xAA,
sizeof(buf_cmp));
1557 memset(buf_cmp, 0, bm.bmWidthBytes * bm.bmHeight);
1561 ok(
ret == bm.bmWidthBytes * bm.bmHeight,
"%d != %d\n",
ret, bm.bmWidthBytes * bm.bmHeight);
1562 ok(!
memcmp(
buf, buf_cmp,
sizeof(
buf)),
"buffers do not match\n");
1567 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
1569 ok(bm.bmType == 0,
"wrong bm.bmType %d\n", bm.bmType);
1570 ok(bm.bmWidth == 15,
"wrong bm.bmWidth %d\n", bm.bmWidth);
1571 ok(bm.bmHeight == 15,
"wrong bm.bmHeight %d\n", bm.bmHeight);
1572 ok(bm.bmWidthBytes == 2,
"wrong bm.bmWidthBytes %d\n", bm.bmWidthBytes);
1573 ok(bm.bmPlanes == 1,
"wrong bm.bmPlanes %d\n", bm.bmPlanes);
1574 ok(bm.bmBitsPixel == 1,
"wrong bm.bmBitsPixel %d\n", bm.bmBitsPixel);
1575 ok(bm.bmBits ==
NULL,
"wrong bm.bmBits %p\n", bm.bmBits);
1579 ok(
ret == bm.bmWidthBytes * bm.bmHeight,
"%d != %d\n",
ret, bm.bmWidthBytes * bm.bmHeight);
1580 ok(!
memcmp(
buf, buf_cmp,
sizeof(
buf)),
"buffers do not match\n");
1583 ok(hbmp_old ==
hbmp,
"wrong old bitmap %p\n", hbmp_old);
1587 ok(
ret ==
sizeof(*bma),
"wrong size %d\n",
ret);
1604 return (
r*
r +
g*
g +
b*
b < (255-
r)*(255-
r) + (255-
g)*(255-
g) + (255-
b)*(255-
b)) ? 0x000000 : 0xffffff;
1609 if (fg == 0 || bg == 0xffffff)
return RGB(
r,
g,
b) != 0xffffff &&
RGB(
r,
g,
b) != bg;
1615 static const WORD pattern_bits[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa };
1629 "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n",
res,
r,
g,
b, fg, bg );
1632 "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n",
res,
r,
g,
b, fg, bg );
1635 "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n",
res,
r,
g,
b, fg, bg );
1643 "wrong result %06x for %02x,%02x,%02x fg %06x bg %06x\n",
res,
r,
g,
b, fg, bg );
1646 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1655 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1664 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1670 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1674 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
1675 info->bmiHeader.biHeight = -16;
1676 info->bmiHeader.biWidth = 16;
1677 info->bmiHeader.biBitCount = 1;
1678 info->bmiHeader.biPlanes = 1;
1680 colors[0].rgbRed = 0xff;
1681 colors[0].rgbGreen = 0xff;
1682 colors[0].rgbBlue = 0xf0;
1683 colors[1].rgbRed = 0x20;
1684 colors[1].rgbGreen = 0x0;
1685 colors[1].rgbBlue = 0x0;
1687 memset( bits_ptr, 0x55, 64 );
1692 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1694 colors[0].rgbRed = 0x0;
1695 colors[0].rgbGreen = 0x0;
1696 colors[0].rgbBlue = 0x10;
1697 colors[1].rgbRed = 0xff;
1698 colors[1].rgbGreen = 0xf0;
1699 colors[1].rgbBlue = 0xff;
1701 memset( bits_ptr, 0x55, 64 );
1706 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1713 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1720 "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n",
bits[0],
r,
g,
b, fg, bg );
1727 static const COLORREF colors[][2] =
1729 {
RGB(0x00,0x00,0x00),
RGB(0xff,0xff,0xff) },
1730 {
RGB(0xff,0xff,0xff),
RGB(0x00,0x00,0x00) },
1731 {
RGB(0x00,0x00,0x00),
RGB(0xff,0xff,0xfe) },
1732 {
RGB(0x00,0x01,0x00),
RGB(0xff,0xff,0xff) },
1733 {
RGB(0x00,0x00,0x00),
RGB(0x80,0x80,0x80) },
1734 {
RGB(0x80,0x80,0x80),
RGB(0xff,0xff,0xff) },
1735 {
RGB(0x30,0x40,0x50),
RGB(0x60,0x70,0x80) },
1736 {
RGB(0xa0,0xa0,0xa0),
RGB(0x20,0x30,0x10) },
1748 skip(
"ROSTESTS-153: Skipping test_mono_bitmap because it causes too many failures and takes too long\n");
1760 for (col = 0; col <
sizeof(colors) /
sizeof(colors[0]); col++)
1765 for (
i = 0;
i < 256;
i++)
1775 for (
r = 0;
r < 256;
r += 15)
1776 for (
g = 0;
g < 256;
g += 15)
1777 for (
b = 0;
b < 256;
b += 15)
1797 "GetObject failed or returned a wrong structure size\n");
1798 ok(!
bmp.bmBits,
"bmBits must be NULL for device-dependent bitmaps\n");
1810 UINT dib_size, dib32_size;
1822 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
1823 info->bmiHeader.biWidth = 32;
1824 info->bmiHeader.biHeight = 32;
1825 info->bmiHeader.biPlanes = 1;
1826 info->bmiHeader.biBitCount =
bpp;
1828 info->bmiHeader.biXPelsPerMeter = 0;
1829 info->bmiHeader.biYPelsPerMeter = 0;
1830 info->bmiHeader.biClrUsed = 0;
1831 info->bmiHeader.biClrImportant = 0;
1833 for (
i=0;
i < (1u <<
bpp);
i++)
1836 info->bmiColors[
i].rgbRed =
c;
1837 info->bmiColors[
i].rgbGreen =
c;
1838 info->bmiColors[
i].rgbBlue =
c;
1839 info->bmiColors[
i].rgbReserved = 0;
1843 dib_size =
bpp * (
info->bmiHeader.biWidth *
info->bmiHeader.biHeight) / 8;
1844 dib32_size = 32 * (
info->bmiHeader.biWidth *
info->bmiHeader.biHeight) / 8;
1847 for (
i=0;
i < dib_size;
i++)
1865 for (
i=0;
i < (1u <<
bpp);
i++)
1870 "color table entry %d differs (bpp %d)\n",
i,
bpp );
1872 ok( !
memcmp(
bits, bits2, dib_size ),
"bit mismatch (bpp %d)\n",
bpp );
1879 "color table mismatch (bpp %d)\n",
bpp );
1885 "color table mismatch (bpp %d)\n",
bpp );
1891 "color table mismatch (bpp %d)\n",
bpp );
1899 pixel = ((
DWORD *)bits2)[
info->bmiHeader.biWidth *
info->bmiHeader.biHeight - 1];
1900 ok(pixel != 0,
"Pixel: 0x%08x\n", pixel);
1958 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
1961 info->bmiHeader.biPlanes = 1;
1962 info->bmiHeader.biBitCount =
bpp;
1969 ok(
info->bmiHeader.biSizeImage != 0,
"GetDIBits failed to get the DIB attributes\n");
1991 for (
i=0;
i < (1u <<
bpp);
i++)
1996 "color table entry %d differs (bpp %d)\n",
i,
bpp );
1999 ok( !
memcmp(
bits, bits2,
info->bmiHeader.biSizeImage ),
"bit mismatch (bpp %d)\n",
bpp );
2010 for (
i = 0;
i < (1 <<
info->bmiHeader.biBitCount);
i++)
2011 ok( colors[
i] ==
i,
"%d: got %d (bpp %d)\n",
i, colors[
i],
bpp );
2028 static const BYTE bmp_bits_1[16 * 2] =
2030 0xff,0xff, 0,0, 0xff,0xff, 0,0,
2031 0xff,0xff, 0,0, 0xff,0xff, 0,0,
2032 0xff,0xff, 0,0, 0xff,0xff, 0,0,
2033 0xff,0xff, 0,0, 0xff,0xff, 0,0
2036 static const BYTE dib_bits_1[16 * 4] =
2038 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0,
2039 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0,
2040 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0,
2041 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0
2044 static const BYTE bmp_bits_24[16 * 16*3] =
2046 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2047 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2048 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2049 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2050 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2051 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2052 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2053 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2054 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2055 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2056 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2057 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2058 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2059 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2060 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2061 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2062 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2063 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2064 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2065 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2066 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2067 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2068 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2069 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2070 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2071 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2072 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2073 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2074 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2075 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2076 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2077 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2080 static const BYTE dib_bits_24[16 * 16*3] =
2082 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2083 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2084 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2085 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2086 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2087 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2088 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2089 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2090 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2091 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2092 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2093 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2094 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2095 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2096 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2097 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2098 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2099 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2100 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2101 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2102 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2103 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2104 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2105 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2106 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2107 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2108 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2109 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2110 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2111 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2112 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2113 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
2129 ok(
hbmp != 0,
"CreateBitmap failed\n");
2131 memset(&bm, 0xAA,
sizeof(bm));
2133 ok(
bytes ==
sizeof(bm),
"GetObject returned %d\n",
bytes);
2134 ok(bm.bmType == 0,
"wrong bmType %d\n", bm.bmType);
2135 ok(bm.bmWidth == 16,
"wrong bmWidth %d\n", bm.bmWidth);
2136 ok(bm.bmHeight == 16,
"wrong bmHeight %d\n", bm.bmHeight);
2137 ok(bm.bmWidthBytes == 2,
"wrong bmWidthBytes %d\n", bm.bmWidthBytes);
2138 ok(bm.bmPlanes == 1,
"wrong bmPlanes %u\n", bm.bmPlanes);
2139 ok(bm.bmBitsPixel == 1,
"wrong bmBitsPixel %d\n", bm.bmBitsPixel);
2140 ok(!bm.bmBits,
"wrong bmBits %p\n", bm.bmBits);
2143 ok(
bytes ==
sizeof(bmp_bits_1),
"expected 16*2 got %d bytes\n",
bytes);
2145 ok(
bytes ==
sizeof(bmp_bits_1),
"expected 16*2 got %d bytes\n",
bytes);
2146 ok(!
memcmp(
buf, bmp_bits_1,
sizeof(bmp_bits_1)),
"bitmap bits don't match\n");
2149 memset(bi, 0,
sizeof(*bi));
2161 ok(
lines == 0,
"GetDIBits copied %d lines with hdc = 0\n",
lines);
2172 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2178 ok(colors[0].rgbRed == 0 && colors[0].rgbGreen == 0 &&
2179 colors[0].rgbBlue == 0 && colors[0].rgbReserved == 0,
2180 "expected bmiColors[0] 0,0,0,0 - got %x %x %x %x\n",
2181 colors[0].rgbRed, colors[0].rgbGreen, colors[0].rgbBlue, colors[0].rgbReserved);
2182 ok(colors[1].rgbRed == 0xff && colors[1].rgbGreen == 0xff &&
2183 colors[1].rgbBlue == 0xff && colors[1].rgbReserved == 0,
2184 "expected bmiColors[0] 0xff,0xff,0xff,0 - got %x %x %x %x\n",
2185 colors[1].rgbRed, colors[1].rgbGreen, colors[1].rgbBlue, colors[1].rgbReserved);
2186 for (
i = 2;
i < 256;
i++)
2188 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2189 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2190 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2191 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2195 ok(!
memcmp(
buf, dib_bits_1,
sizeof(dib_bits_1)),
"DIB bits don't match\n");
2201 ok(((
WORD*)colors)[0] == 0,
"Color 0 is %d\n", ((
WORD*)colors)[0]);
2202 ok(((
WORD*)colors)[1] == 1,
"Color 1 is %d\n", ((
WORD*)colors)[1]);
2203 for (
i = 2;
i < 256;
i++)
2204 ok(((
WORD*)colors)[
i] == 0xAAAA,
"Color %d is %d\n",
i, ((
WORD*)colors)[1]);
2207 memset(bi, 0,
sizeof(*bi));
2220 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2226 for (
i = 0;
i < 256;
i++)
2228 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2229 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2230 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2231 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2235 ok(!
memcmp(
buf, dib_bits_24,
sizeof(dib_bits_24)),
"DIB bits don't match\n");
2240 ok(
hbmp != 0,
"CreateBitmap failed\n");
2244 ok(
lines == bm.bmHeight,
"SetDIBits copied %d lines of %d, error %u\n",
2247 memset(&bm, 0xAA,
sizeof(bm));
2249 ok(
bytes ==
sizeof(bm),
"GetObject returned %d\n",
bytes);
2250 ok(bm.bmType == 0,
"wrong bmType %d\n", bm.bmType);
2251 ok(bm.bmWidth == 16,
"wrong bmWidth %d\n", bm.bmWidth);
2252 ok(bm.bmHeight == 16,
"wrong bmHeight %d\n", bm.bmHeight);
2253 ok(bm.bmWidthBytes ==
get_bitmap_stride(bm.bmWidth, bm.bmBitsPixel),
"wrong bmWidthBytes %d\n", bm.bmWidthBytes);
2256 ok(!bm.bmBits,
"wrong bmBits %p\n", bm.bmBits);
2259 ok(
bytes == bm.bmWidthBytes * bm.bmHeight,
"expected %d got %d bytes\n", bm.bmWidthBytes * bm.bmHeight,
bytes);
2261 ok(
bytes == bm.bmWidthBytes * bm.bmHeight,
"expected %d got %d bytes\n",
2262 bm.bmWidthBytes * bm.bmHeight,
bytes);
2265 memset(bi, 0,
sizeof(*bi));
2278 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2284 ok(colors[0].rgbRed == 0 && colors[0].rgbGreen == 0 &&
2285 colors[0].rgbBlue == 0 && colors[0].rgbReserved == 0,
2286 "expected bmiColors[0] 0,0,0,0 - got %x %x %x %x\n",
2287 colors[0].rgbRed, colors[0].rgbGreen, colors[0].rgbBlue, colors[0].rgbReserved);
2288 ok(colors[1].rgbRed == 0xff && colors[1].rgbGreen == 0xff &&
2289 colors[1].rgbBlue == 0xff && colors[1].rgbReserved == 0,
2290 "expected bmiColors[0] 0xff,0xff,0xff,0 - got %x %x %x %x\n",
2291 colors[1].rgbRed, colors[1].rgbGreen, colors[1].rgbBlue, colors[1].rgbReserved);
2292 for (
i = 2;
i < 256;
i++)
2294 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2295 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2296 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2297 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2301 ok(!
memcmp(
buf, dib_bits_1,
sizeof(dib_bits_1)),
"DIB bits don't match\n");
2307 ok(((
WORD*)colors)[0] == 0,
"Color 0 is %d\n", ((
WORD*)colors)[0]);
2308 ok(((
WORD*)colors)[1] == 1,
"Color 1 is %d\n", ((
WORD*)colors)[1]);
2309 for (
i = 2;
i < 256;
i++)
2310 ok(((
WORD*)colors)[
i] == 0xAAAA,
"Color %d is %d\n",
i, ((
WORD*)colors)[
i]);
2313 memset(bi, 0,
sizeof(*bi));
2326 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2332 for (
i = 0;
i < 16;
i++)
2346 "expected bmiColors[%d] %x %x %x %x - got %x %x %x %x\n",
i,
2348 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2352 memset(bi, 0,
sizeof(*bi));
2365 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2371 for (
i = 0;
i < 256;
i++)
2375 if (i < 10 || i >= 246)
2384 expect.rgbRed = (
i & 0x07) << 5;
2385 expect.rgbGreen = (
i & 0x38) << 2;
2391 "expected bmiColors[%d] %x %x %x %x - got %x %x %x %x\n",
i,
2393 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2397 memset(bi, 0,
sizeof(*bi));
2410 ok(
lines == bm.bmHeight,
"GetDIBits copied %d lines of %d, error %u\n",
2416 for (
i = 0;
i < 256;
i++)
2418 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2419 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2420 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2421 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2425 ok(!
memcmp(
buf, dib_bits_24,
sizeof(dib_bits_24)),
"DIB bits don't match\n");
2450 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2456 ok(
hbm !=
NULL,
"CreateCompatibleBitmap failed?\n");
2460 ok(
ret == 1,
"GetDIBits failed\n");
2469 ok( !bitmasks[0],
"red mask is set\n" );
2470 ok( !bitmasks[1],
"green mask is set\n" );
2471 ok( !bitmasks[2],
"blue mask is set\n" );
2476 ok(
ret == 1,
"GetDIBits failed\n");
2478 ok( bitmasks[0] != 0,
"red mask is not set\n" );
2479 ok( bitmasks[1] != 0,
"green mask is not set\n" );
2480 ok( bitmasks[2] != 0,
"blue mask is not set\n" );
2484 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2492 ok( bitmasks[0] != 0,
"red mask is not set\n" );
2493 ok( bitmasks[1] != 0,
"green mask is not set\n" );
2494 ok( bitmasks[2] != 0,
"blue mask is not set\n" );
2498 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2505 ok( !bitmasks[0],
"red mask is set\n" );
2506 ok( !bitmasks[1],
"green mask is set\n" );
2507 ok( !bitmasks[2],
"blue mask is set\n" );
2515 ok( bitmasks[0] != 0,
"red mask is not set\n" );
2516 ok( bitmasks[1] != 0,
"green mask is not set\n" );
2517 ok( bitmasks[2] != 0,
"blue mask is not set\n" );
2521 else skip(
"bitmap in colortable mode, skipping BI_BITFIELDS tests\n");
2538 bitmasks[0] = 0x0000ff;
2539 bitmasks[1] = 0x00ff00;
2540 bitmasks[2] = 0xff0000;
2542 ok(
hbm != 0,
"failed to create bitmap\n" );
2544 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2547 ok(
ret == 1,
"GetDIBits failed\n");
2553 ok( !bitmasks[0],
"red mask is set\n" );
2554 ok( !bitmasks[1],
"green mask is set\n" );
2555 ok( !bitmasks[2],
"blue mask is set\n" );
2559 ok(
ret == 1,
"GetDIBits failed\n");
2566 ok( bitmasks[0] == 0xff0000,
"wrong red mask %08x\n", bitmasks[0] );
2567 ok( bitmasks[1] == 0x00ff00,
"wrong green mask %08x\n", bitmasks[1] );
2568 ok( bitmasks[2] == 0x0000ff,
"wrong blue mask %08x\n", bitmasks[2] );
2585 bitmasks[0] = 0x0000ff;
2586 bitmasks[1] = 0x00ff00;
2587 bitmasks[2] = 0xff0000;
2589 ok(
hbm != 0,
"failed to create bitmap\n" );
2593 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2596 ok(
ret == 1,
"GetDIBits failed\n");
2600 ok( !bitmasks[0],
"red mask is set\n" );
2601 ok( !bitmasks[1],
"green mask is set\n" );
2602 ok( !bitmasks[2],
"blue mask is set\n" );
2606 ok(
ret == 1,
"GetDIBits failed\n");
2607 ok( bitmasks[0] == 0x0000ff,
"wrong red mask %08x\n", bitmasks[0] );
2608 ok( bitmasks[1] == 0x00ff00,
"wrong green mask %08x\n", bitmasks[1] );
2609 ok( bitmasks[2] == 0xff0000,
"wrong blue mask %08x\n", bitmasks[2] );
2629 ok(
hbm == 0,
"creating 24-bpp BI_BITFIELDS dibsection should fail\n" );
2632 ok(
hbm != 0,
"failed to create bitmap\n" );
2634 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2637 ok(
ret == 1,
"GetDIBits failed\n");
2642 ok( !bitmasks[0],
"red mask is set\n" );
2643 ok( !bitmasks[1],
"green mask is set\n" );
2644 ok( !bitmasks[2],
"blue mask is set\n" );
2648 ok(
ret == 1,
"GetDIBits failed\n");
2650 ok( !bitmasks[0],
"red mask is set\n" );
2651 ok( !bitmasks[1],
"green mask is set\n" );
2652 ok( !bitmasks[2],
"blue mask is set\n" );
2664 DWORD depths[] = {8, 15, 16, 24, 32};
2669 ok(
hdc != 0,
"GetDC(0) failed\n");
2671 ok(
hbm != 0,
"CreateCompatibleBitmap failed\n");
2674 ok(hbm_old == 0,
"SelectObject should fail\n");
2680 ok(
hdc != 0,
"GetDC(0) failed\n");
2682 ok(
hbm != 0,
"CreateCompatibleBitmap failed\n");
2685 ok(hbm_old != 0,
"SelectObject failed\n");
2687 ok(hbm_old ==
hbm,
"SelectObject failed\n");
2696 ok(
hbm != 0,
"CreateBitmap failed\n");
2699 ok(hbm_old != 0,
"SelectObject failed\n");
2701 ok(hbm_old ==
hbm,
"SelectObject failed\n");
2705 for(
i = 0;
i <
sizeof(depths)/
sizeof(depths[0]);
i++) {
2711 ok(
hbm != 0,
"CreateBitmap failed\n");
2714 if(depths[
i] ==
bpp ||
2715 (
bpp == 16 && depths[
i] == 15)
2717 ok(hbm_old != 0,
"SelectObject failed, BITSPIXEL: %d, created depth: %d\n",
bpp, depths[
i]);
2720 ok(hbm_old == 0,
"SelectObject should fail. BITSPIXELS: %d, created depth: %d\n",
bpp, depths[
i]);
2723 memset(&bm, 0xAA,
sizeof(bm));
2725 ok(
bytes ==
sizeof(bm),
"GetObject returned %d\n",
bytes);
2726 ok(bm.bmType == 0,
"wrong bmType %d\n", bm.bmType);
2727 ok(bm.bmWidth == 10,
"wrong bmWidth %d\n", bm.bmWidth);
2728 ok(bm.bmHeight == 10,
"wrong bmHeight %d\n", bm.bmHeight);
2729 ok(bm.bmWidthBytes ==
get_bitmap_stride(bm.bmWidth, bm.bmBitsPixel),
"wrong bmWidthBytes %d\n", bm.bmWidthBytes);
2730 ok(bm.bmPlanes == planes,
"wrong bmPlanes %u\n", bm.bmPlanes);
2731 if(depths[
i] == 15) {
2732 ok(bm.bmBitsPixel == 16,
"wrong bmBitsPixel %d(15 bpp special)\n", bm.bmBitsPixel);
2734 ok(bm.bmBitsPixel == depths[
i],
"wrong bmBitsPixel %d\n", bm.bmBitsPixel);
2736 ok(!bm.bmBits,
"wrong bmBits %p\n", bm.bmBits);
2755 memset(&bm, 0xDA,
sizeof(bm));
2760 ok_(__FILE__,
line)(bm.bmType == 0,
"wrong bmType, expected 0 got %d\n", bm.bmType);
2761 ok_(__FILE__,
line)(bm.bmWidth == 1,
"wrong bmWidth, expected 1 got %d\n", bm.bmWidth);
2762 ok_(__FILE__,
line)(bm.bmHeight == 1,
"wrong bmHeight, expected 1 got %d\n", bm.bmHeight);
2763 ok_(__FILE__,
line)(bm.bmWidthBytes == 2,
"wrong bmWidthBytes, expected 2 got %d\n", bm.bmWidthBytes);
2764 ok_(__FILE__,
line)(bm.bmPlanes == 1,
"wrong bmPlanes, expected 1 got %u\n", bm.bmPlanes);
2765 ok_(__FILE__,
line)(bm.bmBitsPixel == 1,
"wrong bmBitsPixel, expected 1 got %d\n", bm.bmBitsPixel);
2766 ok_(__FILE__,
line)(!bm.bmBits,
"wrong bmBits %p\n", bm.bmBits);
2769#define test_mono_1x1_bmp(a) test_mono_1x1_bmp_dbg((a), __LINE__)
2795 ok(bm == bm1 && bm == bm4 && bm == bm5 && bm == curObj1 && bm == old1,
2796 "0: %p, 1: %p, 4: %p, 5: %p, curObj1 %p, old1 %p\n",
2797 bm, bm1, bm4, bm5, curObj1, old1);
2798 ok(bm != bm2 && bm != bm3,
"0: %p, 2: %p, 3: %p\n", bm, bm2, bm3);
2800 ok(bm != curObj2,
"0: %p, curObj2 %p\n", bm, curObj2);
2801 ok(old2 == 0,
"old2 %p\n", old2);
2826 bmp.bmWidthBytes = 28;
2828 bmp.bmBitsPixel = 1;
2836 for(
i = 1;
i <= 33;
i++) {
2840 bmp.bmWidthBytes = 28;
2842 bmp.bmBitsPixel =
i;
2848 ok(bm == 0,
"CreateBitmapIndirect for %d bpp succeeded\n",
i);
2861 }
else if(
i <= 16) {
2863 }
else if(
i <= 24) {
2865 }
else if(
i <= 32) {
2868 ok(
bmp.bmBitsPixel ==
expect,
"CreateBitmapIndirect for a %d bpp bitmap created a %d bpp bitmap, expected %d\n",
2890 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2951 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2963 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2968 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2982 int overwritten_bytes = 0;
2994 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
2995 info->bmiHeader.biWidth = 2;
2996 info->bmiHeader.biHeight = 2;
2997 info->bmiHeader.biPlanes = 1;
3001 ok(
ret != 0,
"GetDIBits failed got %d\n",
ret);
3005 overwritten_bytes++;
3006 ok(overwritten_bytes == 0,
"GetDIBits wrote past the buffer given\n");
3016 *srcBuffer = 0xFEDCBA98;
3017 *dstBuffer = 0x89ABCDEF;
3020 "BitBlt with dwRop %06X. Expected 0x%08X, got 0x%08X from line %d\n",
3029 UINT32 *dstBuffer, *srcBuffer;
3030 HBRUSH hBrush, hOldBrush;
3093 *srcBuffer = 0xFEDCBA98;
3094 *dstBuffer = 0x89ABCDEF;
3095 StretchBlt(
hdcDst, 0, 0, 2, 1,
hdcSrc, 0, 0, 1, 1, dwRop);
3097 "StretchBlt with dwRop %06X. Expected 0x%08X, got 0x%08X from line %d\n",
3102 int nXOriginDest,
int nYOriginDest,
int nWidthDest,
int nHeightDest,
3103 int nXOriginSrc,
int nYOriginSrc,
int nWidthSrc,
int nHeightSrc,
3108 memset(dstBuffer, 0, dst_size);
3110 hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
SRCCOPY);
3112 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X } "
3113 "stretching { %d, %d, %d, %d } to { %d, %d, %d, %d } from line %d\n",
3115 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3],
3116 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
3117 nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
line);
3125 UINT32 *dstBuffer, *srcBuffer;
3126 HBRUSH hBrush, hOldBrush;
3176 srcBuffer[0] = 0xCAFED00D, srcBuffer[1] = 0xFEEDFACE;
3177 srcBuffer[16] = 0xFEDCBA98, srcBuffer[17] = 0x76543210;
3183 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3188 0, 0, 1, 1, 0, 0, 1, 1,
expected, __LINE__);
3193 0, 0, 2, 2, 0, 0, 1, 1,
expected, __LINE__);
3199 0, 0, 1, 1, 0, 0, 2, 2,
expected, __LINE__);
3204 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3209 1, 1, -2, -2, 0, 0, 2, 2,
expected, __LINE__);
3214 1, 1, -2, -2, 1, 1, -2, -2,
expected, __LINE__);
3221 1, 1, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3225 srcBuffer[0] = 0x0000ff00, srcBuffer[1] = 0x0000f0f0, srcBuffer[2] = 0x0000cccc, srcBuffer[3] = 0x0000aaaa;
3226 srcBuffer[16] = 0xFEDCBA98, srcBuffer[17] = 0x76543210;
3231 0, 0, 1, 1, 0, 0, 2, 1,
expected, __LINE__);
3233 expected[0] = srcBuffer[0] & srcBuffer[1];
3235 0, 0, 1, 1, 0, 0, 3, 1,
expected, __LINE__);
3237 expected[0] = srcBuffer[0] & srcBuffer[1] & srcBuffer[2];
3239 0, 0, 1, 1, 0, 0, 4, 1,
expected, __LINE__);
3242 expected[0] = srcBuffer[1] & srcBuffer[2];
3244 0, 0, 1, 1, 2, 0, -2, 1,
expected, __LINE__);
3247 expected[0] = srcBuffer[0] & srcBuffer[1],
expected[1] = srcBuffer[2] & srcBuffer[3];
3249 0, 0, 2, 1, 0, 0, 4, 1,
expected, __LINE__);
3255 0, 0, 1, 1, 0, 0, 1, 2,
expected, __LINE__);
3262 expected[0] = srcBuffer[0] & srcBuffer[1] & srcBuffer[2];
3264 0, 0, 2, 2, 0, 0, 4, 1,
expected, __LINE__);
3272 srcBuffer[0] = 0xCAFED00D, srcBuffer[1] = 0xFEEDFACE;
3273 srcBuffer[16] = 0xFEDCBA98, srcBuffer[17] = 0x76543210;
3285 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3290 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3299 srcBuffer[224] = 0xCAFED00D, srcBuffer[225] = 0xFEEDFACE;
3300 srcBuffer[240] = 0xFEDCBA98, srcBuffer[241] = 0x76543210;
3308 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3313 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3328 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3333 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3347 StretchBlt(
hdcSrc, 0, 0, 4, 1,
hdcDst, 0, 0, 4, 1,
SRCCOPY );
3348 memset(dstBuffer, 0x55, 4 *
sizeof(*dstBuffer));
3349 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
3353 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
3355 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
3360 memset(dstBuffer, 0x55, 4 *
sizeof(*dstBuffer));
3361 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
3365 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
3367 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
3375 *((
DWORD *)colors + 0) = 0x123456;
3376 *((
DWORD *)colors + 1) = 0x335577;
3378 srcBuffer[0] = 0x55555555;
3379 memset(dstBuffer, 0xcc, 4 *
sizeof(*dstBuffer));
3382 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
3386 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
3388 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
3399 memset(dstBuffer, 0xcc, 4 *
sizeof(*dstBuffer));
3402 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
3406 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
3408 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
3437 *dstBuffer = 0x89ABCDEF;
3439 StretchDIBits(
hdcDst, 0, 0, 2, 1, 0, 0, 1, 1, &
buffer, &bitmapInfo,
DIB_RGB_COLORS, dwRop);
3441 "StretchDIBits with dwRop %06X. Expected 0x%08X, got 0x%08X from line %d\n",
3446 int nXOriginDest,
int nYOriginDest,
int nWidthDest,
int nHeightDest,
3447 int nXOriginSrc,
int nYOriginSrc,
int nWidthSrc,
int nHeightSrc,
3461 memset(dstBuffer, 0, 16);
3463 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
3466 "StretchDIBits expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X } "
3467 "stretching { %d, %d, %d, %d } to { %d, %d, %d, %d } from line %d\n",
3469 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3],
3470 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
3471 nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
line);
3480 UINT32 *dstBuffer, srcBuffer[4];
3481 HBRUSH hBrush, hOldBrush;
3525 srcBuffer[0] = 0xCAFED00D, srcBuffer[1] = 0xFEEDFACE;
3526 srcBuffer[2] = 0xFEDCBA98, srcBuffer[3] = 0x76543210;
3531 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3532 ok(
ret == 2,
"got ret %d\n",
ret );
3537 0, 0, 1, 1, 0, 0, 1, 1,
expected, __LINE__);
3543 0, 0, 2, 2, 0, 0, 1, 1,
expected, __LINE__);
3544 ok(
ret == 2,
"got ret %d\n",
ret );
3549 0, 0, 1, 1, 0, 0, 2, 2,
expected, __LINE__);
3550 ok(
ret == 2,
"got ret %d\n",
ret );
3555 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3556 ok(
ret == 0,
"got ret %d\n",
ret );
3561 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3562 ok(
ret == 0,
"got ret %d\n",
ret );
3567 1, 1, -2, -2, 1, 1, -2, -2,
expected, __LINE__);
3568 ok(
ret == 0,
"got ret %d\n",
ret );
3573 1, 1, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3574 ok(
ret == 2,
"got ret %d\n",
ret );
3579 2, 2, 4, 4, 0, 0, 2, 2,
expected, __LINE__);
3580 ok(
ret == 2,
"got ret %d\n",
ret );
3585 -4, -4, 4, 4, 0, 0, 4, 4,
expected, __LINE__);
3586 ok(
ret == 2,
"got ret %d\n",
ret );
3600 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3623 if (!pGdiAlphaBlend)
3625 win_skip(
"GdiAlphaBlend() is not implemented\n");
3642 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3653 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3657 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -1, 0, 10, 10, blend);
3658 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3661 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, -1, 10, 10, blend);
3662 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3663 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 15, 0, 10, 10, blend);
3664 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3665 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 10, 10, -2, 3, blend);
3666 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3667 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 10, 10, -2, 3, blend);
3668 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3672 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -1, 0, 10, 10, blend);
3675 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, -1, 10, 10, blend);
3680 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -1, 0, 30, 30, blend);
3683 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, -1, 30, 30, blend);
3689 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, -1, 50, 50, blend);
3693 ret = pGdiAlphaBlend(
hdcDst, -20, -20, 20, 20,
hdcSrc, 0, -1, 50, 50, blend);
3696 ret = pGdiAlphaBlend(
hdcDst, -20, -20, -20, -20,
hdcSrc, 0, -1, 50, 50, blend);
3697 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3700 ret = pGdiAlphaBlend(
hdcDst, -20, 0, -20, 20,
hdcSrc, 0, -1, 50, 50, blend);
3701 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3704 ret = pGdiAlphaBlend(
hdcDst, 0, -20, 20, -20,
hdcSrc, 0, -1, 50, 50, blend);
3705 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3711 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -20, -20, -30, -30, blend);
3712 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3715 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -20, -20, 30, -30, blend);
3716 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3719 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -20, -20, -30, 30, blend);
3720 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3723 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -20, -20, 30, 30, blend);
3724 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3727 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 20, 20, 30, 30, blend);
3728 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3731 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -60, -60, 30, 30, blend);
3732 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3737 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
NULL, 0, 0, 20, 20, blend);
3738 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3744 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcDst, 19, 19, 20, 20, blend);
3745 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3749 ret = pGdiAlphaBlend(
hdcDst, 20, 20, 20, 20,
hdcDst, 1, 1, 20, 20, blend);
3750 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3754 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcDst, 20, 10, 20, 20, blend);
3755 ok(
ret,
"GdiAlphaBlend succeeded\n" );
3757 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcDst, 10, 20, 20, 20, blend);
3758 ok(
ret,
"GdiAlphaBlend succeeded\n" );
3764 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3772 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3777 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3785 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3790 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3791 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3797 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3802 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3803 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3808 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3813 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3814 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3818 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3823 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3824 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3844 GRADIENT_TRIANGLE tri[] = { { 0, 0, 0 }, { 0, 1, 2 }, { 0, 2, 1 }, { 0, 1, 3 } };
3845 TRIVERTEX vt[3] = { { 2, 2, 0xff00, 0x0000, 0x0000, 0x8000 },
3846 { 10, 10, 0x0000, 0xff00, 0x0000, 0x8000 },
3847 { 20, 10, 0x0000, 0x0000, 0xff00, 0xff00 } };
3849 if (!pGdiGradientFill)
3851 win_skip(
"GdiGradientFill is not implemented\n" );
3864 ok(
bmp !=
NULL,
"couldn't create bitmap\n" );
3868 ret = pGdiGradientFill(
hdc,
vt, 3,
rect, 1, GRADIENT_FILL_RECT_H );
3872 ok( !
ret,
"GdiGradientFill succeeded\n" );
3875 ret = pGdiGradientFill( (
HDC)0xdead,
vt, 3,
rect, 1, GRADIENT_FILL_RECT_H );
3876 ok( !
ret,
"GdiGradientFill succeeded\n" );
3879 ret = pGdiGradientFill(
NULL,
NULL, 0,
rect, 1, GRADIENT_FILL_RECT_H );
3880 ok( !
ret,
"GdiGradientFill succeeded\n" );
3882 ret = pGdiGradientFill(
hdc,
NULL, 0,
rect, 1, GRADIENT_FILL_RECT_H );
3883 ok( !
ret,
"GdiGradientFill succeeded\n" );
3886 ret = pGdiGradientFill(
hdc,
NULL, 3,
rect, 1, GRADIENT_FILL_RECT_H );
3887 ok( !
ret,
"GdiGradientFill succeeded\n" );
3890 ret = pGdiGradientFill(
hdc,
vt, 3,
NULL, 0, GRADIENT_FILL_RECT_H );
3891 ok( !
ret,
"GdiGradientFill succeeded\n" );
3894 ret = pGdiGradientFill(
hdc,
vt, 3,
NULL, 1, GRADIENT_FILL_RECT_H );
3895 ok( !
ret,
"GdiGradientFill succeeded\n" );
3898 ret = pGdiGradientFill(
hdc,
vt, 3,
rect, 0, GRADIENT_FILL_RECT_H );
3899 ok( !
ret,
"GdiGradientFill succeeded\n" );
3902 ret = pGdiGradientFill(
hdc,
vt, 3,
rect, 3, GRADIENT_FILL_RECT_H );
3903 ok( !
ret,
"GdiGradientFill succeeded\n" );
3905 rect[2].UpperLeft =
rect[2].LowerRight = 1;
3907 ret = pGdiGradientFill(
hdc,
vt, 3,
rect, 3, GRADIENT_FILL_RECT_H );
3910 ret = pGdiGradientFill(
hdc,
vt, 1,
rect, 1, GRADIENT_FILL_RECT_H );
3913 ret = pGdiGradientFill(
hdc,
vt, 1, tri, 0, GRADIENT_FILL_TRIANGLE );
3914 ok( !
ret,
"GdiGradientFill succeeded\n" );
3917 ret = pGdiGradientFill(
hdc,
vt, 1, tri, 1, GRADIENT_FILL_TRIANGLE );
3920 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 2, GRADIENT_FILL_TRIANGLE );
3923 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 3, GRADIENT_FILL_TRIANGLE );
3926 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE );
3927 ok( !
ret,
"GdiGradientFill succeeded\n" );
3931 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE );
3932 ok( !
ret,
"GdiGradientFill succeeded\n" );
3936 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE );
3937 ok( !
ret,
"GdiGradientFill succeeded\n" );
3941 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE );
3969 ok(bmpDst !=
NULL,
"Couldn't create destination bitmap\n");
3973 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
4001 DWORD colorSrc = 0x40201008;
4015 trace(
"Skipping 32-bit DDB test\n");
4027 StretchBlt(
hdcDst, 0, 0, 1, 1,
hdcSrc, 0, 0, 1, 1,
SRCCOPY);
4028 ok(dstBuffer[0] == colorSrc,
"Expected color=%x, received color=%x\n", colorSrc, dstBuffer[0]);
4039 dstBuffer[0] = 0x80808080;
4040 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 1, 1,
hdcSrc, 0, 0, 1, 1, blend );
4042 ok(dstBuffer[0] == 0x60504844,
"wrong color %x\n", dstBuffer[0]);
4044 dstBuffer[0] = 0x80808080;
4045 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 1, 1,
hdcSrc, 0, 0, 1, 1, blend );
4047 ok(dstBuffer[0] == 0x90807874,
"wrong color %x\n", dstBuffer[0]);
4051 data[0] = 0x20304050;
4053 ok( brush != 0,
"brush creation failed\n" );
4057 ok(dstBuffer[0] ==
data[0],
"Expected color=%x, received color=%x\n",
data[0], dstBuffer[0]);
4063 ok( brush != 0,
"brush creation failed\n" );
4067 ok(dstBuffer[0] == (
data[0] & ~0xff000000),
4068 "Expected color=%x, received color=%x\n",
data[0] & 0xff000000, dstBuffer[0]);
4096 for (
i = 0;
i < 4;
i++)
4118 memset( &bi, 0,
sizeof(bi) );
4128 ok(
hdc !=
NULL,
"Could not get a handle to a device context.\n");
4132 ok(bmpbt !=
NULL,
"Could not create a DIB section.\n");
4138 ok(bmptb !=
NULL,
"Could not create a DIB section.\n");
4146 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4148 ok((
char)pictureOut[0] == 0,
"Bottom-up -> bottom-up: first pixel should be 0 but was %d.\n", (
char)pictureOut[0]);
4150 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4151 ok((
char)pictureOut[0] == 2,
"Top-down -> bottom-up: first pixel should be 2 but was %d.\n", (
char)pictureOut[0]);
4154 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4155 ok((
char)pictureOut[0] == 0,
"Top-down -> bottom-up: first pixel should be 0 but was %d.\n", (
char)pictureOut[0]);
4157 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4158 ok((
char)pictureOut[0] == 2,
"Bottom-up -> bottom-up: first pixel should be 2 but was %d.\n", (
char)pictureOut[0]);
4161 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4162 ok((
char)pictureOut[0] == 2,
"Top-down -> bottom-up: first scanline should be 2 but was %d.\n", (
char)pictureOut[0]);
4163 ok((
char)pictureOut[1] == 0,
"Top-down -> bottom-up: second scanline should be 0 but was %d.\n", (
char)pictureOut[0]);
4165 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4166 ok((
char)pictureOut[0] == 0,
"Bottom up -> bottom-up: first scanline should be 0 but was %d.\n", (
char)pictureOut[0]);
4167 ok((
char)pictureOut[1] == 2,
"Bottom up -> bottom-up: second scanline should be 2 but was %d.\n", (
char)pictureOut[0]);
4172 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4173 ok((
char)pictureOut[0] == 0,
"Bottom-up -> top-down: first pixel should be 0 but was %d.\n", (
char)pictureOut[0]);
4175 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4176 ok((
char)pictureOut[0] == 2,
"Top-down -> top-down: first pixel should be 2 but was %d.\n", (
char)pictureOut[0]);
4179 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4180 ok((
char)pictureOut[0] == 0,
"Top-down -> bottom-up: first pixel should be 0 but was %d.\n", (
char)pictureOut[0]);
4182 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4183 ok((
char)pictureOut[0] == 2,
"Top-down -> bottom-up: first pixel should be 2 but was %d.\n", (
char)pictureOut[0]);
4186 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4187 ok((
char)pictureOut[0] == 0,
"Top-down -> top-down: first scanline should be 0 but was %d.\n", (
char)pictureOut[0]);
4188 ok((
char)pictureOut[1] == 2,
"Top-down -> top-down: second scanline should be 2 but was %d.\n", (
char)pictureOut[0]);
4190 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4191 ok((
char)pictureOut[0] == 2,
"Bottom up -> top-down: first scanline should be 2 but was %d.\n", (
char)pictureOut[0]);
4192 ok((
char)pictureOut[1] == 0,
"Bottom up -> top-down: second scanline should be 0 but was %d.\n", (
char)pictureOut[0]);
4204 DWORD bits_1[8 * 8], bits_2[8 * 8];
4208 win_skip(
"Don't have SetLayout\n");
4222 info.bmiHeader.biWidth = 8;
4223 info.bmiHeader.biHeight = 8;
4224 info.bmiHeader.biPlanes = 1;
4225 info.bmiHeader.biBitCount = 32;
4232 ok(bits_1[56] == 0xff0000,
"got %08x\n", bits_1[56]);
4239 ok(!
memcmp( bits_1, bits_2,
sizeof(bits_1) ),
"bits differ\n");
4250 ok(!
memcmp( bits_1, bits_2,
sizeof(bits_1) ),
"bits differ\n");
4258 ok(!
memcmp( bits_1, bits_2,
sizeof(bits_1) ),
"bits differ\n");
4276 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4277 info->bmiHeader.biWidth = 8;
4278 info->bmiHeader.biHeight = 8;
4279 info->bmiHeader.biPlanes = 1;
4280 info->bmiHeader.biBitCount = 32;
4285 for (
i = 0;
i < 64;
i++)
4288 inverted_bits[56 - (
i & ~7) + (
i & 7)] =
i;
4297 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4302 ok( !
memcmp(
data, dib_bits + 8, 40 * 4 ),
"bits differ\n");
4303 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4308 ok( !
memcmp(
data, dib_bits + 8, 56 * 4 ),
"bits differ\n");
4309 for (
i = 56;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4314 for (
i = 0;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4317 info->bmiHeader.biHeight = 16;
4318 info->bmiHeader.biSizeImage = 0;
4321 ok(
info->bmiHeader.biSizeImage == 128 * 4,
"got %d\n",
info->bmiHeader.biSizeImage );
4323 ok( !
memcmp(
data + 56, dib_bits, 40 * 4 ),
"bits differ\n");
4324 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4330 ok( !
memcmp(
data + 48, dib_bits, 48 * 4 ),
"bits differ\n");
4331 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4337 for (
i = 24;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4340 info->bmiHeader.biHeight = 5;
4343 ok( !
memcmp(
data, dib_bits + 32, 16 * 4 ),
"bits differ\n");
4344 for (
i = 16;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4349 info->bmiHeader.biHeight = -8;
4352 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4357 ok( !
memcmp(
data, inverted_bits + 16, 40 * 4 ),
"bits differ\n");
4358 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4363 ok( !
memcmp(
data, inverted_bits, 56 * 4 ),
"bits differ\n");
4364 for (
i = 56;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4369 ok( !
memcmp(
data, inverted_bits, 32 * 4 ),
"bits differ\n");
4370 for (
i = 32;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4375 ok( !
memcmp(
data, inverted_bits, 40 * 4 ),
"bits differ\n");
4376 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4381 ok( !
memcmp(
data, inverted_bits, 40 * 4 ),
"bits differ\n");
4382 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4385 info->bmiHeader.biHeight = -16;
4388 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4389 for (
i = 64;
i < 128;
i++)
ok(
data[
i] == 0,
"%d: got %08x\n",
i,
data[
i] );
4394 ok( !
memcmp(
data, inverted_bits + 24, 40 * 4 ),
"bits differ\n");
4395 for (
i = 40;
i < 96;
i++)
ok(
data[
i] == 0,
"%d: got %08x\n",
i,
data[
i] );
4396 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4401 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4402 for (
i = 64;
i < 96;
i++)
ok(
data[
i] == 0,
"%d: got %08x\n",
i,
data[
i] );
4403 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4408 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4409 for (
i = 64;
i < 88;
i++)
ok(
data[
i] == 0,
"%d: got %08x\n",
i,
data[
i] );
4410 for (
i = 88;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4415 ok( !
memcmp(
data, inverted_bits, 56 * 4 ),
"bits differ\n");
4416 for (
i = 56;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4421 for (
i = 0;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4424 info->bmiHeader.biHeight = -5;
4427 ok( !
memcmp(
data, inverted_bits + 16, 16 * 4 ),
"bits differ\n");
4428 for (
i = 16;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4433 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4434 info->bmiHeader.biWidth = 8;
4435 info->bmiHeader.biHeight = -8;
4436 info->bmiHeader.biPlanes = 1;
4437 info->bmiHeader.biBitCount = 32;
4442 for (
i = 0;
i < 64;
i++) dib_bits[
i] =
i;
4446 info->bmiHeader.biHeight = -8;
4449 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4454 ok( !
memcmp(
data, dib_bits + 16, 40 * 4 ),
"bits differ\n");
4455 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4460 ok( !
memcmp(
data, dib_bits, 56 * 4 ),
"bits differ\n");
4461 for (
i = 56;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4466 ok( !
memcmp(
data, dib_bits, 32 * 4 ),
"bits differ\n");
4467 for (
i = 32;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4472 ok( !
memcmp(
data, dib_bits, 40 * 4 ),
"bits differ\n");
4473 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4478 ok( !
memcmp(
data, dib_bits, 40 * 4 ),
"bits differ\n");
4479 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4482 info->bmiHeader.biHeight = -16;
4485 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4486 for (
i = 64;
i < 128;
i++)
ok(
data[
i] == 0,
"%d: got %08x\n",
i,
data[
i] );
4491 ok( !
memcmp(
data, dib_bits + 24, 40 * 4 ),
"bits differ\n");
4492 for (
i = 40;
i < 96;
i++)
ok(
data[
i] == 0,
"%d: got %08x\n",
i,
data[
i] );
4493 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4498 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4499 for (
i = 64;
i < 96;
i++)
ok(
data[
i] == 0,
"%d: got %08x\n",
i,
data[
i] );
4500 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4505 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4506 for (
i = 64;
i < 88;
i++)
ok(
data[
i] == 0,
"%d: got %08x\n",
i,
data[
i] );
4507 for (
i = 88;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4512 ok( !
memcmp(
data, dib_bits, 56 * 4 ),
"bits differ\n");
4513 for (
i = 56;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4516 info->bmiHeader.biHeight = -5;
4519 ok( !
memcmp(
data, dib_bits + 16, 16 * 4 ),
"bits differ\n");
4520 for (
i = 16;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4526 info->bmiHeader.biHeight = 8;
4530 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4535 ok( !
memcmp(
data, inverted_bits + 8, 40 * 4 ),
"bits differ\n");
4536 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4541 ok( !
memcmp(
data, inverted_bits + 8, 56 * 4 ),
"bits differ\n");
4542 for (
i = 56;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4547 for (
i = 0;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4550 info->bmiHeader.biHeight = 16;
4554 ok( !
memcmp(
data + 56, inverted_bits, 40 * 4 ),
"bits differ\n");
4555 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4561 ok( !
memcmp(
data + 48, inverted_bits, 48 * 4 ),
"bits differ\n");
4562 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4568 for (
i = 24;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4571 info->bmiHeader.biHeight = 5;
4574 ok( !
memcmp(
data, inverted_bits + 32, 16 * 4 ),
"bits differ\n");
4575 for (
i = 16;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i,
data[
i] );
4599 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4600 info->bmiHeader.biWidth = 8;
4601 info->bmiHeader.biHeight = 8;
4602 info->bmiHeader.biPlanes = 1;
4603 info->bmiHeader.biBitCount = 32;
4607 memset( dib_bits, 0xaa, 64 * 4 );
4609 for (
i = 0;
i < 128;
i++)
4612 inverted_data[120 - (
i & ~7) + (
i & 7)] =
i;
4619 ok( !
memcmp( dib_bits,
data, 64 * 4 ),
"bits differ\n");
4620 memset( dib_bits, 0xaa, 64 * 4 );
4624 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4625 ok( !
memcmp( dib_bits + 8,
data, 40 * 4 ),
"bits differ\n");
4626 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4627 memset( dib_bits, 0xaa, 64 * 4 );
4632 info->bmiHeader.biHeight = 16;
4635 ok( !
memcmp( dib_bits,
data + 56, 40 * 4 ),
"bits differ\n");
4636 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4637 memset( dib_bits, 0xaa, 64 * 4 );
4639 info->bmiHeader.biHeight = 5;
4642 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4643 ok( !
memcmp( dib_bits + 32,
data, 16 * 4 ),
"bits differ\n");
4644 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4645 memset( dib_bits, 0xaa, 64 * 4 );
4648 info->bmiHeader.biHeight = -8;
4651 ok( !
memcmp( dib_bits, inverted_data + 64, 64 * 4 ),
"bits differ\n");
4652 memset( dib_bits, 0xaa, 64 * 4 );
4659 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4660 ok( !
memcmp( dib_bits + 8, inverted_data + 88, 40 * 4 ),
"bits differ\n");
4661 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4662 memset( dib_bits, 0xaa, 64 * 4 );
4664 info->bmiHeader.biHeight = -16;
4667 ok( !
memcmp( dib_bits, inverted_data + 88, 40 * 4 ),
"bits differ\n");
4668 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4669 memset( dib_bits, 0xaa, 64 * 4 );
4673 ok( !
memcmp( dib_bits, inverted_data + 64, 64 * 4 ),
"bits differ\n");
4674 memset( dib_bits, 0xaa, 64 * 4 );
4678 ok( !
memcmp( dib_bits, inverted_data + 56, 64 * 4 ),
"bits differ\n");
4679 memset( dib_bits, 0xaa, 64 * 4 );
4681 info->bmiHeader.biHeight = -5;
4684 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4685 ok( !
memcmp( dib_bits + 32, inverted_data + 112, 16 * 4 ),
"bits differ\n");
4686 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4687 memset( dib_bits, 0xaa, 64 * 4 );
4691 info->bmiHeader.biHeight = -8;
4694 memset( dib_bits, 0xaa, 16 * 16 * 4 );
4702 ok( !
memcmp( dib_bits,
data, 64 * 4 ),
"bits differ\n");
4703 memset( dib_bits, 0xaa, 64 * 4 );
4707 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4708 ok( !
memcmp( dib_bits + 16,
data, 40 * 4 ),
"bits differ\n");
4709 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4710 memset( dib_bits, 0xaa, 64 * 4 );
4712 info->bmiHeader.biHeight = -16;
4715 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4716 ok( !
memcmp( dib_bits + 24,
data, 40 * 4 ),
"bits differ\n");
4717 memset( dib_bits, 0xaa, 64 * 4 );
4719 info->bmiHeader.biHeight = -5;
4722 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4723 ok( !
memcmp( dib_bits + 16,
data, 16 * 4 ),
"bits differ\n");
4724 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4725 memset( dib_bits, 0xaa, 64 * 4 );
4730 info->bmiHeader.biHeight = 8;
4733 ok( !
memcmp( dib_bits, inverted_data + 64, 64 * 4 ),
"bits differ\n");
4734 memset( dib_bits, 0xaa, 64 * 4 );
4738 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4739 ok( !
memcmp( dib_bits + 16, inverted_data + 88, 40 * 4 ),
"bits differ\n");
4740 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4741 memset( dib_bits, 0xaa, 64 * 4 );
4743 info->bmiHeader.biHeight = 16;
4746 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4747 ok( !
memcmp( dib_bits + 24, inverted_data + 32, 40 * 4 ),
"bits differ\n");
4748 memset( dib_bits, 0xaa, 64 * 4 );
4750 info->bmiHeader.biHeight = 5;
4753 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4754 ok( !
memcmp( dib_bits + 16, inverted_data + 112, 16 * 4 ),
"bits differ\n");
4755 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4756 memset( dib_bits, 0xaa, 64 * 4 );
4760 info->bmiHeader.biHeight = -8;
4761 info->bmiHeader.biBitCount = 8;
4762 info->bmiHeader.biClrUsed = 137;
4763 for (
i = 0;
i < 256;
i++)
4765 info->bmiColors[
i].rgbRed = 255 -
i;
4766 info->bmiColors[
i].rgbGreen =
i * 2;
4767 info->bmiColors[
i].rgbBlue =
i;
4768 info->bmiColors[
i].rgbReserved = 0;
4773 for (
i = 0;
i < 64;
i++)
4775 int idx =
i * 4 + 1;
4777 info->bmiColors[
idx].rgbGreen << 8 |
4778 info->bmiColors[
idx].rgbBlue);
4779 ok( dib_bits[
i] ==
expect,
"%d: got %08x instead of %08x\n",
i, dib_bits[
i],
expect );
4781 memset( dib_bits, 0xaa, 64 * 4 );
4787 info->bmiHeader.biClrUsed = 221;
4788 for (
i = 0;
i < 256;
i++)
4795 ok(
palette != 0,
"palette creation failed\n" );
4797 for (
i = 0;
i < 256;
i++) ((
WORD *)
info->bmiColors)[
i] = 255 -
i;
4800 for (
i = 0;
i < 64;
i++)
4802 int idx =
i * 4 + 1;
4807 "%d: got %08x instead of %08x\n",
i, dib_bits[
i],
expect );
4809 memset( dib_bits, 0xaa, 64 * 4 );
4822 BYTE rle4_data[26] = { 0x03, 0x52, 0x07, 0x68, 0x00, 0x00,
4823 0x00, 0x03, 0x14, 0x50, 0x00, 0x05,
4824 0x79, 0xfd, 0xb0, 0x00, 0x00, 0x00,
4825 0x00, 0x02, 0x01, 0x02, 0x05, 0x87,
4829 DWORD bottom_up[64] = { 0x00050505, 0x00020202, 0x00050505, 0x00060606, 0x00080808, 0x00060606, 0x00080808, 0x00060606,
4830 0x00010101, 0x00040404, 0x00050505, 0x00070707, 0x00090909, 0x000f0f0f, 0x000d0d0d, 0x000b0b0b,
4831 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4832 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4833 0xaaaaaaaa, 0x00080808, 0x00070707, 0x00080808, 0x00070707, 0x00080808, 0xaaaaaaaa, 0xaaaaaaaa,
4834 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4835 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4836 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa };
4840 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4841 info->bmiHeader.biWidth = 8;
4842 info->bmiHeader.biHeight = 8;
4843 info->bmiHeader.biPlanes = 1;
4844 info->bmiHeader.biBitCount = 32;
4848 memset( dib_bits, 0xaa, 64 * 4 );
4850 info->bmiHeader.biBitCount = 4;
4852 info->bmiHeader.biSizeImage =
sizeof(rle4_data);
4854 for (
i = 0;
i < 16;
i++)
4856 info->bmiColors[
i].rgbRed =
i;
4857 info->bmiColors[
i].rgbGreen =
i;
4858 info->bmiColors[
i].rgbBlue =
i;
4859 info->bmiColors[
i].rgbReserved = 0;
4864 ok( !
memcmp( dib_bits, bottom_up,
sizeof(bottom_up) ),
"bits differ\n" );
4865 memset( dib_bits, 0xaa, 64 * 4 );
4878 0x00, 0x03, 0x04, 0x05, 0x06, 0x00,
4879 0x00, 0x02, 0x01, 0x02, 0x05, 0x80,
4883 DWORD bottom_up[64] = { 0x00020202, 0x00020202, 0x00020202, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0xaaaaaaaa,
4884 0x00040404, 0x00050505, 0x00060606, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4885 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4886 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x00808080, 0x00808080, 0x00808080, 0x00808080,
4887 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4888 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4889 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4890 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa };
4891 DWORD top_down[64] = { 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4892 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4893 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4894 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4895 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x00808080, 0x00808080, 0x00808080, 0x00808080,
4896 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4897 0x00040404, 0x00050505, 0x00060606, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4898 0x00020202, 0x00020202, 0x00020202, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0xaaaaaaaa };
4902 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4903 info->bmiHeader.biWidth = 8;
4904 info->bmiHeader.biHeight = 8;
4905 info->bmiHeader.biPlanes = 1;
4906 info->bmiHeader.biBitCount = 32;
4910 memset( dib_bits, 0xaa, 64 * 4 );
4912 info->bmiHeader.biBitCount = 8;
4916 for (
i = 0;
i < 256;
i++)
4918 info->bmiColors[
i].rgbRed =
i;
4919 info->bmiColors[
i].rgbGreen =
i;
4920 info->bmiColors[
i].rgbBlue =
i;
4921 info->bmiColors[
i].rgbReserved = 0;
4926 ok( !
memcmp( dib_bits, bottom_up,
sizeof(bottom_up) ),
"bits differ\n");
4927 memset( dib_bits, 0xaa, 64 * 4 );
4932 ok( !
memcmp( dib_bits, bottom_up,
sizeof(bottom_up) ),
"bits differ\n");
4933 memset( dib_bits, 0xaa, 64 * 4 );
4937 ok( !
memcmp( dib_bits, bottom_up,
sizeof(bottom_up) ),
"bits differ\n");
4938 memset( dib_bits, 0xaa, 64 * 4 );
4942 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4943 memset( dib_bits, 0xaa, 64 * 4 );
4946 info->bmiHeader.biWidth = 4;
4949 for (
i = 0;
i < 64;
i++)
4952 ok( dib_bits[
i] ==
expect,
"%d: got %08x\n",
i, dib_bits[
i] );
4954 memset( dib_bits, 0xaa, 64 * 4 );
4959 info->bmiHeader.biWidth = 8;
4960 info->bmiHeader.biHeight = 4;
4963 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
4964 ok( !
memcmp( dib_bits + 32, bottom_up, 32 * 4 ),
"bits differ\n");
4965 memset( dib_bits, 0xaa, 64 * 4 );
4968 info->bmiHeader.biHeight = 9;
4971 ok( !
memcmp( dib_bits, bottom_up + 8, 56 * 4 ),
"bits differ\n");
4972 for (
i = 0;
i < 8;
i++)
ok( dib_bits[56 +
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[56 +
i] );
4973 memset( dib_bits, 0xaa, 64 * 4 );
4976 info->bmiHeader.biHeight = -8;
4985 info->bmiHeader.biHeight = -8;
4986 info->bmiHeader.biBitCount = 32;
4988 info->bmiHeader.biSizeImage = 0;
4991 memset( dib_bits, 0xaa, 16 * 16 * 4 );
4993 info->bmiHeader.biHeight = 8;
4994 info->bmiHeader.biBitCount = 8;
5000 ok( !
memcmp( dib_bits, top_down,
sizeof(top_down) ),
"bits differ\n");
5001 memset( dib_bits, 0xaa, 64 * 4 );
5003 info->bmiHeader.biHeight = 4;
5006 ok( !
memcmp( dib_bits, top_down + 32, 32 * 4 ),
"bits differ\n");
5007 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5008 memset( dib_bits, 0xaa, 64 * 4 );
5010 info->bmiHeader.biHeight = 9;
5013 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5014 ok( !
memcmp( dib_bits + 8, top_down, 56 * 4 ),
"bits differ\n");
5015 memset( dib_bits, 0xaa, 64 * 4 );
5037 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
5038 info->bmiHeader.biWidth = 8;
5039 info->bmiHeader.biHeight = 8;
5040 info->bmiHeader.biPlanes = 1;
5041 info->bmiHeader.biBitCount = 32;
5045 memset( dib_bits, 0xaa, 64 * 4 );
5048 for (
i = 0;
i < 128;
i++)
5051 inverted_data[120 - (
i & ~7) + (
i & 7)] =
i;
5056 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5058 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] ==
data[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5059 memset( dib_bits, 0xaa, 64 * 4 );
5061 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 5,
data,
info,
DIB_RGB_COLORS );
5063 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5064 for (
i = 8;
i < 48;
i++)
ok( dib_bits[
i] ==
data[
i - 8],
"%d: got %08x\n",
i, dib_bits[
i] );
5065 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5066 memset( dib_bits, 0xaa, 64 * 4 );
5068 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 3, 1, 5,
data,
info,
DIB_RGB_COLORS );
5070 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] ==
data[
i + 16],
"%d: got %08x\n",
i, dib_bits[
i] );
5071 for (
i = 24;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5072 memset( dib_bits, 0xaa, 64 * 4 );
5074 info->bmiHeader.biHeight = 16;
5075 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 12,
data,
info,
DIB_RGB_COLORS );
5077 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5078 for (
i = 8;
i < 64;
i++)
ok( dib_bits[
i] ==
data[
i - 8],
"%d: got %08x\n",
i, dib_bits[
i] );
5079 memset( dib_bits, 0xaa, 64 * 4 );
5081 ret =
SetDIBitsToDevice(
hdc, 0, 2, 8, 8, 0, 6, 1, 12,
data,
info,
DIB_RGB_COLORS );
5083 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] ==
data[
i + 56],
"%d: got %08x\n",
i, dib_bits[
i] );
5084 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5085 memset( dib_bits, 0xaa, 64 * 4 );
5087 ret =
SetDIBitsToDevice(
hdc, 0, -4, 8, 8, 0, 3, 1, 12,
data,
info,
DIB_RGB_COLORS );
5089 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5090 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] ==
data[
i - 16],
"%d: got %08x\n",
i, dib_bits[
i] );
5091 memset( dib_bits, 0xaa, 64 * 4 );
5093 ret =
SetDIBitsToDevice(
hdc, 0, 4, 8, 8, 0, -3, 1, 12,
data,
info,
DIB_RGB_COLORS );
5095 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] ==
data[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5096 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5097 memset( dib_bits, 0xaa, 64 * 4 );
5099 ret =
SetDIBitsToDevice(
hdc, 0, 2, 8, 5, 0, -2, 1, 12,
data,
info,
DIB_RGB_COLORS );
5101 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5102 for (
i = 32;
i < 48;
i++)
ok( dib_bits[
i] ==
data[
i - 32],
"%d: got %08x\n",
i, dib_bits[
i] );
5103 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5104 memset( dib_bits, 0xaa, 64 * 4 );
5106 info->bmiHeader.biHeight = 5;
5107 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 2, 2,
data,
info,
DIB_RGB_COLORS );
5109 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5110 for (
i = 16;
i < 32;
i++)
ok( dib_bits[
i] ==
data[
i - 16],
"%d: got %08x\n",
i, dib_bits[
i] );
5111 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5112 memset( dib_bits, 0xaa, 64 * 4 );
5114 ret =
SetDIBitsToDevice(
hdc, 3, 3, 2, 2, 1, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5116 for (
i = 0;
i < 64;
i++)
5117 if (
i == 27 ||
i == 28 ||
i == 35 ||
i == 36)
5118 ok( dib_bits[
i] ==
data[
i - 18],
"%d: got %08x\n",
i, dib_bits[
i] );
5120 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5121 memset( dib_bits, 0xaa, 64 * 4 );
5123 ret =
SetDIBitsToDevice(
hdc, 0, 0, 16, 16, 0, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5125 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5126 memset( dib_bits, 0xaa, 64 * 4 );
5128 ret =
SetDIBitsToDevice(
hdc, 0, 2, 8, 4, 0, -1, 3, 12,
data,
info,
DIB_RGB_COLORS );
5130 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5131 memset( dib_bits, 0xaa, 64 * 4 );
5135 ret =
SetDIBitsToDevice(
hdc, 2, 2, 2, 2, 1, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5137 for (
i = 0;
i < 64;
i++)
5138 if (
i == 41 ||
i == 42 ||
i == 49 ||
i == 50)
5139 ok( dib_bits[
i] ==
data[
i - 32],
"%d: got %08x\n",
i, dib_bits[
i] );
5141 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5142 memset( dib_bits, 0xaa, 64 * 4 );
5145 ret =
SetDIBitsToDevice(
hdc, 2, 2, 4, 4, 1, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5147 for (
i = 0;
i < 64;
i++)
5148 if (
i == 48 ||
i == 49 ||
i == 56 ||
i == 57)
5149 ok( dib_bits[
i] ==
data[
i - 37],
"%d: got %08x\n",
i, dib_bits[
i] );
5151 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5152 memset( dib_bits, 0xaa, 64 * 4 );
5158 ret =
SetDIBitsToDevice(
hdc, 1, 2, 3, 2, 1, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5160 for (
i = 0;
i < 64;
i++)
5161 if (
i == 36 ||
i == 37 ||
i == 38 ||
i == 44 ||
i == 45 ||
i == 46)
5162 ok( dib_bits[
i] ==
data[
i - 27],
"%d: got %08x\n",
i, dib_bits[
i] );
5164 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5165 memset( dib_bits, 0xaa, 64 * 4 );
5170 info->bmiHeader.biHeight = -8;
5171 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5173 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i + 64],
"%d: got %08x\n",
i, dib_bits[
i] );
5174 memset( dib_bits, 0xaa, 64 * 4 );
5176 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 5,
data,
info,
DIB_RGB_COLORS );
5178 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5179 for (
i = 8;
i < 48;
i++)
ok( dib_bits[
i] == inverted_data[
i + 80],
"%d: got %08x\n",
i, dib_bits[
i] );
5180 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5181 memset( dib_bits, 0xaa, 64 * 4 );
5183 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 4, 1, 5,
data,
info,
DIB_RGB_COLORS );
5185 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == inverted_data[
i + 112],
"%d: got %08x\n",
i, dib_bits[
i] );
5186 for (
i = 16;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5187 memset( dib_bits, 0xaa, 64 * 4 );
5189 info->bmiHeader.biHeight = -16;
5190 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 12,
data,
info,
DIB_RGB_COLORS );
5192 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5193 for (
i = 8;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i + 24],
"%d: got %08x\n",
i, dib_bits[
i] );
5194 memset( dib_bits, 0xaa, 64 * 4 );
5196 ret =
SetDIBitsToDevice(
hdc, 0, 4, 8, 8, 0, 7, 1, 12,
data,
info,
DIB_RGB_COLORS );
5198 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == inverted_data[
i + 112],
"%d: got %08x\n",
i, dib_bits[
i] );
5199 for (
i = 16;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5200 memset( dib_bits, 0xaa, 64 * 4 );
5202 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 4, 12,
data,
info,
DIB_RGB_COLORS );
5204 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5205 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5206 memset( dib_bits, 0xaa, 64 * 4 );
5208 ret =
SetDIBitsToDevice(
hdc, 0, -3, 8, 8, 0, 2, 4, 12,
data,
info,
DIB_RGB_COLORS );
5210 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5211 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i - 8],
"%d: got %08x\n",
i, dib_bits[
i] );
5212 memset( dib_bits, 0xaa, 64 * 4 );
5214 ret =
SetDIBitsToDevice(
hdc, 0, 3, 8, 8, 0, -2, 4, 12,
data,
info,
DIB_RGB_COLORS );
5216 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5217 for (
i = 24;
i < 40;
i++)
ok( dib_bits[
i] == inverted_data[
i + 8],
"%d: got %08x\n",
i, dib_bits[
i] );
5218 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5219 memset( dib_bits, 0xaa, 64 * 4 );
5221 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 5, 12,
data,
info,
DIB_RGB_COLORS );
5223 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5224 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i - 8],
"%d: got %08x\n",
i, dib_bits[
i] );
5225 memset( dib_bits, 0xaa, 64 * 4 );
5227 ret =
SetDIBitsToDevice(
hdc, 0, 2, 8, 4, 0, -1, 3, 12,
data,
info,
DIB_RGB_COLORS );
5229 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5230 memset( dib_bits, 0xaa, 64 * 4 );
5232 ret =
SetDIBitsToDevice(
hdc, 5, -7, 8, 16, -2, -4, 0, 12,
data,
info,
DIB_RGB_COLORS );
5234 for (
i = 0;
i < 64;
i++)
5235 if (
i == 31 ||
i == 39 ||
i == 47 ||
i == 55 ||
i == 63)
5236 ok( dib_bits[
i] == inverted_data[
i + 1],
"%d: got %08x\n",
i, dib_bits[
i] );
5238 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5239 memset( dib_bits, 0xaa, 64 * 4 );
5241 info->bmiHeader.biHeight = -5;
5242 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 2,
data,
info,
DIB_RGB_COLORS );
5244 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5245 for (
i = 8;
i < 24;
i++)
ok( dib_bits[
i] == inverted_data[
i + 104],
"%d: got %08x\n",
i, dib_bits[
i] );
5246 for (
i = 24;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5247 memset( dib_bits, 0xaa, 64 * 4 );
5249 ret =
SetDIBitsToDevice(
hdc, 5, 4, 2, 2, 6, 3, 1, 5,
data,
info,
DIB_RGB_COLORS );
5251 for (
i = 0;
i < 64;
i++)
5252 if (
i == 21 ||
i == 22 ||
i == 29 ||
i == 30)
5253 ok( dib_bits[
i] == inverted_data[
i + 89],
"%d: got %08x\n",
i, dib_bits[
i] );
5255 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5256 memset( dib_bits, 0xaa, 64 * 4 );
5258 ret =
SetDIBitsToDevice(
hdc, 0, 0, 16, 16, 0, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5260 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5261 memset( dib_bits, 0xaa, 64 * 4 );
5263 info->bmiHeader.biHeight = -8;
5267 memset( dib_bits, 0xaa, 16 * 16 * 4 );
5271 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5273 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] ==
data[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5274 memset( dib_bits, 0xaa, 64 * 4 );
5276 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 5,
data,
info,
DIB_RGB_COLORS );
5278 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5279 for (
i = 16;
i < 56;
i++)
ok( dib_bits[
i] ==
data[
i - 16],
"%d: got %08x\n",
i, dib_bits[
i] );
5280 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5281 memset( dib_bits, 0xaa, 64 * 4 );
5283 ret =
SetDIBitsToDevice(
hdc, 0, 3, 8, 3, 0, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5285 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5286 for (
i = 24;
i < 48;
i++)
ok( dib_bits[
i] ==
data[
i - 16],
"%d: got %08x\n",
i, dib_bits[
i] );
5287 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5288 memset( dib_bits, 0xaa, 64 * 4 );
5290 info->bmiHeader.biHeight = -16;
5291 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 12,
data,
info,
DIB_RGB_COLORS );
5293 for (
i = 0;
i < 56;
i++)
ok( dib_bits[
i] ==
data[
i + 40],
"%d: got %08x\n",
i, dib_bits[
i] );
5294 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5295 memset( dib_bits, 0xaa, 64 * 4 );
5297 ret =
SetDIBitsToDevice(
hdc, 5, -7, 8, 16, -1, -8, 0, 12,
data,
info,
DIB_RGB_COLORS );
5299 for (
i = 0;
i < 64;
i++)
5300 if (
i == 6 ||
i == 7)
5301 ok( dib_bits[
i] ==
data[
i + 82],
"%d: got %08x\n",
i, dib_bits[
i] );
5303 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5304 memset( dib_bits, 0xaa, 64 * 4 );
5306 info->bmiHeader.biHeight = -5;
5307 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 2,
data,
info,
DIB_RGB_COLORS );
5309 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5310 for (
i = 40;
i < 56;
i++)
ok( dib_bits[
i] ==
data[
i - 40],
"%d: got %08x\n",
i, dib_bits[
i] );
5311 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5312 memset( dib_bits, 0xaa, 64 * 4 );
5314 ret =
SetDIBitsToDevice(
hdc, 7, 2, 8, 8, 1, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5316 for (
i = 0;
i < 64;
i++)
5317 if (
i == 47 ||
i == 55 ||
i == 63)
5318 ok( dib_bits[
i] ==
data[
i - 46],
"%d: got %08x\n",
i, dib_bits[
i] );
5320 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5321 memset( dib_bits, 0xaa, 64 * 4 );
5323 ret =
SetDIBitsToDevice(
hdc, 0, 0, 16, 16, 0, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5325 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5326 memset( dib_bits, 0xaa, 64 * 4 );
5330 info->bmiHeader.biHeight = 8;
5331 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5333 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i + 64],
"%d: got %08x\n",
i, dib_bits[
i] );
5334 memset( dib_bits, 0xaa, 64 * 4 );
5336 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 5,
data,
info,
DIB_RGB_COLORS );
5338 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5339 for (
i = 16;
i < 56;
i++)
ok( dib_bits[
i] == inverted_data[
i + 72],
"%d: got %08x\n",
i, dib_bits[
i] );
5340 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5341 memset( dib_bits, 0xaa, 64 * 4 );
5343 info->bmiHeader.biHeight = 16;
5344 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 12,
data,
info,
DIB_RGB_COLORS );
5346 for (
i = 0;
i < 56;
i++)
ok( dib_bits[
i] == inverted_data[
i + 72],
"%d: got %08x\n",
i, dib_bits[
i] );
5347 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5348 memset( dib_bits, 0xaa, 64 * 4 );
5350 ret =
SetDIBitsToDevice(
hdc, 4, 4, 8, 8, 0, -4, 1, 12,
data,
info,
DIB_RGB_COLORS );
5352 for (
i = 0;
i < 64;
i++)
5353 if ((
i >= 36 &&
i <= 39) || (
i >= 44 &&
i <= 47) || (
i >= 52 &&
i <= 55))
5354 ok( dib_bits[
i] == inverted_data[
i + 68],
"%d: got %08x\n",
i, dib_bits[
i] );
5356 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5357 memset( dib_bits, 0xaa, 64 * 4 );
5359 ret =
SetDIBitsToDevice(
hdc, 4, 4, 8, 8, -30, -30, 1, 12,
data,
info,
DIB_RGB_COLORS );
5361 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5362 memset( dib_bits, 0xaa, 64 * 4 );
5364 ret =
SetDIBitsToDevice(
hdc, 5, -5, 8, 16, -2, -4, 4, 12,
data,
info,
DIB_RGB_COLORS );
5366 for (
i = 0;
i < 64;
i++)
5367 if (
i == 7 ||
i == 15 ||
i == 23)
5368 ok( dib_bits[
i] == inverted_data[
i + 97],
"%d: got %08x\n",
i, dib_bits[
i] );
5370 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5371 memset( dib_bits, 0xaa, 64 * 4 );
5373 info->bmiHeader.biHeight = 5;
5374 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 2,
data,
info,
DIB_RGB_COLORS );
5376 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5377 for (
i = 40;
i < 56;
i++)
ok( dib_bits[
i] == inverted_data[
i + 72],
"%d: got %08x\n",
i, dib_bits[
i] );
5378 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5379 memset( dib_bits, 0xaa, 64 * 4 );
5381 ret =
SetDIBitsToDevice(
hdc, 0, 0, 16, 16, 0, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5383 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5384 memset( dib_bits, 0xaa, 64 * 4 );
5388 info->bmiHeader.biHeight = -8;
5389 info->bmiHeader.biBitCount = 8;
5390 info->bmiHeader.biClrUsed = 137;
5391 for (
i = 0;
i < 256;
i++)
5393 info->bmiColors[
i].rgbRed = 255 -
i;
5394 info->bmiColors[
i].rgbGreen =
i * 2;
5395 info->bmiColors[
i].rgbBlue =
i;
5396 info->bmiColors[
i].rgbReserved = 0;
5399 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5401 for (
i = 0;
i < 64;
i++)
5403 int idx =
i * 4 + 1;
5405 info->bmiColors[
idx].rgbGreen << 8 |
5406 info->bmiColors[
idx].rgbBlue);
5407 ok( dib_bits[
i] ==
expect,
"%d: got %08x instead of %08x\n",
i, dib_bits[
i],
expect );
5409 memset( dib_bits, 0xaa, 64 * 4 );
5415 info->bmiHeader.biClrUsed = 221;
5416 for (
i = 0;
i < 256;
i++)
5423 ok(
palette != 0,
"palette creation failed\n" );
5425 for (
i = 0;
i < 256;
i++) ((
WORD *)
info->bmiColors)[
i] = 255 -
i;
5426 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_PAL_COLORS );
5428 for (
i = 0;
i < 64;
i++)
5430 int idx =
i * 4 + 1;
5435 "%d: got %08x instead of %08x\n",
i, dib_bits[
i],
expect );
5437 memset( dib_bits, 0xaa, 64 * 4 );
5451 0x00, 0x03, 0x04, 0x05, 0x06, 0x00,
5452 0x00, 0x02, 0x01, 0x02, 0x05, 0x80,
5456 DWORD bottom_up[64] = { 0x00020202, 0x00020202, 0x00020202, 0x00020202, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0xaaaaaaaa,
5457 0x00040404, 0x00050505, 0x00060606, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5458 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5459 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x00808080, 0x00808080, 0x00808080, 0x00808080,
5460 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5461 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5462 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5463 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa };
5464 DWORD top_down[64] = { 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5465 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5466 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5467 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5468 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x00808080, 0x00808080, 0x00808080, 0x00808080,
5469 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5470 0x00040404, 0x00050505, 0x00060606, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5471 0x00020202, 0x00020202, 0x00020202, 0x00020202, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0xaaaaaaaa };
5475 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
5476 info->bmiHeader.biWidth = 8;
5477 info->bmiHeader.biHeight = 8;
5478 info->bmiHeader.biPlanes = 1;
5479 info->bmiHeader.biBitCount = 32;
5483 memset( dib_bits, 0xaa, 64 * 4 );
5486 info->bmiHeader.biBitCount = 8;
5490 for (
i = 0;
i < 256;
i++)
5492 info->bmiColors[
i].rgbRed =
i;
5493 info->bmiColors[
i].rgbGreen =
i;
5494 info->bmiColors[
i].rgbBlue =
i;
5495 info->bmiColors[
i].rgbReserved = 0;
5498 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5500 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5501 memset( dib_bits, 0xaa, 64 * 4 );
5504 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5506 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5507 memset( dib_bits, 0xaa, 64 * 4 );
5509 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 1,
rle8_data,
info,
DIB_RGB_COLORS );
5511 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5512 memset( dib_bits, 0xaa, 64 * 4 );
5514 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 0,
rle8_data,
info,
DIB_RGB_COLORS );
5516 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5517 memset( dib_bits, 0xaa, 64 * 4 );
5519 info->bmiHeader.biWidth = 2;
5520 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5522 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5523 memset( dib_bits, 0xaa, 64 * 4 );
5525 info->bmiHeader.biWidth = 8;
5526 info->bmiHeader.biHeight = 2;
5527 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5529 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5530 memset( dib_bits, 0xaa, 64 * 4 );
5532 info->bmiHeader.biHeight = 9;
5533 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5535 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5536 memset( dib_bits, 0xaa, 64 * 4 );
5538 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 9,
rle8_data,
info,
DIB_RGB_COLORS );
5540 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5541 memset( dib_bits, 0xaa, 64 * 4 );
5543 info->bmiHeader.biHeight = 8;
5544 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 9,
rle8_data,
info,
DIB_RGB_COLORS );
5546 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5547 memset( dib_bits, 0xaa, 64 * 4 );
5549 ret =
SetDIBitsToDevice(
hdc, 0, 3, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5551 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == bottom_up[
i + 24],
"%d: got %08x\n",
i, dib_bits[
i] );
5552 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5553 memset( dib_bits, 0xaa, 64 * 4 );
5555 ret =
SetDIBitsToDevice(
hdc, 0, 3, 4, 4, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5557 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5558 for (
i = 8;
i < 40;
i++)
5559 if (
i & 4)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5560 else ok( dib_bits[
i] == bottom_up[
i - 8],
"%d: got %08x\n",
i, dib_bits[
i] );
5561 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5562 memset( dib_bits, 0xaa, 64 * 4 );
5564 ret =
SetDIBitsToDevice(
hdc, 3, 3, 8, 4, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5566 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5567 for (
i = 8;
i < 40;
i++)
5568 if ((
i & 7) < 3)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5569 else ok( dib_bits[
i] == bottom_up[
i - 11],
"%d: got %08x\n",
i, dib_bits[
i] );
5570 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5571 memset( dib_bits, 0xaa, 64 * 4 );
5573 ret =
SetDIBitsToDevice(
hdc, 2, 3, 8, 4, 2, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5575 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5576 for (
i = 8;
i < 40;
i++)
5577 if ((
i & 7) < 2)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5578 else ok( dib_bits[
i] == bottom_up[
i - 8],
"%d: got %08x\n",
i, dib_bits[
i] );
5579 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5580 memset( dib_bits, 0xaa, 64 * 4 );
5582 info->bmiHeader.biWidth = 37;
5583 info->bmiHeader.biHeight = 37;
5584 ret =
SetDIBitsToDevice(
hdc, -2, 1, 10, 5, 2, -1, 12, 24,
rle8_data,
info,
DIB_RGB_COLORS );
5586 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5587 for (
i = 24;
i < 64;
i++)
5588 if (
i == 52)
ok( dib_bits[
i] == 0x00808080,
"%d: got %08x\n",
i, dib_bits[
i] );
5589 else if (
i & 4)
ros_skip_flaky ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5591 memset( dib_bits, 0xaa, 64 * 4 );
5594 info->bmiHeader.biWidth = 8;
5595 info->bmiHeader.biHeight = -8;
5597 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5603 info->bmiHeader.biHeight = -8;
5604 info->bmiHeader.biBitCount = 32;
5606 info->bmiHeader.biSizeImage = 0;
5609 memset( dib_bits, 0xaa, 16 * 16 * 4 );
5612 info->bmiHeader.biHeight = 8;
5613 info->bmiHeader.biBitCount = 8;
5617 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5619 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5620 memset( dib_bits, 0xaa, 64 * 4 );
5622 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 9,
rle8_data,
info,
DIB_RGB_COLORS );
5624 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5625 memset( dib_bits, 0xaa, 64 * 4 );
5627 info->bmiHeader.biHeight = 4;
5628 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5630 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5631 memset( dib_bits, 0xaa, 64 * 4 );
5633 info->bmiHeader.biHeight = 9;
5634 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5636 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5637 memset( dib_bits, 0xaa, 64 * 4 );
5639 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 9,
rle8_data,
info,
DIB_RGB_COLORS );
5641 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08x\n",
i, dib_bits[
i] );
5642 memset( dib_bits, 0xaa, 64 * 4 );
5644 ret =
SetDIBitsToDevice(
hdc, 2, 3, 8, 6, 2, 2, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5646 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5647 for (
i = 24;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i - 24],
"%d: got %08x\n",
i, dib_bits[
i] );
5648 memset( dib_bits, 0xaa, 64 * 4 );
5650 info->bmiHeader.biWidth = 37;
5651 info->bmiHeader.biHeight = 37;
5652 ret =
SetDIBitsToDevice(
hdc, -2, 1, 10, 5, 2, -1, 12, 24,
rle8_data,
info,
DIB_RGB_COLORS );
5654 for (
i = 0;
i < 40;
i++)
5655 if (
i == 12)
ok( dib_bits[
i] == 0x00808080,
"%d: got %08x\n",
i, dib_bits[
i] );
5656 else if (
i & 4)
ros_skip_flaky ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5658 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08x\n",
i, dib_bits[
i] );
5659 memset( dib_bits, 0xaa, 64 * 4 );
5669 D3DKMT_DESTROYDCFROMMEMORY destroy_desc;
5670 D3DKMT_CREATEDCFROMMEMORY create_desc;
5672 unsigned int i,
x,
y,
z;
5688 unsigned int bit_count;
5689 DWORD mask_r, mask_g, mask_b;
5694 {
"R8G8B8", D3DDDIFMT_R8G8B8, 24, 0x00000000, 0x00000000, 0x00000000,
STATUS_SUCCESS },
5695 {
"A8R8G8B8", D3DDDIFMT_A8R8G8B8, 32, 0x00000000, 0x00000000, 0x00000000,
STATUS_SUCCESS },
5696 {
"X8R8G8B8", D3DDDIFMT_X8R8G8B8, 32, 0x00000000, 0x00000000, 0x00000000,
STATUS_SUCCESS },
5697 {
"R5G6B5", D3DDDIFMT_R5G6B5, 16, 0x0000f800, 0x000007e0, 0x0000001f,
STATUS_SUCCESS },
5698 {
"X1R5G5B5", D3DDDIFMT_X1R5G5B5, 16, 0x00007c00, 0x000003e0, 0x0000001f,
STATUS_SUCCESS },
5699 {
"A1R5G5B5", D3DDDIFMT_A1R5G5B5, 16, 0x00007c00, 0x000003e0, 0x0000001f,
STATUS_SUCCESS },
5705 {
"P8", D3DDDIFMT_P8, 8, 0x00000000, 0x00000000, 0x00000000,
STATUS_SUCCESS },
5717 if (!pD3DKMTCreateDCFromMemory)
5719 win_skip(
"D3DKMTCreateDCFromMemory() is not implemented.\n");
5730 create_desc.pMemory =
data;
5732 create_desc.Width = 9;
5733 create_desc.Height = 7;
5734 create_desc.Pitch =
sizeof(*data);
5735 create_desc.hDeviceDc =
NULL;
5736 create_desc.pColorTable =
NULL;
5737 create_desc.hDc = (
void *)0x010baade;
5738 create_desc.hBitmap = (
void *)0x020baade;
5740 status = pD3DKMTCreateDCFromMemory( &create_desc );
5745 create_desc.pMemory =
NULL;
5746 status = pD3DKMTCreateDCFromMemory( &create_desc );
5750 create_desc.pMemory =
data;
5751 create_desc.Height = 0;
5752 status = pD3DKMTCreateDCFromMemory( &create_desc );
5755 ok(create_desc.hDc == (
void *)0x010baade,
"%s: Got unexpected dc %p.\n",
5757 ok(create_desc.hBitmap == (
void *)0x020baade,
"%s: Got unexpected bitmap %p.\n",
5760 create_desc.Height = 7;
5761 create_desc.Width = 0;
5762 status = pD3DKMTCreateDCFromMemory( &create_desc );
5767 destroy_desc.hDc = create_desc.hDc;
5768 destroy_desc.hBitmap = create_desc.hBitmap;
5769 status = pD3DKMTDestroyDCFromMemory( &destroy_desc );
5771 create_desc.hDc = (
void *)0x010baade;
5772 create_desc.hBitmap = (
void *)0x020baade;
5775 create_desc.Pitch = 0;
5776 status = pD3DKMTCreateDCFromMemory( &create_desc );
5779 ok(create_desc.hDc == (
void *)0x010baade,
"%s: Got unexpected dc %p.\n",
5781 ok(create_desc.hBitmap == (
void *)0x020baade,
"%s: Got unexpected bitmap %p.\n",
5784 create_desc.Width = 9;
5785 create_desc.Pitch =
sizeof(*data);
5786 status = pD3DKMTCreateDCFromMemory( &create_desc );
5791 ok(!!create_desc.hDc,
"%s: Got unexpected dc %p.\n",
5793 ok(!!create_desc.hBitmap,
"%s: Got unexpected bitmap %p.\n",
5798 ok(create_desc.hDc == (
void *)0x010baade,
"%s: Got unexpected dc %p.\n",
5800 ok(create_desc.hBitmap == (
void *)0x020baade,
"%s: Got unexpected bitmap %p.\n",
5810 ok(
bitmap == create_desc.hBitmap,
"%s: Got unexpected bitmap %p, expected %p.\n",
5815 ok(!
dib.dsBm.bmType,
"%s: Got unexpected type %#x.\n",
5817 ok(
dib.dsBm.bmWidth == create_desc.Width,
"%s: Got unexpected width %d.\n",
5819 ok(
dib.dsBm.bmHeight == create_desc.Height,
"%s: Got unexpected height %d.\n",
5822 ok(
dib.dsBm.bmWidthBytes ==
width_bytes,
"%s: Got unexpected width bytes %d.\n",
5824 ok(
dib.dsBm.bmPlanes == 1,
"%s: Got unexpected plane count %d.\n",
5826 ok(
dib.dsBm.bmBitsPixel ==
test_data[
i].bit_count,
"%s: Got unexpected bit count %d.\n",
5828 ok(
dib.dsBm.bmBits == create_desc.pMemory,
"%s: Got unexpected bits %p, expected %p.\n",
5831 ok(
dib.dsBmih.biSize ==
sizeof(
dib.dsBmih),
"%s: Got unexpected size %u.\n",
5833 ok(
dib.dsBmih.biWidth == create_desc.Width,
"%s: Got unexpected width %d.\n",
5835 ok(
dib.dsBmih.biHeight == create_desc.Height,
"%s: Got unexpected height %d.\n",
5837 ok(
dib.dsBmih.biPlanes == 1,
"%s: Got unexpected plane count %u.\n",
5839 ok(
dib.dsBmih.biBitCount ==
test_data[
i].bit_count,
"%s: Got unexpected bit count %u.\n",
5842 "%s: Got unexpected compression %#x.\n",
5844 ok(!
dib.dsBmih.biSizeImage,
"%s: Got unexpected image size %u.\n",
5846 ok(!
dib.dsBmih.biXPelsPerMeter,
"%s: Got unexpected horizontal resolution %d.\n",
5848 ok(!
dib.dsBmih.biYPelsPerMeter,
"%s: Got unexpected vertical resolution %d.\n",
5852 ok(
dib.dsBmih.biClrUsed == 256,
"%s: Got unexpected used colour count %u.\n",
5854 ok(
dib.dsBmih.biClrImportant == 256,
"%s: Got unexpected important colour count %u.\n",
5859 ok(!
dib.dsBmih.biClrUsed,
"%s: Got unexpected used colour count %u.\n",
5861 ok(!
dib.dsBmih.biClrImportant,
"%s: Got unexpected important colour count %u.\n",
5867 "%s: Got unexpected colour masks 0x%08x 0x%08x 0x%08x.\n",
5869 ok(!
dib.dshSection,
"%s: Got unexpected section %p.\n",
test_data[
i].name,
dib.dshSection);
5870 ok(!
dib.dsOffset,
"%s: Got unexpected offset %u.\n",
test_data[
i].name,
dib.dsOffset);
5873 ok(
ret,
"Failed to blit.\n");
5875 ok(
ret,
"Failed to blit.\n");
5879 ok(bmp_dc !=
NULL,
"failed to create DC\n");
5881 ok(
bmp !=
NULL,
"failed to create bmp\n");
5883 ret =
BitBlt( bmp_dc, 0, 0, create_desc.Width, create_desc.Height, create_desc.hDc, 0, 0,
SRCCOPY );
5884 ok(
ret,
"Failed to blit.\n");
5886 destroy_desc.hDc = create_desc.hDc;
5887 destroy_desc.hBitmap = create_desc.hBitmap;
5891 status = pD3DKMTDestroyDCFromMemory( &destroy_desc );
5893 status = pD3DKMTDestroyDCFromMemory( &destroy_desc );
5897 ok(
ret,
"Failed to delete dc.\n");
5899 for (
y = 0, fail =
FALSE;
y < 12 && !fail; ++
y)
5901 for (
x = 0;
x <
sizeof(*data) / (
test_data[
i].bit_count / 8) && !fail; ++
x)
5903 for (
z = 0, colour = 0;
z <
test_data[
i].bit_count / 8; ++
z)
5908 if ((
x == 1 ||
x == 2) && (
y == 1 ||
y == 2))
5910 else if (
x < 4 &&
y < 7)
5914 ok(colour ==
expected,
"%s: Got unexpected colour 0x%08x at %u, %u, expected 0x%08x.\n",
5923 if ((
x == 1 ||
x == 2) && (
y == 1 ||
y == 2))
5925 else if (
x < create_desc.Width &&
y < create_desc.Height)
5947 pD3DKMTCreateDCFromMemory = (
void *)
GetProcAddress(
hdll,
"D3DKMTCreateDCFromMemory" );
5948 pD3DKMTDestroyDCFromMemory = (
void *)
GetProcAddress(
hdll,
"D3DKMTDestroyDCFromMemory" );
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static unsigned char bytes[4]
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define HeapFree(x, y, z)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define memcpy(s1, s2, n)
static void test_size(void)
static const WCHAR desc[]
static void test_StretchDIBits(void)
static void test_GetDIBits_BI_BITFIELDS(void)
#define test_mono_1x1_bmp(a)
static void test_clipping(void)
static int get_dib_stride(int width, int bpp)
static void test_createdibitmap(void)
static void test_dibsections(void)
static void test_GetDIBits(void)
static void test_get16dibits(void)
static void test_bitmapinfoheadersize(void)
static void test_bmBits(void)
static COLORREF get_nearest(int r, int g, int b)
static void check_StretchDIBits_pixel(HDC hdcDst, UINT32 *dstBuffer, UINT32 *srcBuffer, DWORD dwRop, UINT32 expected, int line)
static void test_GetDIBits_selected_DDB(BOOL monochrome)
static void test_SetDIBits_RLE4(void)
static void test_mono_dibsection(void)
static void test_mono_bitmap(void)
static BOOL is_black_pen(COLORREF fg, COLORREF bg, int r, int g, int b)
static void test_bitmap_colors(HDC hdc, COLORREF fg, COLORREF bg, int r, int g, int b)
static void test_dib_bits_access(HBITMAP hdib, void *bits)
static void test_select_object(void)
static void test_GetDIBits_selected_DIB(UINT bpp)
static void test_dib_formats(void)
static int get_bitmap_stride(int width, int bpp)
static void test_GdiAlphaBlend(void)
static void test_32bit_ddb(void)
static void test_D3DKMTCreateDCFromMemory(void)
#define test_color(hdc, color, exp)
static void test_BitBlt(void)
static void test_bitmap(void)
static INT check_StretchDIBits_stretch(HDC hdcDst, UINT32 *dstBuffer, UINT32 *srcBuffer, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, UINT32 expected[4], int line)
static void test_SetDIBitsToDevice_RLE8(void)
static void test_GetSetDIBits_rtl(void)
static void test_SetDIBitsToDevice(void)
static void test_StretchBlt(void)
static void _test_color(int line, HDC hdc, COLORREF color, COLORREF exp)
static void check_BitBlt_pixel(HDC hdcDst, HDC hdcSrc, UINT32 *dstBuffer, UINT32 *srcBuffer, DWORD dwRop, UINT32 expected, int line)
static void test_GetDIBits_top_down(int bpp)
static void test_bitmap_info(HBITMAP hbm, INT expected_depth, const BITMAPINFOHEADER *bmih)
static void test_SetDIBits(void)
static void test_CreateBitmap(void)
static void setup_picture(char *picture, int bpp)
static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER *bmih)
static void test_GetDIBits_scanlines(void)
static void test_mono_1x1_bmp_dbg(HBITMAP hbmp, int line)
static int get_dib_image_size(const BITMAPINFO *info)
static void test_SetDIBits_RLE8(void)
static void check_StretchBlt_pixel(HDC hdcDst, HDC hdcSrc, UINT32 *dstBuffer, UINT32 *srcBuffer, DWORD dwRop, UINT32 expected, int line)
static void test_GdiGradientFill(void)
static void check_StretchBlt_stretch(HDC hdcDst, HDC hdcSrc, BITMAPINFO *dst_info, UINT32 *dstBuffer, UINT32 *srcBuffer, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, UINT32 *expected, int line)
static const BYTE rle8_data[20]
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
BITMAPCOREHEADER bmciHeader
BITMAPINFOHEADER bmiHeader
#define FIELD_OFFSET(t, f)
#define STATUS_INVALID_PARAMETER
static int __cdecl compr(const void *a, const void *b)
SIZE_T NTAPI VirtualQuery(IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
UINT WINAPI GetDIBColorTable(HDC hDC, UINT iStartIndex, UINT cEntries, RGBQUAD *pColors)
DWORD WINAPI GetLastError(void)
_In_ ULONG _In_ ULONG rgb
int WINAPI SetMapMode(_In_ HDC, _In_ int)
int WINAPI SetDIBitsToDevice(_In_ HDC, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ int, _In_ int, _In_ UINT, _In_ UINT, _In_ CONST VOID *, _In_ CONST BITMAPINFO *, _In_ UINT)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
BOOL WINAPI SetWindowOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
BOOL WINAPI SetViewportExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
int WINAPI SetDIBits(_In_opt_ HDC, _In_ HBITMAP, _In_ UINT, _In_ UINT, _In_ CONST VOID *, _In_ CONST BITMAPINFO *, _In_ UINT)
struct tagBITMAPCOREHEADER BITMAPCOREHEADER
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)
HBITMAP WINAPI CreateBitmapIndirect(_In_ const BITMAP *pbm)
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
struct tagLOGPALETTE LOGPALETTE
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
struct tagBITMAPINFO * LPBITMAPINFO
#define PALETTERGB(r, g, b)
BOOL WINAPI SetWindowExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
LONG WINAPI GetBitmapBits(_In_ HBITMAP hbit, _In_ LONG cb, _Out_writes_bytes_(cb) LPVOID lpvBits)
BOOL WINAPI ScaleWindowExtEx(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _Out_opt_ LPSIZE)
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
UINT WINAPI SetDIBColorTable(_In_ HDC hdc, _In_ UINT iStart, _In_ UINT cEntries, _In_reads_(cEntries) const RGBQUAD *prgbq)
BOOL WINAPI SetPixelV(_In_ HDC, _In_ int, _In_ int, _In_ COLORREF)
COLORREF WINAPI GetNearestColor(_In_ HDC, _In_ COLORREF)
struct tagBITMAPINFO BITMAPINFO
struct _BITMAPCOREINFO BITMAPCOREINFO
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
HBRUSH WINAPI CreateDIBPatternBrushPt(_In_ const VOID *pvPackedDIB, _In_ UINT uUsage)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
HBITMAP WINAPI CreateDIBitmap(_In_ HDC hdc, _In_opt_ const BITMAPINFOHEADER *pbmih, _In_ DWORD fdwInit, _In_opt_ const VOID *pvInit, _In_opt_ const BITMAPINFO *pbmi, _In_ UINT uUsage)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
HBITMAP WINAPI CreateDiscardableBitmap(_In_ HDC, _In_ int, _In_ int)
int WINAPI StretchDIBits(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ const VOID *, _In_ const BITMAPINFO *, _In_ UINT, _In_ DWORD)
HBRUSH WINAPI CreatePatternBrush(_In_ HBITMAP)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)