51 HPALETTE hpal, hpalOld;
52 COLORREF setColor, chkColor, getColor;
66 bmp->bmiHeader.biWidth = 1;
67 bmp->bmiHeader.biHeight = 1;
68 bmp->bmiHeader.biPlanes = 1;
69 bmp->bmiHeader.biBitCount = 8;
71 bmp->bmiHeader.biClrUsed = 10;
72 bmp->bmiHeader.biClrImportant = 0;
73 bmpPalPtr = (
WORD *)&
bmp->bmiColors;
74 for(
i = 0;
i < 8;
i++ ) {
90 ok( getColor == chkColor,
"getColor=%08X\n", (
UINT)getColor );
97 ok( getColor == chkColor,
"getColor=%08X\n", (
UINT)getColor );
102 chkColor =
RGB( 0, 0, 0 );
103 getColor =
GetPixel( memhdc, 0, 0 );
104 ok( getColor == chkColor,
"getColor=%08X\n", (
UINT)getColor );
111 getColor =
GetPixel( memhdc, 0, 0 );
112 ok( getColor == chkColor,
"getColor=%08X\n", (
UINT)getColor );
142 ok(
res == 1,
"GetPaletteEntries should have returned 1 but returned %d\n",
res);
144 ok( palEntry.
peFlags == getEntryResult.
peFlags,
"palEntry.peFlags (%#x) != getEntryResult.peFlags (%#x)\n", palEntry.
peFlags, getEntryResult.
peFlags );
163 "wrong size %u\n",
count );
168 for (
i = 0;
i < 8;
i++)
170 ok( entries[
i].peRed == defpal[
i].peRed &&
171 entries[
i].peGreen == defpal[
i].peGreen &&
172 entries[
i].peBlue == defpal[
i].peBlue &&
174 "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n",
i,
175 entries[
i].peRed, entries[
i].peGreen, entries[
i].peBlue, entries[
i].peFlags,
176 defpal[
i].peRed, defpal[
i].peGreen, defpal[
i].peBlue );
181 ok( entries[
i].peRed == defpal[
idx].peRed &&
182 entries[
i].peGreen == defpal[
idx].peGreen &&
183 entries[
i].peBlue == defpal[
idx].peBlue &&
185 "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n",
i,
186 entries[
i].peRed, entries[
i].peGreen, entries[
i].peBlue, entries[
i].peFlags,
187 defpal[
idx].peRed, defpal[
idx].peGreen, defpal[
idx].peBlue );
200 memset( defpal, 0xaa,
sizeof(defpal) );
204 memset( entries, 0x55,
sizeof(entries) );
207 for (
i = 0;
i < 10;
i++)
209 ok( entries[
i].peRed == defpal[
i].peRed &&
210 entries[
i].peGreen == defpal[
i].peGreen &&
211 entries[
i].peBlue == defpal[
i].peBlue &&
213 "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n",
i,
214 entries[
i].peRed, entries[
i].peGreen, entries[
i].peBlue, entries[
i].peFlags,
215 defpal[
i].peRed, defpal[
i].peGreen, defpal[
i].peBlue );
217 for (
i = 10;
i < 246; ++
i)
219 ok( !entries[
i].peRed &&
220 !entries[
i].peGreen &&
221 !entries[
i].peBlue &&
223 "%u: wrong color %02x,%02x,%02x,%02x instead of 0,0,0\n",
i,
224 entries[
i].peRed, entries[
i].peGreen, entries[
i].peBlue, entries[
i].peFlags);
226 for (
i = 246;
i < 256;
i++)
228 int idx =
i - 246 + 10;
229 ok( entries[
i].peRed == defpal[
idx].peRed &&
230 entries[
i].peGreen == defpal[
idx].peGreen &&
231 entries[
i].peBlue == defpal[
idx].peBlue &&
233 "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n",
i,
234 entries[
i].peRed, entries[
i].peGreen, entries[
i].peBlue, entries[
i].peFlags,
235 defpal[
idx].peRed, defpal[
idx].peGreen, defpal[
idx].peBlue );
238 memset( entries, 0x55,
sizeof(entries) );
241 for (
i = 0;
i < 10;
i++)
243 ok( entries[
i].peRed == defpal[
i].peRed &&
244 entries[
i].peGreen == defpal[
i].peGreen &&
245 entries[
i].peBlue == defpal[
i].peBlue &&
247 "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n",
i,
248 entries[
i].peRed, entries[
i].peGreen, entries[
i].peBlue, entries[
i].peFlags,
249 defpal[
i].peRed, defpal[
i].peGreen, defpal[
i].peBlue );
252 memset( entries, 0x55,
sizeof(entries) );
255 for (
i = 0;
i < 236; ++
i)
257 ok( !entries[
i].peRed &&
258 !entries[
i].peGreen &&
259 !entries[
i].peBlue &&
261 "%u: wrong color %02x,%02x,%02x,%02x instead of 0,0,0\n",
i,
262 entries[
i].peRed, entries[
i].peGreen, entries[
i].peBlue, entries[
i].peFlags);
264 for (
i = 236;
i < 246;
i++)
266 int idx =
i - 236 + 10;
267 ok( entries[
i].peRed == defpal[
idx].peRed &&
268 entries[
i].peGreen == defpal[
idx].peGreen &&
269 entries[
i].peBlue == defpal[
idx].peBlue &&
271 "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n",
i,
272 entries[
i].peRed, entries[
i].peGreen, entries[
i].peBlue, entries[
i].peFlags,
273 defpal[
idx].peRed, defpal[
idx].peGreen, defpal[
idx].peBlue );
276 memset( entries, 0x55,
sizeof(entries) );
279 for (
i = 0;
i < 10;
i++)
282 ok( entries[
i].peRed == defpal[
idx].peRed &&
283 entries[
i].peGreen == defpal[
idx].peGreen &&
284 entries[
i].peBlue == defpal[
idx].peBlue &&
286 "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n",
i,
287 entries[
i].peRed, entries[
i].peGreen, entries[
i].peBlue, entries[
i].peFlags,
288 defpal[
idx].peRed, defpal[
idx].peGreen, defpal[
idx].peBlue );
306 skip(
"device is palette-based, skipping test\n" );
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
GLuint GLuint GLsizei count
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
#define memcpy(s1, s2, n)
static void test_halftone_palette(void)
static void test_palette_entries(void)
static void test_DIB_PAL_COLORS(void)
static void check_system_palette_entries(HDC hdc)
static const PALETTEENTRY logpalettedata[8]
static void test_system_palette_entries(void)
static const unsigned char metafile[]
static const LOGPALETTE logpalette
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)
DWORD WINAPI GetLastError(void)
BOOL WINAPI DeleteMetaFile(_In_ HMETAFILE)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HDC WINAPI CreateMetaFileA(_In_opt_ LPCSTR)
struct tagLOGPALETTE * PLOGPALETTE
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
struct tagLOGPALETTE LOGPALETTE
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HMETAFILE WINAPI CloseMetaFile(_In_ HDC hdc)
UINT WINAPI GetSystemPaletteEntries(_In_ HDC hdc, _In_ UINT iStart, _In_ UINT cEntries, _Out_writes_opt_(cEntries) LPPALETTEENTRY pPalEntries)
struct tagBITMAPINFO BITMAPINFO
struct tagBITMAPINFO * PBITMAPINFO
UINT WINAPI SetPaletteEntries(_In_ HPALETTE hpal, _In_ UINT iStart, _In_ UINT cEntries, _In_reads_(cEntries) CONST PALETTEENTRY *pPalEntries)
BOOL WINAPI DeleteDC(_In_ HDC)
HPALETTE WINAPI CreateHalftonePalette(_In_opt_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)