ReactOS 0.4.17-dev-243-g1369312
brush.c
Go to the documentation of this file.
1/*
2 * Unit test suite for brushes
3 *
4 * Copyright (C) 2007 Google (Evan Stade)
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#define COBJMACROS
22#include <math.h>
23
24#include "objbase.h"
25#include "gdiplus.h"
26#include "wine/test.h"
27
28#define expect(expected,got) expect_(__LINE__, expected, got)
29static inline void expect_(unsigned line, DWORD expected, DWORD got)
30{
31 ok_(__FILE__, line)(expected == got, "Expected %.8ld, got %.8ld\n", expected, got);
32}
33#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
34
35static HWND hwnd;
36
38{
40 GpSolidFill *brush = NULL;
41
42 status = GdipCreateSolidFill((ARGB)0xdeadbeef, &brush);
44 ok(brush != NULL, "Expected brush to be initialized\n");
45
48
49 status = GdipDeleteBrush((GpBrush*) brush);
51}
52
53static void test_createHatchBrush(void)
54{
56 GpHatch *brush;
57
60 ok(brush != NULL, "Expected the brush to be initialized.\n");
61
62 GdipDeleteBrush((GpBrush *)brush);
63
66 ok(brush != NULL, "Expected the brush to be initialized.\n");
67
68 GdipDeleteBrush((GpBrush *)brush);
69
72
75
78}
79
81{
83 GpLineGradient *brush;
84 GpRectF rect1 = { 1, 3, 1, 2 };
85 GpRectF rect2 = { 1, 3, -1, -2 };
86 GpRectF rect3 = { 1, 3, 0, 1 };
87 GpRectF rect4 = { 1, 3, 1, 0 };
88
89 status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 0, TRUE, WrapModeTile, &brush);
91 GdipDeleteBrush((GpBrush *) brush);
92
95 GdipDeleteBrush((GpBrush *) brush);
96
99 GdipDeleteBrush((GpBrush *) brush);
100
101 status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 405, TRUE, (WrapMode)(WrapModeClamp + 1), &brush);
102 expect(Ok, status);
103 GdipDeleteBrush((GpBrush *) brush);
104
105 status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 45, FALSE, (WrapMode)(WrapModeClamp + 1), &brush);
106 expect(Ok, status);
107 GdipDeleteBrush((GpBrush *) brush);
108
110 expect(Ok, status);
111
114
117
120
123
126
127 status = GdipCreateLineBrushFromRectWithAngle(&rect3, 10, 11, 90, TRUE, WrapModeClamp, &brush);
129
130 status = GdipCreateLineBrushFromRectWithAngle(&rect4, 10, 11, 90, TRUE, WrapModeClamp, &brush);
132
133 status = GdipCreateLineBrushFromRectWithAngle(&rect1, 10, 11, 90, TRUE, WrapModeClamp, &brush);
135
138
139 GdipDeleteBrush((GpBrush *) brush);
140}
141
142static void test_type(void)
143{
145 GpBrushType bt;
146 GpSolidFill *brush = NULL;
147
148 GdipCreateSolidFill((ARGB)0xdeadbeef, &brush);
149
150 status = GdipGetBrushType((GpBrush*)brush, &bt);
151 expect(Ok, status);
153
154 GdipDeleteBrush((GpBrush*) brush);
155}
156static GpPointF blendcount_ptf[] = {{0.0, 0.0},
157 {50.0, 50.0}};
158static void test_gradientblendcount(void)
159{
161 GpPathGradient *brush;
162 INT count;
163
165 expect(Ok, status);
166
173
175 expect(Ok, status);
176 expect(1, count);
177
178 GdipDeleteBrush((GpBrush*) brush);
179}
180
181static GpPointF getblend_ptf[] = {{0.0, 0.0},
182 {50.0, 50.0}};
183static void test_getblend(void)
184{
186 GpPathGradient *brush;
187 REAL blends[4];
188 REAL pos[4];
189
191 expect(Ok, status);
192
193 /* check some invalid parameters combinations */
204
205 blends[0] = (REAL)0xdeadbeef;
206 pos[0] = (REAL)0xdeadbeef;
207 status = GdipGetPathGradientBlend(brush, blends, pos, 1);
208 expect(Ok, status);
209 expectf(1.0, blends[0]);
210 expectf((REAL)0xdeadbeef, pos[0]);
211
212 GdipDeleteBrush((GpBrush*) brush);
213}
214
215static GpPointF getbounds_ptf[] = {{0.0, 20.0},
216 {50.0, 50.0},
217 {21.0, 25.0},
218 {25.0, 46.0}};
219static void test_getbounds(void)
220{
222 GpPathGradient *brush;
223 GpRectF bounds;
224
226 expect(Ok, status);
227
234
235 status = GdipGetPathGradientRect(brush, &bounds);
236 expect(Ok, status);
237 expectf(0.0, bounds.X);
238 expectf(20.0, bounds.Y);
239 expectf(50.0, bounds.Width);
240 expectf(30.0, bounds.Height);
241
242 GdipDeleteBrush((GpBrush*) brush);
243}
244
245static void test_getgamma(void)
246{
250 BOOL gamma;
251
252 start.X = start.Y = 0.0;
253 end.X = end.Y = 100.0;
254
255 status = GdipCreateLineBrush(&start, &end, (ARGB)0xdeadbeef, 0xdeadbeef, WrapModeTile, &line);
256 expect(Ok, status);
257
258 /* NULL arguments */
265
267}
268
269static void test_transform(void)
270{
274 GpGraphics *graphics = NULL;
276 HDC hdc = GetDC(0);
277 GpMatrix *m, *m1;
278 BOOL res;
280 GpRectF rectf;
281 REAL elements[6];
282 UINT buf[15];
283 HBITMAP hbmp,old;
284 HDC dcmem;
285 BITMAP bm;
286 GpImage *image;
288 HGLOBAL hglob;
289 VOID *data;
290 HRESULT hr;
291 LONG size;
292
293 /* 3*5 bmp 32bit*/
294 static const unsigned char bmpimage[] = {
295 0x42,0x4d,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,
296 0x00,0x00,0x28,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x05,0x00,
297 0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,
298 0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
299 0x00,0x00,0x00,0x00,0x00,0x00,
300 0xff,0x11,0xff,0x00,0xff,0x11,0xff,0x00,0xff,0x11,0xff,0x00,
301 0xff,0x33,0xff,0x00,0xff,0x33,0xff,0x00,0xff,0x33,0xff,0x00,
302 0xff,0x55,0xff,0x00,0xff,0x55,0xff,0x00,0xff,0x55,0xff,0x00,
303 0xff,0xaa,0xff,0x00,0xff,0xaa,0xff,0x00,0xff,0xaa,0xff,0x00,
304 0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
305 0x00,0x00,0x00,0x00};
306
307 static const UINT buf_rotate_180[15] = {
308 0xffffffff, 0xffffffff, 0xffffffff,
309 0xffff11ff, 0xffff11ff, 0xffff11ff,
310 0xffff33ff, 0xffff33ff, 0xffff33ff,
311 0xffff55ff, 0xffff55ff, 0xffff55ff,
312 0xffffaaff, 0xffffaaff, 0xffffaaff};
313
314 /* GpTexture */
315 status = GdipCreateMatrix2(2.0, 0.0, 0.0, 0.0, 0.0, 0.0, &m);
316 expect(Ok, status);
317
318 status = GdipCreateFromHDC(hdc, &graphics);
319 expect(Ok, status);
320 status = GdipCreateBitmapFromGraphics(1, 1, graphics, &bitmap);
321 expect(Ok, status);
322
324 expect(Ok, status);
325
326 /* NULL */
331
332 /* get default value - identity matrix */
334 expect(Ok, status);
336 expect(Ok, status);
337 expect(TRUE, res);
338 /* set and get then */
339 status = GdipCreateMatrix2(2.0, 0.0, 0.0, 2.0, 0.0, 0.0, &m1);
340 expect(Ok, status);
342 expect(Ok, status);
344 expect(Ok, status);
345 status = GdipIsMatrixEqual(m, m1, &res);
346 expect(Ok, status);
347 expect(TRUE, res);
348 /* reset */
350 expect(Ok, status);
352 expect(Ok, status);
354 expect(Ok, status);
355 expect(TRUE, res);
356
358 expect(Ok, status);
359
361 expect(Ok, status);
363 expect(Ok, status);
365 expect(Ok, status);
366 status = GdipDeleteGraphics(graphics);
367 expect(Ok, status);
368
369
370
371 status = GdipCreateFromHWND(hwnd, &graphics);
372 expect(Ok, status);
373
374 /* GpLineGradient */
375 /* create with vertical gradient line */
376 start.X = start.Y = end.X = 0.0;
377 end.Y = 100.0;
378
379 status = GdipCreateLineBrush(&start, &end, (ARGB)0xffff0000, 0xff00ff00, WrapModeTile, &line);
380 expect(Ok, status);
381
382 status = GdipCreateMatrix2(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, &m);
383 expect(Ok, status);
384
385 /* NULL arguments */
402
403 /* initial transform */
405 expect(Ok, status);
406
407 status = GdipGetMatrixElements(m, elements);
408 expect(Ok, status);
409 expectf(0.0, elements[0]);
410 expectf(1.0, elements[1]);
411 expectf(-1.0, elements[2]);
412 expectf(0.0, elements[3]);
413 expectf(50.0, elements[4]);
414 expectf(50.0, elements[5]);
415
416 status = GdipGetLineRect(line, &rectf);
417 expect(Ok, status);
418 expectf(-50.0, rectf.X);
419 expectf(0.0, rectf.Y);
420 expectf(100.0, rectf.Width);
421 expectf(100.0, rectf.Height);
422
423 status = GdipFillRectangle(graphics, (GpBrush*)line, 0, 0, 200, 200);
424 expect(Ok, status);
425
426 /* manually set transform */
427 GdipSetMatrixElements(m, 2.0, 0.0, 0.0, 4.0, 0.0, 0.0);
428
430 expect(Ok, status);
431
433 expect(Ok, status);
434
435 status = GdipGetMatrixElements(m, elements);
436 expect(Ok, status);
437 expectf(2.0, elements[0]);
438 expectf(0.0, elements[1]);
439 expectf(0.0, elements[2]);
440 expectf(4.0, elements[3]);
441 expectf(0.0, elements[4]);
442 expectf(0.0, elements[5]);
443
444 status = GdipGetLineRect(line, &rectf);
445 expect(Ok, status);
446 expectf(-50.0, rectf.X);
447 expectf(0.0, rectf.Y);
448 expectf(100.0, rectf.Width);
449 expectf(100.0, rectf.Height);
450
451 status = GdipFillRectangle(graphics, (GpBrush*)line, 200, 0, 200, 200);
452 expect(Ok, status);
453
454 /* scale transform */
456 expect(Ok, status);
457
459 expect(Ok, status);
460
461 status = GdipGetMatrixElements(m, elements);
462 expect(Ok, status);
463 expectf(8.0, elements[0]);
464 expectf(0.0, elements[1]);
465 expectf(0.0, elements[2]);
466 expectf(2.0, elements[3]);
467 expectf(0.0, elements[4]);
468 expectf(0.0, elements[5]);
469
470 status = GdipGetLineRect(line, &rectf);
471 expect(Ok, status);
472 expectf(-50.0, rectf.X);
473 expectf(0.0, rectf.Y);
474 expectf(100.0, rectf.Width);
475 expectf(100.0, rectf.Height);
476
477 status = GdipFillRectangle(graphics, (GpBrush*)line, 400, 0, 200, 200);
478 expect(Ok, status);
479
480 /* translate transform */
482 expect(Ok, status);
483
485 expect(Ok, status);
486
487 status = GdipGetMatrixElements(m, elements);
488 expect(Ok, status);
489 expectf(8.0, elements[0]);
490 expectf(0.0, elements[1]);
491 expectf(0.0, elements[2]);
492 expectf(2.0, elements[3]);
493 expectf(10.0, elements[4]);
494 expectf(-20.0, elements[5]);
495
496 status = GdipGetLineRect(line, &rectf);
497 expect(Ok, status);
498 expectf(-50.0, rectf.X);
499 expectf(0.0, rectf.Y);
500 expectf(100.0, rectf.Width);
501 expectf(100.0, rectf.Height);
502
503 status = GdipFillRectangle(graphics, (GpBrush*)line, 0, 200, 200, 200);
504 expect(Ok, status);
505
506 /* multiply transform */
507 GdipSetMatrixElements(m, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
510
512 expect(Ok, status);
513
514 /* NULL transform does nothing */
516 expect(Ok, status);
517
519 expect(Ok, status);
520
521 status = GdipGetMatrixElements(m, elements);
522 expect(Ok, status);
523 expectf(1.414214, elements[0]);
524 expectf(2.828427, elements[1]);
525 expectf(-0.353553, elements[2]);
526 expectf(0.707107, elements[3]);
527 expectf(5.303300, elements[4]);
528 expectf(-3.535534, elements[5]);
529
530 status = GdipGetLineRect(line, &rectf);
531 expect(Ok, status);
532 expectf(-50.0, rectf.X);
533 expectf(0.0, rectf.Y);
534 expectf(100.0, rectf.Width);
535 expectf(100.0, rectf.Height);
536
537 status = GdipFillRectangle(graphics, (GpBrush*)line, 200, 200, 200, 200);
538 expect(Ok, status);
539
540 /* reset transform sets to identity */
542 expect(Ok, status);
543
545 expect(Ok, status);
546
547 status = GdipGetMatrixElements(m, elements);
548 expect(Ok, status);
549 expectf(1.0, elements[0]);
550 expectf(0.0, elements[1]);
551 expectf(0.0, elements[2]);
552 expectf(1.0, elements[3]);
553 expectf(0.0, elements[4]);
554 expectf(0.0, elements[5]);
555
556 status = GdipGetLineRect(line, &rectf);
557 expect(Ok, status);
558 expectf(-50.0, rectf.X);
559 expectf(0.0, rectf.Y);
560 expectf(100.0, rectf.Width);
561 expectf(100.0, rectf.Height);
562
563 status = GdipFillRectangle(graphics, (GpBrush*)line, 400, 200, 200, 200);
564 expect(Ok, status);
565
567
568 /* passing negative Width/Height to LinearGradientModeHorizontal */
569 rectf.X = rectf.Y = 10.0;
570 rectf.Width = rectf.Height = -100.0;
571 status = GdipCreateLineBrushFromRect(&rectf, (ARGB)0xffff0000, 0xff00ff00,
573 expect(Ok, status);
574 memset(&rectf, 0, sizeof(GpRectF));
575 status = GdipGetLineRect(line, &rectf);
576 expect(Ok, status);
577 expectf(10.0, rectf.X);
578 expectf(10.0, rectf.Y);
579 expectf(-100.0, rectf.Width);
580 expectf(-100.0, rectf.Height);
582 expect(Ok, status);
583 status = GdipGetMatrixElements(m, elements);
585 expectf(1.0, elements[0]);
586 expectf(0.0, elements[1]);
587 expectf(0.0, elements[2]);
588 expectf(1.0, elements[3]);
589 expectf(0.0, elements[4]);
590 expectf(0.0, elements[5]);
591 status = GdipFillRectangle(graphics, (GpBrush*)line, 0, 400, 200, 200);
592 expect(Ok, status);
595 GdipDeleteGraphics(graphics);
596
597 dcmem = CreateCompatibleDC(hdc);
598 hbmp = CreateBitmap(3, 5, 1, 32, NULL);
599 old = SelectObject(dcmem, hbmp);
600 status = GdipCreateFromHDC(dcmem, &graphics);
601 expect(Ok, status);
602 hglob = GlobalAlloc(0, sizeof(bmpimage));
603 data = GlobalLock (hglob);
604 memcpy(data, bmpimage, sizeof(bmpimage));
605 GlobalUnlock(hglob);
607 expect(S_OK, hr);
609 expect(Ok, status);
611 expect(Ok, status);
613 expect(Ok, status);
614 status = GdipFillRectangle(graphics, (GpBrush*)texture, .0f, .0f, (REAL)3, (REAL)5);
615 expect(Ok, status);
618 GdipDeleteGraphics(graphics);
619 IStream_Release(stream);
620 hbmp = SelectObject(dcmem, old);
621 GetObjectW(hbmp, sizeof(bm), &bm);
622 size = GetBitmapBits(hbmp, sizeof(buf), buf);
623 expect(sizeof(buf), size);
625 DeleteDC(dcmem);
626 ok(!memcmp(buf, buf_rotate_180, sizeof(buf)), "Failed to rotate image.\n");
627
628 if(0){
629 /* enable to visually compare with Windows */
630 MSG msg;
631 while(GetMessageW(&msg, hwnd, 0, 0) > 0){
634 }
635 }
636
638 ReleaseDC(0, hdc);
639}
640
641static void test_texturewrap(void)
642{
645 GpGraphics *graphics = NULL;
647 HDC hdc = GetDC(0);
649
650 status = GdipCreateFromHDC(hdc, &graphics);
651 expect(Ok, status);
652 status = GdipCreateBitmapFromGraphics(1, 1, graphics, &bitmap);
653 expect(Ok, status);
654
656 expect(Ok, status);
657
658 /* NULL */
665
666 /* get */
669 expect(Ok, status);
671 /* set, then get */
674 expect(Ok, status);
677 expect(Ok, status);
679
681 expect(Ok, status);
683 expect(Ok, status);
684 status = GdipDeleteGraphics(graphics);
685 expect(Ok, status);
686 ReleaseDC(0, hdc);
687}
688
689static void test_gradientgetrect(void)
690{
691 static const struct
692 {
695 REAL transform[6];
696 }
697 create_from_rect[] =
698 {
699 { LinearGradientModeHorizontal, { 10.0f, 10.0f, -100.0f, -100.0f } },
700 { LinearGradientModeHorizontal, { 10.0f, 10.0f, 100.0f, 100.0f } },
701 { LinearGradientModeHorizontal, { 10.0f, -5.0f, 100.0f, 50.0f } },
702 { LinearGradientModeHorizontal, { -5.0f, 10.0f, 100.0f, 50.0f } },
703 { LinearGradientModeVertical, { 0.0f, 0.0f, 100.0f, 10.0f }, { 0.0f, 0.1f, -10.0f, -0.0f, 100.0f, 0.0f } },
704 { LinearGradientModeVertical, { 10.0f, -12.0f, 100.0f, 105.0f }, { 0.0f, 1.05f, -0.952f, 0.0f, 98.571f, -22.5f } },
705 };
706 static const struct
707 {
708 GpPointF pt1, pt2;
710 REAL transform[6];
711 }
712 create_from_pt[] =
713 {
714 { { 1.0f, 1.0f }, { 100.0f, 100.0f }, { 1.0f, 1.0f, 99.0f, 99.0f }, { 1.0f, 1.0f, -1.0f, 1.0f, 50.50f, -50.50f } },
715 { { 0.0f, 0.0f }, { 0.0f, 10.0f }, { -5.0f, 0.0f, 10.0f, 10.0f }, { 0.0f, 1.0f, -1.0f, 0.0f, 5.0f, 5.0f } },
716 { { 0.0f, 0.0f }, { 10.0f, 0.0f }, { 0.0f, -5.0f, 10.0f, 10.0f }, { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f } },
717 /* Slope = -1 */
718 { { 0.0f, 0.0f }, { 20.0f, -20.0f }, { 0.0f, -20.0f, 20.0f, 20.0f }, { 1.0f, -1.0f, 1.0f, 1.0f, 10.0f, 10.0f } },
719 /* Slope = 1/100 */
720 { { 0.0f, 0.0f }, { 100.0f, 1.0f }, { 0.0f, 0.0f, 100.0f, 1.0f }, { 1.0f, 0.01f, -0.02f, 2.0f, 0.01f, -1.0f } },
721 { { 10.0f, 10.0f }, { -90.0f, 10.0f }, { -90.0f, -40.0f, 100.0f, 100.0f }, { -1.0f, 0.0f, 0.0f, -1.0f, -80.0f, 20.0f } },
722 };
723 static const struct
724 {
726 REAL angle;
727 BOOL is_scalable;
728 REAL transform[6];
729 }
730 create_with_angle[] =
731 {
732 { { 10.0f, 10.0f, -100.0f, -100.0f }, 0.0f, TRUE },
733 { { 10.0f, 10.0f, -100.0f, -100.0f }, 0.0f, FALSE },
734 { { 10.0f, 10.0f, 100.0f, 100.0f }, 0.0f, FALSE },
735 { { 10.0f, 10.0f, 100.0f, 100.0f }, 0.0f, TRUE },
736 { { 10.0f, -5.0f, 100.0f, 50.0f }, 0.0f, FALSE },
737 { { 10.0f, -5.0f, 100.0f, 50.0f }, 0.0f, TRUE },
738 { { -5.0f, 10.0f, 100.0f, 50.0f }, 0.0f, FALSE },
739 { { -5.0f, 10.0f, 100.0f, 50.0f }, 0.0f, TRUE },
740 { { 0.0f, 0.0f, 100.0f, 10.0f }, -90.0f, TRUE, { 0.0f, -0.1f, 10.0f, 0.0f, 0.0f, 10.0f } },
741 { { 10.0f, -12.0f, 100.0f, 105.0f }, -90.0f, TRUE, { 0.0f, -1.05f, 0.952f, 0.0f, 21.429f, 103.5f } },
742 { { 0.0f, 0.0f, 100.0f, 10.0f }, -90.0f, FALSE, { 0.0f, -0.1f, 10.0f, -0.0f, 0.0f, 10.0f } },
743 { { 10.0f, -12.0f, 100.0f, 105.0f }, -90.0f, FALSE, { 0.0f, -1.05f, 0.952f, 0.0f, 21.429f, 103.5f } },
744 };
745 GpLineGradient *brush;
747 REAL elements[6];
749 unsigned int i;
750 ARGB colors[2];
751 GpRectF rectf;
752
754 expect(Ok, status);
755
756 for (i = 0; i < ARRAY_SIZE(create_from_pt); ++i)
757 {
758 status = GdipCreateLineBrush(&create_from_pt[i].pt1, &create_from_pt[i].pt2, 0x1, 0x2, WrapModeTile, &brush);
759 ok(status == Ok, "Failed to create a brush, %d.\n", status);
760
761 memset(&rectf, 0, sizeof(rectf));
762 status = GdipGetLineRect(brush, &rectf);
763 ok(status == Ok, "Failed to get brush rect, %d.\n", status);
764 ok(!memcmp(&rectf, &create_from_pt[i].rect, sizeof(rectf)), "Unexpected brush rect.\n");
765
767 ok(status == Ok, "Failed to get brush transform, %d.\n", status);
768
770 ok(status == Ok, "Failed to get matrix elements, %d.\n", status);
771
772#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
773 expectf2(create_from_pt[i].transform[0], elements[0]);
774 expectf2(create_from_pt[i].transform[1], elements[1]);
775 expectf2(create_from_pt[i].transform[2], elements[2]);
776 expectf2(create_from_pt[i].transform[3], elements[3]);
777 expectf2(create_from_pt[i].transform[4], elements[4]);
778 expectf2(create_from_pt[i].transform[5], elements[5]);
779#undef expect2f
780
781 status = GdipGetLineColors(brush, colors);
782 ok(status == Ok, "Failed to get line colors, %d.\n", status);
783 ok(colors[0] == 0x1 && colors[1] == 0x2, "Unexpected brush colors.\n");
784
785 status = GdipDeleteBrush((GpBrush *)brush);
786 ok(status == Ok, "Failed to delete a brush, %d.\n", status);
787 }
788
789 /* zero height rect */
790 rectf.X = rectf.Y = 10.0;
791 rectf.Width = 100.0;
792 rectf.Height = 0.0;
794 WrapModeTile, &brush);
796
797 /* zero width rect */
798 rectf.X = rectf.Y = 10.0;
799 rectf.Width = 0.0;
800 rectf.Height = 100.0;
802 WrapModeTile, &brush);
804
805 for (i = 0; i < ARRAY_SIZE(create_from_rect); ++i)
806 {
807 ARGB colors[2];
808 BOOL ret;
809
810 status = GdipCreateLineBrushFromRect(&create_from_rect[i].rect, 0x1, 0x2, create_from_rect[i].mode,
811 WrapModeTile, &brush);
812 ok(status == Ok, "Failed to create a brush, %d.\n", status);
813
814 memset(&rectf, 0, sizeof(rectf));
815 status = GdipGetLineRect(brush, &rectf);
816 ok(status == Ok, "Failed to get brush rect, %d.\n", status);
817 ok(!memcmp(&rectf, &create_from_rect[i].rect, sizeof(rectf)), "Unexpected brush rect.\n");
818
820 ok(status == Ok, "Failed to get brush transform, %d.\n", status);
821
822 if (create_from_rect[i].mode == LinearGradientModeHorizontal)
823 {
825 ok(status == Ok, "Unexpected ret value %d.\n", status);
826 }
827 else
828 {
830 ok(status == Ok, "Failed to get matrix elements, %d.\n", status);
831
832#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
833 expectf2(create_from_rect[i].transform[0], elements[0]);
834 expectf2(create_from_rect[i].transform[1], elements[1]);
835 expectf2(create_from_rect[i].transform[2], elements[2]);
836 expectf2(create_from_rect[i].transform[3], elements[3]);
837 expectf2(create_from_rect[i].transform[4], elements[4]);
838 expectf2(create_from_rect[i].transform[5], elements[5]);
839#undef expectf2
840 }
841
842 status = GdipGetLineColors(brush, colors);
843 ok(status == Ok, "Failed to get line colors, %d.\n", status);
844 ok(colors[0] == 0x1 && colors[1] == 0x2, "Unexpected brush colors.\n");
845
846 status = GdipDeleteBrush((GpBrush*)brush);
847 ok(status == Ok, "Failed to delete a brush, %d.\n", status);
848 }
849
850 for (i = 0; i < ARRAY_SIZE(create_with_angle); ++i)
851 {
852 ARGB colors[2];
853 BOOL ret;
854
855 status = GdipCreateLineBrushFromRectWithAngle(&create_with_angle[i].rect, 0x1, 0x2, create_with_angle[i].angle,
856 create_with_angle[i].is_scalable, WrapModeTile, &brush);
857 ok(status == Ok, "Failed to create a brush, %d.\n", status);
858
859 memset(&rectf, 0, sizeof(rectf));
860 status = GdipGetLineRect(brush, &rectf);
861 ok(status == Ok, "Failed to get brush rect, %d.\n", status);
862 ok(!memcmp(&rectf, &create_with_angle[i].rect, sizeof(rectf)), "%u: unexpected brush rect {%f,%f,%f,%f}.\n",
863 i, rectf.X, rectf.Y, rectf.Width, rectf.Height);
864
866 ok(status == Ok, "Failed to get brush transform, %d.\n", status);
867
868 if (create_with_angle[i].angle == 0.0f)
869 {
871 ok(status == Ok, "Unexpected ret value %d.\n", status);
872 }
873 else
874 {
876 ok(status == Ok, "Failed to get matrix elements, %d.\n", status);
877
878#define expectf2(expected, got) ok(fabs(expected - got) < 0.001, "%u: expected %.3f, got %.3f.\n", i, expected, got)
879 expectf2(create_with_angle[i].transform[0], elements[0]);
880 expectf2(create_with_angle[i].transform[1], elements[1]);
881 expectf2(create_with_angle[i].transform[2], elements[2]);
882 expectf2(create_with_angle[i].transform[3], elements[3]);
883 expectf2(create_with_angle[i].transform[4], elements[4]);
884 expectf2(create_with_angle[i].transform[5], elements[5]);
885#undef expectf2
886 }
887
888 status = GdipGetLineColors(brush, colors);
889 ok(status == Ok, "Failed to get line colors, %d.\n", status);
890 ok(colors[0] == 0x1 && colors[1] == 0x2, "Unexpected brush colors.\n");
891
892 status = GdipDeleteBrush((GpBrush*)brush);
893 ok(status == Ok, "Failed to delete a brush, %d.\n", status);
894 }
895
897}
898
899static void test_lineblend(void)
900{
901 GpLineGradient *brush;
903 GpPointF pt1, pt2;
904 INT count=10;
905 int i;
906 const REAL factors[5] = {0.0f, 0.1f, 0.5f, 0.9f, 1.0f};
907 const REAL positions[5] = {0.0f, 0.2f, 0.5f, 0.8f, 1.0f};
908 const REAL two_positions[2] = {0.0f, 1.0f};
909 const ARGB colors[5] = {0xff0000ff, 0xff00ff00, 0xff00ffff, 0xffff0000, 0xffffffff};
910 REAL res_factors[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
911 REAL res_positions[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
912 ARGB res_colors[6] = {0xdeadbeef, 0, 0, 0, 0};
913
914 pt1.X = pt1.Y = pt2.Y = pt2.X = 1.0;
915 status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
917
918 pt1.X = pt1.Y = 1.0;
919 pt2.X = pt2.Y = 100.0;
920 status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
921 expect(Ok, status);
922
925
928
930 expect(Ok, status);
931 expect(1, count);
932
933 status = GdipGetLineBlend(NULL, res_factors, res_positions, 1);
935
936 status = GdipGetLineBlend(brush, NULL, res_positions, 1);
938
939 status = GdipGetLineBlend(brush, res_factors, NULL, 1);
941
942 status = GdipGetLineBlend(brush, res_factors, res_positions, 0);
944
945 status = GdipGetLineBlend(brush, res_factors, res_positions, -1);
947
948 status = GdipGetLineBlend(brush, res_factors, res_positions, 1);
949 expect(Ok, status);
950
951 status = GdipGetLineBlend(brush, res_factors, res_positions, 2);
952 expect(Ok, status);
953
954 status = GdipSetLineBlend(NULL, factors, positions, 5);
956
957 status = GdipSetLineBlend(brush, NULL, positions, 5);
959
960 status = GdipSetLineBlend(brush, factors, NULL, 5);
962
963 status = GdipSetLineBlend(brush, factors, positions, 0);
965
966 status = GdipSetLineBlend(brush, factors, positions, -1);
968
969 /* leave off the 0.0 position */
970 status = GdipSetLineBlend(brush, &factors[1], &positions[1], 4);
972
973 /* leave off the 1.0 position */
974 status = GdipSetLineBlend(brush, factors, positions, 4);
976
977 status = GdipSetLineBlend(brush, factors, positions, 5);
978 expect(Ok, status);
979
981 expect(Ok, status);
982 expect(5, count);
983
984 status = GdipGetLineBlend(brush, res_factors, res_positions, 4);
986
987 status = GdipGetLineBlend(brush, res_factors, res_positions, 5);
988 expect(Ok, status);
989
990 for (i=0; i<5; i++)
991 {
992 expectf(factors[i], res_factors[i]);
993 expectf(positions[i], res_positions[i]);
994 }
995
996 status = GdipGetLineBlend(brush, res_factors, res_positions, 6);
997 expect(Ok, status);
998
999 status = GdipSetLineBlend(brush, factors, positions, 1);
1000 expect(Ok, status);
1001
1003 expect(Ok, status);
1004 expect(1, count);
1005
1006 status = GdipGetLineBlend(brush, res_factors, res_positions, 1);
1007 expect(Ok, status);
1008
1011
1014
1016 expect(Ok, status);
1017 expect(0, count);
1018
1019 status = GdipGetLinePresetBlend(NULL, res_colors, res_positions, 1);
1021
1022 status = GdipGetLinePresetBlend(brush, NULL, res_positions, 1);
1024
1025 status = GdipGetLinePresetBlend(brush, res_colors, NULL, 1);
1027
1028 status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 0);
1030
1031 status = GdipGetLinePresetBlend(brush, res_colors, res_positions, -1);
1033
1034 status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 1);
1036
1037 status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 2);
1039
1040 status = GdipSetLinePresetBlend(NULL, colors, positions, 5);
1042
1043 status = GdipSetLinePresetBlend(brush, NULL, positions, 5);
1045
1046 status = GdipSetLinePresetBlend(brush, colors, NULL, 5);
1048
1049 status = GdipSetLinePresetBlend(brush, colors, positions, 0);
1051
1052 status = GdipSetLinePresetBlend(brush, colors, positions, -1);
1054
1055 status = GdipSetLinePresetBlend(brush, colors, positions, 1);
1057
1058 /* leave off the 0.0 position */
1059 status = GdipSetLinePresetBlend(brush, &colors[1], &positions[1], 4);
1061
1062 /* leave off the 1.0 position */
1063 status = GdipSetLinePresetBlend(brush, colors, positions, 4);
1065
1066 status = GdipSetLinePresetBlend(brush, colors, positions, 5);
1067 expect(Ok, status);
1068
1070 expect(Ok, status);
1071 expect(5, count);
1072
1073 status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 4);
1075
1076 status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 5);
1077 expect(Ok, status);
1078
1079 for (i=0; i<5; i++)
1080 {
1081 expect(colors[i], res_colors[i]);
1082 expectf(positions[i], res_positions[i]);
1083 }
1084
1085 status = GdipGetLinePresetBlend(brush, res_colors, res_positions, 6);
1086 expect(Ok, status);
1087
1088 status = GdipSetLinePresetBlend(brush, colors, two_positions, 2);
1089 expect(Ok, status);
1090
1091 status = GdipDeleteBrush((GpBrush*)brush);
1092 expect(Ok, status);
1093}
1094
1095static void test_linelinearblend(void)
1096{
1097 GpLineGradient *brush;
1099 GpPointF pt1, pt2;
1100 INT count=10;
1101 REAL res_factors[3] = {0.3f};
1102 REAL res_positions[3] = {0.3f};
1103
1104 status = GdipSetLineLinearBlend(NULL, 0.6, 0.8);
1106
1107 pt1.X = pt1.Y = 1.0;
1108 pt2.X = pt2.Y = 100.0;
1109 status = GdipCreateLineBrush(&pt1, &pt2, 0, 0, WrapModeTile, &brush);
1110 expect(Ok, status);
1111
1112
1113 status = GdipSetLineLinearBlend(brush, 0.6, 0.8);
1114 expect(Ok, status);
1115
1117 expect(Ok, status);
1118 expect(3, count);
1119
1120 status = GdipGetLineBlend(brush, res_factors, res_positions, 3);
1121 expect(Ok, status);
1122 expectf(0.0, res_factors[0]);
1123 expectf(0.0, res_positions[0]);
1124 expectf(0.8, res_factors[1]);
1125 expectf(0.6, res_positions[1]);
1126 expectf(0.0, res_factors[2]);
1127 expectf(1.0, res_positions[2]);
1128
1129
1130 status = GdipSetLineLinearBlend(brush, 0.0, 0.8);
1131 expect(Ok, status);
1132
1134 expect(Ok, status);
1135 expect(2, count);
1136
1137 status = GdipGetLineBlend(brush, res_factors, res_positions, 3);
1138 expect(Ok, status);
1139 expectf(0.8, res_factors[0]);
1140 expectf(0.0, res_positions[0]);
1141 expectf(0.0, res_factors[1]);
1142 expectf(1.0, res_positions[1]);
1143
1144
1145 status = GdipSetLineLinearBlend(brush, 1.0, 0.8);
1146 expect(Ok, status);
1147
1149 expect(Ok, status);
1150 expect(2, count);
1151
1152 status = GdipGetLineBlend(brush, res_factors, res_positions, 3);
1153 expect(Ok, status);
1154 expectf(0.0, res_factors[0]);
1155 expectf(0.0, res_positions[0]);
1156 expectf(0.8, res_factors[1]);
1157 expectf(1.0, res_positions[1]);
1158
1159 status = GdipDeleteBrush((GpBrush*)brush);
1160 expect(Ok, status);
1161}
1162
1164{
1166 GpPathGradient *grad;
1167 ARGB color[3];
1168 INT count;
1169
1171 expect(Ok, status);
1172
1173 count = 0;
1175 expect(Ok, status);
1176 expect(2, count);
1177
1178 color[0] = color[1] = color[2] = 0xdeadbeef;
1179 count = 3;
1181 expect(Ok, status);
1182 expect(1, count);
1183 expect(0xffffffff, color[0]);
1184 expect(0xffffffff, color[1]);
1185 expect(0xdeadbeef, color[2]);
1186
1187 color[0] = color[1] = color[2] = 0xdeadbeef;
1188 count = 2;
1190 expect(Ok, status);
1191 expect(1, count);
1192 expect(0xffffffff, color[0]);
1193 expect(0xffffffff, color[1]);
1194 expect(0xdeadbeef, color[2]);
1195
1196 color[0] = color[1] = color[2] = 0xdeadbeef;
1197 count = 1;
1200 expect(1, count);
1201 expect(0xdeadbeef, color[0]);
1202 expect(0xdeadbeef, color[1]);
1203 expect(0xdeadbeef, color[2]);
1204
1205 color[0] = color[1] = color[2] = 0xdeadbeef;
1206 count = 0;
1209 expect(0, count);
1210 expect(0xdeadbeef, color[0]);
1211 expect(0xdeadbeef, color[1]);
1212 expect(0xdeadbeef, color[2]);
1213
1214 count = 3;
1217
1218 count = 2;
1219
1220 color[0] = 0x00ff0000;
1221 color[1] = 0x0000ff00;
1222
1225
1228
1229 /* WinXP crashes on this test */
1230 if(0)
1231 {
1234 }
1235
1237 expect(Ok, status);
1238 expect(2, count);
1239
1242
1245
1246 count = 0;
1248 expect(Ok, status);
1249 expect(2, count);
1250
1251 color[0] = color[1] = color[2] = 0xdeadbeef;
1252 count = 2;
1254 expect(Ok, status);
1255 expect(2, count);
1256 expect(0x00ff0000, color[0]);
1257 expect(0x0000ff00, color[1]);
1258 expect(0xdeadbeef, color[2]);
1259
1260 count = 1;
1262 expect(Ok, status);
1263 expect(1, count);
1264
1265 count = 0;
1267 expect(Ok, status);
1268 expect(2, count);
1269
1270 /* If all colors are the same, count is set to 1. */
1271 color[0] = color[1] = 0;
1272 count = 2;
1274 expect(Ok, status);
1275 expect(2, count);
1276
1277 color[0] = color[1] = color[2] = 0xdeadbeef;
1278 count = 2;
1280 expect(Ok, status);
1281 expect(1, count);
1282 expect(0x00000000, color[0]);
1283 expect(0x00000000, color[1]);
1284 expect(0xdeadbeef, color[2]);
1285
1286 color[0] = color[1] = 0xff00ff00;
1287 count = 2;
1289 expect(Ok, status);
1290 expect(2, count);
1291
1292 color[0] = color[1] = color[2] = 0xdeadbeef;
1293 count = 2;
1295 expect(Ok, status);
1296 expect(1, count);
1297 expect(0xff00ff00, color[0]);
1298 expect(0xff00ff00, color[1]);
1299 expect(0xdeadbeef, color[2]);
1300
1301 count = 0;
1304 expect(0, count);
1305
1306 GdipDeleteBrush((GpBrush*)grad);
1307
1309 expect(Ok, status);
1310
1311 color[0] = color[1] = color[2] = 0xdeadbeef;
1312 count = 3;
1314 expect(Ok, status);
1315 expect(1, count);
1316 expect(0xffffffff, color[0]);
1317 expect(0xffffffff, color[1]);
1318 expect(0xffffffff, color[2]);
1319
1320 color[0] = color[1] = color[2] = 0xdeadbeef;
1321 count = 2;
1324 expect(2, count);
1325 expect(0xdeadbeef, color[0]);
1326 expect(0xdeadbeef, color[1]);
1327 expect(0xdeadbeef, color[2]);
1328
1329 count = 0;
1331 expect(Ok, status);
1332 expect(3, count);
1333
1334 GdipDeleteBrush((GpBrush*)grad);
1335}
1336
1337static void test_pathgradientpath(void)
1338{
1340 GpPath *path=NULL;
1341 GpPathGradient *grad=NULL;
1342
1344 expect(Ok, status);
1345
1348
1350 expect(Ok, status);
1351
1354
1357
1359 expect(Ok, status);
1360
1361 status = GdipDeleteBrush((GpBrush*)grad);
1362 expect(Ok, status);
1363}
1364
1366{
1367 static const GpPointF path_points[] = {{0,0}, {3,0}, {0,4}};
1369 GpPath* path;
1370 GpPathGradient *grad;
1372
1373 status = GdipCreatePathGradient(path_points+1, 2, WrapModeClamp, &grad);
1374 expect(Ok, status);
1375
1378
1381
1383 expect(Ok, status);
1384 expectf(1.5, point.X);
1385 expectf(2.0, point.Y);
1386
1389
1392
1393 point.X = 10.0;
1394 point.Y = 15.0;
1396 expect(Ok, status);
1397
1398 point.X = point.Y = -1;
1400 expect(Ok, status);
1401 expectf(10.0, point.X);
1402 expectf(15.0, point.Y);
1403
1404 status = GdipDeleteBrush((GpBrush*)grad);
1405 expect(Ok, status);
1406
1407 status = GdipCreatePathGradient(path_points, 3, WrapModeClamp, &grad);
1408 expect(Ok, status);
1409
1411 expect(Ok, status);
1412 expectf(1.0, point.X);
1413 expectf(4.0/3.0, point.Y);
1414
1415 status = GdipDeleteBrush((GpBrush*)grad);
1416 expect(Ok, status);
1417
1419 expect(Ok, status);
1420
1421 status = GdipAddPathEllipse(path, 0, 0, 100, 50);
1422 expect(Ok, status);
1423
1425 expect(Ok, status);
1426
1428 expect(Ok, status);
1429 expectf(700.0/13.0, point.X);
1430 expectf(25.0, point.Y);
1431
1433 expect(Ok, status);
1434
1435 status = GdipDeleteBrush((GpBrush*)grad);
1436 expect(Ok, status);
1437}
1438
1440{
1441 static const GpPointF path_points[] = {{0,0}, {3,0}, {0,4}};
1443 GpPathGradient *grad;
1444 INT count;
1445 int i;
1446 const REAL positions[5] = {0.0f, 0.2f, 0.5f, 0.8f, 1.0f};
1447 const REAL two_positions[2] = {0.0f, 1.0f};
1448 const ARGB colors[5] = {0xff0000ff, 0xff00ff00, 0xff00ffff, 0xffff0000, 0xffffffff};
1449 REAL res_positions[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
1450 ARGB res_colors[6] = {0xdeadbeef, 0, 0, 0, 0};
1451
1452 status = GdipCreatePathGradient(path_points+1, 2, WrapModeClamp, &grad);
1453 expect(Ok, status);
1454
1457
1460
1462 expect(Ok, status);
1463 expect(0, count);
1464
1465 status = GdipGetPathGradientPresetBlend(NULL, res_colors, res_positions, 1);
1467
1468 status = GdipGetPathGradientPresetBlend(grad, NULL, res_positions, 1);
1470
1471 status = GdipGetPathGradientPresetBlend(grad, res_colors, NULL, 1);
1473
1474 status = GdipGetPathGradientPresetBlend(grad, res_colors, res_positions, 0);
1476
1477 status = GdipGetPathGradientPresetBlend(grad, res_colors, res_positions, -1);
1479
1480 status = GdipGetPathGradientPresetBlend(grad, res_colors, res_positions, 1);
1482
1483 status = GdipGetPathGradientPresetBlend(grad, res_colors, res_positions, 2);
1485
1486 status = GdipSetPathGradientPresetBlend(NULL, colors, positions, 5);
1488
1489 status = GdipSetPathGradientPresetBlend(grad, NULL, positions, 5);
1491
1492 if (0)
1493 {
1494 /* crashes on windows xp */
1495 status = GdipSetPathGradientPresetBlend(grad, colors, NULL, 5);
1497 }
1498
1499 status = GdipSetPathGradientPresetBlend(grad, colors, positions, 0);
1501
1502 status = GdipSetPathGradientPresetBlend(grad, colors, positions, -1);
1504
1505 status = GdipSetPathGradientPresetBlend(grad, colors, positions, 1);
1507
1508 /* leave off the 0.0 position */
1509 status = GdipSetPathGradientPresetBlend(grad, &colors[1], &positions[1], 4);
1511
1512 /* leave off the 1.0 position */
1513 status = GdipSetPathGradientPresetBlend(grad, colors, positions, 4);
1515
1516 status = GdipSetPathGradientPresetBlend(grad, colors, positions, 5);
1517 expect(Ok, status);
1518
1520 expect(Ok, status);
1521 expect(5, count);
1522
1523 if (0)
1524 {
1525 /* Native GdipGetPathGradientPresetBlend seems to copy starting from
1526 * the end of each array and do no bounds checking. This is so braindead
1527 * I'm not going to copy it. */
1528
1529 res_colors[0] = 0xdeadbeef;
1530 res_positions[0] = 0.3;
1531
1532 status = GdipGetPathGradientPresetBlend(grad, &res_colors[1], &res_positions[1], 4);
1533 expect(Ok, status);
1534
1535 expect(0xdeadbeef, res_colors[0]);
1536 expectf(0.3, res_positions[0]);
1537
1538 for (i=1; i<5; i++)
1539 {
1540 expect(colors[i], res_colors[i]);
1541 expectf(positions[i], res_positions[i]);
1542 }
1543
1544 status = GdipGetPathGradientPresetBlend(grad, res_colors, res_positions, 6);
1545 expect(Ok, status);
1546
1547 for (i=0; i<5; i++)
1548 {
1549 expect(colors[i], res_colors[i+1]);
1550 expectf(positions[i], res_positions[i+1]);
1551 }
1552 }
1553
1554 status = GdipGetPathGradientPresetBlend(grad, res_colors, res_positions, 5);
1555 expect(Ok, status);
1556
1557 for (i=0; i<5; i++)
1558 {
1559 expect(colors[i], res_colors[i]);
1560 expectf(positions[i], res_positions[i]);
1561 }
1562
1563 status = GdipGetPathGradientPresetBlend(grad, res_colors, res_positions, 0);
1565
1566 status = GdipGetPathGradientPresetBlend(grad, res_colors, res_positions, -1);
1568
1569 status = GdipGetPathGradientPresetBlend(grad, res_colors, res_positions, 1);
1571
1572 status = GdipSetPathGradientPresetBlend(grad, colors, two_positions, 2);
1573 expect(Ok, status);
1574
1575 status = GdipDeleteBrush((GpBrush*)grad);
1576 expect(Ok, status);
1577}
1578
1579static void test_pathgradientblend(void)
1580{
1581 static const GpPointF path_points[] = {{0,0}, {3,0}, {0,4}};
1582 GpPathGradient *brush;
1584 INT count, i;
1585 const REAL factors[5] = {0.0f, 0.1f, 0.5f, 0.9f, 1.0f};
1586 const REAL positions[5] = {0.0f, 0.2f, 0.5f, 0.8f, 1.0f};
1587 REAL res_factors[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
1588 REAL res_positions[6] = {0.3f, 0.0f, 0.0f, 0.0f, 0.0f};
1589
1590 status = GdipCreatePathGradient(path_points, 3, WrapModeClamp, &brush);
1591 expect(Ok, status);
1592
1595
1598
1600 expect(Ok, status);
1601 expect(1, count);
1602
1603 status = GdipGetPathGradientBlend(NULL, res_factors, res_positions, 1);
1605
1606 status = GdipGetPathGradientBlend(brush, NULL, res_positions, 1);
1608
1609 status = GdipGetPathGradientBlend(brush, res_factors, NULL, 1);
1611
1612 status = GdipGetPathGradientBlend(brush, res_factors, res_positions, 0);
1614
1615 status = GdipGetPathGradientBlend(brush, res_factors, res_positions, -1);
1617
1618 status = GdipGetPathGradientBlend(brush, res_factors, res_positions, 1);
1619 expect(Ok, status);
1620
1621 status = GdipGetPathGradientBlend(brush, res_factors, res_positions, 2);
1622 expect(Ok, status);
1623
1624 status = GdipSetPathGradientBlend(NULL, factors, positions, 5);
1626
1627 status = GdipSetPathGradientBlend(brush, NULL, positions, 5);
1629
1630 status = GdipSetPathGradientBlend(brush, factors, NULL, 5);
1632
1633 status = GdipSetPathGradientBlend(brush, factors, positions, 0);
1635
1636 status = GdipSetPathGradientBlend(brush, factors, positions, -1);
1638
1639 /* leave off the 0.0 position */
1640 status = GdipSetPathGradientBlend(brush, &factors[1], &positions[1], 4);
1642
1643 /* leave off the 1.0 position */
1644 status = GdipSetPathGradientBlend(brush, factors, positions, 4);
1646
1647 status = GdipSetPathGradientBlend(brush, factors, positions, 5);
1648 expect(Ok, status);
1649
1651 expect(Ok, status);
1652 expect(5, count);
1653
1654 status = GdipGetPathGradientBlend(brush, res_factors, res_positions, 4);
1656
1657 status = GdipGetPathGradientBlend(brush, res_factors, res_positions, 5);
1658 expect(Ok, status);
1659
1660 for (i=0; i<5; i++)
1661 {
1662 expectf(factors[i], res_factors[i]);
1663 expectf(positions[i], res_positions[i]);
1664 }
1665
1666 status = GdipGetPathGradientBlend(brush, res_factors, res_positions, 6);
1667 expect(Ok, status);
1668
1669 status = GdipSetPathGradientBlend(brush, factors, positions, 1);
1670 expect(Ok, status);
1671
1673 expect(Ok, status);
1674 expect(1, count);
1675
1676 status = GdipGetPathGradientBlend(brush, res_factors, res_positions, 1);
1677 expect(Ok, status);
1678
1679 status = GdipDeleteBrush((GpBrush*)brush);
1680 expect(Ok, status);
1681}
1682
1683static void test_getHatchStyle(void)
1684{
1686 GpHatch *brush;
1687 GpHatchStyle hatchStyle;
1688
1690
1691 status = GdipGetHatchStyle(NULL, &hatchStyle);
1693
1694 status = GdipGetHatchStyle(brush, NULL);
1696
1697 status = GdipGetHatchStyle(brush, &hatchStyle);
1698 expect(Ok, status);
1699 expect(HatchStyleHorizontal, hatchStyle);
1700
1701 GdipDeleteBrush((GpBrush *)brush);
1702}
1703
1705{
1706 return 0xff000000 |
1707 (color & 0xff) << 16 |
1708 (color & 0xff00) |
1709 (color & 0xff0000) >> 16;
1710}
1711
1712extern BOOL color_match(ARGB c1, ARGB c2, BYTE max_diff);
1713
1714static void test_hatchBrushStyles(void)
1715{
1716 static const struct
1717 {
1718 short pattern[8];
1719 GpHatchStyle hs;
1720 }
1721 styles[] =
1722 {
1723 { {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff}, HatchStyleHorizontal },
1724 { {0xc000, 0xc000, 0xc000, 0xc000, 0xc000, 0xc000, 0xc000, 0xc000}, HatchStyleVertical },
1725 { {0x4006, 0x0019, 0x0064, 0x0190, 0x0640, 0x1900, 0x6400, 0x9001}, HatchStyleForwardDiagonal },
1726 { {0x9001, 0x6400, 0x1900, 0x0640, 0x0190, 0x0064, 0x0019, 0x4006}, HatchStyleBackwardDiagonal },
1727 { {0xc000, 0xc000, 0xc000, 0xc000, 0xc000, 0xc000, 0xc000, 0xffff}, HatchStyleCross },
1728 { {0x9006, 0x6419, 0x1964, 0x0690, 0x0690, 0x1964, 0x6419, 0x9006}, HatchStyleDiagonalCross },
1729 { {0x0000, 0x0000, 0x0000, 0x00c0, 0x0000, 0x0000, 0x0000, 0xc000}, HatchStyle05Percent },
1730 { {0x0000, 0x00c0, 0x0000, 0xc000, 0x0000, 0x00c0, 0x0000, 0xc000}, HatchStyle10Percent },
1731 { {0x0000, 0x0c0c, 0x0000, 0xc0c0, 0x0000, 0x0c0c, 0x0000, 0xc0c0}, HatchStyle20Percent },
1732 { {0x0c0c, 0xc0c0, 0x0c0c, 0xc0c0, 0x0c0c, 0xc0c0, 0x0c0c, 0xc0c0}, HatchStyle25Percent },
1733 { {0x0303, 0xcccc, 0x3030, 0xcccc, 0x0303, 0xcccc, 0x3030, 0xcccc}, HatchStyle30Percent },
1734 { {0x0333, 0xcccc, 0x3333, 0xcccc, 0x3303, 0xcccc, 0x3333, 0xcccc}, HatchStyle40Percent },
1735 { {0x3333, 0xcccc, 0x3333, 0xcccc, 0x3333, 0xcccc, 0x3333, 0xcccc}, HatchStyle50Percent },
1736 { {0x3333, 0xcfcf, 0x3333, 0xfcfc, 0x3333, 0xcfcf, 0x3333, 0xfcfc}, HatchStyle60Percent },
1737 { {0xf3f3, 0x3f3f, 0xf3f3, 0x3f3f, 0xf3f3, 0x3f3f, 0xf3f3, 0x3f3f}, HatchStyle70Percent },
1738 { {0xffff, 0xf3f3, 0xffff, 0x3f3f, 0xffff, 0xf3f3, 0xffff, 0x3f3f}, HatchStyle75Percent },
1739 { {0xffff, 0xfffc, 0xffff, 0xfcff, 0xffff, 0xfffc, 0xffff, 0xfcff}, HatchStyle80Percent },
1740 { {0x3fff, 0xffff, 0xffff, 0xffff, 0xff3f, 0xffff, 0xffff, 0xffff}, HatchStyle90Percent },
1741 { {0x0303, 0x0c0c, 0x3030, 0xc0c0, 0x0303, 0x0c0c, 0x3030, 0xc0c0}, HatchStyleLightDownwardDiagonal },
1742 { {0xc0c0, 0x3030, 0x0c0c, 0x0303, 0xc0c0, 0x3030, 0x0c0c, 0x0303}, HatchStyleLightUpwardDiagonal },
1743 { {0xc3c3, 0x0f0f, 0x3c3c, 0xf0f0, 0xc3c3, 0x0f0f, 0x3c3c, 0xf0f0}, HatchStyleDarkDownwardDiagonal },
1744 { {0xc3c3, 0xf0f0, 0x3c3c, 0x0f0f, 0xc3c3, 0xf0f0, 0x3c3c, 0x0f0f}, HatchStyleDarkUpwardDiagonal },
1745 { {0xc00f, 0x003f, 0x00fc, 0x03f0, 0x0fc0, 0x3f00, 0xfc00, 0xf003}, HatchStyleWideDownwardDiagonal },
1746 { {0xf003, 0xfc00, 0x3f00, 0x0fc0, 0x03f0, 0x00fc, 0x003f, 0xc00f}, HatchStyleWideUpwardDiagonal },
1747 { {0xc0c0, 0xc0c0, 0xc0c0, 0xc0c0, 0xc0c0, 0xc0c0, 0xc0c0, 0xc0c0}, HatchStyleLightVertical },
1748 { {0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0xffff}, HatchStyleLightHorizontal },
1749 { {0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333}, HatchStyleNarrowVertical },
1750 { {0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff}, HatchStyleNarrowHorizontal },
1751 { {0xf0f0, 0xf0f0, 0xf0f0, 0xf0f0, 0xf0f0, 0xf0f0, 0xf0f0, 0xf0f0}, HatchStyleDarkVertical },
1752 { {0x0000, 0x0000, 0xffff, 0xffff, 0x0000, 0x0000, 0xffff, 0xffff}, HatchStyleDarkHorizontal },
1753 { {0x0000, 0x0000, 0x0303, 0x0c0c, 0x3030, 0xc0c0, 0x0000, 0x0000}, HatchStyleDashedDownwardDiagonal },
1754 { {0x0000, 0x0000, 0xc0c0, 0x3030, 0x0c0c, 0x0303, 0x0000, 0x0000}, HatchStyleDashedUpwardDiagonal },
1755 { {0x0000, 0x0000, 0x0000, 0x00ff, 0x0000, 0x0000, 0x0000, 0xff00}, HatchStyleDashedHorizontal },
1756 { {0x00c0, 0x00c0, 0x00c0, 0x00c0, 0xc000, 0xc000, 0xc000, 0xc000}, HatchStyleDashedVertical },
1757 { {0x0030, 0x0c00, 0x0003, 0x0300, 0x000c, 0x3000, 0x00c0, 0xc000}, HatchStyleSmallConfetti },
1758 { {0xc0f3, 0x00f0, 0xf000, 0xf3c0, 0x03cf, 0x000f, 0x0f00, 0xcf03}, HatchStyleLargeConfetti },
1759 { {0x03c0, 0x0c30, 0x300c, 0xc003, 0x03c0, 0x0c30, 0x300c, 0xc003}, HatchStyleZigZag },
1760 { {0xf000, 0x0c33, 0x03c0, 0x0000, 0xf000, 0x0c33, 0x03c0, 0x0000}, HatchStyleWave },
1761 { {0xc003, 0x300c, 0x0c30, 0x03c0, 0x00c0, 0x0030, 0x000c, 0x0003}, HatchStyleDiagonalBrick },
1762 { {0x00c0, 0x00c0, 0x00c0, 0xffff, 0xc000, 0xc000, 0xc000, 0xffff}, HatchStyleHorizontalBrick },
1763 { {0x3303, 0x0c0c, 0x0330, 0xc0c0, 0x3033, 0x0c0c, 0x3330, 0xc0c0}, HatchStyleWeave },
1764 { {0xff00, 0xff00, 0xff00, 0xff00, 0x3333, 0xcccc, 0x3333, 0xcccc}, HatchStylePlaid },
1765 { {0xc000, 0x0003, 0xc000, 0x0000, 0x0300, 0x00c0, 0x0300, 0x0000}, HatchStyleDivot },
1766 { {0x0000, 0xc000, 0x0000, 0xc000, 0x0000, 0xc000, 0x0000, 0xcccc}, HatchStyleDottedGrid },
1767 { {0x0000, 0x0c0c, 0x0000, 0x00c0, 0x0000, 0x0c0c, 0x0000, 0xc000}, HatchStyleDottedDiamond },
1768 { {0x0003, 0x0003, 0x000c, 0x00f0, 0x0f00, 0x30c0, 0xc030, 0x000f}, HatchStyleShingle },
1769 { {0xc3c3, 0xffff, 0x3c3c, 0xffff, 0xc3c3, 0xffff, 0x3c3c, 0xffff}, HatchStyleTrellis },
1770 { {0xffc0, 0xffc0, 0xc3c0, 0x3f3f, 0xc0ff, 0xc0ff, 0xc0c3, 0x3f3f}, HatchStyleSphere },
1771 { {0xc0c0, 0xc0c0, 0xc0c0, 0xffff, 0xc0c0, 0xc0c0, 0xc0c0, 0xffff}, HatchStyleSmallGrid },
1772 { {0xc3c3, 0x3c3c, 0x3c3c, 0xc3c3, 0xc3c3, 0x3c3c, 0x3c3c, 0xc3c3}, HatchStyleSmallCheckerBoard },
1773 { {0x00ff, 0x00ff, 0x00ff, 0x00ff, 0xff00, 0xff00, 0xff00, 0xff00}, HatchStyleLargeCheckerBoard },
1774 { {0x0003, 0xc00c, 0x3030, 0x0cc0, 0x0300, 0x0cc0, 0x3030, 0xc00c}, HatchStyleOutlinedDiamond },
1775 { {0x0000, 0x0300, 0x0fc0, 0x3ff0, 0xfffc, 0x3ff0, 0x0fc0, 0x0300}, HatchStyleSolidDiamond },
1776 };
1777 static const ARGB exp_colors[] = { 0xffffffff, 0xffbfbfbf, 0xff151515, 0xff000000 };
1778 static const ARGB fore_color = 0xff000000;
1779 static const ARGB back_color = 0xffffffff;
1780 static const int width = 16, height = 16;
1782 HDC hdc;
1783 GpGraphics *graphics_hdc;
1784 GpGraphics *graphics_image;
1786 GpHatch *brush = NULL;
1787 BOOL match_hdc;
1788 BOOL match_image;
1789 int x, y;
1790 int i;
1791
1792 hdc = GetDC(hwnd);
1793 status = GdipCreateFromHDC(hdc, &graphics_hdc);
1794 expect(Ok, status);
1795 ok(graphics_hdc != NULL, "Expected the graphics context to be initialized.\n");
1796
1798 expect(Ok, status);
1799 status = GdipGetImageGraphicsContext((GpImage *)bitmap, &graphics_image);
1800 expect(Ok, status);
1801 ok(graphics_image != NULL, "Expected the graphics context to be initialized.\n");
1802
1803 for (i = 0; i < ARRAY_SIZE(styles); i++)
1804 {
1805 status = GdipCreateHatchBrush(styles[i].hs, fore_color, back_color, &brush);
1806 expect(Ok, status);
1807 ok(brush != NULL, "Expected the brush to be initialized.\n");
1808 status = GdipFillRectangleI(graphics_hdc, (GpBrush *)brush, 0, 0, width, height);
1809 expect(Ok, status);
1810 status = GdipFillRectangleI(graphics_image, (GpBrush *)brush, 0, 0, width, height);
1811 expect(Ok, status);
1812 status = GdipDeleteBrush((GpBrush *)brush);
1813 expect(Ok, status);
1814 brush = NULL;
1815
1816 match_hdc = TRUE;
1817 match_image = TRUE;
1818 for(y = 0; y < width && (match_hdc || match_image); y++)
1819 {
1820 for(x = 0; x < height && (match_hdc || match_image); x++)
1821 {
1822 ARGB color;
1823 int cindex = (styles[i].pattern[7-(y%8)] >> (2*(7-(x%8)))) & 3;
1824
1826 if (!color_match(color, exp_colors[cindex], 1))
1827 match_hdc = FALSE;
1828
1830 if (!color_match(color, exp_colors[cindex], 1))
1831 match_image = FALSE;
1832 }
1833 }
1834 ok(match_hdc, "Unexpected pattern for hatch style %#x with hdc.\n", styles[i].hs);
1835 ok(match_image, "Unexpected pattern for hatch style %#x with image.\n", styles[i].hs);
1836 }
1837
1838 status = GdipDeleteGraphics(graphics_image);
1839 expect(Ok, status);
1841 expect(Ok, status);
1842
1843 status = GdipDeleteGraphics(graphics_hdc);
1844 expect(Ok, status);
1845 ReleaseDC(hwnd, hdc);
1846}
1847
1848static void test_renderingOrigin(void)
1849{
1850 static const int width = 8, height = 8;
1852 HDC hdc;
1854 GpGraphics *graphics_hdc;
1855 GpGraphics *graphics_image;
1856 GpHatch *brush;
1857 BOOL match_hdc;
1858 BOOL match_image;
1859 static const INT tests[][2] = {{3, 6}, {-7, -4}};
1860 static const ARGB fore_color = 0xff000000;
1861 static const ARGB back_color = 0xffffffff;
1862 INT x, y;
1863 int i;
1864
1865 hdc = GetDC(hwnd);
1866 GdipCreateFromHDC(hdc, &graphics_hdc);
1867
1869 GdipGetImageGraphicsContext((GpImage *)bitmap, &graphics_image);
1870
1871 GdipCreateHatchBrush(HatchStyleCross, fore_color, back_color, &brush);
1872
1873 x = y = 0xdeadbeef;
1874 status = GdipGetRenderingOrigin(graphics_image, &x, &y);
1875 expect(Ok, status);
1876 ok(x == 0 && y == 0, "Expected (%d, %d) got (%d, %d)\n", 0, 0, x, y);
1877 x = y = 0xdeadbeef;
1878 status = GdipGetRenderingOrigin(graphics_image, &x, &y);
1879 expect(Ok, status);
1880 ok(x == 0 && y == 0, "Expected (%d, %d) got (%d, %d)\n", 0, 0, x, y);
1881
1882 for (i = 0; i < ARRAY_SIZE(tests); i++)
1883 {
1884 const INT exp_x = tests[i][0] & 7;
1885 const INT exp_y = tests[i][1] & 7;
1886
1887 status = GdipSetRenderingOrigin(graphics_image, tests[i][0], tests[i][1]);
1888 expect(Ok, status);
1889 status = GdipSetRenderingOrigin(graphics_hdc, tests[i][0], tests[i][1]);
1890 expect(Ok, status);
1891
1892 status = GdipGetRenderingOrigin(graphics_image, &x, &y);
1893 expect(Ok, status);
1894 ok(x == tests[i][0] && y == tests[i][1], "Expected (%d, %d) got (%d, %d)\n",
1895 tests[i][0], tests[i][1], x, y);
1896 status = GdipGetRenderingOrigin(graphics_image, &x, &y);
1897 expect(Ok, status);
1898 ok(x == tests[i][0] && y == tests[i][1], "Expected (%d, %d) got (%d, %d)\n",
1899 tests[i][0], tests[i][1], x, y);
1900
1901 GdipFillRectangleI(graphics_image, (GpBrush *)brush, 0, 0, width, height);
1902 GdipFillRectangleI(graphics_hdc, (GpBrush *)brush, 0, 0, width, height);
1903
1904 match_hdc = TRUE;
1905 match_image = TRUE;
1906 for (y = 0; y < height && (match_hdc || match_image); y++)
1907 {
1908 for (x = 0; x < width && (match_hdc || match_image); x++)
1909 {
1910 ARGB color;
1911 const ARGB exp_color = (x == exp_x || y == exp_y) ? fore_color : back_color;
1912
1914 if (color != exp_color)
1915 match_hdc = FALSE;
1916
1918 if (color != exp_color)
1919 match_image = FALSE;
1920 }
1921 }
1922 ok(match_hdc, "Hatch brush rendered incorrectly on hdc with rendering origin (%d, %d).\n",
1923 tests[i][0], tests[i][1]);
1924 ok(match_image, "Hatch brush rendered incorrectly on image with rendering origin (%d, %d).\n",
1925 tests[i][0], tests[i][1]);
1926 }
1927
1928 GdipDeleteBrush((GpBrush *)brush);
1929
1930 GdipDeleteGraphics(graphics_image);
1932
1933 GdipDeleteGraphics(graphics_hdc);
1934 ReleaseDC(hwnd, hdc);
1935}
1936
1938{
1939 struct GdiplusStartupInput gdiplusStartupInput;
1940 ULONG_PTR gdiplusToken;
1941 HMODULE hmsvcrt;
1942 int (CDECL * _controlfp_s)(unsigned int *cur, unsigned int newval, unsigned int mask);
1943 WNDCLASSA class;
1944
1945 /* Enable all FP exceptions except _EM_INEXACT, which gdi32 can trigger */
1946 hmsvcrt = LoadLibraryA("msvcrt");
1947 _controlfp_s = (void*)GetProcAddress(hmsvcrt, "_controlfp_s");
1948 if (_controlfp_s) _controlfp_s(0, 0, 0x0008001e);
1949
1950 memset( &class, 0, sizeof(class) );
1951 class.lpszClassName = "gdiplus_test";
1952 class.style = CS_HREDRAW | CS_VREDRAW;
1953 class.lpfnWndProc = DefWindowProcA;
1954 class.hInstance = GetModuleHandleA(0);
1955 class.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION);
1956 class.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
1957 class.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
1958 RegisterClassA( &class );
1959 hwnd = CreateWindowA( "gdiplus_test", "graphics test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
1960 CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, 0, 0, GetModuleHandleA(0), 0 );
1961 ok(hwnd != NULL, "Expected window to be created\n");
1962
1963 gdiplusStartupInput.GdiplusVersion = 1;
1964 gdiplusStartupInput.DebugEventCallback = NULL;
1965 gdiplusStartupInput.SuppressBackgroundThread = 0;
1966 gdiplusStartupInput.SuppressExternalCodecs = 0;
1967
1968 GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
1969
1973 test_type();
1975 test_getblend();
1977 test_getgamma();
1991
1992 GdiplusShutdown(gdiplusToken);
1994}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define ok_(x1, x2)
Definition: atltest.h:61
#define msg(x)
Definition: auth_time.c:54
#define ARRAY_SIZE(A)
Definition: main.h:20
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
HBITMAP hbmp
RECT rect
Definition: combotst.c:67
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
float REAL
Definition: types.h:41
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL delete_on_release, IStream **stream)
#define CDECL
Definition: compat.h:29
#define GetProcAddress(x, y)
Definition: compat.h:753
GpStatus WINGDIPAPI GdipScaleLineTransform(GpLineGradient *brush, REAL sx, REAL sy, GpMatrixOrder order)
Definition: brush.c:2167
GpStatus WINGDIPAPI GdipGetTextureTransform(GpTexture *brush, GpMatrix *matrix)
Definition: brush.c:1327
GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF *rect, ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:462
GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF *rect, ARGB startcolor, ARGB endcolor, REAL angle, BOOL isAngleScalable, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:511
GpStatus WINGDIPAPI GdipMultiplyLineTransform(GpLineGradient *brush, GDIPCONST GpMatrix *matrix, GpMatrixOrder order)
Definition: brush.c:2178
GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient *brush, ARGB *colors)
Definition: brush.c:2009
GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
Definition: brush.c:1020
GpStatus WINGDIPAPI GdipGetLinePresetBlendCount(GpLineGradient *brush, INT *count)
Definition: brush.c:2121
GpStatus WINGDIPAPI GdipCreateHatchBrush(GpHatchStyle hatchstyle, ARGB forecol, ARGB backcol, GpHatch **brush)
Definition: brush.c:302
GpStatus WINGDIPAPI GdipGetLineGammaCorrection(GpLineGradient *line, BOOL *usinggamma)
Definition: brush.c:1056
GpStatus WINGDIPAPI GdipGetTextureWrapMode(GpTexture *brush, GpWrapMode *wrapmode)
Definition: brush.c:1342
GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath *path, GpPathGradient **grad)
Definition: brush.c:753
GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *texture, GDIPCONST GpMatrix *matrix)
Definition: brush.c:1965
GpStatus WINGDIPAPI GdipGetPathGradientPresetBlend(GpPathGradient *brush, ARGB *blend, REAL *pos, INT count)
Definition: brush.c:1642
GpStatus WINGDIPAPI GdipGetPathGradientBlendCount(GpPathGradient *brush, INT *count)
Definition: brush.c:1100
GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient *grad, ARGB *argb, INT *count)
Definition: brush.c:1247
GpStatus WINGDIPAPI GdipResetLineTransform(GpLineGradient *brush)
Definition: brush.c:2132
GpStatus WINGDIPAPI GdipGetPathGradientRect(GpPathGradient *brush, GpRectF *rect)
Definition: brush.c:1212
GpStatus WINGDIPAPI GdipSetPathGradientBlend(GpPathGradient *brush, GDIPCONST REAL *blend, GDIPCONST REAL *pos, INT count)
Definition: brush.c:1540
GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad, GpPointF *point)
Definition: brush.c:1112
GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF *points, INT count, GpWrapMode wrap, GpPathGradient **grad)
Definition: brush.c:684
GpStatus WINGDIPAPI GdipGetLineTransform(GpLineGradient *brush, GpMatrix *matrix)
Definition: brush.c:2155
GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF *startpoint, GDIPCONST GpPointF *endpoint, ARGB startcolor, ARGB endcolor, GpWrapMode wrap, GpLineGradient **line)
Definition: brush.c:398
GpStatus WINGDIPAPI GdipSetLinePresetBlend(GpLineGradient *brush, GDIPCONST ARGB *blend, GDIPCONST REAL *positions, INT count)
Definition: brush.c:2068
GpStatus WINGDIPAPI GdipGetPathGradientBlend(GpPathGradient *brush, REAL *blend, REAL *positions, INT count)
Definition: brush.c:1081
GpStatus WINGDIPAPI GdipSetLineTransform(GpLineGradient *brush, GDIPCONST GpMatrix *matrix)
Definition: brush.c:2142
GpStatus WINGDIPAPI GdipGetHatchStyle(GpHatch *brush, GpHatchStyle *hatchstyle)
Definition: brush.c:1009
GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount(GpPathGradient *brush, INT *count)
Definition: brush.c:1669
GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient *brush, GDIPCONST REAL *factors, GDIPCONST REAL *positions, INT count)
Definition: brush.c:1395
GpStatus WINGDIPAPI GdipGetPathGradientPath(GpPathGradient *grad, GpPath *path)
Definition: brush.c:1187
GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount(GpPathGradient *brush, INT *count)
Definition: brush.c:1270
GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
Definition: brush.c:783
GpStatus WINGDIPAPI GdipTranslateLineTransform(GpLineGradient *brush, REAL dx, REAL dy, GpMatrixOrder order)
Definition: brush.c:2192
GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus, REAL scale)
Definition: brush.c:2036
GpStatus WINGDIPAPI GdipResetTextureTransform(GpTexture *brush)
Definition: brush.c:1371
GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
Definition: brush.c:2217
GpStatus WINGDIPAPI GdipRotateTextureTransform(GpTexture *brush, REAL angle, GpMatrixOrder order)
Definition: brush.c:2025
GpStatus WINGDIPAPI GdipSetTextureWrapMode(GpTexture *brush, GpWrapMode wrapmode)
Definition: brush.c:1983
GpStatus WINGDIPAPI GdipGetLineBlend(GpLineGradient *brush, REAL *factors, REAL *positions, INT count)
Definition: brush.c:1429
GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient *grad, GpPointF *point)
Definition: brush.c:1694
GpStatus WINGDIPAPI GdipGetLinePresetBlend(GpLineGradient *brush, ARGB *blend, REAL *positions, INT count)
Definition: brush.c:2103
GpStatus WINGDIPAPI GdipGetLineBlendCount(GpLineGradient *brush, INT *count)
Definition: brush.c:1446
GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient *grad, GDIPCONST ARGB *argb, INT *count)
Definition: brush.c:1819
GpStatus WINGDIPAPI GdipCreateTexture(GpImage *image, GpWrapMode wrapmode, GpTexture **texture)
Definition: brush.c:812
GpStatus WINGDIPAPI GdipGetBrushType(GpBrush *brush, GpBrushType *type)
Definition: brush.c:976
GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend(GpPathGradient *brush, GDIPCONST ARGB *blend, GDIPCONST REAL *pos, INT count)
Definition: brush.c:1607
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
Definition: graphics.c:2434
GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height)
Definition: graphics.c:4693
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
Definition: graphics.c:2616
GpStatus WINGDIPAPI GdipGetRenderingOrigin(GpGraphics *graphics, INT *x, INT *y)
Definition: graphics.c:6641
GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height)
Definition: graphics.c:4682
GpStatus WINGDIPAPI GdipSetRenderingOrigin(GpGraphics *graphics, INT x, INT y)
Definition: graphics.c:6616
GpStatus WINGDIPAPI GdipCreateFromHWND(HWND hwnd, GpGraphics **graphics)
Definition: graphics.c:2561
GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path)
GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width, REAL height)
Definition: graphicspath.c:703
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE *scan0, GpBitmap **bitmap)
Definition: image.c:1793
GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, GpGraphics **graphics)
Definition: image.c:2195
GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height, GpGraphics *target, GpBitmap **bitmap)
Definition: image.c:1597
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
Definition: image.c:2099
GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap *bitmap, INT x, INT y, ARGB *color)
Definition: image.c:310
GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream *stream, GpImage **image)
Definition: image.c:4525
GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, GpMatrixOrder order)
Definition: matrix.c:288
GpStatus WINGDIPAPI GdipCreateMatrix2(REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy, GpMatrix **matrix)
Definition: matrix.c:59
GpStatus WINGDIPAPI GdipIsMatrixEqual(GDIPCONST GpMatrix *matrix, GDIPCONST GpMatrix *matrix2, BOOL *result)
Definition: matrix.c:500
GpStatus WINGDIPAPI GdipGetMatrixElements(GDIPCONST GpMatrix *matrix, REAL *out)
Definition: matrix.c:168
GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy)
Definition: matrix.c:318
GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix *matrix, REAL angle, GpMatrixOrder order)
Definition: matrix.c:257
GpStatus WINGDIPAPI GdipIsMatrixIdentity(GDIPCONST GpMatrix *matrix, BOOL *result)
Definition: matrix.c:513
GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
Definition: matrix.c:156
GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix **matrix)
Definition: matrix.c:136
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802
_ACRTIMP errno_t __cdecl _controlfp_s(unsigned int *, unsigned int, unsigned int)
Definition: math.c:1304
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
return ret
Definition: mutex.c:146
#define wrap(journal, var)
Definition: recovery.c:207
POINTL point
Definition: edittest.c:50
RECT rect2
Definition: edittest.c:51
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
FxCollectionEntry * cur
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
Definition: gdiplus.c:83
HatchStyle
Definition: gdiplusenums.h:427
@ HatchStyleDashedUpwardDiagonal
Definition: gdiplusenums.h:459
@ HatchStyleLargeConfetti
Definition: gdiplusenums.h:463
@ HatchStyleNarrowHorizontal
Definition: gdiplusenums.h:455
@ HatchStyle40Percent
Definition: gdiplusenums.h:439
@ HatchStyleDottedDiamond
Definition: gdiplusenums.h:472
@ HatchStyleNarrowVertical
Definition: gdiplusenums.h:454
@ HatchStyleMin
Definition: gdiplusenums.h:483
@ HatchStyle20Percent
Definition: gdiplusenums.h:436
@ HatchStyle05Percent
Definition: gdiplusenums.h:434
@ HatchStyleLightVertical
Definition: gdiplusenums.h:452
@ HatchStyleZigZag
Definition: gdiplusenums.h:464
@ HatchStyleLargeCheckerBoard
Definition: gdiplusenums.h:478
@ HatchStyleDashedVertical
Definition: gdiplusenums.h:461
@ HatchStyleDashedHorizontal
Definition: gdiplusenums.h:460
@ HatchStyleDarkVertical
Definition: gdiplusenums.h:456
@ HatchStyleWideUpwardDiagonal
Definition: gdiplusenums.h:451
@ HatchStyleSmallConfetti
Definition: gdiplusenums.h:462
@ HatchStyleWideDownwardDiagonal
Definition: gdiplusenums.h:450
@ HatchStyleOutlinedDiamond
Definition: gdiplusenums.h:479
@ HatchStyleVertical
Definition: gdiplusenums.h:429
@ HatchStyleDarkDownwardDiagonal
Definition: gdiplusenums.h:448
@ HatchStyleDivot
Definition: gdiplusenums.h:470
@ HatchStyleSolidDiamond
Definition: gdiplusenums.h:480
@ HatchStyleDiagonalCross
Definition: gdiplusenums.h:433
@ HatchStyle80Percent
Definition: gdiplusenums.h:444
@ HatchStylePlaid
Definition: gdiplusenums.h:469
@ HatchStyleLightDownwardDiagonal
Definition: gdiplusenums.h:446
@ HatchStyle50Percent
Definition: gdiplusenums.h:440
@ HatchStyleHorizontal
Definition: gdiplusenums.h:428
@ HatchStyleTrellis
Definition: gdiplusenums.h:474
@ HatchStyleLightUpwardDiagonal
Definition: gdiplusenums.h:447
@ HatchStyle70Percent
Definition: gdiplusenums.h:442
@ HatchStyleDashedDownwardDiagonal
Definition: gdiplusenums.h:458
@ HatchStyleDarkHorizontal
Definition: gdiplusenums.h:457
@ HatchStyleForwardDiagonal
Definition: gdiplusenums.h:430
@ HatchStyleSmallCheckerBoard
Definition: gdiplusenums.h:477
@ HatchStyleBackwardDiagonal
Definition: gdiplusenums.h:431
@ HatchStyle10Percent
Definition: gdiplusenums.h:435
@ HatchStyle30Percent
Definition: gdiplusenums.h:438
@ HatchStyle90Percent
Definition: gdiplusenums.h:445
@ HatchStyleHorizontalBrick
Definition: gdiplusenums.h:467
@ HatchStyleShingle
Definition: gdiplusenums.h:473
@ HatchStyle60Percent
Definition: gdiplusenums.h:441
@ HatchStyle75Percent
Definition: gdiplusenums.h:443
@ HatchStyleDottedGrid
Definition: gdiplusenums.h:471
@ HatchStyleLightHorizontal
Definition: gdiplusenums.h:453
@ HatchStyleDarkUpwardDiagonal
Definition: gdiplusenums.h:449
@ HatchStyleSmallGrid
Definition: gdiplusenums.h:476
@ HatchStyleWave
Definition: gdiplusenums.h:465
@ HatchStyleSphere
Definition: gdiplusenums.h:475
@ HatchStyleDiagonalBrick
Definition: gdiplusenums.h:466
@ HatchStyleCross
Definition: gdiplusenums.h:432
@ HatchStyleMax
Definition: gdiplusenums.h:484
@ HatchStyleWeave
Definition: gdiplusenums.h:468
@ HatchStyle25Percent
Definition: gdiplusenums.h:437
@ FillModeWinding
Definition: gdiplusenums.h:56
WrapMode
Definition: gdiplusenums.h:204
@ WrapModeTileFlipXY
Definition: gdiplusenums.h:208
@ WrapModeTile
Definition: gdiplusenums.h:205
@ WrapModeTileFlipX
Definition: gdiplusenums.h:206
@ WrapModeClamp
Definition: gdiplusenums.h:209
@ MatrixOrderAppend
Definition: gdiplusenums.h:188
@ MatrixOrderPrepend
Definition: gdiplusenums.h:187
BrushType
Definition: gdiplusenums.h:37
@ BrushTypeSolidColor
Definition: gdiplusenums.h:38
LinearGradientMode
Definition: gdiplusenums.h:223
@ LinearGradientModeHorizontal
Definition: gdiplusenums.h:224
@ LinearGradientModeVertical
Definition: gdiplusenums.h:225
void WINAPI GdiplusShutdown(ULONG_PTR)
DWORD ARGB
#define PixelFormat32bppRGB
Status
Definition: gdiplustypes.h:24
@ Ok
Definition: gdiplustypes.h:25
@ InvalidParameter
Definition: gdiplustypes.h:27
@ OutOfMemory
Definition: gdiplustypes.h:28
@ InsufficientBuffer
Definition: gdiplustypes.h:30
@ NotImplemented
Definition: gdiplustypes.h:31
@ GenericError
Definition: gdiplustypes.h:26
GLuint start
Definition: gl.h:1545
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLeglImageOES image
Definition: gl.h:2204
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint GLenum GLenum transform
Definition: glext.h:9407
GLenum GLuint texture
Definition: glext.h:6295
GLuint res
Definition: glext.h:9613
GLsizeiptr size
Definition: glext.h:5919
GLuint color
Definition: glext.h:6243
GLenum GLint GLuint mask
Definition: glext.h:6028
GLubyte * pattern
Definition: glext.h:7787
GLenum mode
Definition: glext.h:6217
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat angle
Definition: glext.h:10853
const GLfloat * m
Definition: glext.h:10848
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
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define S_OK
Definition: intsafe.h:52
static ERESOURCE GlobalLock
Definition: sys_arch.c:8
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static struct test_info tests[]
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
BOOL expected
Definition: store.c:2000
static void test_renderingOrigin(void)
Definition: brush.c:1848
static void test_getgamma(void)
Definition: brush.c:245
static void test_gradientgetrect(void)
Definition: brush.c:689
BOOL color_match(ARGB c1, ARGB c2, BYTE max_diff)
Definition: image.c:48
static void test_pathgradientpresetblend(void)
Definition: brush.c:1439
static void test_pathgradientblend(void)
Definition: brush.c:1579
static void test_createHatchBrush(void)
Definition: brush.c:53
static void test_getblend(void)
Definition: brush.c:183
static void test_getHatchStyle(void)
Definition: brush.c:1683
static void test_createLineBrushFromRectWithAngle(void)
Definition: brush.c:80
static void test_linelinearblend(void)
Definition: brush.c:1095
static GpPointF getblend_ptf[]
Definition: brush.c:181
static void test_type(void)
Definition: brush.c:142
static void test_lineblend(void)
Definition: brush.c:899
static GpPointF getbounds_ptf[]
Definition: brush.c:215
static void test_pathgradientcenterpoint(void)
Definition: brush.c:1365
static void test_texturewrap(void)
Definition: brush.c:641
static void test_getbounds(void)
Definition: brush.c:219
static GpPointF blendcount_ptf[]
Definition: brush.c:156
static HWND hwnd
Definition: brush.c:35
#define expectf(expected, got)
Definition: brush.c:33
static void test_gradientblendcount(void)
Definition: brush.c:158
static void test_pathgradientpath(void)
Definition: brush.c:1337
static void test_gradientsurroundcolorcount(void)
Definition: brush.c:1163
static ARGB COLORREF2ARGB(COLORREF color)
Definition: brush.c:1704
static void test_constructor_destructor(void)
Definition: brush.c:37
#define expectf2(expected, got)
static void test_hatchBrushStyles(void)
Definition: brush.c:1714
static void test_transform(void)
Definition: brush.c:269
#define expect_(expected, got, precision)
Definition: font.c:34
static const unsigned char bmpimage[66]
Definition: image.c:1762
unsigned int UINT
Definition: ndis.h:50
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define memset(x, y, z)
Definition: compat.h:39
BOOL SuppressBackgroundThread
Definition: gdiplusinit.h:36
DebugEventProc DebugEventCallback
Definition: gdiplusinit.h:35
REAL Y
Definition: gdiplustypes.h:644
REAL X
Definition: gdiplustypes.h:643
REAL Height
Definition: gdiplustypes.h:659
REAL X
Definition: gdiplustypes.h:656
REAL Width
Definition: gdiplustypes.h:658
REAL Y
Definition: gdiplustypes.h:657
Definition: uimain.c:89
Definition: parser.c:49
Definition: ps.c:97
Definition: parse.h:23
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
const char * LPCSTR
Definition: typedefs.h:52
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
DWORD COLORREF
Definition: windef.h:100
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)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
LONG WINAPI GetBitmapBits(_In_ HBITMAP hbit, _In_ LONG cb, _Out_writes_bytes_(cb) LPVOID lpvBits)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CS_VREDRAW
Definition: winuser.h:666
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define COLOR_WINDOW
Definition: winuser.h:929
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4469
#define CS_HREDRAW
Definition: winuser.h:661
#define IDC_ARROW
Definition: winuser.h:695
#define IDI_APPLICATION
Definition: winuser.h:712
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE hInstance, _In_ LPCSTR lpIconName)
Definition: cursoricon.c:2429
HDC WINAPI GetDC(_In_opt_ HWND)
#define CW_USEDEFAULT
Definition: winuser.h:225
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
BOOL WINAPI DestroyWindow(_In_ HWND)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2459
unsigned char BYTE
Definition: xxhash.c:193