27#define WIN32_NO_STATUS
35#include "ddk/d3dkmthk.h"
43static BOOL (
WINAPI *pGdiAlphaBlend)(
HDC,
int,
int,
int,
int,
HDC,
int,
int,
int,
int,
BLENDFUNCTION);
48 return ((
width *
bpp + 15) >> 3) & ~1;
53 return ((
width *
bpp + 31) >> 3) & ~3;
59 *
abs(
info->bmiHeader.biHeight );
71 ok(
ret ==
sizeof(bm),
"GetObject returned %d\n",
ret);
94 memset(buf_cmp, 0xAA,
sizeof(buf_cmp));
106 "Test[%d]: buffers do not match, depth %d\n",
i, bmih->
biBitCount);
111 ok(
ret ==
sizeof(*bma),
"wrong size %d\n",
ret);
123 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
137 memset(&bmih, 0,
sizeof(bmih));
138 bmih.
biSize =
sizeof(bmih);
146 ok(
hbm ==
NULL,
"CreateDIBitmap should fail\n");
148 ok(
hbm ==
NULL,
"CreateDIBitmap should fail\n");
156 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
163 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
170 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
180 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
187 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
194 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
207 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
214 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
221 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
231 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
241 memset(&bm, 0,
sizeof(bm));
250 ok(
hbm !=
NULL,
"CreateDIBitmap failed\n");
255 ok(pixel == 0x00ffffff,
"Reading a 32 bit pixel from a DDB returned %08lx\n", pixel);
267 INT ret, bm_width_bytes, dib_width_bytes;
271 ok(
ret ==
sizeof(bm),
"GetObject returned %d\n",
ret);
303 ok(
ret ==
sizeof(*bma),
"wrong size %d\n",
ret);
319 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
322 ok(
ret ==
sizeof(*dsa),
"wrong size %d\n",
ret);
326 ok(
ret ==
sizeof(
ds),
"wrong size %d\n",
ret);
328 ok(
ds.dsBm.bmBits ==
bits,
"wrong bm.bmBits %p != %p\n",
ds.dsBm.bmBits,
bits);
329 if (
ds.dsBm.bmWidthBytes != bm_width_bytes)
330 ok(
ds.dsBmih.biSizeImage ==
ds.dsBm.bmWidthBytes *
ds.dsBm.bmHeight,
"%lu != %u\n",
331 ds.dsBmih.biSizeImage,
ds.dsBm.bmWidthBytes *
ds.dsBm.bmHeight);
333 ds.dsBmih.biSizeImage = 0;
349 ok(
ret ==
sizeof(
ds.dsBm),
"wrong size %d\n",
ret);
365 ok_(__FILE__,
line)(
c ==
exp,
"SetPixel failed: got 0x%06lx expected 0x%06lx\n",
c,
exp);
367 ok_(__FILE__,
line)(
c ==
exp,
"GetPixel failed: got 0x%06lx expected 0x%06lx\n",
c,
exp);
369 ok_(__FILE__,
line)(
c ==
exp,
"GetNearestColor failed: got 0x%06lx expected 0x%06lx\n",
c,
exp);
371#define test_color(hdc, color, exp) _test_color( __LINE__, hdc, color, exp )
387 "VirtualQuery failed\n");
407 ok(
ret == 16,
"SetDIBits failed: expected 16 got %d\n",
ret);
412 "VirtualQuery failed\n");
428 if (
ret)
ok( written == 8192,
"only wrote %lu bytes\n", written );
436 HBITMAP hdib, oldbm, hdib2, oldbm2;
453 HPALETTE hpal, oldpal;
475 ok(hdib ==
NULL &&
bits ==
NULL,
"CreateDIBSection failed for invalid parameter: bmi == 0x0\n");
484 "VirtualQuery failed\n");
488 ok(
info.RegionSize == 0x26000,
"0x%Ix != 0x26000\n",
info.RegionSize);
510 ok(hdib ==
NULL,
"CreateDIBSection should fail when asked to create a compressed DIB section\n");
524 "VirtualQuery failed\n");
528 ok(
info.RegionSize == 0x19000,
"0x%Ix != 0x19000\n",
info.RegionSize);
543 colors[0].rgbRed = 0xff;
544 colors[0].rgbGreen = 0;
545 colors[0].rgbBlue = 0;
546 colors[1].rgbRed = 0;
547 colors[1].rgbGreen = 0;
548 colors[1].rgbBlue = 0xff;
551 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
554 "created DIBSection: wrong biClrUsed field: %lu, should be: %u\n", dibsec.
dsBmih.
biClrUsed, 2);
562 ok(
ret,
"GetDIBits doesn't work with a BITMAPCOREHEADER\n");
565 "GetDIBits didn't fill in the BITMAPCOREHEADER structure properly\n");
568 ok(
ret,
"GetDIBits doesn't work with a BITMAPCOREHEADER\n");
569 ok((ccolors[0].rgbtRed == 0xff) && (ccolors[0].rgbtGreen == 0) &&
570 (ccolors[0].rgbtBlue == 0) && (ccolors[1].rgbtRed == 0) &&
571 (ccolors[1].rgbtGreen == 0) && (ccolors[1].rgbtBlue == 0xff),
572 "The color table has not been translated to the old BITMAPCOREINFO format\n");
575 ok(hcoredib !=
NULL,
"CreateDIBSection failed with a BITMAPCOREINFO\n");
579 ok(
ret,
"GetDIBits doesn't work with a BITMAPCOREHEADER\n");
580 ok((ccolors[0].rgbtRed == 0xff) && (ccolors[0].rgbtGreen == 0) &&
581 (ccolors[0].rgbtBlue == 0) && (ccolors[1].rgbtRed == 0) &&
582 (ccolors[1].rgbtGreen == 0) && (ccolors[1].rgbtBlue == 0xff),
583 "The color table has not been translated to the old BITMAPCOREINFO format\n");
591 ok(
ret == 2,
"GetDIBColorTable returned %d\n",
ret);
593 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
594 rgb[0].rgbRed,
rgb[0].rgbGreen,
rgb[0].rgbBlue,
rgb[0].rgbReserved,
595 rgb[1].rgbRed,
rgb[1].rgbGreen,
rgb[1].rgbBlue,
rgb[1].rgbReserved);
597 c0 =
RGB(colors[0].rgbRed, colors[0].rgbGreen, colors[0].rgbBlue);
598 c1 =
RGB(colors[1].rgbRed, colors[1].rgbGreen, colors[1].rgbBlue);
615 colors[0].rgbRed = 0xff;
616 colors[0].rgbGreen = 0xff;
617 colors[0].rgbBlue = 0xff;
618 colors[1].rgbRed = 0;
619 colors[1].rgbGreen = 0;
620 colors[1].rgbBlue = 0;
623 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
630 ok(
ret == 2,
"GetDIBColorTable returned %d\n",
ret);
632 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
633 rgb[0].rgbRed,
rgb[0].rgbGreen,
rgb[0].rgbBlue,
rgb[0].rgbReserved,
634 rgb[1].rgbRed,
rgb[1].rgbGreen,
rgb[1].rgbBlue,
rgb[1].rgbReserved);
641 for (
i = 0;
i < 16;
i++) {
642 colors[
i].rgbRed =
i;
643 colors[
i].rgbGreen = 16-
i;
644 colors[
i].rgbBlue = 0;
647 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
650 "created DIBSection: wrong biClrUsed field: %lu, should be: %u\n", dibsec.
dsBmih.
biClrUsed, 16);
656 for (
i = 0;
i < 128;
i++) {
657 colors[
i].rgbRed = 255 -
i * 2;
658 colors[
i].rgbGreen =
i * 2;
659 colors[
i].rgbBlue = 0;
660 colors[255 -
i].rgbRed = 0;
661 colors[255 -
i].rgbGreen =
i * 2;
662 colors[255 -
i].rgbBlue = 255 -
i * 2;
665 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
668 "created DIBSection: wrong biClrUsed field: %lu, should be: %u\n", dibsec.
dsBmih.
biClrUsed, 256);
672 for (
i = 0;
i < 256;
i++) {
675 RGB(colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue));
685 memset(plogpal, 0,
sizeof(logpalbuf));
688 palent[0].
peRed = 0xff;
696 ok(hpal !=
NULL,
"CreatePalette failed\n");
699 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
711 ok(
ret == 2,
"GetDIBColorTable returned %d\n",
ret);
712 ok(
rgb[0].rgbRed == 0xff &&
rgb[0].rgbBlue == 0xff &&
rgb[0].rgbGreen == 0 &&
713 rgb[1].rgbRed == 0 &&
rgb[1].rgbBlue == 0 &&
rgb[1].rgbGreen == 0xff,
714 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
715 rgb[0].rgbRed,
rgb[0].rgbGreen,
rgb[0].rgbBlue,
rgb[0].rgbReserved,
716 rgb[1].rgbRed,
rgb[1].rgbGreen,
rgb[1].rgbBlue,
rgb[1].rgbReserved);
718 c0 =
RGB(palent[0].peRed, palent[0].peGreen, palent[0].peBlue);
719 c1 =
RGB(palent[1].peRed, palent[1].peGreen, palent[1].peBlue);
738 bits[13 * 4] =
bits[13*4 + 1] = 0xff;
745 ok(hdib2 !=
NULL,
"CreateDIBSection failed\n");
751 ok(bits32[0] == 0xff00,
"lower left pixel is %08lx\n", bits32[0]);
752 ok(bits32[17] == 0xff00ff,
"bottom but one, left pixel is %08lx\n", bits32[17]);
766 memset(plogpal, 0,
sizeof(logpalbuf));
770 for (
i = 0;
i < 128;
i++) {
774 palent[255 -
i].
peRed = 0;
776 palent[255 -
i].
peBlue = 255 -
i * 2;
780 for (
i = 0;
i < 256;
i++) {
785 ok(hpal !=
NULL,
"CreatePalette failed\n");
788 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
799 ok(
ret == 256,
"GetDIBColorTable returned %d\n",
ret);
800 for (
i = 0;
i < 256;
i++) {
801 ok(
rgb[
i].rgbRed == palent[
i].peRed &&
802 rgb[
i].rgbBlue == palent[
i].peBlue &&
803 rgb[
i].rgbGreen == palent[
i].peGreen,
804 "GetDIBColorTable returns table %d: r%02x g%02x b%02x res%02x\n",
808 for (
i = 0;
i < 256;
i++) {
812 RGB(palent[
i].peRed, palent[
i].peGreen, palent[
i].peBlue));
822 ok(hpal !=
NULL,
"CreatePalette failed\n");
826 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
837 ok(
ret == 256,
"GetDIBColorTable returned %d\n",
ret);
838 for (
i = 0;
i < 256;
i++)
840 if (i < pbmi->bmiHeader.biClrUsed)
842 ok(
rgb[
i].rgbRed == palent[
i % 37].peRed &&
843 rgb[
i].rgbBlue == palent[
i % 37].peBlue &&
844 rgb[
i].rgbGreen == palent[
i % 37].peGreen,
845 "GetDIBColorTable returns table %d: r %02x g %02x b %02x res%02x\n",
848 RGB(palent[
i % 37].peRed, palent[
i % 37].peGreen, palent[
i % 37].peBlue));
852 ok(
rgb[
i].rgbRed == 0 &&
rgb[
i].rgbBlue == 0 &&
rgb[
i].rgbGreen == 0,
853 "GetDIBColorTable returns table %d: r %02x g %02x b %02x res%02x\n",
862 for (
i = 0;
i < 256;
i++)
865 ok(colors[
i].rgbRed == palent[
i % 37].peRed &&
866 colors[
i].rgbBlue == palent[
i % 37].peBlue &&
867 colors[
i].rgbGreen == palent[
i % 37].peGreen,
868 "GetDIBits returns table %d: r %02x g %02x b %02x res%02x\n",
869 i, colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
871 ok(colors[
i].rgbRed == 0 && colors[
i].rgbBlue == 0 && colors[
i].rgbGreen == 0,
872 "GetDIBits returns table %d: r %02x g %02x b %02x res%02x\n",
873 i, colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
879 rgb[0].rgbReserved = 123;
881 ok(
ret == 1,
"SetDIBColorTable returned unexpected result %u\n",
ret );
882 ok(
rgb[0].rgbReserved == 123,
"Expected rgbReserved = 123, got %u\n",
rgb[0].rgbReserved );
884 rgb[0].rgbRed =
rgb[0].rgbGreen =
rgb[0].rgbBlue =
rgb[0].rgbReserved = -1;
886 ok(
ret == 1,
"GetDIBColorTable returned unexpected result %u\n",
ret );
887 ok(
rgb[0].rgbRed == 1,
"Expected rgbRed = 1, got %u\n",
rgb[0].rgbRed );
888 ok(
rgb[0].rgbGreen == 2,
"Expected rgbGreen = 2, got %u\n",
rgb[0].rgbGreen );
889 ok(
rgb[0].rgbBlue == 3,
"Expected rgbBlue = 3, got %u\n",
rgb[0].rgbBlue );
890 ok(
rgb[0].rgbReserved == 0,
"Expected rgbReserved = 0, got %u\n",
rgb[0].rgbReserved );
900 ok(hdib !=
NULL,
"CreateDIBSection failed\n");
905 ok(
ret == 0,
"GetDIBColorTable returned %d\n",
ret);
923 BOOL format_ok, expect_ok;
934 skip(
"ROSTESTS-152: Skipping loop in test_dib_formats because it's too big and causes too many failures\n");
938 for (planes = 0; planes <= 64; planes++)
952 default: expect_ok =
FALSE;
break;
970 "GetDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
973 format_ok = expect_ok;
974 if (!planes) expect_ok =
FALSE;
986 if (expect_ok && (planes == 1 || planes *
bpp <= 16) &&
997 "CreateDIBitmap succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1010 "SetDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1011 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
format );
1017 "SetDIBitsToDevice succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1018 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
format,
SRCCOPY );
1024 "StretchDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1050 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
format );
1055 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
format,
SRCCOPY );
1063 if (expect_ok || !
bpp)
1067 "GetDIBits succeeded for %u/%u/%u/%u\n",
bpp, planes,
compr,
format );
1086 ok( hdib ==
NULL,
"CreateDIBSection succeeded with null bitfields\n" );
1088 ok( !
ret,
"SetDIBits succeeded with null bitfields\n" );
1091 ok( hdib !=
NULL,
"CreateDIBitmap failed with null bitfields\n" );
1093 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1094 ok(
ret,
"SetDIBitsToDevice failed with null bitfields\n" );
1095 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1096 ok(
ret,
"StretchDIBits failed with null bitfields\n" );
1098 ok(
ret,
"GetDIBits failed with null bitfields\n" );
1107 ok(
ret,
"GetDIBits failed with null bitfields\n" );
1114 ok( hdib ==
NULL,
"CreateDIBSection succeeded with null bitfields\n" );
1116 ok( !
ret,
"SetDIBits succeeded with null bitfields\n" );
1123 ok( hdib !=
NULL,
"CreateDIBSection failed with bad bitfields\n" );
1126 ok(
ret,
"SetDIBits failed with bad bitfields\n" );
1133 ok( hdib ==
NULL,
"CreateDIBSection succeeded with negative width\n" );
1135 ok( hdib ==
NULL,
"CreateDIBitmap succeeded with negative width\n" );
1137 ok( !
ret,
"SetDIBits succeeded with negative width\n" );
1138 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1139 ok( !
ret,
"SetDIBitsToDevice succeeded with negative width\n" );
1140 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1141 ok( !
ret,
"StretchDIBits succeeded with negative width\n" );
1143 ok( !
ret,
"GetDIBits succeeded with negative width\n" );
1149 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with negative width\n" );
1156 ok( hdib ==
NULL,
"CreateDIBSection succeeded with zero width\n" );
1158 ok( hdib !=
NULL,
"CreateDIBitmap failed with zero width\n" );
1161 ok( !
ret ||
broken(
ret),
"SetDIBits succeeded with zero width\n" );
1162 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1163 ok( !
ret ||
broken(
ret),
"SetDIBitsToDevice succeeded with zero width\n" );
1164 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1165 ok( !
ret ||
broken(
ret),
"StretchDIBits succeeded with zero width\n" );
1167 ok( !
ret,
"GetDIBits succeeded with zero width\n" );
1173 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with zero width\n" );
1180 ok( hdib ==
NULL,
"CreateDIBSection succeeded with zero height\n" );
1182 ok( hdib !=
NULL,
"CreateDIBitmap failed with zero height\n" );
1185 ok( !
ret,
"SetDIBits succeeded with zero height\n" );
1186 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_RGB_COLORS );
1187 ok( !
ret,
"SetDIBitsToDevice succeeded with zero height\n" );
1188 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_RGB_COLORS,
SRCCOPY );
1189 ok( !
ret,
"StretchDIBits succeeded with zero height\n" );
1191 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with zero height\n" );
1197 ok( !
ret ||
broken(
ret),
"GetDIBits succeeded with zero height\n" );
1206 ok( hdib ==
NULL,
"CreateDIBSection succeeded with DIB_PAL_COLORS+1\n" );
1208 ok( hdib !=
NULL,
"CreateDIBitmap failed with DIB_PAL_COLORS+1\n" );
1211 ok( !
ret,
"SetDIBits succeeded with DIB_PAL_COLORS+1\n" );
1213 ok(
ret,
"SetDIBits failed with DIB_PAL_COLORS+1\n" );
1214 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_PAL_COLORS+1 );
1215 ok(
ret,
"SetDIBitsToDevice failed with DIB_PAL_COLORS+1\n" );
1216 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_PAL_COLORS+1,
SRCCOPY );
1217 ok(
ret,
"StretchDIBits failed with DIB_PAL_COLORS+1\n" );
1219 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+1\n" );
1225 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+1\n" );
1232 ok( hdib ==
NULL,
"CreateDIBSection succeeded with DIB_PAL_COLORS+2\n" );
1234 ok( hdib ==
NULL,
"CreateDIBitmap succeeded with DIB_PAL_COLORS+2\n" );
1237 ok( !
ret,
"SetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1239 ok( !
ret,
"SetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1240 ret =
SetDIBitsToDevice( memdc, 0, 0, 1, 1, 0, 0, 0, 1,
data, bi,
DIB_PAL_COLORS+2 );
1241 ok( !
ret,
"SetDIBitsToDevice succeeded with DIB_PAL_COLORS+2\n" );
1242 ret =
StretchDIBits( memdc, 0, 0, 1, 1, 0, 0, 1, 1,
data, bi,
DIB_PAL_COLORS+2,
SRCCOPY );
1243 ok( !
ret,
"StretchDIBits succeeded with DIB_PAL_COLORS+2\n" );
1245 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1251 ok( !
ret,
"GetDIBits succeeded with DIB_PAL_COLORS+2\n" );
1258 ok( hdib !=
NULL,
"CreateDIBSection failed with large size\n" );
1266 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1273 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1280 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1287 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1294 ok( hdib ==
NULL,
"CreateDIBSection succeeded with size overflow\n" );
1325 colors[0].rgbRed = 0xff;
1326 colors[0].rgbGreen = 0xff;
1327 colors[0].rgbBlue = 0xff;
1328 colors[1].rgbRed = 0x0;
1329 colors[1].rgbGreen = 0x0;
1330 colors[1].rgbBlue = 0x0;
1337 ok(mono_ds !=
NULL,
"CreateDIBSection rets NULL\n");
1342 ok(ds_bits[0] == 0xff,
"out_bits %02x\n", ds_bits[0]);
1343 ok(ds_bits[4] == 0x80,
"out_bits %02x\n", ds_bits[4]);
1350 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1351 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1355 colors[0].rgbRed = 0x0;
1356 colors[0].rgbGreen = 0x0;
1357 colors[0].rgbBlue = 0x0;
1358 colors[1].rgbRed = 0xff;
1359 colors[1].rgbGreen = 0xff;
1360 colors[1].rgbBlue = 0xff;
1362 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1363 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1372 colors[0].rgbRed = 0x0;
1373 colors[0].rgbGreen = 0x0;
1374 colors[0].rgbBlue = 0x0;
1375 colors[1].rgbRed = 0xff;
1376 colors[1].rgbGreen = 0xff;
1377 colors[1].rgbBlue = 0xff;
1380 ok(mono_ds !=
NULL,
"CreateDIBSection rets NULL\n");
1385 ok(ds_bits[0] == 0x00,
"out_bits %02x\n", ds_bits[0]);
1386 ok(ds_bits[4] == 0x7f,
"out_bits %02x\n", ds_bits[4]);
1390 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1391 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1395 colors[0].rgbRed = 0xff;
1396 colors[0].rgbGreen = 0xff;
1397 colors[0].rgbBlue = 0xff;
1398 colors[1].rgbRed = 0x0;
1399 colors[1].rgbGreen = 0x0;
1400 colors[1].rgbBlue = 0x0;
1402 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1403 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1409 colors[0].rgbRed = 0xff;
1410 colors[0].rgbGreen = 0xff;
1411 colors[0].rgbBlue = 0xff;
1412 colors[1].rgbRed = 0x0;
1413 colors[1].rgbGreen = 0x0;
1414 colors[1].rgbBlue = 0x0;
1420 ok(ds_bits[0] == 0xff,
"out_bits %02x\n", ds_bits[0]);
1421 ok(ds_bits[4] == 0x80,
"out_bits %02x\n", ds_bits[4]);
1428 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1429 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1433 colors[0].rgbRed = 0x0;
1434 colors[0].rgbGreen = 0x0;
1435 colors[0].rgbBlue = 0x0;
1436 colors[1].rgbRed = 0xff;
1437 colors[1].rgbGreen = 0xff;
1438 colors[1].rgbBlue = 0xff;
1440 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1441 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1450 colors[0].rgbRed = 0xff;
1451 colors[0].rgbGreen = 0x0;
1452 colors[0].rgbBlue = 0x0;
1453 colors[1].rgbRed = 0xfe;
1454 colors[1].rgbGreen = 0x0;
1455 colors[1].rgbBlue = 0x0;
1458 ok(mono_ds !=
NULL,
"CreateDIBSection rets NULL\n");
1463 ok(ds_bits[0] == 0xff,
"out_bits %02x\n", ds_bits[0]);
1464 ok(ds_bits[4] == 0x80,
"out_bits %02x\n", ds_bits[4]);
1468 colors[0].rgbRed = 0x0;
1469 colors[0].rgbGreen = 0x0;
1470 colors[0].rgbBlue = 0x0;
1471 colors[1].rgbRed = 0xff;
1472 colors[1].rgbGreen = 0xff;
1473 colors[1].rgbBlue = 0xff;
1475 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1476 ok(ds_bits[0] == 0x55,
"out_bits %02x\n", ds_bits[0]);
1480 colors[0].rgbRed = 0xff;
1481 colors[0].rgbGreen = 0xff;
1482 colors[0].rgbBlue = 0xff;
1483 colors[1].rgbRed = 0x0;
1484 colors[1].rgbGreen = 0x0;
1485 colors[1].rgbBlue = 0x0;
1487 SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10,
bits,
pbmi,
DIB_RGB_COLORS);
1488 ok(ds_bits[0] == 0xaa,
"out_bits %02x\n", ds_bits[0]);
1499 char buf[256], buf_cmp[256];
1515 "expected ERROR_NOT_ENOUGH_MEMORY, got %lu\n",
GetLastError());
1526 "expected ERROR_NOT_ENOUGH_MEMORY, got %lu\n",
GetLastError());
1533 ok(!
hbmp,
"CreateBitmap should fail\n");
1536 "expected ERROR_INVALID_PARAMETER, got %lu\n",
GetLastError());
1544 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
1560 memset(buf_cmp, 0xAA,
sizeof(buf_cmp));
1566 ok(!
memcmp(
buf, buf_cmp,
sizeof(
buf)),
"buffers do not match\n");
1571 ok(
ret ==
sizeof(bm),
"wrong size %d\n",
ret);
1584 ok(!
memcmp(
buf, buf_cmp,
sizeof(
buf)),
"buffers do not match\n");
1587 ok(hbmp_old ==
hbmp,
"wrong old bitmap %p\n", hbmp_old);
1591 ok(
ret ==
sizeof(*bma),
"wrong size %d\n",
ret);
1608 return (
r*
r +
g*
g +
b*
b < (255-
r)*(255-
r) + (255-
g)*(255-
g) + (255-
b)*(255-
b)) ? 0x000000 : 0xffffff;
1613 if (fg == 0 || bg == 0xffffff)
return RGB(
r,
g,
b) != 0xffffff &&
RGB(
r,
g,
b) != bg;
1619 static const WORD pattern_bits[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa };
1633 "wrong result %06lx for %02x,%02x,%02x fg %06lx bg %06lx\n",
res,
r,
g,
b, fg, bg );
1636 "wrong result %06lx for %02x,%02x,%02x fg %06lx bg %06lx\n",
res,
r,
g,
b, fg, bg );
1639 "wrong result %06lx for %02x,%02x,%02x fg %06lx bg %06lx\n",
res,
r,
g,
b, fg, bg );
1647 "wrong result %06lx for %02x,%02x,%02x fg %06lx bg %06lx\n",
res,
r,
g,
b, fg, bg );
1650 "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n",
bits[0],
r,
g,
b, fg, bg );
1659 "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n",
bits[0],
r,
g,
b, fg, bg );
1668 "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n",
bits[0],
r,
g,
b, fg, bg );
1674 "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n",
bits[0],
r,
g,
b, fg, bg );
1678 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
1679 info->bmiHeader.biHeight = -16;
1680 info->bmiHeader.biWidth = 16;
1681 info->bmiHeader.biBitCount = 1;
1682 info->bmiHeader.biPlanes = 1;
1684 colors[0].rgbRed = 0xff;
1685 colors[0].rgbGreen = 0xff;
1686 colors[0].rgbBlue = 0xf0;
1687 colors[1].rgbRed = 0x20;
1688 colors[1].rgbGreen = 0x0;
1689 colors[1].rgbBlue = 0x0;
1691 memset( bits_ptr, 0x55, 64 );
1696 "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n",
bits[0],
r,
g,
b, fg, bg );
1698 colors[0].rgbRed = 0x0;
1699 colors[0].rgbGreen = 0x0;
1700 colors[0].rgbBlue = 0x10;
1701 colors[1].rgbRed = 0xff;
1702 colors[1].rgbGreen = 0xf0;
1703 colors[1].rgbBlue = 0xff;
1705 memset( bits_ptr, 0x55, 64 );
1710 "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n",
bits[0],
r,
g,
b, fg, bg );
1717 "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n",
bits[0],
r,
g,
b, fg, bg );
1724 "wrong bits %04x for %02x,%02x,%02x fg %06lx bg %06lx\n",
bits[0],
r,
g,
b, fg, bg );
1731 static const COLORREF colors[][2] =
1733 {
RGB(0x00,0x00,0x00),
RGB(0xff,0xff,0xff) },
1734 {
RGB(0xff,0xff,0xff),
RGB(0x00,0x00,0x00) },
1735 {
RGB(0x00,0x00,0x00),
RGB(0xff,0xff,0xfe) },
1736 {
RGB(0x00,0x01,0x00),
RGB(0xff,0xff,0xff) },
1737 {
RGB(0x00,0x00,0x00),
RGB(0x80,0x80,0x80) },
1738 {
RGB(0x80,0x80,0x80),
RGB(0xff,0xff,0xff) },
1739 {
RGB(0x30,0x40,0x50),
RGB(0x60,0x70,0x80) },
1740 {
RGB(0xa0,0xa0,0xa0),
RGB(0x20,0x30,0x10) },
1752 skip(
"ROSTESTS-153: Skipping test_mono_bitmap because it causes too many failures and takes too long\n");
1764 for (col = 0; col <
ARRAY_SIZE(colors); col++)
1769 for (
i = 0;
i < 256;
i++)
1779 for (
r = 0;
r < 256;
r += 15)
1780 for (
g = 0;
g < 256;
g += 15)
1781 for (
b = 0;
b < 256;
b += 15)
1801 "GetObject failed or returned a wrong structure size\n");
1802 ok(!
bmp.
bmBits,
"bmBits must be NULL for device-dependent bitmaps\n");
1814 UINT dib_size, dib32_size;
1826 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
1827 info->bmiHeader.biWidth = 32;
1828 info->bmiHeader.biHeight = 32;
1829 info->bmiHeader.biPlanes = 1;
1830 info->bmiHeader.biBitCount =
bpp;
1832 info->bmiHeader.biXPelsPerMeter = 0;
1833 info->bmiHeader.biYPelsPerMeter = 0;
1834 info->bmiHeader.biClrUsed = 0;
1835 info->bmiHeader.biClrImportant = 0;
1837 for (
i=0;
i < (1u <<
bpp);
i++)
1840 info->bmiColors[
i].rgbRed =
c;
1841 info->bmiColors[
i].rgbGreen =
c;
1842 info->bmiColors[
i].rgbBlue =
c;
1843 info->bmiColors[
i].rgbReserved = 0;
1847 dib_size =
bpp * (
info->bmiHeader.biWidth *
info->bmiHeader.biHeight) / 8;
1848 dib32_size = 32 * (
info->bmiHeader.biWidth *
info->bmiHeader.biHeight) / 8;
1851 for (
i=0;
i < dib_size;
i++)
1860 bits2 =
calloc(1, dib32_size);
1869 for (
i=0;
i < (1u <<
bpp);
i++)
1874 "color table entry %d differs (bpp %d)\n",
i,
bpp );
1876 ok( !
memcmp(
bits, bits2, dib_size ),
"bit mismatch (bpp %d)\n",
bpp );
1883 "color table mismatch (bpp %d)\n",
bpp );
1889 "color table mismatch (bpp %d)\n",
bpp );
1895 "color table mismatch (bpp %d)\n",
bpp );
1903 pixel = ((
DWORD *)bits2)[
info->bmiHeader.biWidth *
info->bmiHeader.biHeight - 1];
1904 ok(pixel != 0,
"Pixel: 0x%08lx\n", pixel);
1962 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
1965 info->bmiHeader.biPlanes = 1;
1966 info->bmiHeader.biBitCount =
bpp;
1973 ok(
info->bmiHeader.biSizeImage != 0,
"GetDIBits failed to get the DIB attributes\n");
1976 bits2 =
calloc(1,
info->bmiHeader.biSizeImage);
1995 for (
i=0;
i < (1u <<
bpp);
i++)
2000 "color table entry %d differs (bpp %d)\n",
i,
bpp );
2003 ok( !
memcmp(
bits, bits2,
info->bmiHeader.biSizeImage ),
"bit mismatch (bpp %d)\n",
bpp );
2014 for (
i = 0;
i < (1 <<
info->bmiHeader.biBitCount);
i++)
2015 ok( colors[
i] ==
i,
"%d: got %d (bpp %d)\n",
i, colors[
i],
bpp );
2032 static const BYTE bmp_bits_1[16 * 2] =
2034 0xff,0xff, 0,0, 0xff,0xff, 0,0,
2035 0xff,0xff, 0,0, 0xff,0xff, 0,0,
2036 0xff,0xff, 0,0, 0xff,0xff, 0,0,
2037 0xff,0xff, 0,0, 0xff,0xff, 0,0
2040 static const BYTE dib_bits_1[16 * 4] =
2042 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0,
2043 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0,
2044 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0,
2045 0,0,0,0, 0xff,0xff,0,0, 0,0,0,0, 0xff,0xff,0,0
2048 static const BYTE bmp_bits_24[16 * 16*3] =
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,
2078 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2079 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2080 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2081 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 static const BYTE dib_bits_24[16 * 16*3] =
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,
2114 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2115 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2116 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
2117 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
2133 ok(
hbmp != 0,
"CreateBitmap failed\n");
2135 memset(&bm, 0xAA,
sizeof(bm));
2137 ok(
bytes ==
sizeof(bm),
"GetObject returned %d\n",
bytes);
2147 ok(
bytes ==
sizeof(bmp_bits_1),
"expected 16*2 got %d bytes\n",
bytes);
2149 ok(
bytes ==
sizeof(bmp_bits_1),
"expected 16*2 got %d bytes\n",
bytes);
2150 ok(!
memcmp(
buf, bmp_bits_1,
sizeof(bmp_bits_1)),
"bitmap bits don't match\n");
2153 memset(bi, 0,
sizeof(*bi));
2165 ok(
lines == 0,
"GetDIBits copied %d lines with hdc = 0\n",
lines);
2176 ok(
lines == bm.
bmHeight,
"GetDIBits copied %d lines of %d, error %lu\n",
2182 ok(colors[0].rgbRed == 0 && colors[0].rgbGreen == 0 &&
2183 colors[0].rgbBlue == 0 && colors[0].rgbReserved == 0,
2184 "expected bmiColors[0] 0,0,0,0 - got %x %x %x %x\n",
2185 colors[0].rgbRed, colors[0].rgbGreen, colors[0].rgbBlue, colors[0].rgbReserved);
2186 ok(colors[1].rgbRed == 0xff && colors[1].rgbGreen == 0xff &&
2187 colors[1].rgbBlue == 0xff && colors[1].rgbReserved == 0,
2188 "expected bmiColors[0] 0xff,0xff,0xff,0 - got %x %x %x %x\n",
2189 colors[1].rgbRed, colors[1].rgbGreen, colors[1].rgbBlue, colors[1].rgbReserved);
2190 for (
i = 2;
i < 256;
i++)
2192 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2193 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2194 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2195 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2199 ok(!
memcmp(
buf, dib_bits_1,
sizeof(dib_bits_1)),
"DIB bits don't match\n");
2205 ok(((
WORD*)colors)[0] == 0,
"Color 0 is %d\n", ((
WORD*)colors)[0]);
2206 ok(((
WORD*)colors)[1] == 1,
"Color 1 is %d\n", ((
WORD*)colors)[1]);
2207 for (
i = 2;
i < 256;
i++)
2208 ok(((
WORD*)colors)[
i] == 0xAAAA,
"Color %d is %d\n",
i, ((
WORD*)colors)[1]);
2211 memset(bi, 0,
sizeof(*bi));
2224 ok(
lines == bm.
bmHeight,
"GetDIBits copied %d lines of %d, error %lu\n",
2230 for (
i = 0;
i < 256;
i++)
2232 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2233 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2234 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2235 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2239 ok(!
memcmp(
buf, dib_bits_24,
sizeof(dib_bits_24)),
"DIB bits don't match\n");
2244 ok(
hbmp != 0,
"CreateBitmap failed\n");
2248 ok(
lines == bm.
bmHeight,
"SetDIBits copied %d lines of %d, error %lu\n",
2251 memset(&bm, 0xAA,
sizeof(bm));
2253 ok(
bytes ==
sizeof(bm),
"GetObject returned %d\n",
bytes);
2269 memset(bi, 0,
sizeof(*bi));
2282 ok(
lines == bm.
bmHeight,
"GetDIBits copied %d lines of %d, error %lu\n",
2288 ok(colors[0].rgbRed == 0 && colors[0].rgbGreen == 0 &&
2289 colors[0].rgbBlue == 0 && colors[0].rgbReserved == 0,
2290 "expected bmiColors[0] 0,0,0,0 - got %x %x %x %x\n",
2291 colors[0].rgbRed, colors[0].rgbGreen, colors[0].rgbBlue, colors[0].rgbReserved);
2292 ok(colors[1].rgbRed == 0xff && colors[1].rgbGreen == 0xff &&
2293 colors[1].rgbBlue == 0xff && colors[1].rgbReserved == 0,
2294 "expected bmiColors[0] 0xff,0xff,0xff,0 - got %x %x %x %x\n",
2295 colors[1].rgbRed, colors[1].rgbGreen, colors[1].rgbBlue, colors[1].rgbReserved);
2296 for (
i = 2;
i < 256;
i++)
2298 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2299 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2300 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2301 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2305 ok(!
memcmp(
buf, dib_bits_1,
sizeof(dib_bits_1)),
"DIB bits don't match\n");
2311 ok(((
WORD*)colors)[0] == 0,
"Color 0 is %d\n", ((
WORD*)colors)[0]);
2312 ok(((
WORD*)colors)[1] == 1,
"Color 1 is %d\n", ((
WORD*)colors)[1]);
2313 for (
i = 2;
i < 256;
i++)
2314 ok(((
WORD*)colors)[
i] == 0xAAAA,
"Color %d is %d\n",
i, ((
WORD*)colors)[
i]);
2317 memset(bi, 0,
sizeof(*bi));
2330 ok(
lines == bm.
bmHeight,
"GetDIBits copied %d lines of %d, error %lu\n",
2336 for (
i = 0;
i < 16;
i++)
2350 "expected bmiColors[%d] %x %x %x %x - got %x %x %x %x\n",
i,
2352 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2356 memset(bi, 0,
sizeof(*bi));
2369 ok(
lines == bm.
bmHeight,
"GetDIBits copied %d lines of %d, error %lu\n",
2375 for (
i = 0;
i < 256;
i++)
2379 if (i < 10 || i >= 246)
2388 expect.rgbRed = (
i & 0x07) << 5;
2389 expect.rgbGreen = (
i & 0x38) << 2;
2395 "expected bmiColors[%d] %x %x %x %x - got %x %x %x %x\n",
i,
2397 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2401 memset(bi, 0,
sizeof(*bi));
2414 ok(
lines == bm.
bmHeight,
"GetDIBits copied %d lines of %d, error %lu\n",
2420 for (
i = 0;
i < 256;
i++)
2422 ok(colors[
i].rgbRed == 0xAA && colors[
i].rgbGreen == 0xAA &&
2423 colors[
i].rgbBlue == 0xAA && colors[
i].rgbReserved == 0xAA,
2424 "expected bmiColors[%d] 0xAA,0xAA,0xAA,0xAA - got %x %x %x %x\n",
i,
2425 colors[
i].rgbRed, colors[
i].rgbGreen, colors[
i].rgbBlue, colors[
i].rgbReserved);
2429 ok(!
memcmp(
buf, dib_bits_24,
sizeof(dib_bits_24)),
"DIB bits don't match\n");
2454 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2460 ok(
hbm !=
NULL,
"CreateCompatibleBitmap failed?\n");
2464 ok(
ret == 1,
"GetDIBits failed\n");
2473 ok( !bitmasks[0],
"red mask is set\n" );
2474 ok( !bitmasks[1],
"green mask is set\n" );
2475 ok( !bitmasks[2],
"blue mask is set\n" );
2480 ok(
ret == 1,
"GetDIBits failed\n");
2482 ok( bitmasks[0] != 0,
"red mask is not set\n" );
2483 ok( bitmasks[1] != 0,
"green mask is not set\n" );
2484 ok( bitmasks[2] != 0,
"blue mask is not set\n" );
2488 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2496 ok( bitmasks[0] != 0,
"red mask is not set\n" );
2497 ok( bitmasks[1] != 0,
"green mask is not set\n" );
2498 ok( bitmasks[2] != 0,
"blue mask is not set\n" );
2502 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2509 ok( !bitmasks[0],
"red mask is set\n" );
2510 ok( !bitmasks[1],
"green mask is set\n" );
2511 ok( !bitmasks[2],
"blue mask is set\n" );
2519 ok( bitmasks[0] != 0,
"red mask is not set\n" );
2520 ok( bitmasks[1] != 0,
"green mask is not set\n" );
2521 ok( bitmasks[2] != 0,
"blue mask is not set\n" );
2525 else skip(
"bitmap in colortable mode, skipping BI_BITFIELDS tests\n");
2542 bitmasks[0] = 0x0000ff;
2543 bitmasks[1] = 0x00ff00;
2544 bitmasks[2] = 0xff0000;
2546 ok(
hbm != 0,
"failed to create bitmap\n" );
2548 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2551 ok(
ret == 1,
"GetDIBits failed\n");
2557 ok( !bitmasks[0],
"red mask is set\n" );
2558 ok( !bitmasks[1],
"green mask is set\n" );
2559 ok( !bitmasks[2],
"blue mask is set\n" );
2563 ok(
ret == 1,
"GetDIBits failed\n");
2570 ok( bitmasks[0] == 0xff0000,
"wrong red mask %08lx\n", bitmasks[0] );
2571 ok( bitmasks[1] == 0x00ff00,
"wrong green mask %08lx\n", bitmasks[1] );
2572 ok( bitmasks[2] == 0x0000ff,
"wrong blue mask %08lx\n", bitmasks[2] );
2589 bitmasks[0] = 0x0000ff;
2590 bitmasks[1] = 0x00ff00;
2591 bitmasks[2] = 0xff0000;
2593 ok(
hbm != 0,
"failed to create bitmap\n" );
2597 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2600 ok(
ret == 1,
"GetDIBits failed\n");
2604 ok( !bitmasks[0],
"red mask is set\n" );
2605 ok( !bitmasks[1],
"green mask is set\n" );
2606 ok( !bitmasks[2],
"blue mask is set\n" );
2610 ok(
ret == 1,
"GetDIBits failed\n");
2611 ok( bitmasks[0] == 0x0000ff,
"wrong red mask %08lx\n", bitmasks[0] );
2612 ok( bitmasks[1] == 0x00ff00,
"wrong green mask %08lx\n", bitmasks[1] );
2613 ok( bitmasks[2] == 0xff0000,
"wrong blue mask %08lx\n", bitmasks[2] );
2633 ok(
hbm == 0,
"creating 24-bpp BI_BITFIELDS dibsection should fail\n" );
2636 ok(
hbm != 0,
"failed to create bitmap\n" );
2638 memset(dibinfo, 0,
sizeof(dibinfo_buf));
2641 ok(
ret == 1,
"GetDIBits failed\n");
2646 ok( !bitmasks[0],
"red mask is set\n" );
2647 ok( !bitmasks[1],
"green mask is set\n" );
2648 ok( !bitmasks[2],
"blue mask is set\n" );
2652 ok(
ret == 1,
"GetDIBits failed\n");
2654 ok( !bitmasks[0],
"red mask is set\n" );
2655 ok( !bitmasks[1],
"green mask is set\n" );
2656 ok( !bitmasks[2],
"blue mask is set\n" );
2668 DWORD depths[] = {8, 15, 16, 24, 32};
2673 ok(
hdc != 0,
"GetDC(0) failed\n");
2675 ok(
hbm != 0,
"CreateCompatibleBitmap failed\n");
2678 ok(hbm_old == 0,
"SelectObject should fail\n");
2684 ok(
hdc != 0,
"GetDC(0) failed\n");
2686 ok(
hbm != 0,
"CreateCompatibleBitmap failed\n");
2689 ok(hbm_old != 0,
"SelectObject failed\n");
2691 ok(hbm_old ==
hbm,
"SelectObject failed\n");
2695 ok(!hbm_old,
"SelectObject returned %p\n", hbm_old);
2706 ok(
hbm != 0,
"CreateBitmap failed\n");
2709 ok(hbm_old != 0,
"SelectObject failed\n");
2711 ok(hbm_old ==
hbm,
"SelectObject failed\n");
2721 ok(
hbm != 0,
"CreateBitmap failed\n");
2724 if(depths[
i] ==
bpp ||
2725 (
bpp == 16 && depths[
i] == 15)
2727 ok(hbm_old != 0,
"SelectObject failed, BITSPIXEL: %d, created depth: %ld\n",
bpp, depths[
i]);
2730 ok(hbm_old == 0,
"SelectObject should fail. BITSPIXELS: %d, created depth: %ld\n",
bpp, depths[
i]);
2733 memset(&bm, 0xAA,
sizeof(bm));
2735 ok(
bytes ==
sizeof(bm),
"GetObject returned %ld\n",
bytes);
2741 if(depths[
i] == 15) {
2765 memset(&bm, 0xDA,
sizeof(bm));
2779#define test_mono_1x1_bmp(a) test_mono_1x1_bmp_dbg((a), __LINE__)
2805 ok(bm == bm1 && bm == bm4 && bm == bm5 && bm == curObj1 && bm == old1,
2806 "0: %p, 1: %p, 4: %p, 5: %p, curObj1 %p, old1 %p\n",
2807 bm, bm1, bm4, bm5, curObj1, old1);
2808 ok(bm != bm2 && bm != bm3,
"0: %p, 2: %p, 3: %p\n", bm, bm2, bm3);
2809 ok(bm != curObj2,
"0: %p, curObj2 %p\n", bm, curObj2);
2810 ok(old2 == 0,
"old2 %p\n", old2);
2845 for(
i = 1;
i <= 33;
i++) {
2857 ok(bm == 0,
"CreateBitmapIndirect for %d bpp succeeded\n",
i);
2870 }
else if(
i <= 16) {
2872 }
else if(
i <= 24) {
2874 }
else if(
i <= 32) {
2877 ok(
bmp.
bmBitsPixel ==
expect,
"CreateBitmapIndirect for a %d bpp bitmap created a %d bpp bitmap, expected %d\n",
2899 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2960 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2972 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2977 ok(hdib ==
NULL,
"CreateDIBSection succeeded\n");
2991 int overwritten_bytes = 0;
3003 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
3004 info->bmiHeader.biWidth = 2;
3005 info->bmiHeader.biHeight = 2;
3006 info->bmiHeader.biPlanes = 1;
3010 ok(
ret != 0,
"GetDIBits failed got %d\n",
ret);
3014 overwritten_bytes++;
3015 ok(overwritten_bytes == 0,
"GetDIBits wrote past the buffer given\n");
3025 *srcBuffer = 0xFEDCBA98;
3026 *dstBuffer = 0x89ABCDEF;
3029 "BitBlt with dwRop %06lX. Expected 0x%08X, got 0x%08X from line %d\n",
3038 UINT32 *dstBuffer, *srcBuffer;
3039 HBRUSH hBrush, hOldBrush;
3102 *srcBuffer = 0xFEDCBA98;
3103 *dstBuffer = 0x89ABCDEF;
3104 StretchBlt(
hdcDst, 0, 0, 2, 1,
hdcSrc, 0, 0, 1, 1, dwRop);
3106 "StretchBlt with dwRop %06lX. Expected 0x%08X, got 0x%08X from line %d\n",
3111 int nXOriginDest,
int nYOriginDest,
int nWidthDest,
int nHeightDest,
3112 int nXOriginSrc,
int nYOriginSrc,
int nWidthSrc,
int nHeightSrc,
3117 memset(dstBuffer, 0, dst_size);
3119 hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
SRCCOPY);
3121 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X } "
3122 "stretching { %d, %d, %d, %d } to { %d, %d, %d, %d } from line %d\n",
3124 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3],
3125 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
3126 nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
line);
3134 UINT32 *dstBuffer, *srcBuffer;
3135 HBRUSH hBrush, hOldBrush;
3185 srcBuffer[0] = 0xCAFED00D; srcBuffer[1] = 0xFEEDFACE;
3186 srcBuffer[16] = 0xFEDCBA98; srcBuffer[17] = 0x76543210;
3192 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3197 0, 0, 1, 1, 0, 0, 1, 1,
expected, __LINE__);
3202 0, 0, 2, 2, 0, 0, 1, 1,
expected, __LINE__);
3208 0, 0, 1, 1, 0, 0, 2, 2,
expected, __LINE__);
3213 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3218 1, 1, -2, -2, 0, 0, 2, 2,
expected, __LINE__);
3223 1, 1, -2, -2, 1, 1, -2, -2,
expected, __LINE__);
3230 1, 1, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3234 srcBuffer[0] = 0x0000ff00; srcBuffer[1] = 0x0000f0f0; srcBuffer[2] = 0x0000cccc; srcBuffer[3] = 0x0000aaaa;
3235 srcBuffer[16] = 0xFEDCBA98; srcBuffer[17] = 0x76543210;
3240 0, 0, 1, 1, 0, 0, 2, 1,
expected, __LINE__);
3242 expected[0] = srcBuffer[0] & srcBuffer[1];
3244 0, 0, 1, 1, 0, 0, 3, 1,
expected, __LINE__);
3246 expected[0] = srcBuffer[0] & srcBuffer[1] & srcBuffer[2];
3248 0, 0, 1, 1, 0, 0, 4, 1,
expected, __LINE__);
3251 expected[0] = srcBuffer[1] & srcBuffer[2];
3253 0, 0, 1, 1, 2, 0, -2, 1,
expected, __LINE__);
3256 expected[0] = srcBuffer[0] & srcBuffer[1];
expected[1] = srcBuffer[2] & srcBuffer[3];
3258 0, 0, 2, 1, 0, 0, 4, 1,
expected, __LINE__);
3264 0, 0, 1, 1, 0, 0, 1, 2,
expected, __LINE__);
3271 expected[0] = srcBuffer[0] & srcBuffer[1] & srcBuffer[2];
3273 0, 0, 2, 2, 0, 0, 4, 1,
expected, __LINE__);
3281 2, 2, -8, -8, 0, 0, 8, 8,
expected, __LINE__);
3288 0, 0, 8, 8, 2, 2, -8, -8,
expected, __LINE__);
3294 8, 8, -18, -18, 0, 0, 18, 18,
expected, __LINE__);
3301 srcBuffer[0] = 0xCAFED00D; srcBuffer[1] = 0xFEEDFACE;
3302 srcBuffer[16] = 0xFEDCBA98; srcBuffer[17] = 0x76543210;
3314 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3319 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3328 srcBuffer[224] = 0xCAFED00D; srcBuffer[225] = 0xFEEDFACE;
3329 srcBuffer[240] = 0xFEDCBA98; srcBuffer[241] = 0x76543210;
3337 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3342 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3357 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3362 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3376 StretchBlt(
hdcSrc, 0, 0, 4, 1,
hdcDst, 0, 0, 4, 1,
SRCCOPY );
3377 memset(dstBuffer, 0x55, 4 *
sizeof(*dstBuffer));
3378 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
3382 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
3384 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
3389 memset(dstBuffer, 0x55, 4 *
sizeof(*dstBuffer));
3390 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
3394 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
3396 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
3404 *((
DWORD *)colors + 0) = 0x123456;
3405 *((
DWORD *)colors + 1) = 0x335577;
3407 srcBuffer[0] = 0x55555555;
3408 memset(dstBuffer, 0xcc, 4 *
sizeof(*dstBuffer));
3411 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
3415 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
3417 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
3428 memset(dstBuffer, 0xcc, 4 *
sizeof(*dstBuffer));
3431 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
3435 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
3437 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
3466 *dstBuffer = 0x89ABCDEF;
3468 StretchDIBits(
hdcDst, 0, 0, 2, 1, 0, 0, 1, 1, &
buffer, &bitmapInfo,
DIB_RGB_COLORS, dwRop);
3470 "StretchDIBits with dwRop %06lX. Expected 0x%08X, got 0x%08X from line %d\n",
3475 int nXOriginDest,
int nYOriginDest,
int nWidthDest,
int nHeightDest,
3476 int nXOriginSrc,
int nYOriginSrc,
int nWidthSrc,
int nHeightSrc,
3490 memset(dstBuffer, 0, 16);
3492 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
3495 "StretchDIBits expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X } "
3496 "stretching { %d, %d, %d, %d } to { %d, %d, %d, %d } from line %d\n",
3498 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3],
3499 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
3500 nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
line);
3509 UINT32 *dstBuffer, srcBuffer[4];
3510 HBRUSH hBrush, hOldBrush;
3554 srcBuffer[0] = 0xCAFED00D; srcBuffer[1] = 0xFEEDFACE;
3555 srcBuffer[2] = 0xFEDCBA98; srcBuffer[3] = 0x76543210;
3560 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3561 ok(
ret == 2,
"got ret %d\n",
ret );
3566 0, 0, 1, 1, 0, 0, 1, 1,
expected, __LINE__);
3572 0, 0, 2, 2, 0, 0, 1, 1,
expected, __LINE__);
3573 ok(
ret == 2,
"got ret %d\n",
ret );
3578 0, 0, 1, 1, 0, 0, 2, 2,
expected, __LINE__);
3579 ok(
ret == 2,
"got ret %d\n",
ret );
3584 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3585 ok(
ret == 0,
"got ret %d\n",
ret );
3590 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
3591 ok(
ret == 0,
"got ret %d\n",
ret );
3596 1, 1, -2, -2, 1, 1, -2, -2,
expected, __LINE__);
3597 ok(
ret == 0,
"got ret %d\n",
ret );
3602 1, 1, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3603 ok(
ret == 2,
"got ret %d\n",
ret );
3608 2, 2, 4, 4, 0, 0, 2, 2,
expected, __LINE__);
3609 ok(
ret == 2,
"got ret %d\n",
ret );
3614 -4, -4, 4, 4, 0, 0, 4, 4,
expected, __LINE__);
3615 ok(
ret == 2,
"got ret %d\n",
ret );
3620 1, 1, -2, -2, 1, 1, 2, 2,
expected, __LINE__);
3621 ok(
ret == 2,
"got ret %d\n",
ret );
3635 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
3658 if (!pGdiAlphaBlend)
3660 win_skip(
"GdiAlphaBlend() is not implemented\n");
3677 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3688 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3692 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -1, 0, 10, 10, blend);
3693 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3696 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, -1, 10, 10, blend);
3697 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3698 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 15, 0, 10, 10, blend);
3699 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3700 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 10, 10, -2, 3, blend);
3701 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3702 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 10, 10, -2, 3, blend);
3703 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3707 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -1, 0, 10, 10, blend);
3710 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, -1, 10, 10, blend);
3715 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -1, 0, 30, 30, blend);
3718 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, -1, 30, 30, blend);
3724 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, -1, 50, 50, blend);
3727 ret = pGdiAlphaBlend(
hdcDst, -20, -20, 20, 20,
hdcSrc, 0, -1, 50, 50, blend);
3730 ret = pGdiAlphaBlend(
hdcDst, -20, -20, -20, -20,
hdcSrc, 0, -1, 50, 50, blend);
3731 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3734 ret = pGdiAlphaBlend(
hdcDst, -20, 0, -20, 20,
hdcSrc, 0, -1, 50, 50, blend);
3735 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3738 ret = pGdiAlphaBlend(
hdcDst, 0, -20, 20, -20,
hdcSrc, 0, -1, 50, 50, blend);
3739 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3745 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -20, -20, -30, -30, blend);
3746 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3749 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -20, -20, 30, -30, blend);
3750 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3753 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -20, -20, -30, 30, blend);
3754 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3757 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -20, -20, 30, 30, blend);
3758 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3761 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 20, 20, 30, 30, blend);
3762 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3765 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, -60, -60, 30, 30, blend);
3766 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3771 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
NULL, 0, 0, 20, 20, blend);
3772 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3778 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcDst, 19, 19, 20, 20, blend);
3779 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3783 ret = pGdiAlphaBlend(
hdcDst, 20, 20, 20, 20,
hdcDst, 1, 1, 20, 20, blend);
3784 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3788 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcDst, 20, 10, 20, 20, blend);
3789 ok(
ret,
"GdiAlphaBlend succeeded\n" );
3791 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcDst, 10, 20, 20, 20, blend);
3792 ok(
ret,
"GdiAlphaBlend succeeded\n" );
3798 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3806 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3811 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3819 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3824 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3825 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3831 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3836 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3837 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3842 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3847 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3848 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3852 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
3857 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 20, 20,
hdcSrc, 0, 0, 20, 20, blend);
3858 ok( !
ret,
"GdiAlphaBlend succeeded\n" );
3878 GRADIENT_TRIANGLE tri[] = { { 0, 0, 0 }, { 0, 1, 2 }, { 0, 2, 1 }, { 0, 1, 3 } };
3879 TRIVERTEX vt[3] = { { 2, 2, 0xff00, 0x0000, 0x0000, 0x8000 },
3880 { 10, 10, 0x0000, 0xff00, 0x0000, 0x8000 },
3881 { 20, 10, 0x0000, 0x0000, 0xff00, 0xff00 } };
3883 if (!pGdiGradientFill)
3885 win_skip(
"GdiGradientFill is not implemented\n" );
3898 ok(
bmp !=
NULL,
"couldn't create bitmap\n" );
3902 ret = pGdiGradientFill(
hdc,
vt, 3,
rect, 1, GRADIENT_FILL_RECT_H );
3906 ok( !
ret,
"GdiGradientFill succeeded\n" );
3909 ret = pGdiGradientFill( (
HDC)0xdead,
vt, 3,
rect, 1, GRADIENT_FILL_RECT_H );
3910 ok( !
ret,
"GdiGradientFill succeeded\n" );
3913 ret = pGdiGradientFill(
NULL,
NULL, 0,
rect, 1, GRADIENT_FILL_RECT_H );
3914 ok( !
ret,
"GdiGradientFill succeeded\n" );
3916 ret = pGdiGradientFill(
hdc,
NULL, 0,
rect, 1, GRADIENT_FILL_RECT_H );
3917 ok( !
ret,
"GdiGradientFill succeeded\n" );
3920 ret = pGdiGradientFill(
hdc,
NULL, 3,
rect, 1, GRADIENT_FILL_RECT_H );
3921 ok( !
ret,
"GdiGradientFill succeeded\n" );
3924 ret = pGdiGradientFill(
hdc,
vt, 3,
NULL, 0, GRADIENT_FILL_RECT_H );
3925 ok( !
ret,
"GdiGradientFill succeeded\n" );
3928 ret = pGdiGradientFill(
hdc,
vt, 3,
NULL, 1, GRADIENT_FILL_RECT_H );
3929 ok( !
ret,
"GdiGradientFill succeeded\n" );
3932 ret = pGdiGradientFill(
hdc,
vt, 3,
rect, 0, GRADIENT_FILL_RECT_H );
3933 ok( !
ret,
"GdiGradientFill succeeded\n" );
3936 ret = pGdiGradientFill(
hdc,
vt, 3,
rect, 3, GRADIENT_FILL_RECT_H );
3937 ok( !
ret,
"GdiGradientFill succeeded\n" );
3939 rect[2].UpperLeft =
rect[2].LowerRight = 1;
3941 ret = pGdiGradientFill(
hdc,
vt, 3,
rect, 3, GRADIENT_FILL_RECT_H );
3944 ret = pGdiGradientFill(
hdc,
vt, 1,
rect, 1, GRADIENT_FILL_RECT_H );
3947 ret = pGdiGradientFill(
hdc,
vt, 1, tri, 0, GRADIENT_FILL_TRIANGLE );
3948 ok( !
ret,
"GdiGradientFill succeeded\n" );
3951 ret = pGdiGradientFill(
hdc,
vt, 1, tri, 1, GRADIENT_FILL_TRIANGLE );
3954 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 2, GRADIENT_FILL_TRIANGLE );
3957 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 3, GRADIENT_FILL_TRIANGLE );
3960 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE );
3961 ok( !
ret,
"GdiGradientFill succeeded\n" );
3965 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE );
3966 ok( !
ret,
"GdiGradientFill succeeded\n" );
3970 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE );
3971 ok( !
ret,
"GdiGradientFill succeeded\n" );
3975 ret = pGdiGradientFill(
hdc,
vt, 3, tri, 4, GRADIENT_FILL_TRIANGLE );
4003 ok(bmpDst !=
NULL,
"Couldn't create destination bitmap\n");
4007 ok(bmpSrc !=
NULL,
"Couldn't create source bitmap\n");
4035 DWORD colorSrc = 0x40201008;
4049 trace(
"Skipping 32-bit DDB test\n");
4061 StretchBlt(
hdcDst, 0, 0, 1, 1,
hdcSrc, 0, 0, 1, 1,
SRCCOPY);
4062 ok(dstBuffer[0] == colorSrc,
"Expected color=%lx, received color=%lx\n", colorSrc, dstBuffer[0]);
4073 dstBuffer[0] = 0x80808080;
4074 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 1, 1,
hdcSrc, 0, 0, 1, 1, blend );
4076 ok(dstBuffer[0] == 0x60504844,
"wrong color %lx\n", dstBuffer[0]);
4078 dstBuffer[0] = 0x80808080;
4079 ret = pGdiAlphaBlend(
hdcDst, 0, 0, 1, 1,
hdcSrc, 0, 0, 1, 1, blend );
4081 ok(dstBuffer[0] == 0x90807874,
"wrong color %lx\n", dstBuffer[0]);
4085 data[0] = 0x20304050;
4087 ok( brush != 0,
"brush creation failed\n" );
4091 ok(dstBuffer[0] ==
data[0],
"Expected color=%lx, received color=%lx\n",
data[0], dstBuffer[0]);
4097 ok( brush != 0,
"brush creation failed\n" );
4101 ok(dstBuffer[0] == (
data[0] & ~0xff000000),
4102 "Expected color=%lx, received color=%lx\n",
data[0] & 0xff000000, dstBuffer[0]);
4130 for (
i = 0;
i < 4;
i++)
4152 memset( &bi, 0,
sizeof(bi) );
4162 ok(
hdc !=
NULL,
"Could not get a handle to a device context.\n");
4166 ok(bmpbt !=
NULL,
"Could not create a DIB section.\n");
4172 ok(bmptb !=
NULL,
"Could not create a DIB section.\n");
4180 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4182 ok((
char)pictureOut[0] == 0,
"Bottom-up -> bottom-up: first pixel should be 0 but was %d.\n", (
char)pictureOut[0]);
4184 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4185 ok((
char)pictureOut[0] == 2,
"Top-down -> bottom-up: first pixel should be 2 but was %d.\n", (
char)pictureOut[0]);
4188 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4189 ok((
char)pictureOut[0] == 0,
"Top-down -> bottom-up: first pixel should be 0 but was %d.\n", (
char)pictureOut[0]);
4191 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4192 ok((
char)pictureOut[0] == 2,
"Bottom-up -> bottom-up: first pixel should be 2 but was %d.\n", (
char)pictureOut[0]);
4195 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4196 ok((
char)pictureOut[0] == 2,
"Top-down -> bottom-up: first scanline should be 2 but was %d.\n", (
char)pictureOut[0]);
4197 ok((
char)pictureOut[1] == 0,
"Top-down -> bottom-up: second scanline should be 0 but was %d.\n", (
char)pictureOut[0]);
4199 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4200 ok((
char)pictureOut[0] == 0,
"Bottom up -> bottom-up: first scanline should be 0 but was %d.\n", (
char)pictureOut[0]);
4201 ok((
char)pictureOut[1] == 2,
"Bottom up -> bottom-up: second scanline should be 2 but was %d.\n", (
char)pictureOut[0]);
4206 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4207 ok((
char)pictureOut[0] == 0,
"Bottom-up -> top-down: first pixel should be 0 but was %d.\n", (
char)pictureOut[0]);
4209 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4210 ok((
char)pictureOut[0] == 2,
"Top-down -> top-down: first pixel should be 2 but was %d.\n", (
char)pictureOut[0]);
4213 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4214 ok((
char)pictureOut[0] == 0,
"Top-down -> bottom-up: first pixel should be 0 but was %d.\n", (
char)pictureOut[0]);
4216 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4217 ok((
char)pictureOut[0] == 2,
"Top-down -> bottom-up: first pixel should be 2 but was %d.\n", (
char)pictureOut[0]);
4220 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4221 ok((
char)pictureOut[0] == 0,
"Top-down -> top-down: first scanline should be 0 but was %d.\n", (
char)pictureOut[0]);
4222 ok((
char)pictureOut[1] == 2,
"Top-down -> top-down: second scanline should be 2 but was %d.\n", (
char)pictureOut[0]);
4224 ok(statusCode,
"Failed to call GetDIBits. Status code: %d.\n", statusCode);
4225 ok((
char)pictureOut[0] == 2,
"Bottom up -> top-down: first scanline should be 2 but was %d.\n", (
char)pictureOut[0]);
4226 ok((
char)pictureOut[1] == 0,
"Bottom up -> top-down: second scanline should be 0 but was %d.\n", (
char)pictureOut[0]);
4238 DWORD bits_1[8 * 8], bits_2[8 * 8];
4250 info.bmiHeader.biWidth = 8;
4251 info.bmiHeader.biHeight = 8;
4252 info.bmiHeader.biPlanes = 1;
4253 info.bmiHeader.biBitCount = 32;
4260 ok(bits_1[56] == 0xff0000,
"got %08lx\n", bits_1[56]);
4267 ok(!
memcmp( bits_1, bits_2,
sizeof(bits_1) ),
"bits differ\n");
4278 ok(!
memcmp( bits_1, bits_2,
sizeof(bits_1) ),
"bits differ\n");
4286 ok(!
memcmp( bits_1, bits_2,
sizeof(bits_1) ),
"bits differ\n");
4304 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4305 info->bmiHeader.biWidth = 8;
4306 info->bmiHeader.biHeight = 8;
4307 info->bmiHeader.biPlanes = 1;
4308 info->bmiHeader.biBitCount = 32;
4313 for (
i = 0;
i < 64;
i++)
4316 inverted_bits[56 - (
i & ~7) + (
i & 7)] =
i;
4325 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4330 ok( !
memcmp(
data, dib_bits + 8, 40 * 4 ),
"bits differ\n");
4331 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4336 ok( !
memcmp(
data, dib_bits + 8, 56 * 4 ),
"bits differ\n");
4337 for (
i = 56;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4342 for (
i = 0;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4345 info->bmiHeader.biHeight = 16;
4346 info->bmiHeader.biSizeImage = 0;
4349 ok(
info->bmiHeader.biSizeImage == 128 * 4,
"got %ld\n",
info->bmiHeader.biSizeImage );
4350 for (
i = 0;
i < 56;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4351 ok( !
memcmp(
data + 56, dib_bits, 40 * 4 ),
"bits differ\n");
4352 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4357 for (
i = 0;
i < 48;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4358 ok( !
memcmp(
data + 48, dib_bits, 48 * 4 ),
"bits differ\n");
4359 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4364 for (
i = 0;
i < 24;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4365 for (
i = 24;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4368 info->bmiHeader.biHeight = 5;
4371 ok( !
memcmp(
data, dib_bits + 32, 16 * 4 ),
"bits differ\n");
4372 for (
i = 16;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4377 info->bmiHeader.biHeight = -8;
4380 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4385 ok( !
memcmp(
data, inverted_bits + 16, 40 * 4 ),
"bits differ\n");
4386 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4391 ok( !
memcmp(
data, inverted_bits, 56 * 4 ),
"bits differ\n");
4392 for (
i = 56;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4397 ok( !
memcmp(
data, inverted_bits, 32 * 4 ),
"bits differ\n");
4398 for (
i = 32;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4403 ok( !
memcmp(
data, inverted_bits, 40 * 4 ),
"bits differ\n");
4404 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4409 ok( !
memcmp(
data, inverted_bits, 40 * 4 ),
"bits differ\n");
4410 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4413 info->bmiHeader.biHeight = -16;
4416 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4417 for (
i = 64;
i < 128;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4422 ok( !
memcmp(
data, inverted_bits + 24, 40 * 4 ),
"bits differ\n");
4423 for (
i = 40;
i < 96;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4424 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4429 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4430 for (
i = 64;
i < 96;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4431 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4436 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4437 for (
i = 64;
i < 88;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4438 for (
i = 88;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4443 ok( !
memcmp(
data, inverted_bits, 56 * 4 ),
"bits differ\n");
4444 for (
i = 56;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4449 for (
i = 0;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4452 info->bmiHeader.biHeight = -5;
4455 ok( !
memcmp(
data, inverted_bits + 16, 16 * 4 ),
"bits differ\n");
4456 for (
i = 16;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4461 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4462 info->bmiHeader.biWidth = 8;
4463 info->bmiHeader.biHeight = -8;
4464 info->bmiHeader.biPlanes = 1;
4465 info->bmiHeader.biBitCount = 32;
4470 for (
i = 0;
i < 64;
i++) dib_bits[
i] =
i;
4474 info->bmiHeader.biHeight = -8;
4477 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4482 ok( !
memcmp(
data, dib_bits + 16, 40 * 4 ),
"bits differ\n");
4483 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4488 ok( !
memcmp(
data, dib_bits, 56 * 4 ),
"bits differ\n");
4489 for (
i = 56;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4494 ok( !
memcmp(
data, dib_bits, 32 * 4 ),
"bits differ\n");
4495 for (
i = 32;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4500 ok( !
memcmp(
data, dib_bits, 40 * 4 ),
"bits differ\n");
4501 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4506 ok( !
memcmp(
data, dib_bits, 40 * 4 ),
"bits differ\n");
4507 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4510 info->bmiHeader.biHeight = -16;
4513 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4514 for (
i = 64;
i < 128;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4519 ok( !
memcmp(
data, dib_bits + 24, 40 * 4 ),
"bits differ\n");
4520 for (
i = 40;
i < 96;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4521 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4526 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4527 for (
i = 64;
i < 96;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4528 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4533 ok( !
memcmp(
data, dib_bits, 64 * 4 ),
"bits differ\n");
4534 for (
i = 64;
i < 88;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4535 for (
i = 88;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4540 ok( !
memcmp(
data, dib_bits, 56 * 4 ),
"bits differ\n");
4541 for (
i = 56;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4544 info->bmiHeader.biHeight = -5;
4547 ok( !
memcmp(
data, dib_bits + 16, 16 * 4 ),
"bits differ\n");
4548 for (
i = 16;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4554 info->bmiHeader.biHeight = 8;
4558 ok( !
memcmp(
data, inverted_bits, 64 * 4 ),
"bits differ\n");
4563 ok( !
memcmp(
data, inverted_bits + 8, 40 * 4 ),
"bits differ\n");
4564 for (
i = 40;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4569 ok( !
memcmp(
data, inverted_bits + 8, 56 * 4 ),
"bits differ\n");
4570 for (
i = 56;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4575 for (
i = 0;
i < 64;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4578 info->bmiHeader.biHeight = 16;
4581 for (
i = 0;
i < 56;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4582 ok( !
memcmp(
data + 56, inverted_bits, 40 * 4 ),
"bits differ\n");
4583 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4588 for (
i = 0;
i < 48;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4589 ok( !
memcmp(
data + 48, inverted_bits, 48 * 4 ),
"bits differ\n");
4590 for (
i = 96;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4595 for (
i = 0;
i < 24;
i++)
ok(
data[
i] == 0,
"%d: got %08lx\n",
i,
data[
i] );
4596 for (
i = 24;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4599 info->bmiHeader.biHeight = 5;
4602 ok( !
memcmp(
data, inverted_bits + 32, 16 * 4 ),
"bits differ\n");
4603 for (
i = 16;
i < 128;
i++)
ok(
data[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i,
data[
i] );
4627 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4628 info->bmiHeader.biWidth = 8;
4629 info->bmiHeader.biHeight = 8;
4630 info->bmiHeader.biPlanes = 1;
4631 info->bmiHeader.biBitCount = 32;
4635 memset( dib_bits, 0xaa, 64 * 4 );
4637 for (
i = 0;
i < 128;
i++)
4640 inverted_data[120 - (
i & ~7) + (
i & 7)] =
i;
4647 ok( !
memcmp( dib_bits,
data, 64 * 4 ),
"bits differ\n");
4648 memset( dib_bits, 0xaa, 64 * 4 );
4652 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4653 ok( !
memcmp( dib_bits + 8,
data, 40 * 4 ),
"bits differ\n");
4654 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4655 memset( dib_bits, 0xaa, 64 * 4 );
4660 info->bmiHeader.biHeight = 16;
4663 ok( !
memcmp( dib_bits,
data + 56, 40 * 4 ),
"bits differ\n");
4664 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4665 memset( dib_bits, 0xaa, 64 * 4 );
4667 info->bmiHeader.biHeight = 5;
4670 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4671 ok( !
memcmp( dib_bits + 32,
data, 16 * 4 ),
"bits differ\n");
4672 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4673 memset( dib_bits, 0xaa, 64 * 4 );
4676 info->bmiHeader.biHeight = -8;
4679 ok( !
memcmp( dib_bits, inverted_data + 64, 64 * 4 ),
"bits differ\n");
4680 memset( dib_bits, 0xaa, 64 * 4 );
4687 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4688 ok( !
memcmp( dib_bits + 8, inverted_data + 88, 40 * 4 ),
"bits differ\n");
4689 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4690 memset( dib_bits, 0xaa, 64 * 4 );
4692 info->bmiHeader.biHeight = -16;
4695 ok( !
memcmp( dib_bits, inverted_data + 88, 40 * 4 ),
"bits differ\n");
4696 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4697 memset( dib_bits, 0xaa, 64 * 4 );
4701 ok( !
memcmp( dib_bits, inverted_data + 64, 64 * 4 ),
"bits differ\n");
4702 memset( dib_bits, 0xaa, 64 * 4 );
4706 ok( !
memcmp( dib_bits, inverted_data + 56, 64 * 4 ),
"bits differ\n");
4707 memset( dib_bits, 0xaa, 64 * 4 );
4709 info->bmiHeader.biHeight = -5;
4712 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4713 ok( !
memcmp( dib_bits + 32, inverted_data + 112, 16 * 4 ),
"bits differ\n");
4714 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4715 memset( dib_bits, 0xaa, 64 * 4 );
4719 info->bmiHeader.biHeight = -8;
4722 memset( dib_bits, 0xaa, 16 * 16 * 4 );
4730 ok( !
memcmp( dib_bits,
data, 64 * 4 ),
"bits differ\n");
4731 memset( dib_bits, 0xaa, 64 * 4 );
4735 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4736 ok( !
memcmp( dib_bits + 16,
data, 40 * 4 ),
"bits differ\n");
4737 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4738 memset( dib_bits, 0xaa, 64 * 4 );
4740 info->bmiHeader.biHeight = -16;
4743 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4744 ok( !
memcmp( dib_bits + 24,
data, 40 * 4 ),
"bits differ\n");
4745 memset( dib_bits, 0xaa, 64 * 4 );
4747 info->bmiHeader.biHeight = -5;
4750 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4751 ok( !
memcmp( dib_bits + 16,
data, 16 * 4 ),
"bits differ\n");
4752 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4753 memset( dib_bits, 0xaa, 64 * 4 );
4758 info->bmiHeader.biHeight = 8;
4761 ok( !
memcmp( dib_bits, inverted_data + 64, 64 * 4 ),
"bits differ\n");
4762 memset( dib_bits, 0xaa, 64 * 4 );
4766 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4767 ok( !
memcmp( dib_bits + 16, inverted_data + 88, 40 * 4 ),
"bits differ\n");
4768 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4769 memset( dib_bits, 0xaa, 64 * 4 );
4771 info->bmiHeader.biHeight = 16;
4774 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4775 ok( !
memcmp( dib_bits + 24, inverted_data + 32, 40 * 4 ),
"bits differ\n");
4776 memset( dib_bits, 0xaa, 64 * 4 );
4778 info->bmiHeader.biHeight = 5;
4781 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4782 ok( !
memcmp( dib_bits + 16, inverted_data + 112, 16 * 4 ),
"bits differ\n");
4783 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4784 memset( dib_bits, 0xaa, 64 * 4 );
4788 info->bmiHeader.biHeight = -8;
4789 info->bmiHeader.biBitCount = 8;
4790 info->bmiHeader.biClrUsed = 137;
4791 for (
i = 0;
i < 256;
i++)
4793 info->bmiColors[
i].rgbRed = 255 -
i;
4794 info->bmiColors[
i].rgbGreen =
i * 2;
4795 info->bmiColors[
i].rgbBlue =
i;
4796 info->bmiColors[
i].rgbReserved = 0;
4801 for (
i = 0;
i < 64;
i++)
4803 int idx =
i * 4 + 1;
4805 info->bmiColors[
idx].rgbGreen << 8 |
4806 info->bmiColors[
idx].rgbBlue);
4807 ok( dib_bits[
i] ==
expect,
"%d: got %08lx instead of %08lx\n",
i, dib_bits[
i],
expect );
4809 memset( dib_bits, 0xaa, 64 * 4 );
4815 info->bmiHeader.biClrUsed = 221;
4816 for (
i = 0;
i < 256;
i++)
4823 ok(
palette != 0,
"palette creation failed\n" );
4825 for (
i = 0;
i < 256;
i++) ((
WORD *)
info->bmiColors)[
i] = 255 -
i;
4828 for (
i = 0;
i < 64;
i++)
4830 int idx =
i * 4 + 1;
4835 "%d: got %08lx instead of %08lx\n",
i, dib_bits[
i],
expect );
4837 memset( dib_bits, 0xaa, 64 * 4 );
4850 BYTE rle4_data[26] = { 0x03, 0x52, 0x07, 0x68, 0x00, 0x00,
4851 0x00, 0x03, 0x14, 0x50, 0x00, 0x05,
4852 0x79, 0xfd, 0xb0, 0x00, 0x00, 0x00,
4853 0x00, 0x02, 0x01, 0x02, 0x05, 0x87,
4857 DWORD bottom_up[64] = { 0x00050505, 0x00020202, 0x00050505, 0x00060606, 0x00080808, 0x00060606, 0x00080808, 0x00060606,
4858 0x00010101, 0x00040404, 0x00050505, 0x00070707, 0x00090909, 0x000f0f0f, 0x000d0d0d, 0x000b0b0b,
4859 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4860 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4861 0xaaaaaaaa, 0x00080808, 0x00070707, 0x00080808, 0x00070707, 0x00080808, 0xaaaaaaaa, 0xaaaaaaaa,
4862 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4863 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4864 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa };
4868 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4869 info->bmiHeader.biWidth = 8;
4870 info->bmiHeader.biHeight = 8;
4871 info->bmiHeader.biPlanes = 1;
4872 info->bmiHeader.biBitCount = 32;
4876 memset( dib_bits, 0xaa, 64 * 4 );
4878 info->bmiHeader.biBitCount = 4;
4880 info->bmiHeader.biSizeImage =
sizeof(rle4_data);
4882 for (
i = 0;
i < 16;
i++)
4884 info->bmiColors[
i].rgbRed =
i;
4885 info->bmiColors[
i].rgbGreen =
i;
4886 info->bmiColors[
i].rgbBlue =
i;
4887 info->bmiColors[
i].rgbReserved = 0;
4892 ok( !
memcmp( dib_bits, bottom_up,
sizeof(bottom_up) ),
"bits differ\n" );
4893 memset( dib_bits, 0xaa, 64 * 4 );
4906 0x00, 0x03, 0x04, 0x05, 0x06, 0x00,
4907 0x00, 0x02, 0x01, 0x02, 0x05, 0x80,
4911 DWORD bottom_up[64] = { 0x00020202, 0x00020202, 0x00020202, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0xaaaaaaaa,
4912 0x00040404, 0x00050505, 0x00060606, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4913 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4914 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x00808080, 0x00808080, 0x00808080, 0x00808080,
4915 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4916 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4917 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4918 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa };
4919 DWORD top_down[64] = { 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4920 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4921 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4922 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4923 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x00808080, 0x00808080, 0x00808080, 0x00808080,
4924 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4925 0x00040404, 0x00050505, 0x00060606, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
4926 0x00020202, 0x00020202, 0x00020202, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0xaaaaaaaa };
4930 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
4931 info->bmiHeader.biWidth = 8;
4932 info->bmiHeader.biHeight = 8;
4933 info->bmiHeader.biPlanes = 1;
4934 info->bmiHeader.biBitCount = 32;
4938 memset( dib_bits, 0xaa, 64 * 4 );
4940 info->bmiHeader.biBitCount = 8;
4944 for (
i = 0;
i < 256;
i++)
4946 info->bmiColors[
i].rgbRed =
i;
4947 info->bmiColors[
i].rgbGreen =
i;
4948 info->bmiColors[
i].rgbBlue =
i;
4949 info->bmiColors[
i].rgbReserved = 0;
4954 ok( !
memcmp( dib_bits, bottom_up,
sizeof(bottom_up) ),
"bits differ\n");
4955 memset( dib_bits, 0xaa, 64 * 4 );
4960 ok( !
memcmp( dib_bits, bottom_up,
sizeof(bottom_up) ),
"bits differ\n");
4961 memset( dib_bits, 0xaa, 64 * 4 );
4965 ok( !
memcmp( dib_bits, bottom_up,
sizeof(bottom_up) ),
"bits differ\n");
4966 memset( dib_bits, 0xaa, 64 * 4 );
4970 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4971 memset( dib_bits, 0xaa, 64 * 4 );
4974 info->bmiHeader.biWidth = 4;
4977 for (
i = 0;
i < 64;
i++)
4980 ok( dib_bits[
i] ==
expect,
"%d: got %08lx\n",
i, dib_bits[
i] );
4982 memset( dib_bits, 0xaa, 64 * 4 );
4987 info->bmiHeader.biWidth = 8;
4988 info->bmiHeader.biHeight = 4;
4991 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
4992 ok( !
memcmp( dib_bits + 32, bottom_up, 32 * 4 ),
"bits differ\n");
4993 memset( dib_bits, 0xaa, 64 * 4 );
4996 info->bmiHeader.biHeight = 9;
4999 ok( !
memcmp( dib_bits, bottom_up + 8, 56 * 4 ),
"bits differ\n");
5000 for (
i = 0;
i < 8;
i++)
ok( dib_bits[56 +
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[56 +
i] );
5001 memset( dib_bits, 0xaa, 64 * 4 );
5004 info->bmiHeader.biHeight = -8;
5013 info->bmiHeader.biHeight = -8;
5014 info->bmiHeader.biBitCount = 32;
5016 info->bmiHeader.biSizeImage = 0;
5019 memset( dib_bits, 0xaa, 16 * 16 * 4 );
5021 info->bmiHeader.biHeight = 8;
5022 info->bmiHeader.biBitCount = 8;
5028 ok( !
memcmp( dib_bits, top_down,
sizeof(top_down) ),
"bits differ\n");
5029 memset( dib_bits, 0xaa, 64 * 4 );
5031 info->bmiHeader.biHeight = 4;
5034 ok( !
memcmp( dib_bits, top_down + 32, 32 * 4 ),
"bits differ\n");
5035 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5036 memset( dib_bits, 0xaa, 64 * 4 );
5038 info->bmiHeader.biHeight = 9;
5041 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5042 ok( !
memcmp( dib_bits + 8, top_down, 56 * 4 ),
"bits differ\n");
5043 memset( dib_bits, 0xaa, 64 * 4 );
5065 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
5066 info->bmiHeader.biWidth = 8;
5067 info->bmiHeader.biHeight = 8;
5068 info->bmiHeader.biPlanes = 1;
5069 info->bmiHeader.biBitCount = 32;
5073 memset( dib_bits, 0xaa, 64 * 4 );
5076 for (
i = 0;
i < 128;
i++)
5079 inverted_data[120 - (
i & ~7) + (
i & 7)] =
i;
5084 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5086 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] ==
data[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5087 memset( dib_bits, 0xaa, 64 * 4 );
5089 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 5,
data,
info,
DIB_RGB_COLORS );
5091 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5092 for (
i = 8;
i < 48;
i++)
ok( dib_bits[
i] ==
data[
i - 8],
"%d: got %08lx\n",
i, dib_bits[
i] );
5093 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5094 memset( dib_bits, 0xaa, 64 * 4 );
5096 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 3, 1, 5,
data,
info,
DIB_RGB_COLORS );
5098 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] ==
data[
i + 16],
"%d: got %08lx\n",
i, dib_bits[
i] );
5099 for (
i = 24;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5100 memset( dib_bits, 0xaa, 64 * 4 );
5102 info->bmiHeader.biHeight = 16;
5103 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 12,
data,
info,
DIB_RGB_COLORS );
5105 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5106 for (
i = 8;
i < 64;
i++)
ok( dib_bits[
i] ==
data[
i - 8],
"%d: got %08lx\n",
i, dib_bits[
i] );
5107 memset( dib_bits, 0xaa, 64 * 4 );
5109 ret =
SetDIBitsToDevice(
hdc, 0, 2, 8, 8, 0, 6, 1, 12,
data,
info,
DIB_RGB_COLORS );
5111 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] ==
data[
i + 56],
"%d: got %08lx\n",
i, dib_bits[
i] );
5112 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5113 memset( dib_bits, 0xaa, 64 * 4 );
5115 ret =
SetDIBitsToDevice(
hdc, 0, -4, 8, 8, 0, 3, 1, 12,
data,
info,
DIB_RGB_COLORS );
5117 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5118 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] ==
data[
i - 16],
"%d: got %08lx\n",
i, dib_bits[
i] );
5119 memset( dib_bits, 0xaa, 64 * 4 );
5121 ret =
SetDIBitsToDevice(
hdc, 0, 4, 8, 8, 0, -3, 1, 12,
data,
info,
DIB_RGB_COLORS );
5123 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] ==
data[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5124 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5125 memset( dib_bits, 0xaa, 64 * 4 );
5127 ret =
SetDIBitsToDevice(
hdc, 0, 2, 8, 5, 0, -2, 1, 12,
data,
info,
DIB_RGB_COLORS );
5129 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5130 for (
i = 32;
i < 48;
i++)
ok( dib_bits[
i] ==
data[
i - 32],
"%d: got %08lx\n",
i, dib_bits[
i] );
5131 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5132 memset( dib_bits, 0xaa, 64 * 4 );
5134 info->bmiHeader.biHeight = 5;
5135 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 2, 2,
data,
info,
DIB_RGB_COLORS );
5137 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5138 for (
i = 16;
i < 32;
i++)
ok( dib_bits[
i] ==
data[
i - 16],
"%d: got %08lx\n",
i, dib_bits[
i] );
5139 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5140 memset( dib_bits, 0xaa, 64 * 4 );
5142 ret =
SetDIBitsToDevice(
hdc, 3, 3, 2, 2, 1, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5144 for (
i = 0;
i < 64;
i++)
5145 if (
i == 27 ||
i == 28 ||
i == 35 ||
i == 36)
5146 ok( dib_bits[
i] ==
data[
i - 18],
"%d: got %08lx\n",
i, dib_bits[
i] );
5148 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5149 memset( dib_bits, 0xaa, 64 * 4 );
5151 ret =
SetDIBitsToDevice(
hdc, 0, 0, 16, 16, 0, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5153 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5154 memset( dib_bits, 0xaa, 64 * 4 );
5156 ret =
SetDIBitsToDevice(
hdc, 0, 2, 8, 4, 0, -1, 3, 12,
data,
info,
DIB_RGB_COLORS );
5158 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5159 memset( dib_bits, 0xaa, 64 * 4 );
5163 ret =
SetDIBitsToDevice(
hdc, 2, 2, 2, 2, 1, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5165 for (
i = 0;
i < 64;
i++)
5166 if (
i == 41 ||
i == 42 ||
i == 49 ||
i == 50)
5167 ok( dib_bits[
i] ==
data[
i - 32],
"%d: got %08lx\n",
i, dib_bits[
i] );
5169 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5170 memset( dib_bits, 0xaa, 64 * 4 );
5173 ret =
SetDIBitsToDevice(
hdc, 2, 2, 4, 4, 1, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5175 for (
i = 0;
i < 64;
i++)
5176 if (
i == 48 ||
i == 49 ||
i == 56 ||
i == 57)
5177 ok( dib_bits[
i] ==
data[
i - 37],
"%d: got %08lx\n",
i, dib_bits[
i] );
5179 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5180 memset( dib_bits, 0xaa, 64 * 4 );
5184 ret =
SetDIBitsToDevice(
hdc, 1, 2, 3, 2, 1, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5186 for (
i = 0;
i < 64;
i++)
5187 if (
i == 36 ||
i == 37 ||
i == 38 ||
i == 44 ||
i == 45 ||
i == 46)
5188 ok( dib_bits[
i] ==
data[
i - 27],
"%d: got %08lx\n",
i, dib_bits[
i] );
5190 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5191 memset( dib_bits, 0xaa, 64 * 4 );
5195 info->bmiHeader.biHeight = -8;
5196 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5198 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i + 64],
"%d: got %08lx\n",
i, dib_bits[
i] );
5199 memset( dib_bits, 0xaa, 64 * 4 );
5201 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 5,
data,
info,
DIB_RGB_COLORS );
5203 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5204 for (
i = 8;
i < 48;
i++)
ok( dib_bits[
i] == inverted_data[
i + 80],
"%d: got %08lx\n",
i, dib_bits[
i] );
5205 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5206 memset( dib_bits, 0xaa, 64 * 4 );
5208 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 4, 1, 5,
data,
info,
DIB_RGB_COLORS );
5210 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == inverted_data[
i + 112],
"%d: got %08lx\n",
i, dib_bits[
i] );
5211 for (
i = 16;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5212 memset( dib_bits, 0xaa, 64 * 4 );
5214 info->bmiHeader.biHeight = -16;
5215 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 12,
data,
info,
DIB_RGB_COLORS );
5217 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5218 for (
i = 8;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i + 24],
"%d: got %08lx\n",
i, dib_bits[
i] );
5219 memset( dib_bits, 0xaa, 64 * 4 );
5221 ret =
SetDIBitsToDevice(
hdc, 0, 4, 8, 8, 0, 7, 1, 12,
data,
info,
DIB_RGB_COLORS );
5223 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == inverted_data[
i + 112],
"%d: got %08lx\n",
i, dib_bits[
i] );
5224 for (
i = 16;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5225 memset( dib_bits, 0xaa, 64 * 4 );
5227 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 4, 12,
data,
info,
DIB_RGB_COLORS );
5229 for (
i = 0;
i < 32;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5230 for (
i = 32;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5231 memset( dib_bits, 0xaa, 64 * 4 );
5233 ret =
SetDIBitsToDevice(
hdc, 0, -3, 8, 8, 0, 2, 4, 12,
data,
info,
DIB_RGB_COLORS );
5235 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5236 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i - 8],
"%d: got %08lx\n",
i, dib_bits[
i] );
5237 memset( dib_bits, 0xaa, 64 * 4 );
5239 ret =
SetDIBitsToDevice(
hdc, 0, 3, 8, 8, 0, -2, 4, 12,
data,
info,
DIB_RGB_COLORS );
5241 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5242 for (
i = 24;
i < 40;
i++)
ok( dib_bits[
i] == inverted_data[
i + 8],
"%d: got %08lx\n",
i, dib_bits[
i] );
5243 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5244 memset( dib_bits, 0xaa, 64 * 4 );
5246 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 5, 12,
data,
info,
DIB_RGB_COLORS );
5248 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5249 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i - 8],
"%d: got %08lx\n",
i, dib_bits[
i] );
5250 memset( dib_bits, 0xaa, 64 * 4 );
5252 ret =
SetDIBitsToDevice(
hdc, 0, 2, 8, 4, 0, -1, 3, 12,
data,
info,
DIB_RGB_COLORS );
5254 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5255 memset( dib_bits, 0xaa, 64 * 4 );
5257 ret =
SetDIBitsToDevice(
hdc, 5, -7, 8, 16, -2, -4, 0, 12,
data,
info,
DIB_RGB_COLORS );
5259 for (
i = 0;
i < 64;
i++)
5260 if (
i == 31 ||
i == 39 ||
i == 47 ||
i == 55 ||
i == 63)
5261 ok( dib_bits[
i] == inverted_data[
i + 1],
"%d: got %08lx\n",
i, dib_bits[
i] );
5263 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5264 memset( dib_bits, 0xaa, 64 * 4 );
5266 info->bmiHeader.biHeight = -5;
5267 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 2,
data,
info,
DIB_RGB_COLORS );
5269 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5270 for (
i = 8;
i < 24;
i++)
ok( dib_bits[
i] == inverted_data[
i + 104],
"%d: got %08lx\n",
i, dib_bits[
i] );
5271 for (
i = 24;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5272 memset( dib_bits, 0xaa, 64 * 4 );
5274 ret =
SetDIBitsToDevice(
hdc, 5, 4, 2, 2, 6, 3, 1, 5,
data,
info,
DIB_RGB_COLORS );
5276 for (
i = 0;
i < 64;
i++)
5277 if (
i == 21 ||
i == 22 ||
i == 29 ||
i == 30)
5278 ok( dib_bits[
i] == inverted_data[
i + 89],
"%d: got %08lx\n",
i, dib_bits[
i] );
5280 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5281 memset( dib_bits, 0xaa, 64 * 4 );
5283 ret =
SetDIBitsToDevice(
hdc, 0, 0, 16, 16, 0, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5285 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5286 memset( dib_bits, 0xaa, 64 * 4 );
5288 info->bmiHeader.biHeight = -8;
5292 memset( dib_bits, 0xaa, 16 * 16 * 4 );
5296 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5298 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] ==
data[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5299 memset( dib_bits, 0xaa, 64 * 4 );
5301 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 5,
data,
info,
DIB_RGB_COLORS );
5303 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5304 for (
i = 16;
i < 56;
i++)
ok( dib_bits[
i] ==
data[
i - 16],
"%d: got %08lx\n",
i, dib_bits[
i] );
5305 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5306 memset( dib_bits, 0xaa, 64 * 4 );
5308 ret =
SetDIBitsToDevice(
hdc, 0, 3, 8, 3, 0, 2, 1, 5,
data,
info,
DIB_RGB_COLORS );
5310 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5311 for (
i = 24;
i < 48;
i++)
ok( dib_bits[
i] ==
data[
i - 16],
"%d: got %08lx\n",
i, dib_bits[
i] );
5312 for (
i = 48;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5313 memset( dib_bits, 0xaa, 64 * 4 );
5315 info->bmiHeader.biHeight = -16;
5316 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 12,
data,
info,
DIB_RGB_COLORS );
5318 for (
i = 0;
i < 56;
i++)
ok( dib_bits[
i] ==
data[
i + 40],
"%d: got %08lx\n",
i, dib_bits[
i] );
5319 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5320 memset( dib_bits, 0xaa, 64 * 4 );
5322 ret =
SetDIBitsToDevice(
hdc, 5, -7, 8, 16, -1, -8, 0, 12,
data,
info,
DIB_RGB_COLORS );
5324 for (
i = 0;
i < 64;
i++)
5325 if (
i == 6 ||
i == 7)
5326 ok( dib_bits[
i] ==
data[
i + 82],
"%d: got %08lx\n",
i, dib_bits[
i] );
5328 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5329 memset( dib_bits, 0xaa, 64 * 4 );
5331 info->bmiHeader.biHeight = -5;
5332 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 2,
data,
info,
DIB_RGB_COLORS );
5334 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5335 for (
i = 40;
i < 56;
i++)
ok( dib_bits[
i] ==
data[
i - 40],
"%d: got %08lx\n",
i, dib_bits[
i] );
5336 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5337 memset( dib_bits, 0xaa, 64 * 4 );
5339 ret =
SetDIBitsToDevice(
hdc, 7, 2, 8, 8, 1, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5341 for (
i = 0;
i < 64;
i++)
5342 if (
i == 47 ||
i == 55 ||
i == 63)
5343 ok( dib_bits[
i] ==
data[
i - 46],
"%d: got %08lx\n",
i, dib_bits[
i] );
5345 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5346 memset( dib_bits, 0xaa, 64 * 4 );
5348 ret =
SetDIBitsToDevice(
hdc, 0, 0, 16, 16, 0, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5350 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5351 memset( dib_bits, 0xaa, 64 * 4 );
5355 info->bmiHeader.biHeight = 8;
5356 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5358 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == inverted_data[
i + 64],
"%d: got %08lx\n",
i, dib_bits[
i] );
5359 memset( dib_bits, 0xaa, 64 * 4 );
5361 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 5,
data,
info,
DIB_RGB_COLORS );
5363 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5364 for (
i = 16;
i < 56;
i++)
ok( dib_bits[
i] == inverted_data[
i + 72],
"%d: got %08lx\n",
i, dib_bits[
i] );
5365 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5366 memset( dib_bits, 0xaa, 64 * 4 );
5368 info->bmiHeader.biHeight = 16;
5369 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 12,
data,
info,
DIB_RGB_COLORS );
5371 for (
i = 0;
i < 56;
i++)
ok( dib_bits[
i] == inverted_data[
i + 72],
"%d: got %08lx\n",
i, dib_bits[
i] );
5372 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5373 memset( dib_bits, 0xaa, 64 * 4 );
5375 ret =
SetDIBitsToDevice(
hdc, 4, 4, 8, 8, 0, -4, 1, 12,
data,
info,
DIB_RGB_COLORS );
5377 for (
i = 0;
i < 64;
i++)
5378 if ((
i >= 36 &&
i <= 39) || (
i >= 44 &&
i <= 47) || (
i >= 52 &&
i <= 55))
5379 ok( dib_bits[
i] == inverted_data[
i + 68],
"%d: got %08lx\n",
i, dib_bits[
i] );
5381 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5382 memset( dib_bits, 0xaa, 64 * 4 );
5384 ret =
SetDIBitsToDevice(
hdc, 4, 4, 8, 8, -30, -30, 1, 12,
data,
info,
DIB_RGB_COLORS );
5386 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5387 memset( dib_bits, 0xaa, 64 * 4 );
5389 ret =
SetDIBitsToDevice(
hdc, 5, -5, 8, 16, -2, -4, 4, 12,
data,
info,
DIB_RGB_COLORS );
5391 for (
i = 0;
i < 64;
i++)
5392 if (
i == 7 ||
i == 15 ||
i == 23)
5393 ok( dib_bits[
i] == inverted_data[
i + 97],
"%d: got %08lx\n",
i, dib_bits[
i] );
5395 ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5396 memset( dib_bits, 0xaa, 64 * 4 );
5398 info->bmiHeader.biHeight = 5;
5399 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 2,
data,
info,
DIB_RGB_COLORS );
5401 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5402 for (
i = 40;
i < 56;
i++)
ok( dib_bits[
i] == inverted_data[
i + 72],
"%d: got %08lx\n",
i, dib_bits[
i] );
5403 for (
i = 56;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5404 memset( dib_bits, 0xaa, 64 * 4 );
5406 ret =
SetDIBitsToDevice(
hdc, 0, 0, 16, 16, 0, 0, 0, 5,
data,
info,
DIB_RGB_COLORS );
5408 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5409 memset( dib_bits, 0xaa, 64 * 4 );
5413 info->bmiHeader.biHeight = -8;
5414 info->bmiHeader.biBitCount = 8;
5415 info->bmiHeader.biClrUsed = 137;
5416 for (
i = 0;
i < 256;
i++)
5418 info->bmiColors[
i].rgbRed = 255 -
i;
5419 info->bmiColors[
i].rgbGreen =
i * 2;
5420 info->bmiColors[
i].rgbBlue =
i;
5421 info->bmiColors[
i].rgbReserved = 0;
5424 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_RGB_COLORS );
5426 for (
i = 0;
i < 64;
i++)
5428 int idx =
i * 4 + 1;
5430 info->bmiColors[
idx].rgbGreen << 8 |
5431 info->bmiColors[
idx].rgbBlue);
5432 ok( dib_bits[
i] ==
expect,
"%d: got %08lx instead of %08lx\n",
i, dib_bits[
i],
expect );
5434 memset( dib_bits, 0xaa, 64 * 4 );
5440 info->bmiHeader.biClrUsed = 221;
5441 for (
i = 0;
i < 256;
i++)
5448 ok(
palette != 0,
"palette creation failed\n" );
5450 for (
i = 0;
i < 256;
i++) ((
WORD *)
info->bmiColors)[
i] = 255 -
i;
5451 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
data,
info,
DIB_PAL_COLORS );
5453 for (
i = 0;
i < 64;
i++)
5455 int idx =
i * 4 + 1;
5460 "%d: got %08lx instead of %08lx\n",
i, dib_bits[
i],
expect );
5462 memset( dib_bits, 0xaa, 64 * 4 );
5476 0x00, 0x03, 0x04, 0x05, 0x06, 0x00,
5477 0x00, 0x02, 0x01, 0x02, 0x05, 0x80,
5481 DWORD bottom_up[64] = { 0x00020202, 0x00020202, 0x00020202, 0x00020202, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0xaaaaaaaa,
5482 0x00040404, 0x00050505, 0x00060606, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5483 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5484 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x00808080, 0x00808080, 0x00808080, 0x00808080,
5485 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5486 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5487 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5488 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa };
5489 DWORD top_down[64] = { 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5490 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5491 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5492 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5493 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0x00808080, 0x00808080, 0x00808080, 0x00808080,
5494 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5495 0x00040404, 0x00050505, 0x00060606, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
5496 0x00020202, 0x00020202, 0x00020202, 0x00020202, 0x00f0f0f0, 0x00f0f0f0, 0x00f0f0f0, 0xaaaaaaaa };
5500 info->bmiHeader.biSize =
sizeof(
info->bmiHeader);
5501 info->bmiHeader.biWidth = 8;
5502 info->bmiHeader.biHeight = 8;
5503 info->bmiHeader.biPlanes = 1;
5504 info->bmiHeader.biBitCount = 32;
5508 memset( dib_bits, 0xaa, 64 * 4 );
5511 info->bmiHeader.biBitCount = 8;
5515 for (
i = 0;
i < 256;
i++)
5517 info->bmiColors[
i].rgbRed =
i;
5518 info->bmiColors[
i].rgbGreen =
i;
5519 info->bmiColors[
i].rgbBlue =
i;
5520 info->bmiColors[
i].rgbReserved = 0;
5523 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5525 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5526 memset( dib_bits, 0xaa, 64 * 4 );
5529 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5531 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5532 memset( dib_bits, 0xaa, 64 * 4 );
5534 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 1,
rle8_data,
info,
DIB_RGB_COLORS );
5536 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5537 memset( dib_bits, 0xaa, 64 * 4 );
5539 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 0,
rle8_data,
info,
DIB_RGB_COLORS );
5541 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5542 memset( dib_bits, 0xaa, 64 * 4 );
5544 info->bmiHeader.biWidth = 2;
5545 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5547 if (dib_bits[0] == 0xaaaaaaaa)
5549 win_skip(
"SetDIBitsToDevice is broken on Windows 2008.\n");
5552 for (
i = 0;
i < 64;
i += 8)
5554 ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5555 ok( dib_bits[
i+1] == bottom_up[
i+1],
"%d: got %08lx\n",
i+1, dib_bits[
i+1] );
5557 memset( dib_bits, 0xaa, 64 * 4 );
5559 info->bmiHeader.biWidth = 8;
5560 info->bmiHeader.biHeight = 2;
5561 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5563 for (
i = 0;
i < 16;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5564 memset( dib_bits, 0xaa, 64 * 4 );
5566 info->bmiHeader.biHeight = 9;
5567 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5569 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5570 memset( dib_bits, 0xaa, 64 * 4 );
5572 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 9,
rle8_data,
info,
DIB_RGB_COLORS );
5574 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5575 memset( dib_bits, 0xaa, 64 * 4 );
5577 info->bmiHeader.biHeight = 8;
5578 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 1, 9,
rle8_data,
info,
DIB_RGB_COLORS );
5580 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == bottom_up[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5581 memset( dib_bits, 0xaa, 64 * 4 );
5583 ret =
SetDIBitsToDevice(
hdc, 0, 3, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5585 for (
i = 0;
i < 40;
i++)
ok( dib_bits[
i] == bottom_up[
i + 24],
"%d: got %08lx\n",
i, dib_bits[
i] );
5586 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5587 memset( dib_bits, 0xaa, 64 * 4 );
5589 ret =
SetDIBitsToDevice(
hdc, 0, 3, 4, 4, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5591 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5592 for (
i = 8;
i < 40;
i++)
5593 if (
i & 4)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5594 else ok( dib_bits[
i] == bottom_up[
i - 8],
"%d: got %08lx\n",
i, dib_bits[
i] );
5595 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5596 memset( dib_bits, 0xaa, 64 * 4 );
5598 ret =
SetDIBitsToDevice(
hdc, 3, 3, 8, 4, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5600 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5601 for (
i = 8;
i < 40;
i++)
5602 if ((
i & 7) < 3)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5603 else ok( dib_bits[
i] == bottom_up[
i - 11],
"%d: got %08lx\n",
i, dib_bits[
i] );
5604 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5605 memset( dib_bits, 0xaa, 64 * 4 );
5607 ret =
SetDIBitsToDevice(
hdc, 2, 3, 8, 4, 2, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5609 for (
i = 0;
i < 8;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5610 for (
i = 8;
i < 40;
i++)
5611 if ((
i & 7) < 2)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5612 else ok( dib_bits[
i] == bottom_up[
i - 8],
"%d: got %08lx\n",
i, dib_bits[
i] );
5613 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5614 memset( dib_bits, 0xaa, 64 * 4 );
5616 info->bmiHeader.biWidth = 37;
5617 info->bmiHeader.biHeight = 37;
5618 ret =
SetDIBitsToDevice(
hdc, -2, 1, 10, 5, 2, -1, 12, 24,
rle8_data,
info,
DIB_RGB_COLORS );
5620 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5621 for (
i = 24;
i < 64;
i++)
5622 if (
i == 52)
ok( dib_bits[
i] == 0x00808080,
"%d: got %08lx\n",
i, dib_bits[
i] );
5623 else if (
i & 4)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5624 else ok( dib_bits[
i] == bottom_up[
i - 20],
"%d: got %08lx\n",
i, dib_bits[
i] );
5625 memset( dib_bits, 0xaa, 64 * 4 );
5628 info->bmiHeader.biWidth = 8;
5629 info->bmiHeader.biHeight = -8;
5631 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5637 info->bmiHeader.biHeight = -8;
5638 info->bmiHeader.biBitCount = 32;
5640 info->bmiHeader.biSizeImage = 0;
5643 memset( dib_bits, 0xaa, 16 * 16 * 4 );
5646 info->bmiHeader.biHeight = 8;
5647 info->bmiHeader.biBitCount = 8;
5651 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5653 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5654 memset( dib_bits, 0xaa, 64 * 4 );
5656 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 9,
rle8_data,
info,
DIB_RGB_COLORS );
5658 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5659 memset( dib_bits, 0xaa, 64 * 4 );
5661 info->bmiHeader.biHeight = 4;
5662 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5664 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5665 memset( dib_bits, 0xaa, 64 * 4 );
5667 info->bmiHeader.biHeight = 9;
5668 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5670 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5671 memset( dib_bits, 0xaa, 64 * 4 );
5673 ret =
SetDIBitsToDevice(
hdc, 0, 0, 8, 8, 0, 0, 0, 9,
rle8_data,
info,
DIB_RGB_COLORS );
5675 for (
i = 0;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i],
"%d: got %08lx\n",
i, dib_bits[
i] );
5676 memset( dib_bits, 0xaa, 64 * 4 );
5678 ret =
SetDIBitsToDevice(
hdc, 2, 3, 8, 6, 2, 2, 0, 8,
rle8_data,
info,
DIB_RGB_COLORS );
5680 for (
i = 0;
i < 24;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5681 for (
i = 24;
i < 64;
i++)
ok( dib_bits[
i] == top_down[
i - 24],
"%d: got %08lx\n",
i, dib_bits[
i] );
5682 memset( dib_bits, 0xaa, 64 * 4 );
5684 info->bmiHeader.biWidth = 37;
5685 info->bmiHeader.biHeight = 37;
5686 ret =
SetDIBitsToDevice(
hdc, -2, 1, 10, 5, 2, -1, 12, 24,
rle8_data,
info,
DIB_RGB_COLORS );
5688 for (
i = 0;
i < 40;
i++)
5689 if (
i == 12)
ok( dib_bits[
i] == 0x00808080,
"%d: got %08lx\n",
i, dib_bits[
i] );
5690 else if (
i & 4)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5691 else ok( dib_bits[
i] == top_down[
i + 28],
"%d: got %08lx\n",
i, dib_bits[
i] );
5692 for (
i = 40;
i < 64;
i++)
ok( dib_bits[
i] == 0xaaaaaaaa,
"%d: got %08lx\n",
i, dib_bits[
i] );
5693 memset( dib_bits, 0xaa, 64 * 4 );
5708 unsigned int i,
x,
y,
z;
5725 unsigned int bit_count;
5726 DWORD mask_r, mask_g, mask_b;
5754 if (!pD3DKMTCreateDCFromMemory)
5756 win_skip(
"D3DKMTCreateDCFromMemory() is not implemented.\n");
5769 create_desc.
Width = 9;
5771 create_desc.
Pitch =
sizeof(*data);
5774 create_desc.
hDc = (
void *)0x010baade;
5775 create_desc.
hBitmap = (
void *)0x020baade;
5777 status = pD3DKMTCreateDCFromMemory( &create_desc );
5783 status = pD3DKMTCreateDCFromMemory( &create_desc );
5789 status = pD3DKMTCreateDCFromMemory( &create_desc );
5792 ok(create_desc.
hDc == (
void *)0x010baade,
"%s: Got unexpected dc %p.\n",
5794 ok(create_desc.
hBitmap == (
void *)0x020baade,
"%s: Got unexpected bitmap %p.\n",
5798 create_desc.
Pitch = 0;
5799 status = pD3DKMTCreateDCFromMemory( &create_desc );
5802 ok(create_desc.
hDc == (
void *)0x010baade,
"%s: Got unexpected dc %p.\n",
5804 ok(create_desc.
hBitmap == (
void *)0x020baade,
"%s: Got unexpected bitmap %p.\n",
5807 create_desc.
Width = 9;
5808 create_desc.
Pitch =
sizeof(*data);
5809 status = pD3DKMTCreateDCFromMemory( &create_desc );
5814 ok(!!create_desc.
hDc,
"%s: Got unexpected dc %p.\n",
5816 ok(!!create_desc.
hBitmap,
"%s: Got unexpected bitmap %p.\n",
5821 ok(create_desc.
hDc == (
void *)0x010baade,
"%s: Got unexpected dc %p.\n",
5823 ok(create_desc.
hBitmap == (
void *)0x020baade,
"%s: Got unexpected bitmap %p.\n",
5833 ok(
bitmap == create_desc.
hBitmap,
"%s: Got unexpected bitmap %p, expected %p.\n",
5847 ok(dib.
dsBm.
bmPlanes == 1,
"%s: Got unexpected plane count %d.\n",
5865 "%s: Got unexpected compression %#lx.\n",
5890 "%s: Got unexpected colour masks 0x%08lx 0x%08lx 0x%08lx.\n",
5896 ok(
ret,
"Failed to blit.\n");
5898 ok(
ret,
"Failed to blit.\n");
5902 ok(bmp_dc !=
NULL,
"failed to create DC\n");
5904 ok(
bmp !=
NULL,
"failed to create bmp\n");
5907 ok(
ret,
"Failed to blit.\n");
5909 destroy_desc.
hDc = create_desc.
hDc;
5914 status = pD3DKMTDestroyDCFromMemory( &destroy_desc );
5916 status = pD3DKMTDestroyDCFromMemory( &destroy_desc );
5920 ok(
ret,
"Failed to delete dc.\n");
5922 for (
y = 0, fail =
FALSE;
y < 12 && !fail; ++
y)
5924 for (
x = 0;
x <
sizeof(*data) / (
test_data[
i].bit_count / 8) && !fail; ++
x)
5926 for (
z = 0, colour = 0;
z <
test_data[
i].bit_count / 8; ++
z)
5931 if ((
x == 1 ||
x == 2) && (
y == 1 ||
y == 2))
5933 else if (
x < 4 &&
y < 7)
5937 ok(colour ==
expected,
"%s: Got unexpected colour 0x%08lx at %u, %u, expected 0x%08lx.\n",
5946 if ((
x == 1 ||
x == 2) && (
y == 1 ||
y == 2))
5963 ok(!!alloc_data,
"Failed to allocate memory, error %lu.\n",
GetLastError());
5965 create_desc.
pMemory = alloc_data;
5967 create_desc.
Width = 16;
5969 create_desc.
Pitch = 16 * 4;
5973 status = pD3DKMTCreateDCFromMemory( &create_desc );
5977 ok(
size ==
sizeof(memory_info),
"Got unexpected size %u.\n",
size);
5981 destroy_desc.
hDc = create_desc.
hDc;
5984 status = pD3DKMTDestroyDCFromMemory( &destroy_desc );
5988 ok(
size ==
sizeof(memory_info),
"Got unexpected size %u.\n",
size);
5999 static const unsigned int dib_width = 100, dib_height = 100;
6010 .bmiHeader.biWidth = dib_width,
6011 .bmiHeader.biHeight = dib_height,
6012 .bmiHeader.biBitCount = 32,
6013 .bmiHeader.biPlanes = 1,
6028 memset(
bits, 0, dib_width * dib_height * 4 );
6029 Arc(
dc, 10, 10, 40, 25, 0, 15, 20, 0 );
6031 for (
unsigned int y = 9;
y <= 26; ++
y)
6033 for (
unsigned int x = 9;
x <= 41; ++
x)
6035 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6037 if (
x < 10 || y < 10 || x >= 40 ||
y >= 25 || (
x < 22 &&
y < 16))
6038 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6040 if (((
x == 24 ||
x == 25) && (
y == 10 ||
y == 24))
6041 || ((
x == 10 ||
x == 39) &&
y == 17))
6042 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6046 memset(
bits, 0, dib_width * dib_height * 4 );
6049 for (
unsigned int y = 9;
y <= 26; ++
y)
6051 for (
unsigned int x = 9;
x <= 41; ++
x)
6053 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6055 if (
x < 10 || y < 10 || x >= 40 ||
y >= 25
6056 || ((
x == 10 ||
x == 39) && (
y == 10 ||
y == 24)))
6057 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6059 if (((
x >= 13 &&
x < 37) && (
y == 10 ||
y == 24))
6060 || ((
y >= 14 &&
y < 21) && (
x == 10 ||
x == 39)))
6061 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6066 memset(
bits, 0, dib_width * dib_height * 4 );
6069 for (
unsigned int y = 9;
y <= 26; ++
y)
6071 for (
unsigned int x = 9;
x <= 41; ++
x)
6073 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6075 if (
x < 10 || y < 10 || x >= 40 ||
y >= 25
6076 || ((
x == 10 ||
x == 39) && (
y == 10 ||
y == 24)))
6077 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6079 if (((
x >= 13 &&
x < 37) && (
y == 10 ||
y == 24))
6080 || ((
y >= 14 &&
y < 21) && (
x == 10 ||
x == 39)))
6081 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6088 memset(
bits, 0, dib_width * dib_height * 4 );
6091 for (
unsigned int y = 9;
y <= 26; ++
y)
6093 for (
unsigned int x = 9;
x <= 41; ++
x)
6095 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6097 if (
x < 10 || y < 10 || x >= 40 ||
y >= 25)
6098 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6100 if (((
x >= 13 &&
x < 37) && (
y == 10 ||
y == 24))
6101 || ((
x == 10 ||
x == 39) &&
y == 17))
6102 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6108 memset(
bits, 0, dib_width * dib_height * 4 );
6111 for (
unsigned int y = 9;
y <= 26; ++
y)
6113 for (
unsigned int x = 9;
x <= 41; ++
x)
6115 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6117 if (
x < 10 || y < 10 || x >= 40 ||
y >= 25)
6118 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6120 if (((
x >= 11 &&
x < 39) && (
y == 10 ||
y == 24))
6121 || ((
x == 10 ||
x == 39) && (
y >= 11 &&
y < 24)))
6122 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6128 memset(
bits, 0, dib_width * dib_height * 4 );
6131 for (
unsigned int y = 9;
y <= 26; ++
y)
6133 for (
unsigned int x = 9;
x <= 41; ++
x)
6135 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6137 if (((
x >= 10 &&
x < 40) && (
y == 10 ||
y == 24))
6138 || ((
x == 10 ||
x == 39) && (
y >= 10 &&
y < 25)))
6139 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6141 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6147 memset(
bits, 0, dib_width * dib_height * 4 );
6148 ret =
Arc(
dc, 10, 10, 40, 10, 0, 1, 1, 0 );
6151 for (
unsigned int y = 9;
y <= 11; ++
y)
6153 for (
unsigned int x = 9;
x <= 41; ++
x)
6155 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6157 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6163 memset(
bits, 0, dib_width * dib_height * 4 );
6164 Arc(
dc, 10, 10, 40, 25, 0, 1, 0, 1 );
6166 for (
unsigned int y = 9;
y <= 26; ++
y)
6168 for (
unsigned int x = 9;
x <= 41; ++
x)
6170 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6172 if (
x < 10 || y < 10 || x >= 40 ||
y >= 25)
6173 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6175 if (((
x == 24 ||
x == 25) && (
y == 10 ||
y == 24))
6176 || ((
x == 10 ||
x == 39) &&
y == 17))
6177 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6185 memset(
bits, 0, dib_width * dib_height * 4 );
6186 Arc(
dc, 10, 10, 40, 25, 20, 0, 0, 15 );
6188 for (
unsigned int y = 9;
y <= 26; ++
y)
6190 for (
unsigned int x = 9;
x <= 41; ++
x)
6192 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6194 if (
x < 10 || y < 10 || x >= 40 ||
y >= 25 || (
x < 22 &&
y < 16))
6195 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6197 if (((
x == 24 ||
x == 25) && (
y == 10 ||
y == 24))
6198 || ((
x == 10 ||
x == 39) &&
y == 17))
6199 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6205 memset(
bits, 0, dib_width * dib_height * 4 );
6206 Arc(
dc, 40, 10, 10, 25, 20, 0, 0, 15 );
6208 for (
unsigned int y = 9;
y <= 26; ++
y)
6210 for (
unsigned int x = 9;
x <= 41; ++
x)
6212 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6214 if (
x < 10 || y < 10 || x >= 40 ||
y >= 25 || (
x < 22 &&
y < 16))
6215 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6217 if (((
x == 24 ||
x == 25) && (
y == 10 ||
y == 24))
6218 || ((
x == 10 ||
x == 39) &&
y == 17))
6219 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6227 memset(
bits, 0, dib_width * dib_height * 4 );
6228 Arc(
dc, 10, 10, 40, 25, 20, 0, 0, 14 );
6230 for (
unsigned int y = 9;
y <= 26; ++
y)
6232 for (
unsigned int x = 9;
x <= 41; ++
x)
6234 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6236 if (
x < 10 || y < 10 || x > 40 ||
y > 25 || (
x < 22 &&
y < 16))
6237 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6241 if ((
x == 25 && (
y == 10 ||
y == 25))
6242 || ((
x == 10 ||
x == 40) && (
y == 17 ||
y == 18)))
6243 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6248 memset(
bits, 0, dib_width * dib_height * 4 );
6251 for (
unsigned int y = 9;
y <= 26; ++
y)
6253 for (
unsigned int x = 9;
x <= 41; ++
x)
6255 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6257 if (
x < 10 || y < 10 || x > 40 ||
y > 25)
6258 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6262 if (((
x >= 13 &&
x <= 37) && (
y == 10 ||
y == 25))
6263 || ((
y >= 14 &&
y <= 21) && (
x == 10 ||
x == 40)))
6264 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6271 memset( &xform, 0,
sizeof(xform) );
6277 memset(
bits, 0, dib_width * dib_height * 4 );
6278 Arc(
dc, 10, 10, 40, 25, 20, 0, 0, 14 );
6280 for (
unsigned int y = 9;
y <= 26; ++
y)
6282 for (
unsigned int x = 9;
x <= 41; ++
x)
6284 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6286 if (
x < 10 || y < 10 || x > 40 ||
y > 25 || (x < 22 && y > 19))
6287 todo_wine_if (colour)
ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6291 if ((
x == 25 && (
y == 10 ||
y == 25))
6292 || ((
x == 10 ||
x == 40) && (
y == 17 ||
y == 18)))
6293 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6298 memset(
bits, 0, dib_width * dib_height * 4 );
6301 for (
unsigned int y = 9;
y <= 26; ++
y)
6303 for (
unsigned int x = 9;
x <= 41; ++
x)
6305 int colour =
bits[(dib_height - 1 -
y) * dib_width +
x];
6307 if (
x < 10 || y < 10 || x > 40 ||
y > 25)
6308 ok(!colour,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6312 if (((
x >= 13 &&
x <= 37) && (
y == 10 ||
y == 25))
6313 || ((
y >= 14 &&
y <= 21) && (
x == 10 ||
x == 40)))
6314 ok(colour == 0x111111,
"Got unexpected colour %08x at (%u, %u).\n", colour,
x,
y);
6330 pD3DKMTCreateDCFromMemory = (
void *)
GetProcAddress(
hdll,
"D3DKMTCreateDCFromMemory" );
6331 pD3DKMTDestroyDCFromMemory = (
void *)
GetProcAddress(
hdll,
"D3DKMTDestroyDCFromMemory" );
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
static unsigned char bytes[4]
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 ERROR_INVALID_HANDLE
static void cleanup(void)
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
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Height *Stride) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Stride)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
for(i=0;i< ARRAY_SIZE(offsets);i++)
DWORD WINAPI SetLayout(_In_ HDC hdc, _In_ DWORD dwLayout)
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 todo_wine_if(is_todo)
#define memcpy(s1, s2, n)
static void test_size(void)
D3D11_SHADER_VARIABLE_DESC 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)
static void test_arcs(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
PALETTEENTRY * pColorTable
BITMAPINFOHEADER bmiHeader
#define FIELD_OFFSET(t, f)
#define STATUS_INVALID_PARAMETER
static int __cdecl compr(const void *a, const void *b)
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
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
enum _D3DDDIFORMAT D3DDDIFORMAT
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)
int WINAPI SetGraphicsMode(_In_ 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)
int WINAPI SetArcDirection(_In_ HDC, _In_ int)
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)
BOOL WINAPI SetWorldTransform(_In_ HDC, _In_ const XFORM *)
HBRUSH WINAPI CreateDIBPatternBrushPt(_In_ const VOID *pvPackedDIB, _In_ UINT uUsage)
BOOL WINAPI RoundRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int)
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)