xref: /haiku/src/tests/kits/interface/flatten_picture/PictureTestCases.cpp (revision e6b30aee0fd7a23d6a6baab9f3718945a0cd838a)
1 /*
2  * Copyright 2007, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Michael Pfeiffer
7  */
8 
9 #include "PictureTestCases.h"
10 
11 static const rgb_color kBlack = {0, 0, 0};
12 static const rgb_color kWhite = {255, 255, 255};
13 static const rgb_color kRed = {255, 0, 0};
14 static const rgb_color kGreen = {0, 255, 0};
15 static const rgb_color kBlue = {0, 0, 255};
16 
17 static BPoint centerPoint(BRect rect)
18 {
19 	int x = (int)(rect.left + rect.IntegerWidth() / 2);
20 	int y = (int)(rect.top + rect.IntegerHeight() / 2);
21 	return BPoint(x, y);
22 }
23 
24 static void testNoOp(BView *view, BRect frame)
25 {
26 	// no op
27 }
28 
29 static void testDrawChar(BView *view, BRect frame)
30 {
31 	view->MovePenTo(frame.left, frame.bottom - 5);
32 	view->DrawChar('A');
33 
34 	view->DrawChar('B', BPoint(frame.left + 20, frame.bottom - 5));
35 }
36 
37 static void testDrawString(BView *view, BRect frame)
38 {
39 	BFont font;
40 	view->GetFont(&font);
41 	font_height height;
42 	font.GetHeight(&height);
43 	float baseline = frame.bottom - height.descent;
44 	// draw base line
45 	view->SetHighColor(kGreen);
46 	view->StrokeLine(BPoint(frame.left, baseline - 1), BPoint(frame.right, baseline -1));
47 
48 	view->SetHighColor(kBlack);
49 	view->DrawString("Haiku [ÖÜÄöüä]", BPoint(frame.left, baseline));
50 }
51 
52 static void testDrawStringWithLength(BView *view, BRect frame)
53 {
54 	BFont font;
55 	view->GetFont(&font);
56 	font_height height;
57 	font.GetHeight(&height);
58 	float baseline = frame.bottom - height.descent;
59 	// draw base line
60 	view->SetHighColor(kGreen);
61 	view->StrokeLine(BPoint(frame.left, baseline - 1), BPoint(frame.right, baseline -1));
62 
63 	view->SetHighColor(kBlack);
64 	view->DrawString("Haiku [ÖÜÄöüä]", 13, BPoint(frame.left, baseline));
65 }
66 
67 static void testFillArc(BView *view, BRect frame)
68 {
69 	frame.InsetBy(2, 2);
70 	view->FillArc(frame, 45, 180);
71 }
72 
73 static void testStrokeArc(BView *view, BRect frame)
74 {
75 	frame.InsetBy(2, 2);
76 	view->StrokeArc(frame, 45, 180);
77 }
78 
79 static void testFillBezier(BView *view, BRect frame)
80 {
81 	frame.InsetBy(2, 2);
82 	BPoint points[4];
83 	points[0] = BPoint(frame.left, frame.bottom);
84 	points[1] = BPoint(frame.left, frame.top);
85 	points[1] = BPoint(frame.left, frame.top);
86 	points[3] = BPoint(frame.right, frame.top);
87 	view->FillBezier(points);
88 }
89 
90 static void testStrokeBezier(BView *view, BRect frame)
91 {
92 	frame.InsetBy(2, 2);
93 	BPoint points[4];
94 	points[0] = BPoint(frame.left, frame.bottom);
95 	points[1] = BPoint(frame.left, frame.top);
96 	points[1] = BPoint(frame.left, frame.top);
97 	points[3] = BPoint(frame.right, frame.top);
98 	view->StrokeBezier(points);
99 }
100 
101 static void testFillEllipse(BView *view, BRect frame)
102 {
103 	frame.InsetBy(2, 2);
104 	view->FillEllipse(frame);
105 
106 	view->SetHighColor(kRed);
107 	float r = frame.Width() / 3;
108 	float s = frame.Height() / 4;
109 	view->FillEllipse(centerPoint(frame), r, s);
110 }
111 
112 static void testStrokeEllipse(BView *view, BRect frame)
113 {
114 	frame.InsetBy(2, 2);
115 	view->StrokeEllipse(frame);
116 
117 	view->SetHighColor(kRed);
118 	float r = frame.Width() / 3;
119 	float s = frame.Height() / 4;
120 	view->StrokeEllipse(centerPoint(frame), r, s);
121 }
122 
123 static void testFillPolygon(BView *view, BRect frame)
124 {
125 	frame.InsetBy(2, 2);
126 
127 	BPoint points[4];
128 	points[0] = BPoint(frame.left, frame.top);
129 	points[1] = BPoint(frame.right, frame.bottom);
130 	points[2] = BPoint(frame.right, frame.top);
131 	points[3] = BPoint(frame.left, frame.bottom);
132 
133 	view->FillPolygon(points, 4);
134 }
135 
136 static void testStrokePolygon(BView *view, BRect frame)
137 {
138 	frame.InsetBy(2, 2);
139 
140 	BPoint points[4];
141 	points[0] = BPoint(frame.left, frame.top);
142 	points[1] = BPoint(frame.right, frame.bottom);
143 	points[2] = BPoint(frame.right, frame.top);
144 	points[3] = BPoint(frame.left, frame.bottom);
145 
146 	view->StrokePolygon(points, 4);
147 }
148 
149 static void testFillRect(BView *view, BRect frame)
150 {
151 	frame.InsetBy(2, 2);
152 	view->FillRect(frame);
153 }
154 
155 static void testStrokeRect(BView *view, BRect frame)
156 {
157 	frame.InsetBy(2, 2);
158 	view->StrokeRect(frame);
159 }
160 
161 static void testFillRegion(BView *view, BRect frame)
162 {
163 	frame.InsetBy(2, 2);
164 	BRegion region(frame);
165 	frame.InsetBy(2, 2);
166 	region.Exclude(frame);
167 	view->FillRegion(&region);
168 }
169 
170 static void testFillRoundRect(BView *view, BRect frame)
171 {
172 	frame.InsetBy(2, 2);
173 	view->FillRoundRect(frame, 5, 3);
174 }
175 
176 static void testStrokeRoundRect(BView *view, BRect frame)
177 {
178 	frame.InsetBy(2, 2);
179 	view->StrokeRoundRect(frame, 5, 3);
180 }
181 
182 static void testFillTriangle(BView *view, BRect frame)
183 {
184 	frame.InsetBy(2, 2);
185 	BPoint points[3];
186 	points[0] = BPoint(frame.left, frame.bottom);
187 	points[1] = BPoint(centerPoint(frame).x, frame.top);
188 	points[2] = BPoint(frame.right, frame.bottom);
189 	view->FillTriangle(points[0], points[1], points[2]);
190 }
191 
192 static void testStrokeTriangle(BView *view, BRect frame)
193 {
194 	frame.InsetBy(2, 2);
195 	BPoint points[3];
196 	points[0] = BPoint(frame.left, frame.bottom);
197 	points[1] = BPoint(centerPoint(frame).x, frame.top);
198 	points[2] = BPoint(frame.right, frame.bottom);
199 	view->StrokeTriangle(points[0], points[1], points[2]);
200 }
201 
202 static void testStrokeLine(BView *view, BRect frame)
203 {
204 	frame.InsetBy(2, 2);
205 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top));
206 
207 	frame.top += 2;
208 	frame.bottom -= 2;
209 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.bottom));
210 
211 	frame.bottom += 2;;
212 	frame.top = frame.bottom;
213 	view->StrokeLine(BPoint(frame.right, frame.top), BPoint(frame.left, frame.top));
214 }
215 
216 static void testFillShape(BView *view, BRect frame)
217 {
218 	frame.InsetBy(2, 2);
219 	BShape shape;
220 	shape.MoveTo(BPoint(frame.left, frame.bottom));
221 	shape.LineTo(BPoint(frame.right, frame.top));
222 	shape.LineTo(BPoint(frame.left, frame.top));
223 	shape.LineTo(BPoint(frame.right, frame.bottom));
224 	view->FillShape(&shape);
225 }
226 
227 static void testStrokeShape(BView *view, BRect frame)
228 {
229 	frame.InsetBy(2, 2);
230 	BShape shape;
231 	shape.MoveTo(BPoint(frame.left, frame.bottom));
232 	shape.LineTo(BPoint(frame.right, frame.top));
233 	shape.LineTo(BPoint(frame.left, frame.top));
234 	shape.LineTo(BPoint(frame.right, frame.bottom));
235 	view->StrokeShape(&shape);
236 }
237 
238 static void testRecordPicture(BView *view, BRect frame)
239 {
240 	BPicture *picture = new BPicture();
241 	view->BeginPicture(picture);
242 	view->FillRect(frame);
243 	view->EndPicture();
244 	delete picture;
245 }
246 
247 static void testRecordAndPlayPicture(BView *view, BRect frame)
248 {
249 	BPicture *picture = new BPicture();
250 	view->BeginPicture(picture);
251 	frame.InsetBy(2, 2);
252 	view->FillRect(frame);
253 	view->EndPicture();
254 	view->DrawPicture(picture);
255 	delete picture;
256 }
257 
258 static void testRecordAndPlayPictureWithOffset(BView *view, BRect frame)
259 {
260 	BPicture *picture = new BPicture();
261 	view->BeginPicture(picture);
262 	frame.InsetBy(frame.Width() / 4, frame.Height() / 4);
263 	frame.OffsetTo(0, 0);
264 	view->FillRect(frame);
265 	view->EndPicture();
266 
267 	view->DrawPicture(picture, BPoint(10, 10));
268 	// color of picture should not change
269 	view->SetLowColor(kGreen);
270 	view->SetLowColor(kRed);
271 	view->DrawPicture(picture, BPoint(0, 0));
272 	delete picture;
273 }
274 
275 static void testAppendToPicture(BView *view, BRect frame)
276 {
277 	frame.InsetBy(2, 2);
278 	view->BeginPicture(new BPicture());
279 	view->FillRect(frame);
280 	BPicture* picture = view->EndPicture();
281 	if (picture == NULL)
282 		return;
283 
284 	frame.InsetBy(2, 2);
285 	view->AppendToPicture(picture);
286 	view->SetHighColor(kRed);
287 	view->FillRect(frame);
288 	if (view->EndPicture() != picture)
289 		return;
290 
291 	view->DrawPicture(picture);
292 	delete picture;
293 }
294 
295 static void testLineArray(BView *view, BRect frame)
296 {
297 	frame.InsetBy(2, 2);
298 	view->BeginLineArray(3);
299 	view->AddLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top), kBlack);
300 
301 	frame.top += 2;
302 	frame.bottom -= 2;
303 	view->AddLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.bottom), kRed);
304 
305 	frame.bottom += 2;;
306 	frame.top = frame.bottom;
307 	view->AddLine(BPoint(frame.right, frame.top), BPoint(frame.left, frame.top), kGreen);
308 
309 	view->EndLineArray();
310 }
311 
312 static void testInvertRect(BView *view, BRect frame)
313 {
314 	frame.InsetBy(2, 2);
315 	view->InvertRect(frame);
316 }
317 
318 static bool isBorder(int32 x, int32 y, int32 width, int32 height) {
319 	return x == 0 || y == 0 || x == width - 1 || y == height - 1;
320 }
321 
322 static void fillBitmap(BBitmap &bitmap) {
323 	int32 height = bitmap.Bounds().IntegerHeight()+1;
324 	int32 width = bitmap.Bounds().IntegerWidth()+1;
325 	for (int32 y = 0; y < height; y ++) {
326 		for (int32 x = 0; x < width; x ++) {
327 			char *pixel = (char*)bitmap.Bits();
328 			pixel += bitmap.BytesPerRow() * y + 4 * x;
329 			if (isBorder(x, y, width, height)) {
330 				// fill with green
331 				pixel[0] = 255;
332 				pixel[1] = 0;
333 				pixel[2] = 255;
334 				pixel[3] = 0;
335 			} else  {
336 				// fill with blue
337 				pixel[0] = 255;
338 				pixel[1] = 0;
339 				pixel[2] = 0;
340 				pixel[3] = 255;
341 			}
342 		}
343 	}
344 }
345 
346 static void testDrawBitmap(BView *view, BRect frame) {
347 	BBitmap bitmap(frame, B_RGBA32);
348 	fillBitmap(bitmap);
349 	view->DrawBitmap(&bitmap, BPoint(0, 0));
350 }
351 
352 static void testDrawBitmapAtPoint(BView *view, BRect frame) {
353 	frame.InsetBy(2, 2);
354 
355 	BRect bounds(frame);
356 	bounds.OffsetTo(0, 0);
357 	bounds.right /= 2;
358 	bounds.bottom /= 2;
359 
360 	BBitmap bitmap(bounds, B_RGBA32);
361 	fillBitmap(bitmap);
362 	view->DrawBitmap(&bitmap, centerPoint(frame));
363 }
364 
365 static void testDrawBitmapAtRect(BView *view, BRect frame) {
366 	BRect bounds(frame);
367 	BBitmap bitmap(bounds, B_RGBA32);
368 	fillBitmap(bitmap);
369 	frame.InsetBy(2, 2);
370 	view->DrawBitmap(&bitmap, frame);
371 }
372 
373 static void testDrawLargeBitmap(BView *view, BRect frame) {
374 	BRect bounds(frame);
375 	bounds.OffsetTo(0, 0);
376 	bounds.left = 1024;
377 	bounds.bottom = 767;
378 	BBitmap bitmap(bounds, B_RGBA32);
379 	fillBitmap(bitmap);
380 	frame.InsetBy(2, 2);
381 	view->DrawBitmap(&bitmap, frame);
382 }
383 
384 static void testConstrainClippingRegion(BView *view, BRect frame)
385 {
386 	frame.InsetBy(2, 2);
387 	// draw background
388 	view->SetHighColor(kRed);
389 	view->FillRect(frame);
390 
391 	frame.InsetBy(1, 1);
392 	BRegion region(frame);
393 	BRect r(frame);
394 	r.InsetBy(r.IntegerWidth() / 4, r.IntegerHeight() / 4);
395 	region.Exclude(r);
396 	view->ConstrainClippingRegion(&region);
397 
398 	frame.InsetBy(-1, -1);
399 	view->SetHighColor(kBlack);
400 	view->FillRect(frame);
401 	// a filled black rectangle with a red one pixel border
402 	// and inside a red rectangle should be drawn.
403 }
404 
405 static void testClipToPicture(BView *view, BRect frame)
406 {
407 	frame.InsetBy(2, 2);
408 	view->BeginPicture(new BPicture());
409 	view->FillEllipse(frame);
410 	BPicture *picture = view->EndPicture();
411 	if (picture == NULL)
412 		return;
413 
414 	view->ClipToPicture(picture);
415 	delete picture;
416 
417 	view->FillRect(frame);
418 	// black ellipse should be drawn
419 }
420 
421 static void testClipToInversePicture(BView *view, BRect frame)
422 {
423 	frame.InsetBy(2, 2);
424 
425 	view->BeginPicture(new BPicture());
426 	view->FillEllipse(frame);
427 	BPicture *picture = view->EndPicture();
428 	if (picture == NULL)
429 		return;
430 
431 	view->ClipToInversePicture(picture);
432 	delete picture;
433 
434 	view->FillRect(frame);
435 	// white ellipse inside a black rectangle
436 }
437 
438 static void testSetPenSize(BView *view, BRect frame)
439 {
440 	frame.InsetBy(8, 2);
441 	float x = centerPoint(frame).x;
442 
443 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top));
444 
445 	frame.OffsetBy(0, 5);
446 	view->SetPenSize(1);
447 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(x, frame.top));
448 	view->SetPenSize(0);
449 	view->StrokeLine(BPoint(x+1, frame.top), BPoint(frame.right, frame.top));
450 
451 	frame.OffsetBy(0, 5);
452 	view->SetPenSize(1);
453 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(x, frame.top));
454 	view->SetPenSize(2);
455 	view->StrokeLine(BPoint(x+1, frame.top), BPoint(frame.right, frame.top));
456 
457 	frame.OffsetBy(0, 5);
458 	view->SetPenSize(1);
459 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(x, frame.top));
460 	view->SetPenSize(3);
461 	view->StrokeLine(BPoint(x+1, frame.top), BPoint(frame.right, frame.top));
462 
463 	frame.OffsetBy(0, 5);
464 	view->SetPenSize(1);
465 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(x, frame.top));
466 	view->SetPenSize(4);
467 	view->StrokeLine(BPoint(x+1, frame.top), BPoint(frame.right, frame.top));
468 }
469 
470 static void testSetPenSize2(BView *view, BRect frame)
471 {
472 	// test if pen size is scaled too
473 	frame.InsetBy(2, 2);
474 	frame.OffsetBy(0, 5);
475 	view->SetPenSize(4);
476 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top));
477 	view->SetScale(0.5);
478 	view->StrokeLine(BPoint(frame.left + 2, frame.bottom), BPoint(frame.right + 2, frame.bottom));
479 
480 	// black line from left to right, 4 pixel size
481 	// below black line with half the length of the first one
482 	// and 2 pixel size
483 }
484 
485 static void testPattern(BView *view, BRect frame)
486 {
487 	frame.InsetBy(2, 2);
488 	int x = frame.IntegerWidth() / 3;
489 	frame.right = frame.left + x - 2;
490 		// -2 for an empty pixel row between
491 		// filled rectangles
492 
493 	view->SetLowColor(kGreen);
494 	view->SetHighColor(kRed);
495 
496 	view->FillRect(frame, B_SOLID_HIGH);
497 
498 	frame.OffsetBy(x, 0);
499 	view->FillRect(frame, B_MIXED_COLORS);
500 
501 	frame.OffsetBy(x, 0);
502 	view->FillRect(frame, B_SOLID_LOW);
503 }
504 
505 static void testSetOrigin(BView *view, BRect frame)
506 {
507 	BPoint origin = view->Origin();
508 	BPoint center = centerPoint(frame);
509 	view->SetOrigin(center);
510 
511 	BRect r(0, 0, center.x, center.y);
512 	view->SetHighColor(kBlue);
513 	view->FillRect(r);
514 
515 	view->SetOrigin(origin);
516 	view->SetHighColor(kRed);
517 	view->FillRect(r);
518 
519 	// red rectangle in left, top corner
520 	// blue rectangle in right, bottom corner
521 	// the red rectangle overwrites the
522 	// top, left pixel of the blue rectangle
523 }
524 
525 static void testSetOrigin2(BView *view, BRect frame)
526 {
527 	BPoint center = centerPoint(frame);
528 	BRect r(0, 0, center.x, center.y);
529 	view->SetOrigin(center);
530 	view->PushState();
531 		view->SetOrigin(BPoint(-center.x, 0));
532 		view->FillRect(r);
533 	view->PopState();
534 	// black rectangle in left, bottom corner
535 }
536 
537 static void testSetScale(BView *view, BRect frame)
538 {
539 	view->SetScale(0.5);
540 	view->FillRect(frame);
541 	// black rectangle in left, top corner
542 }
543 
544 static void testSetScale2(BView *view, BRect frame)
545 {
546 	view->SetScale(0.5);
547 	view->PushState();
548 		view->SetScale(0.5);
549 		view->FillRect(frame);
550 	view->PopState();
551 	// black rectangle in left, top corner
552 	// with half the size of the rectangle
553 	// from test testSetScaling
554 }
555 
556 static void testSetScale3(BView *view, BRect frame)
557 {
558 	view->SetScale(0.5);
559 	view->PushState();
560 		// if the second scale value differs slightly
561 		// the bug under BeOS R5 in testSetScale2
562 		// does not occur
563 		view->SetScale(0.5000001);
564 		view->FillRect(frame);
565 	view->PopState();
566 	// black rectangle in left, top corner
567 	// with half the size of the rectangle
568 	// from test testSetScaling
569 }
570 
571 static void testSetOriginAndScale(BView *view, BRect frame)
572 {
573 	frame.InsetBy(2, 2);
574 	BPoint center = centerPoint(frame);
575 
576 	BRect r(0, 0, frame.IntegerWidth() / 2, frame.IntegerHeight() / 2);
577 	view->SetOrigin(center);
578 	view->FillRect(r);
579 
580 	view->SetScale(0.5);
581 	view->SetHighColor(kRed);
582 	view->FillRect(r);
583 }
584 
585 static void testSetOriginAndScale2(BView *view, BRect frame)
586 {
587 	frame.InsetBy(2, 2);
588 	BPoint center = centerPoint(frame);
589 
590 	BRect r(0, 0, frame.IntegerWidth() / 2, frame.IntegerHeight() / 2);
591 	view->SetOrigin(center);
592 	view->FillRect(r);
593 
594 	view->SetScale(0.5);
595 	view->SetHighColor(kRed);
596 	view->FillRect(r);
597 
598 	view->SetOrigin(0, 0);
599 	view->SetHighColor(kGreen);
600 	view->FillRect(r);
601 }
602 
603 static void testSetOriginAndScale3(BView *view, BRect frame)
604 {
605 	frame.InsetBy(2, 2);
606 	BPoint center = centerPoint(frame);
607 
608 	BRect r(0, 0, frame.IntegerWidth() / 2, frame.IntegerHeight() / 2);
609 	view->SetOrigin(center);
610 	view->FillRect(r);
611 
612 	view->SetScale(0.5);
613 	view->SetHighColor(kRed);
614 	view->FillRect(r);
615 
616 	view->SetScale(0.25);
617 	view->SetHighColor(kGreen);
618 	view->FillRect(r);
619 }
620 
621 static void testSetOriginAndScale4(BView *view, BRect frame)
622 {
623 	frame.InsetBy(2, 2);
624 	BPoint center = centerPoint(frame);
625 
626 	BRect r(0, 0, frame.IntegerWidth() / 2, frame.IntegerHeight() / 2);
627 	view->SetOrigin(center);
628 	view->FillRect(r);
629 
630 	view->SetScale(0.5);
631 	view->SetHighColor(kRed);
632 	view->FillRect(r);
633 
634 	view->PushState();
635 		//
636 		view->SetOrigin(center.x+1, center.y);
637 			// +1 to work around BeOS bug
638 			// where setting the origin has no
639 			// effect if it is the same as
640 			// the previous value althou
641 			// it is from the "outer" coordinate
642 			// system
643 		view->SetHighColor(kGreen);
644 		view->FillRect(r);
645 	view->PopState();
646 }
647 
648 static void testSetOriginAndScale5(BView *view, BRect frame)
649 {
650 	frame.InsetBy(2, 2);
651 	BPoint center = centerPoint(frame);
652 
653 	BRect r(0, 0, frame.IntegerWidth() / 2, frame.IntegerHeight() / 2);
654 	view->SetOrigin(center);
655 	view->FillRect(r);
656 
657 	view->SetScale(0.5);
658 	view->SetHighColor(kRed);
659 	view->FillRect(r);
660 
661 	view->PushState();
662 		view->SetScale(0.75);
663 		view->SetHighColor(kGreen);
664 		view->FillRect(r);
665 	view->PopState();
666 }
667 
668 static void testSetFontSize(BView *view, BRect frame)
669 {
670 	frame.InsetBy(2, 2);
671 	int size = frame.IntegerHeight() / 3;
672 
673 	frame.OffsetBy(0, size);
674 	view->MovePenTo(BPoint(frame.left, frame.top));
675 	view->SetFontSize(size);
676 	view->DrawString("Haiku");
677 
678 	size *= 2;
679 	frame.OffsetBy(0, size);
680 	view->MovePenTo(BPoint(frame.left, frame.top));
681 	view->SetFontSize(size);
682 	view->DrawString("Haiku");
683 }
684 
685 // TODO
686 // - drawing mode
687 // - blending mode
688 // - line mode
689 // - push/pop state
690 // - move pen
691 // - set font
692 
693 
694 TestCase gTestCases[] = {
695 	{ "Test No Operation", testNoOp },
696 	{ "Test DrawChar", testDrawChar },
697 	{ "Test Draw String", testDrawString },
698 	{ "Test Draw String With Length", testDrawStringWithLength },
699 	{ "Test FillArc", testFillArc },
700 	{ "Test StrokeArc", testStrokeArc },
701 	// testFillBezier fails under BeOS because the
702 	// direct draw version is not correct
703 	{ "Test FillBezier", testFillBezier },
704 	{ "Test StrokeBezier", testStrokeBezier },
705 	{ "Test FillEllipse", testFillEllipse },
706 	{ "Test StrokeEllipse", testStrokeEllipse },
707 	{ "Test FillPolygon", testFillPolygon },
708 	{ "Test StrokePolygon", testStrokePolygon },
709 	{ "Test FillRect", testFillRect },
710 	{ "Test StrokeRect", testStrokeRect },
711 	{ "Test FillRegion", testFillRegion },
712 	{ "Test FillRoundRect", testFillRoundRect },
713 	{ "Test StrokeRoundRect", testStrokeRoundRect },
714 	{ "Test FillTriangle", testFillTriangle },
715 	{ "Test StrokeTriangle", testStrokeTriangle },
716 	{ "Test StrokeLine", testStrokeLine },
717 	{ "Test FillShape", testFillShape },
718 	{ "Test StrokeShape", testStrokeShape },
719 	{ "Test Record Picture", testRecordPicture },
720 	{ "Test Record And Play Picture", testRecordAndPlayPicture },
721 	{ "Test Record And Play Picture With Offset", testRecordAndPlayPictureWithOffset },
722 	{ "Test AppendToPicture", testAppendToPicture },
723 	{ "Test LineArray", testLineArray },
724 	{ "Test InvertRect", testInvertRect },
725 	{ "Test DrawBitmap", testDrawBitmap },
726 	{ "Test DrawBitmapAtPoint", testDrawBitmapAtPoint },
727 	{ "Test DrawBitmapAtRect", testDrawBitmapAtRect },
728 	{ "Test DrawLargeBitmap", testDrawLargeBitmap },
729 	{ "Test ConstrainClippingRegion", testConstrainClippingRegion },
730 	{ "Test ClipToPicture", testClipToPicture },
731 	{ "Test ClipToInversePicture", testClipToInversePicture },
732 	{ "Test SetPenSize", testSetPenSize },
733 	{ "Test SetPenSize2", testSetPenSize2 },
734 	{ "Test Pattern", testPattern },
735 	{ "Test SetOrigin", testSetOrigin },
736 	{ "Test SetOrigin2", testSetOrigin2 },
737 	{ "Test SetScale", testSetScale },
738 	// testSetScale2 fails under BeOS. The picture versions of the
739 	// rectangle are twice as large as the direct draw version
740 	{ "Test SetScale2*", testSetScale2 },
741 	{ "Test SetScale3", testSetScale3 },
742 	{ "Test SetOriginAndScale", testSetOriginAndScale },
743 	{ "Test SetOriginAndScale2", testSetOriginAndScale2 },
744 	{ "Test SetOriginAndScale3", testSetOriginAndScale3 },
745 	{ "Test SetOriginAndScale4", testSetOriginAndScale4 },
746 	{ "Test SetOriginAndScale5", testSetOriginAndScale5 },
747 	{ "Test SetFontSize", testSetFontSize },
748 	{ NULL, NULL }
749 };
750 
751