2 * Unit test suite for graphics objects
4 * Copyright (C) 2007 Google (Evan Stade)
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.
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.
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
24 #include "wine/test.h"
26 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
27 #define TABLE_LEN (23)
29 static void test_constructor_destructor(void)
32 GpGraphics *graphics = NULL;
35 stat = GdipCreateFromHDC(NULL, &graphics);
36 expect(OutOfMemory, stat);
37 stat = GdipDeleteGraphics(graphics);
38 expect(InvalidParameter, stat);
40 stat = GdipCreateFromHDC(hdc, &graphics);
42 stat = GdipDeleteGraphics(graphics);
45 stat = GdipCreateFromHWND(NULL, &graphics);
47 stat = GdipDeleteGraphics(graphics);
50 stat = GdipCreateFromHWNDICM(NULL, &graphics);
52 stat = GdipDeleteGraphics(graphics);
55 stat = GdipDeleteGraphics(NULL);
56 expect(InvalidParameter, stat);
65 /* Linked list prepend function. */
66 static void log_state(GraphicsState data, node ** log)
68 node * new_entry = HeapAlloc(GetProcessHeap(), 0, sizeof(node));
70 new_entry->data = data;
71 new_entry->next = *log;
75 /* Checks if there are duplicates in the list, and frees it. */
76 static void check_no_duplicates(node * log)
88 while((temp = temp->next)){
89 if(log->data == temp->data){
96 }while((log = log->next));
101 HeapFree(GetProcessHeap(), 0, temp);
109 static void test_save_restore(void)
112 GraphicsState state_a, state_b, state_c;
113 InterpolationMode mode;
114 GpGraphics *graphics1, *graphics2;
115 node * state_log = NULL;
117 state_a = state_b = state_c = 0xdeadbeef;
119 /* Invalid saving. */
120 GdipCreateFromHDC(hdc, &graphics1);
121 stat = GdipSaveGraphics(graphics1, NULL);
122 expect(InvalidParameter, stat);
123 stat = GdipSaveGraphics(NULL, &state_a);
124 expect(InvalidParameter, stat);
125 GdipDeleteGraphics(graphics1);
127 log_state(state_a, &state_log);
129 /* Basic save/restore. */
130 GdipCreateFromHDC(hdc, &graphics1);
131 GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
132 stat = GdipSaveGraphics(graphics1, &state_a);
135 GdipSetInterpolationMode(graphics1, InterpolationModeBicubic);
136 stat = GdipRestoreGraphics(graphics1, state_a);
139 GdipGetInterpolationMode(graphics1, &mode);
141 expect(InterpolationModeBilinear, mode);
142 GdipDeleteGraphics(graphics1);
144 log_state(state_a, &state_log);
146 /* Restoring garbage doesn't affect saves. */
147 GdipCreateFromHDC(hdc, &graphics1);
148 GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
149 GdipSaveGraphics(graphics1, &state_a);
150 GdipSetInterpolationMode(graphics1, InterpolationModeBicubic);
151 GdipSaveGraphics(graphics1, &state_b);
152 GdipSetInterpolationMode(graphics1, InterpolationModeNearestNeighbor);
153 stat = GdipRestoreGraphics(graphics1, 0xdeadbeef);
156 GdipRestoreGraphics(graphics1, state_b);
157 GdipGetInterpolationMode(graphics1, &mode);
159 expect(InterpolationModeBicubic, mode);
160 GdipRestoreGraphics(graphics1, state_a);
161 GdipGetInterpolationMode(graphics1, &mode);
163 expect(InterpolationModeBilinear, mode);
164 GdipDeleteGraphics(graphics1);
166 log_state(state_a, &state_log);
167 log_state(state_b, &state_log);
169 /* Restoring older state invalidates newer saves (but not older saves). */
170 GdipCreateFromHDC(hdc, &graphics1);
171 GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
172 GdipSaveGraphics(graphics1, &state_a);
173 GdipSetInterpolationMode(graphics1, InterpolationModeBicubic);
174 GdipSaveGraphics(graphics1, &state_b);
175 GdipSetInterpolationMode(graphics1, InterpolationModeNearestNeighbor);
176 GdipSaveGraphics(graphics1, &state_c);
177 GdipSetInterpolationMode(graphics1, InterpolationModeHighQualityBilinear);
178 GdipRestoreGraphics(graphics1, state_b);
179 GdipGetInterpolationMode(graphics1, &mode);
181 expect(InterpolationModeBicubic, mode);
182 GdipRestoreGraphics(graphics1, state_c);
183 GdipGetInterpolationMode(graphics1, &mode);
185 expect(InterpolationModeBicubic, mode);
186 GdipRestoreGraphics(graphics1, state_a);
187 GdipGetInterpolationMode(graphics1, &mode);
189 expect(InterpolationModeBilinear, mode);
190 GdipDeleteGraphics(graphics1);
192 log_state(state_a, &state_log);
193 log_state(state_b, &state_log);
194 log_state(state_c, &state_log);
196 /* Restoring older save from one graphics object does not invalidate
197 * newer save from other graphics object. */
198 GdipCreateFromHDC(hdc, &graphics1);
199 GdipCreateFromHDC(hdc, &graphics2);
200 GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
201 GdipSaveGraphics(graphics1, &state_a);
202 GdipSetInterpolationMode(graphics2, InterpolationModeBicubic);
203 GdipSaveGraphics(graphics2, &state_b);
204 GdipSetInterpolationMode(graphics1, InterpolationModeNearestNeighbor);
205 GdipSetInterpolationMode(graphics2, InterpolationModeNearestNeighbor);
206 GdipRestoreGraphics(graphics1, state_a);
207 GdipGetInterpolationMode(graphics1, &mode);
209 expect(InterpolationModeBilinear, mode);
210 GdipRestoreGraphics(graphics2, state_b);
211 GdipGetInterpolationMode(graphics2, &mode);
213 expect(InterpolationModeBicubic, mode);
214 GdipDeleteGraphics(graphics1);
215 GdipDeleteGraphics(graphics2);
217 /* You can't restore a state to a graphics object that didn't save it. */
218 GdipCreateFromHDC(hdc, &graphics1);
219 GdipCreateFromHDC(hdc, &graphics2);
220 GdipSetInterpolationMode(graphics1, InterpolationModeBilinear);
221 GdipSaveGraphics(graphics1, &state_a);
222 GdipSetInterpolationMode(graphics1, InterpolationModeNearestNeighbor);
223 GdipSetInterpolationMode(graphics2, InterpolationModeNearestNeighbor);
224 GdipRestoreGraphics(graphics2, state_a);
225 GdipGetInterpolationMode(graphics2, &mode);
226 expect(InterpolationModeNearestNeighbor, mode);
227 GdipDeleteGraphics(graphics1);
228 GdipDeleteGraphics(graphics2);
230 log_state(state_a, &state_log);
232 /* The same state value should never be returned twice. */
234 check_no_duplicates(state_log);
239 static void test_GdipDrawArc(void)
242 GpGraphics *graphics = NULL;
246 /* make a graphics object and pen object */
247 status = GdipCreateFromHDC(hdc, &graphics);
249 ok(hdc != NULL, "Expected HDC to be initialized\n");
251 status = GdipCreateFromHDC(hdc, &graphics);
253 ok(graphics != NULL, "Expected graphics to be initialized\n");
255 status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
257 ok(pen != NULL, "Expected pen to be initialized\n");
259 /* InvalidParameter cases: null graphics, null pen, non-positive width, non-positive height */
260 status = GdipDrawArc(NULL, NULL, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
261 expect(InvalidParameter, status);
263 status = GdipDrawArc(graphics, NULL, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);
264 expect(InvalidParameter, status);
266 status = GdipDrawArc(NULL, pen, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);
267 expect(InvalidParameter, status);
269 status = GdipDrawArc(graphics, pen, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0);
270 expect(InvalidParameter, status);
272 status = GdipDrawArc(graphics, pen, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
273 expect(InvalidParameter, status);
275 /* successful case */
276 status = GdipDrawArc(graphics, pen, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);
280 GdipDeleteGraphics(graphics);
285 static void test_GdipDrawArcI(void)
288 GpGraphics *graphics = NULL;
292 /* make a graphics object and pen object */
293 status = GdipCreateFromHDC(hdc, &graphics);
295 ok(hdc != NULL, "Expected HDC to be initialized\n");
297 status = GdipCreateFromHDC(hdc, &graphics);
299 ok(graphics != NULL, "Expected graphics to be initialized\n");
301 status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
303 ok(pen != NULL, "Expected pen to be initialized\n");
305 /* InvalidParameter cases: null graphics, null pen, non-positive width, non-positive height */
306 status = GdipDrawArcI(NULL, NULL, 0, 0, 0, 0, 0, 0);
307 expect(InvalidParameter, status);
309 status = GdipDrawArcI(graphics, NULL, 0, 0, 1, 1, 0, 0);
310 expect(InvalidParameter, status);
312 status = GdipDrawArcI(NULL, pen, 0, 0, 1, 1, 0, 0);
313 expect(InvalidParameter, status);
315 status = GdipDrawArcI(graphics, pen, 0, 0, 1, 0, 0, 0);
316 expect(InvalidParameter, status);
318 status = GdipDrawArcI(graphics, pen, 0, 0, 0, 1, 0, 0);
319 expect(InvalidParameter, status);
321 /* successful case */
322 status = GdipDrawArcI(graphics, pen, 0, 0, 1, 1, 0, 0);
326 GdipDeleteGraphics(graphics);
331 static void test_GdipDrawBezierI(void)
334 GpGraphics *graphics = NULL;
338 /* make a graphics object and pen object */
339 status = GdipCreateFromHDC(hdc, &graphics);
341 ok(hdc != NULL, "Expected HDC to be initialized\n");
343 status = GdipCreateFromHDC(hdc, &graphics);
345 ok(graphics != NULL, "Expected graphics to be initialized\n");
347 status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
349 ok(pen != NULL, "Expected pen to be initialized\n");
351 /* InvalidParameter cases: null graphics, null pen */
352 status = GdipDrawBezierI(NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0);
353 expect(InvalidParameter, status);
355 status = GdipDrawBezierI(graphics, NULL, 0, 0, 0, 0, 0, 0, 0, 0);
356 expect(InvalidParameter, status);
358 status = GdipDrawBezierI(NULL, pen, 0, 0, 0, 0, 0, 0, 0, 0);
359 expect(InvalidParameter, status);
361 /* successful case */
362 status = GdipDrawBezierI(graphics, pen, 0, 0, 0, 0, 0, 0, 0, 0);
366 GdipDeleteGraphics(graphics);
371 static void test_GdipDrawLineI(void)
374 GpGraphics *graphics = NULL;
378 /* make a graphics object and pen object */
379 status = GdipCreateFromHDC(hdc, &graphics);
381 ok(hdc != NULL, "Expected HDC to be initialized\n");
383 status = GdipCreateFromHDC(hdc, &graphics);
385 ok(graphics != NULL, "Expected graphics to be initialized\n");
387 status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
389 ok(pen != NULL, "Expected pen to be initialized\n");
391 /* InvalidParameter cases: null graphics, null pen */
392 status = GdipDrawLineI(NULL, NULL, 0, 0, 0, 0);
393 expect(InvalidParameter, status);
395 status = GdipDrawLineI(graphics, NULL, 0, 0, 0, 0);
396 expect(InvalidParameter, status);
398 status = GdipDrawLineI(NULL, pen, 0, 0, 0, 0);
399 expect(InvalidParameter, status);
401 /* successful case */
402 status = GdipDrawLineI(graphics, pen, 0, 0, 0, 0);
406 GdipDeleteGraphics(graphics);
411 static void test_GdipDrawLinesI(void)
414 GpGraphics *graphics = NULL;
419 /* make a graphics object and pen object */
420 status = GdipCreateFromHDC(hdc, &graphics);
422 ok(hdc != NULL, "Expected HDC to be initialized\n");
424 status = GdipCreateFromHDC(hdc, &graphics);
426 ok(graphics != NULL, "Expected graphics to be initialized\n");
428 status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
430 ok(pen != NULL, "Expected pen to be initialized\n");
432 /* make some arbitrary valid points*/
433 ptf = GdipAlloc(2 * sizeof(GpPointF));
441 /* InvalidParameter cases: null graphics, null pen, null points, count < 2*/
442 status = GdipDrawLinesI(NULL, NULL, NULL, 0);
443 expect(InvalidParameter, status);
445 status = GdipDrawLinesI(graphics, pen, ptf, 0);
446 expect(InvalidParameter, status);
448 status = GdipDrawLinesI(graphics, NULL, ptf, 2);
449 expect(InvalidParameter, status);
451 status = GdipDrawLinesI(NULL, pen, ptf, 2);
452 expect(InvalidParameter, status);
454 /* successful case */
455 status = GdipDrawLinesI(graphics, pen, ptf, 2);
460 GdipDeleteGraphics(graphics);
465 static void test_Get_Release_DC(void)
468 GpGraphics *graphics = NULL;
475 CompositingQuality quality;
476 CompositingMode compmode;
477 InterpolationMode intmode;
481 PixelOffsetMode offsetmode;
482 SmoothingMode smoothmode;
483 TextRenderingHint texthint;
501 for(i = 0; i < 5;i++){
502 ptf[i].X = (REAL)pt[i].X;
503 ptf[i].Y = (REAL)pt[i].Y;
515 for(i = 0; i < 2;i++){
516 rectf[i].X = (REAL)rect[i].X;
517 rectf[i].Y = (REAL)rect[i].Y;
518 rectf[i].Height = (REAL)rect[i].Height;
519 rectf[i].Width = (REAL)rect[i].Width;
522 GdipCreateMatrix(&m);
523 GdipCreateRegion(®ion);
524 GdipCreateSolidFill((ARGB)0xdeadbeef, &brush);
525 GdipCreatePath(FillModeAlternate, &path);
527 status = GdipCreateFromHDC(hdc, &graphics);
529 ok(graphics != NULL, "Expected graphics to be initialized\n");
530 status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
534 status = GdipGetDC(NULL, NULL);
535 expect(InvalidParameter, status);
536 status = GdipGetDC(graphics, NULL);
537 expect(InvalidParameter, status);
538 status = GdipGetDC(NULL, &retdc);
539 expect(InvalidParameter, status);
541 status = GdipReleaseDC(NULL, (HDC)0);
542 expect(InvalidParameter, status);
543 status = GdipReleaseDC(graphics, (HDC)0);
544 expect(InvalidParameter, status);
545 status = GdipReleaseDC(NULL, (HDC)0xdeadbeef);
546 expect(InvalidParameter, status);
548 /* Release without Get */
549 status = GdipReleaseDC(graphics, hdc);
550 expect(InvalidParameter, status);
553 status = GdipGetDC(graphics, &retdc);
555 ok(retdc == hdc, "Invalid HDC returned\n");
556 /* call it once more */
557 status = GdipGetDC(graphics, &retdc);
558 expect(ObjectBusy, status);
560 /* try all Graphics calls here */
562 status = GdipDrawArc(graphics, pen, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);
563 expect(ObjectBusy, status); status = Ok;
564 status = GdipDrawArcI(graphics, pen, 0, 0, 1, 1, 0.0, 0.0);
565 expect(ObjectBusy, status); status = Ok;
566 status = GdipDrawBezier(graphics, pen, 0.0, 10.0, 20.0, 15.0, 35.0, -10.0, 10.0, 10.0);
567 expect(ObjectBusy, status); status = Ok;
568 status = GdipDrawBezierI(graphics, pen, 0, 0, 0, 0, 0, 0, 0, 0);
569 expect(ObjectBusy, status); status = Ok;
570 status = GdipDrawBeziers(graphics, pen, ptf, 5);
571 expect(ObjectBusy, status); status = Ok;
572 status = GdipDrawBeziersI(graphics, pen, pt, 5);
573 expect(ObjectBusy, status); status = Ok;
574 status = GdipDrawClosedCurve(graphics, pen, ptf, 5);
575 expect(ObjectBusy, status); status = Ok;
576 status = GdipDrawClosedCurveI(graphics, pen, pt, 5);
577 expect(ObjectBusy, status); status = Ok;
578 status = GdipDrawClosedCurve2(graphics, pen, ptf, 5, 1.0);
579 expect(ObjectBusy, status); status = Ok;
580 status = GdipDrawClosedCurve2I(graphics, pen, pt, 5, 1.0);
581 expect(ObjectBusy, status); status = Ok;
582 status = GdipDrawCurve(graphics, pen, ptf, 5);
583 expect(ObjectBusy, status); status = Ok;
584 status = GdipDrawCurveI(graphics, pen, pt, 5);
585 expect(ObjectBusy, status); status = Ok;
586 status = GdipDrawCurve2(graphics, pen, ptf, 5, 1.0);
587 expect(ObjectBusy, status); status = Ok;
588 status = GdipDrawCurve2I(graphics, pen, pt, 5, 1.0);
589 expect(ObjectBusy, status); status = Ok;
590 status = GdipDrawEllipse(graphics, pen, 0.0, 0.0, 100.0, 50.0);
591 expect(ObjectBusy, status); status = Ok;
592 status = GdipDrawEllipseI(graphics, pen, 0, 0, 100, 50);
593 expect(ObjectBusy, status); status = Ok;
594 /* GdipDrawImage/GdipDrawImageI */
595 /* GdipDrawImagePointsRect/GdipDrawImagePointsRectI */
596 /* GdipDrawImageRectRect/GdipDrawImageRectRectI */
597 /* GdipDrawImageRect/GdipDrawImageRectI */
598 status = GdipDrawLine(graphics, pen, 0.0, 0.0, 100.0, 200.0);
599 expect(ObjectBusy, status); status = Ok;
600 status = GdipDrawLineI(graphics, pen, 0, 0, 100, 200);
601 expect(ObjectBusy, status); status = Ok;
602 status = GdipDrawLines(graphics, pen, ptf, 5);
603 expect(ObjectBusy, status); status = Ok;
604 status = GdipDrawLinesI(graphics, pen, pt, 5);
605 expect(ObjectBusy, status); status = Ok;
606 status = GdipDrawPath(graphics, pen, path);
607 expect(ObjectBusy, status); status = Ok;
608 status = GdipDrawPie(graphics, pen, 0.0, 0.0, 100.0, 100.0, 0.0, 90.0);
609 expect(ObjectBusy, status); status = Ok;
610 status = GdipDrawPieI(graphics, pen, 0, 0, 100, 100, 0.0, 90.0);
611 expect(ObjectBusy, status); status = Ok;
612 status = GdipDrawRectangle(graphics, pen, 0.0, 0.0, 100.0, 300.0);
613 expect(ObjectBusy, status); status = Ok;
614 status = GdipDrawRectangleI(graphics, pen, 0, 0, 100, 300);
615 expect(ObjectBusy, status); status = Ok;
616 status = GdipDrawRectangles(graphics, pen, rectf, 2);
617 expect(ObjectBusy, status); status = Ok;
618 status = GdipDrawRectanglesI(graphics, pen, rect, 2);
619 expect(ObjectBusy, status); status = Ok;
621 status = GdipFillClosedCurve2(graphics, (GpBrush*)brush, ptf, 5, 1.0, FillModeAlternate);
622 expect(ObjectBusy, status); status = Ok;
623 status = GdipFillClosedCurve2I(graphics, (GpBrush*)brush, pt, 5, 1.0, FillModeAlternate);
624 expect(ObjectBusy, status); status = Ok;
625 status = GdipFillEllipse(graphics, (GpBrush*)brush, 0.0, 0.0, 100.0, 100.0);
626 expect(ObjectBusy, status); status = Ok;
627 status = GdipFillEllipseI(graphics, (GpBrush*)brush, 0, 0, 100, 100);
628 expect(ObjectBusy, status); status = Ok;
629 status = GdipFillPath(graphics, (GpBrush*)brush, path);
630 expect(ObjectBusy, status); status = Ok;
631 status = GdipFillPie(graphics, (GpBrush*)brush, 0.0, 0.0, 100.0, 100.0, 0.0, 15.0);
632 expect(ObjectBusy, status); status = Ok;
633 status = GdipFillPieI(graphics, (GpBrush*)brush, 0, 0, 100, 100, 0.0, 15.0);
634 expect(ObjectBusy, status); status = Ok;
635 status = GdipFillPolygon(graphics, (GpBrush*)brush, ptf, 5, FillModeAlternate);
636 expect(ObjectBusy, status); status = Ok;
637 status = GdipFillPolygonI(graphics, (GpBrush*)brush, pt, 5, FillModeAlternate);
638 expect(ObjectBusy, status); status = Ok;
639 status = GdipFillPolygon2(graphics, (GpBrush*)brush, ptf, 5);
640 expect(ObjectBusy, status); status = Ok;
641 status = GdipFillPolygon2I(graphics, (GpBrush*)brush, pt, 5);
642 expect(ObjectBusy, status); status = Ok;
643 status = GdipFillRectangle(graphics, (GpBrush*)brush, 0.0, 0.0, 100.0, 100.0);
644 expect(ObjectBusy, status); status = Ok;
645 status = GdipFillRectangleI(graphics, (GpBrush*)brush, 0, 0, 100, 100);
646 expect(ObjectBusy, status); status = Ok;
647 status = GdipFillRectangles(graphics, (GpBrush*)brush, rectf, 2);
648 expect(ObjectBusy, status); status = Ok;
649 status = GdipFillRectanglesI(graphics, (GpBrush*)brush, rect, 2);
650 expect(ObjectBusy, status); status = Ok;
651 status = GdipFillRegion(graphics, (GpBrush*)brush, region);
652 expect(ObjectBusy, status); status = Ok;
653 status = GdipFlush(graphics, FlushIntentionFlush);
654 expect(ObjectBusy, status); status = Ok;
655 status = GdipGetCompositingMode(graphics, &compmode);
656 expect(ObjectBusy, status); status = Ok;
657 status = GdipGetCompositingQuality(graphics, &quality);
658 expect(ObjectBusy, status); status = Ok;
659 status = GdipGetInterpolationMode(graphics, &intmode);
660 expect(ObjectBusy, status); status = Ok;
661 status = GdipGetPageScale(graphics, &r);
662 expect(ObjectBusy, status); status = Ok;
663 status = GdipGetPageUnit(graphics, &unit);
664 expect(ObjectBusy, status); status = Ok;
665 status = GdipGetPixelOffsetMode(graphics, &offsetmode);
666 expect(ObjectBusy, status); status = Ok;
667 status = GdipGetSmoothingMode(graphics, &smoothmode);
668 expect(ObjectBusy, status); status = Ok;
669 status = GdipGetTextRenderingHint(graphics, &texthint);
670 expect(ObjectBusy, status); status = Ok;
671 status = GdipGetWorldTransform(graphics, m);
672 expect(ObjectBusy, status); status = Ok;
673 /* GdipMeasureCharacterRanges */
674 /* GdipMeasureString */
675 status = GdipResetWorldTransform(graphics);
676 expect(ObjectBusy, status); status = Ok;
677 /* GdipRestoreGraphics */
678 status = GdipRotateWorldTransform(graphics, 15.0, MatrixOrderPrepend);
679 expect(ObjectBusy, status); status = Ok;
680 /* GdipSaveGraphics */
681 status = GdipScaleWorldTransform(graphics, 1.0, 1.0, MatrixOrderPrepend);
682 expect(ObjectBusy, status); status = Ok;
683 status = GdipSetCompositingMode(graphics, CompositingModeSourceOver);
684 expect(ObjectBusy, status); status = Ok;
685 status = GdipSetCompositingQuality(graphics, CompositingQualityDefault);
686 expect(ObjectBusy, status); status = Ok;
687 status = GdipSetInterpolationMode(graphics, InterpolationModeDefault);
688 expect(ObjectBusy, status); status = Ok;
689 status = GdipSetPageScale(graphics, 1.0);
690 expect(ObjectBusy, status); status = Ok;
691 status = GdipSetPageUnit(graphics, UnitWorld);
692 expect(ObjectBusy, status); status = Ok;
693 status = GdipSetPixelOffsetMode(graphics, PixelOffsetModeDefault);
694 expect(ObjectBusy, status); status = Ok;
695 status = GdipSetSmoothingMode(graphics, SmoothingModeDefault);
696 expect(ObjectBusy, status); status = Ok;
697 status = GdipSetTextRenderingHint(graphics, TextRenderingHintSystemDefault);
698 expect(ObjectBusy, status); status = Ok;
699 status = GdipSetWorldTransform(graphics, m);
700 expect(ObjectBusy, status); status = Ok;
701 status = GdipTranslateWorldTransform(graphics, 0.0, 0.0, MatrixOrderPrepend);
702 expect(ObjectBusy, status); status = Ok;
703 status = GdipSetClipRectI(graphics, 0, 0, 10, 10, CombineModeReplace);
704 expect(ObjectBusy, status); status = Ok;
705 /* GdipSetClipRegion */
706 status = GdipDrawPolygon(graphics, pen, ptf, 5);
707 expect(ObjectBusy, status); status = Ok;
708 status = GdipDrawPolygonI(graphics, pen, pt, 5);
709 expect(ObjectBusy, status); status = Ok;
710 status = GdipGetDpiX(graphics, &r);
711 expect(ObjectBusy, status); status = Ok;
712 status = GdipGetDpiY(graphics, &r);
713 expect(ObjectBusy, status); status = Ok;
714 status = GdipMultiplyWorldTransform(graphics, m, MatrixOrderPrepend);
715 status = GdipGetClip(graphics, region);
716 expect(ObjectBusy, status); status = Ok;
718 status = GdipReleaseDC(graphics, retdc);
722 GdipDeleteGraphics(graphics);
724 GdipDeletePath(path);
725 GdipDeleteBrush((GpBrush*)brush);
726 GdipDeleteRegion(region);
734 struct GdiplusStartupInput gdiplusStartupInput;
735 ULONG_PTR gdiplusToken;
737 gdiplusStartupInput.GdiplusVersion = 1;
738 gdiplusStartupInput.DebugEventCallback = NULL;
739 gdiplusStartupInput.SuppressBackgroundThread = 0;
740 gdiplusStartupInput.SuppressExternalCodecs = 0;
742 GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
744 test_constructor_destructor();
746 test_GdipDrawBezierI();
749 test_GdipDrawLineI();
750 test_GdipDrawLinesI();
751 test_Get_Release_DC();
753 GdiplusShutdown(gdiplusToken);