ReactOS 0.4.17-dev-116-ga4b6fe9
brush.c
Go to the documentation of this file.
1/*
2 * Unit test suite for brushes
3 *
4 * Copyright 2004 Kevin Koltzau
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include <stdarg.h>
22
23#include "windef.h"
24#include "winbase.h"
25#include "wingdi.h"
26#include "winuser.h"
27
28#include "wine/test.h"
29
30typedef struct _STOCK_BRUSH {
33 const char *name;
35
36static void test_solidbrush(void)
37{
38 static const STOCK_BRUSH stock[] = {
39 {RGB(255,255,255), WHITE_BRUSH, "white"},
40 {RGB(192,192,192), LTGRAY_BRUSH, "ltgray"},
41 {RGB(128,128,128), GRAY_BRUSH, "gray"},
42 {RGB(0,0,0), BLACK_BRUSH, "black"},
43 {RGB(0,0,255), -1, "blue"}
44 };
45 HBRUSH solidBrush;
46 HBRUSH stockBrush;
47 LOGBRUSH br;
48 size_t i;
49 INT ret;
50
51 for(i = 0; i < ARRAY_SIZE(stock); i++) {
52 solidBrush = CreateSolidBrush(stock[i].color);
53
54 if(stock[i].stockobj != -1) {
55 stockBrush = GetStockObject(stock[i].stockobj);
56 ok(stockBrush!=solidBrush ||
57 broken(stockBrush==solidBrush), /* win9x does return stock object */
58 "Stock %s brush equals solid %s brush\n", stock[i].name, stock[i].name);
59 }
60 else
61 stockBrush = NULL;
62 memset(&br, 0, sizeof(br));
63 ret = GetObjectW(solidBrush, sizeof(br), &br);
64 ok( ret !=0, "GetObject on solid %s brush failed, error=%ld\n", stock[i].name, GetLastError());
65 ok(br.lbStyle==BS_SOLID, "%s brush has wrong style, got %d expected %d\n", stock[i].name, br.lbStyle, BS_SOLID);
66 ok(br.lbColor==stock[i].color, "%s brush has wrong color, got 0x%08lx expected 0x%08lx\n", stock[i].name, br.lbColor, stock[i].color);
67
68 if(stockBrush) {
69 /* Sanity check, make sure the colors being compared do in fact have a stock brush */
70 ret = GetObjectW(stockBrush, sizeof(br), &br);
71 ok( ret !=0, "GetObject on stock %s brush failed, error=%ld\n", stock[i].name, GetLastError());
72 ok(br.lbColor==stock[i].color, "stock %s brush unexpected color, got 0x%08lx expected 0x%08lx\n", stock[i].name, br.lbColor, stock[i].color);
73 }
74
75 DeleteObject(solidBrush);
76 ret = GetObjectW(solidBrush, sizeof(br), &br);
77 ok(ret==0 ||
78 broken(ret!=0), /* win9x */
79 "GetObject succeeded on a deleted %s brush\n", stock[i].name);
80 }
81}
82
83static void test_hatch_brush(void)
84{
85 int i, size;
86 HBRUSH brush;
87 LOGBRUSH lb;
88
89 for (i = 0; i < 20; i++)
90 {
91 SetLastError( 0xdeadbeef );
92 brush = CreateHatchBrush( i, RGB(12,34,56) );
93 if (i < HS_API_MAX)
94 {
95 ok( brush != 0, "%u: CreateHatchBrush failed err %lu\n", i, GetLastError() );
96 size = GetObjectW( brush, sizeof(lb), &lb );
97 ok( size == sizeof(lb), "wrong size %u\n", size );
98 ok( lb.lbColor == RGB(12,34,56), "wrong color %08lx\n", lb.lbColor );
99 if (i <= HS_DIAGCROSS)
100 {
101 ok( lb.lbStyle == BS_HATCHED, "wrong style %u\n", lb.lbStyle );
102 ok( lb.lbHatch == i, "wrong hatch %Iu/%u\n", lb.lbHatch, i );
103 }
104 else
105 {
106 ok( lb.lbStyle == BS_SOLID, "wrong style %u\n", lb.lbStyle );
107 ok( lb.lbHatch == 0, "wrong hatch %Iu\n", lb.lbHatch );
108 }
109 DeleteObject( brush );
110 }
111 else
112 {
113 ok( !brush, "%u: CreateHatchBrush succeeded\n", i );
114 ok( GetLastError() == 0xdeadbeef, "wrong error %lu\n", GetLastError() );
115 }
116 }
117}
118
119static void test_pattern_brush(void)
120{
121 char buffer[sizeof(BITMAPINFOHEADER) + 2 * sizeof(RGBQUAD) + 32 * 32 / 8];
123 HBITMAP bitmap, bitmap2, old_bitmap;
124 HBRUSH brush, brush2;
125 HDC hdc, hdc_screen;
127 BOOL result;
128 LOGBRUSH br;
129 BITMAP bm;
130 RECT rect;
131 INT ret;
132 void *bits;
133 DIBSECTION dib;
134 HGLOBAL mem;
135
136 bitmap = CreateBitmap( 20, 20, 1, 1, NULL );
137 ok( bitmap != NULL, "CreateBitmap failed\n" );
138 brush = CreatePatternBrush( bitmap );
139 ok( brush != NULL, "CreatePatternBrush failed\n" );
140 memset( &br, 0x55, sizeof(br) );
141 ret = GetObjectW( brush, sizeof(br), &br );
142 ok( ret == sizeof(br), "wrong size %u\n", ret );
143 ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
144 ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
145 ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
146 DeleteObject( brush );
147
149 br.lbColor = 0x12345;
151 brush = CreateBrushIndirect( &br );
152 ok( brush != NULL, "CreatePatternBrush failed\n" );
153 memset( &br, 0x55, sizeof(br) );
154 ret = GetObjectW( brush, sizeof(br), &br );
155 ok( ret == sizeof(br), "wrong size %u\n", ret );
156 ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
157 ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
158 ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
159 ret = GetObjectW( bitmap, sizeof(dib), &dib );
160 ok( ret == sizeof(dib.dsBm), "wrong size %u\n", ret );
162 ret = GetObjectW( bitmap, sizeof(dib), &dib );
163 ok( ret == 0, "wrong size %u\n", ret );
164 DeleteObject( brush );
165
166 memset( info, 0, sizeof(buffer) );
167 info->bmiHeader.biSize = sizeof(info->bmiHeader);
168 info->bmiHeader.biHeight = 32;
169 info->bmiHeader.biWidth = 32;
170 info->bmiHeader.biBitCount = 1;
171 info->bmiHeader.biPlanes = 1;
172 info->bmiHeader.biCompression = BI_RGB;
174 ok( bitmap != NULL, "CreateDIBSection failed\n" );
175
176 /* MSDN says a DIB section is not allowed, but it works fine */
177 brush = CreatePatternBrush( bitmap );
178 ok( brush != NULL, "CreatePatternBrush failed\n" );
179 memset( &br, 0x55, sizeof(br) );
180 ret = GetObjectW( brush, sizeof(br), &br );
181 ok( ret == sizeof(br), "wrong size %u\n", ret );
182 ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
183 ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
184 ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
185 ret = GetObjectW( bitmap, sizeof(dib), &dib );
186 ok( ret == sizeof(dib), "wrong size %u\n", ret );
187 DeleteObject( brush );
189
191 ok( brush != NULL, "CreatePatternBrush failed\n" );
192 memset( &br, 0x55, sizeof(br) );
193 ret = GetObjectW( brush, sizeof(br), &br );
194 ok( ret == sizeof(br), "wrong size %u\n", ret );
195 ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle );
196 ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
197 ok( (BITMAPINFO *)br.lbHatch == info || broken(!br.lbHatch), /* nt4 */
198 "wrong handle %p/%p\n", (BITMAPINFO *)br.lbHatch, info );
199 DeleteObject( brush );
200
203 br.lbHatch = (ULONG_PTR)info;
204 brush = CreateBrushIndirect( &br );
205 ok( brush != NULL, "CreatePatternBrush failed\n" );
206 memset( &br, 0x55, sizeof(br) );
207 ret = GetObjectW( brush, sizeof(br), &br );
208 ok( ret == sizeof(br), "wrong size %u\n", ret );
209 ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle );
210 ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
211 ok( (BITMAPINFO *)br.lbHatch == info || broken(!br.lbHatch), /* nt4 */
212 "wrong handle %p/%p\n", (BITMAPINFO *)br.lbHatch, info );
213
214 mem = GlobalAlloc( GMEM_MOVEABLE, sizeof(buffer) );
215 memcpy( GlobalLock( mem ), buffer, sizeof(buffer) );
216
219 br.lbHatch = (ULONG_PTR)mem;
220 brush = CreateBrushIndirect( &br );
221 ok( brush != NULL, "CreatePatternBrush failed\n" );
222 memset( &br, 0x55, sizeof(br) );
223 ret = GetObjectW( brush, sizeof(br), &br );
224 ok( ret == sizeof(br), "wrong size %u\n", ret );
225 ok( br.lbStyle == BS_DIBPATTERN, "wrong style %u\n", br.lbStyle );
226 ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
227 ok( (HGLOBAL)br.lbHatch != mem, "wrong handle %p/%p\n", (HGLOBAL)br.lbHatch, mem );
228 bits = GlobalLock( mem );
229 ok( (HGLOBAL)br.lbHatch == bits || broken(!br.lbHatch), /* nt4 */
230 "wrong handle %p/%p\n", (HGLOBAL)br.lbHatch, bits );
231 ret = GlobalFlags( mem );
232 ok( ret == 2, "wrong flags %x\n", ret );
233 DeleteObject( brush );
234 ret = GlobalFlags( mem );
235 ok( ret == 2, "wrong flags %x\n", ret );
236
238 ok( brush != 0, "CreateDIBPatternBrushPt failed\n" );
239 DeleteObject( brush );
241 ok( brush != 0, "CreateDIBPatternBrushPt failed\n" );
242 DeleteObject( brush );
244 ok( !brush, "CreateDIBPatternBrushPt succeeded\n" );
246 ok( !brush, "CreateDIBPatternBrushPt succeeded\n" );
247
248 info->bmiHeader.biBitCount = 8;
249 info->bmiHeader.biCompression = BI_RLE8;
251 ok( !brush, "CreateDIBPatternBrushPt succeeded\n" );
252
253 info->bmiHeader.biBitCount = 4;
254 info->bmiHeader.biCompression = BI_RLE4;
256 ok( !brush, "CreateDIBPatternBrushPt succeeded\n" );
257
260 br.lbHatch = (ULONG_PTR)mem;
261 brush = CreateBrushIndirect( &br );
262 ok( !brush, "CreatePatternBrush succeeded\n" );
263
266 br.lbHatch = (ULONG_PTR)mem;
267 brush = CreateBrushIndirect( &br );
268 ok( !brush, "CreatePatternBrush succeeded\n" );
269
270 br.lbStyle = BS_INDEXED;
272 br.lbHatch = (ULONG_PTR)mem;
273 brush = CreateBrushIndirect( &br );
274 ok( !brush, "CreatePatternBrush succeeded\n" );
275
276 GlobalFree( mem );
277
278 /* Test deleting bitmap after brush creation */
279 /* Create hdc and bitmaps */
280 hdc_screen = GetDC( NULL );
281 hdc = CreateCompatibleDC( hdc_screen );
282 bitmap = CreateCompatibleBitmap( hdc_screen, 16, 16 );
283 bitmap2 = CreateCompatibleBitmap( hdc_screen, 16, 16 );
284
285 /* Fill the first bitmap with 0xff5511 */
286 old_bitmap = SelectObject( hdc, bitmap );
287 SetRect( &rect, 0, 0, 16, 16 );
288 brush = CreateSolidBrush( 0xff5511 );
289 result = FillRect( hdc, &rect, brush );
290 ok( result, "FillRect failed, error %ld.\n", GetLastError() );
291 DeleteObject( brush );
292 color = GetPixel( hdc, 10, 10 );
293 ok( color == 0xff5511, "Expected color %#x, got %#lx.\n", 0xff5511, color );
294
295 /* Create a pattern brush with the first bitmap filled with 0xff5511 */
296 brush = CreatePatternBrush( bitmap );
297 ok( brush != NULL, "CreatePatternBrush failed, error %lu.\n", GetLastError() );
298
299 /* Delete the first bitmap used for pattern brush creation */
302
303 memset( &br, 0, sizeof(br) );
304 ret = GetObjectW( brush, sizeof(br), &br );
305 ok( ret == sizeof(br), "wrong size %u\n", ret );
306 ok( br.lbColor == 0, "wrong color %lu\n", br.lbColor );
307 ok( br.lbStyle == BS_PATTERN, "wrong style %u\n", br.lbStyle );
308 ok( (HBITMAP)br.lbHatch == bitmap, "wrong handle %p/%p\n", (HBITMAP)br.lbHatch, bitmap );
309
310 /* The first bitmap is now invalid */
311 memset( &bm, 0, sizeof (bm));
312 ret = GetObjectW( bitmap, sizeof(bm), &bm );
313 ok( !ret, "wrong size %u\n", ret );
314
315 /* Fill hdc with 0xabcdef */
316 brush2 = CreateSolidBrush( 0xabcdef );
317 result = FillRect( hdc, &rect, brush2 );
318 ok( result, "FillRect failed, error %ld.\n", GetLastError() );
319 color = GetPixel( hdc, 10, 10 );
320 ok( color == 0xabcdef, "Expected color %#x, got %#lx.\n", 0xabcdef, color );
321 DeleteObject( brush2 );
322
323 /* Fill hdc with the brush created with the deleted bitmap */
324 /* FillRect() succeeds and hdc is filled with the deleted bitmap content */
325 result = FillRect( hdc, &rect, brush );
326 ok( result, "FillRect failed, error %ld.\n", GetLastError() );
327 color = GetPixel( hdc, 10, 10 );
328 ok( color == 0xff5511, "Expected color %#x, got %#lx.\n", 0xff5511, color );
329 DeleteObject( brush );
330
331 SelectObject( hdc, old_bitmap );
333 DeleteDC( hdc );
334 ReleaseDC( NULL, hdc_screen );
335}
336
337static void test_palette_brush(void)
338{
339 char buffer[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD) + 16 * 16];
341 WORD *indices = (WORD *)info->bmiColors;
342 char pal_buffer[sizeof(LOGPALETTE) + 256 * sizeof(PALETTEENTRY)];
343 LOGPALETTE *pal = (LOGPALETTE *)pal_buffer;
345 DWORD *dib_bits;
346 HBITMAP dib;
347 HBRUSH brush;
348 int i;
349 HPALETTE palette, palette2;
350
351 memset( info, 0, sizeof(*info) );
352 info->bmiHeader.biSize = sizeof(info->bmiHeader);
353 info->bmiHeader.biWidth = 16;
354 info->bmiHeader.biHeight = 16;
355 info->bmiHeader.biPlanes = 1;
356 info->bmiHeader.biBitCount = 32;
357 info->bmiHeader.biCompression = BI_RGB;
358 dib = CreateDIBSection( NULL, info, DIB_RGB_COLORS, (void**)&dib_bits, NULL, 0 );
359 ok( dib != NULL, "CreateDIBSection failed\n" );
360
361 info->bmiHeader.biBitCount = 8;
362 for (i = 0; i < 256; i++) indices[i] = 255 - i;
363 for (i = 0; i < 256; i++) ((BYTE *)(indices + 256))[i] = i;
365 ok( brush != NULL, "CreateDIBPatternBrushPt failed\n" );
366
367 pal->palVersion = 0x300;
368 pal->palNumEntries = 256;
369 for (i = 0; i < 256; i++)
370 {
371 pal->palPalEntry[i].peRed = i * 2;
372 pal->palPalEntry[i].peGreen = i * 2;
373 pal->palPalEntry[i].peBlue = i * 2;
374 pal->palPalEntry[i].peFlags = 0;
375 }
376 palette = CreatePalette( pal );
377
378 ok( SelectObject( hdc, dib ) != NULL, "SelectObject failed\n" );
379 ok( SelectPalette( hdc, palette, 0 ) != NULL, "SelectPalette failed\n" );
380 ok( SelectObject( hdc, brush ) != NULL, "SelectObject failed\n" );
381 memset( dib_bits, 0xaa, 16 * 16 * 4 );
382 PatBlt( hdc, 0, 0, 16, 16, PATCOPY );
383 for (i = 0; i < 256; i++)
384 {
385 DWORD expect = (pal->palPalEntry[255 - i].peRed << 16 |
386 pal->palPalEntry[255 - i].peGreen << 8 |
387 pal->palPalEntry[255 - i].peBlue);
388 ok( dib_bits[i] == expect, "wrong bits %lx/%lx at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 );
389 }
390
391 for (i = 0; i < 256; i++) pal->palPalEntry[i].peRed = i * 3;
392 palette2 = CreatePalette( pal );
393 ok( SelectPalette( hdc, palette2, 0 ) != NULL, "SelectPalette failed\n" );
394 memset( dib_bits, 0xaa, 16 * 16 * 4 );
395 PatBlt( hdc, 0, 0, 16, 16, PATCOPY );
396 for (i = 0; i < 256; i++)
397 {
398 DWORD expect = (pal->palPalEntry[255 - i].peRed << 16 |
399 pal->palPalEntry[255 - i].peGreen << 8 |
400 pal->palPalEntry[255 - i].peBlue);
401 ok( dib_bits[i] == expect, "wrong bits %lx/%lx at %u,%u\n", dib_bits[i], expect, i % 16, i / 16 );
402 }
403 DeleteDC( hdc );
404 DeleteObject( dib );
405 DeleteObject( brush );
407 DeleteObject( palette2 );
408}
409
410static void test_brush_org( void )
411{
412 HDC hdc = GetDC( 0 );
413 POINT old, pt;
414 BOOL ret;
415
416 ret = SetBrushOrgEx( hdc, 0, 0, &old );
417 ok(ret, "Unexpected return value %d.\n", ret);
418
419 ret = SetBrushOrgEx( hdc, 1, 1, &pt );
420 ok(ret, "Unexpected return value %d.\n", ret);
421 ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y );
422 ret = SetBrushOrgEx( hdc, 0x10000, -1, &pt );
423 ok(ret, "Unexpected return value %d.\n", ret);
424 ok( pt.x == 1 && pt.y == 1, "got %ld,%ld\n", pt.x, pt.y );
425 ret = SetBrushOrgEx( hdc, old.x, old.y, &pt );
426 ok(ret, "Unexpected return value %d.\n", ret);
427 ok( pt.x == 0x10000 && pt.y == -1, "got %ld,%ld\n", pt.x, pt.y );
428
429 ret = GetBrushOrgEx( hdc, &pt );
430 ok(ret, "Unexpected return value %d.\n", ret);
431 ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y );
432 pt.x = 10;
433 pt.y = 20;
434 ret = FixBrushOrgEx( hdc, 2, 3, &pt );
436 ok(!ret, "Unexpected return value %d.\n", ret);
438 ok( pt.x == 10 && pt.y == 20, "got %ld,%ld\n", pt.x, pt.y );
439 ret = GetBrushOrgEx( hdc, &pt );
440 ok(ret, "Unexpected return value %d.\n", ret);
442 ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y );
443
444 ReleaseDC( 0, hdc );
445}
446
447static void test_null_brush(void)
448{
449 LOGBRUSH lb;
450 HBRUSH brush;
451
452 lb.lbStyle = BS_NULL;
453 brush = CreateBrushIndirect(&lb);
454 ok(brush == GetStockObject(NULL_BRUSH), "brush is not NULL_BRUSH\n");
455}
456
458{
465}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define ARRAY_SIZE(A)
Definition: main.h:20
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
RECT rect
Definition: combotst.c:67
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
#define pt(x, y)
Definition: drawing.c:79
#define BI_RLE4
Definition: precomp.h:45
#define RGB(r, g, b)
Definition: precomp.h:67
ULONG RGBQUAD
Definition: precomp.h:47
return ret
Definition: mutex.c:146
#define ULONG_PTR
Definition: config.h:101
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLuint GLuint GLsizei GLenum const GLvoid * indices
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLuint color
Definition: glext.h:6243
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLuint64EXT * result
Definition: glext.h:11304
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
Definition: glfuncs.h:248
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
UINT NTAPI GlobalFlags(HGLOBAL hMem)
Definition: heapmem.c:520
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define bits
Definition: infblock.c:15
static ERESOURCE GlobalLock
Definition: sys_arch.c:8
#define todo_wine
Definition: minitest.h:80
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
struct _STOCK_BRUSH STOCK_BRUSH
static void test_pattern_brush(void)
Definition: brush.c:119
static void test_hatch_brush(void)
Definition: brush.c:83
static void test_solidbrush(void)
Definition: brush.c:36
static void test_brush_org(void)
Definition: brush.c:410
static void test_palette_brush(void)
Definition: brush.c:337
static void test_null_brush(void)
Definition: brush.c:447
static HPALETTE palette
Definition: clipboard.c:1457
static HBITMAP bitmap2
Definition: clipboard.c:1456
#define memset(x, y, z)
Definition: compat.h:39
const char * name
Definition: brush.c:33
int stockobj
Definition: brush.c:32
COLORREF color
Definition: brush.c:31
Definition: uimain.c:89
Definition: mem.c:349
Definition: name.c:39
BITMAP dsBm
Definition: wingdi.h:2115
UINT lbStyle
Definition: wingdi.h:2193
ULONG_PTR lbHatch
Definition: wingdi.h:2195
COLORREF lbColor
Definition: wingdi.h:2194
WORD palNumEntries
Definition: wingdi.h:2280
WORD palVersion
Definition: wingdi.h:2279
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
int32_t INT
Definition: typedefs.h:58
#define BI_RGB
Definition: uefivid.c:46
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:245
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define GMEM_MOVEABLE
Definition: winbase.h:318
DWORD COLORREF
Definition: windef.h:100
HBRUSH WINAPI CreateBrushIndirect(_In_ const LOGBRUSH *plb)
#define HS_API_MAX
Definition: wingdi.h:582
#define DIB_RGB_COLORS
Definition: wingdi.h:367
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define BS_MONOPATTERN
Definition: wingdi.h:1096
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)
BOOL WINAPI GetBrushOrgEx(_In_ HDC, _Out_ LPPOINT)
#define BS_PATTERN8X8
Definition: wingdi.h:1094
struct tagPALETTEENTRY PALETTEENTRY
#define LTGRAY_BRUSH
Definition: wingdi.h:900
#define BS_HATCHED
Definition: wingdi.h:1089
#define HS_DIAGCROSS
Definition: wingdi.h:578
BOOL WINAPI SetBrushOrgEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HBRUSH WINAPI CreateHatchBrush(_In_ int, _In_ COLORREF)
#define BS_PATTERN
Definition: wingdi.h:1090
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)
#define BS_DIBPATTERNPT
Definition: wingdi.h:1093
BOOL WINAPI FixBrushOrgEx(_In_ HDC, _In_ int, _In_ int, _In_opt_ LPPOINT)
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define BS_DIBPATTERN8X8
Definition: wingdi.h:1095
#define DIB_PAL_COLORS
Definition: wingdi.h:366
#define BS_DIBPATTERN
Definition: wingdi.h:1092
#define WHITE_BRUSH
Definition: wingdi.h:902
#define GRAY_BRUSH
Definition: wingdi.h:898
#define PATCOPY
Definition: wingdi.h:335
#define NULL_BRUSH
Definition: wingdi.h:901
#define BS_INDEXED
Definition: wingdi.h:1091
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define BLACK_BRUSH
Definition: wingdi.h:896
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define BS_NULL
Definition: wingdi.h:1087
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateDIBPatternBrushPt(_In_ const VOID *pvPackedDIB, _In_ UINT uUsage)
#define BI_RLE8
Definition: wingdi.h:35
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
#define BS_SOLID
Definition: wingdi.h:1086
HBRUSH WINAPI CreatePatternBrush(_In_ HBITMAP)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
unsigned char BYTE
Definition: xxhash.c:193