xref: /haiku/src/tests/kits/interface/flatten_picture/PictureTestCases.cpp (revision 54730332d20e5d1fba4027c9598b9449854048ed)
182afdb09SMichael Pfeiffer /*
282afdb09SMichael Pfeiffer  * Copyright 2007, Haiku. All rights reserved.
382afdb09SMichael Pfeiffer  * Distributed under the terms of the MIT License.
482afdb09SMichael Pfeiffer  *
582afdb09SMichael Pfeiffer  * Authors:
682afdb09SMichael Pfeiffer  *		Michael Pfeiffer
782afdb09SMichael Pfeiffer  */
882afdb09SMichael Pfeiffer 
982afdb09SMichael Pfeiffer #include "PictureTestCases.h"
1082afdb09SMichael Pfeiffer 
11*54730332SMichael Pfeiffer static const rgb_color kBlack = {0, 0, 0};
12*54730332SMichael Pfeiffer static const rgb_color kWhite = {255, 255, 255};
13*54730332SMichael Pfeiffer static const rgb_color kRed = {255, 0, 0};
14*54730332SMichael Pfeiffer static const rgb_color kGreen = {0, 255, 0};
15*54730332SMichael Pfeiffer static const rgb_color kBlue = {0, 0, 255};
16*54730332SMichael Pfeiffer 
17*54730332SMichael Pfeiffer static BPoint centerPoint(BRect rect)
18*54730332SMichael Pfeiffer {
19*54730332SMichael Pfeiffer 	int x = (int)(rect.left + rect.IntegerWidth() / 2);
20*54730332SMichael Pfeiffer 	int y = (int)(rect.top + rect.IntegerHeight() / 2);
21*54730332SMichael Pfeiffer 	return BPoint(x, y);
22*54730332SMichael Pfeiffer }
23*54730332SMichael Pfeiffer 
24*54730332SMichael Pfeiffer static void testNoOp(BView *view, BRect frame)
2582afdb09SMichael Pfeiffer {
2682afdb09SMichael Pfeiffer 	// no op
2782afdb09SMichael Pfeiffer }
2882afdb09SMichael Pfeiffer 
29*54730332SMichael Pfeiffer static void testDrawChar(BView *view, BRect frame)
30*54730332SMichael Pfeiffer {
31*54730332SMichael Pfeiffer 	view->MovePenTo(frame.left, frame.bottom - 5);
32*54730332SMichael Pfeiffer 	view->DrawChar('A');
33*54730332SMichael Pfeiffer 
34*54730332SMichael Pfeiffer 	view->DrawChar('B', BPoint(frame.left + 20, frame.bottom - 5));
35*54730332SMichael Pfeiffer }
36*54730332SMichael Pfeiffer 
37*54730332SMichael Pfeiffer static void testDrawString(BView *view, BRect frame)
3882afdb09SMichael Pfeiffer {
3982afdb09SMichael Pfeiffer 	BFont font;
4082afdb09SMichael Pfeiffer 	view->GetFont(&font);
4182afdb09SMichael Pfeiffer 	font_height height;
4282afdb09SMichael Pfeiffer 	font.GetHeight(&height);
4382afdb09SMichael Pfeiffer 	float baseline = frame.bottom - height.descent;
4482afdb09SMichael Pfeiffer 	// draw base line
45*54730332SMichael Pfeiffer 	view->SetHighColor(kGreen);
4682afdb09SMichael Pfeiffer 	view->StrokeLine(BPoint(frame.left, baseline - 1), BPoint(frame.right, baseline -1));
4782afdb09SMichael Pfeiffer 
48*54730332SMichael Pfeiffer 	view->SetHighColor(kBlack);
4982afdb09SMichael Pfeiffer 	view->DrawString("Haiku [ÖÜÄöüä]", BPoint(frame.left, baseline));
5082afdb09SMichael Pfeiffer }
5182afdb09SMichael Pfeiffer 
52*54730332SMichael Pfeiffer static void testDrawStringWithLength(BView *view, BRect frame)
53*54730332SMichael Pfeiffer {
54*54730332SMichael Pfeiffer 	BFont font;
55*54730332SMichael Pfeiffer 	view->GetFont(&font);
56*54730332SMichael Pfeiffer 	font_height height;
57*54730332SMichael Pfeiffer 	font.GetHeight(&height);
58*54730332SMichael Pfeiffer 	float baseline = frame.bottom - height.descent;
59*54730332SMichael Pfeiffer 	// draw base line
60*54730332SMichael Pfeiffer 	view->SetHighColor(kGreen);
61*54730332SMichael Pfeiffer 	view->StrokeLine(BPoint(frame.left, baseline - 1), BPoint(frame.right, baseline -1));
62*54730332SMichael Pfeiffer 
63*54730332SMichael Pfeiffer 	view->SetHighColor(kBlack);
64*54730332SMichael Pfeiffer 	view->DrawString("Haiku [ÖÜÄöüä]", 13, BPoint(frame.left, baseline));
65*54730332SMichael Pfeiffer }
66*54730332SMichael Pfeiffer 
67*54730332SMichael Pfeiffer static void testFillArc(BView *view, BRect frame)
6882afdb09SMichael Pfeiffer {
6982afdb09SMichael Pfeiffer 	frame.InsetBy(2, 2);
70*54730332SMichael Pfeiffer 	view->FillArc(frame, 45, 180);
71*54730332SMichael Pfeiffer }
72*54730332SMichael Pfeiffer 
73*54730332SMichael Pfeiffer static void testStrokeArc(BView *view, BRect frame)
74*54730332SMichael Pfeiffer {
75*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
76*54730332SMichael Pfeiffer 	view->StrokeArc(frame, 45, 180);
77*54730332SMichael Pfeiffer }
78*54730332SMichael Pfeiffer 
79*54730332SMichael Pfeiffer static void testFillBezier(BView *view, BRect frame)
80*54730332SMichael Pfeiffer {
81*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
82*54730332SMichael Pfeiffer 	BPoint points[4];
83*54730332SMichael Pfeiffer 	points[0] = BPoint(frame.left, frame.bottom);
84*54730332SMichael Pfeiffer 	points[1] = BPoint(frame.left, frame.top);
85*54730332SMichael Pfeiffer 	points[1] = BPoint(frame.left, frame.top);
86*54730332SMichael Pfeiffer 	points[3] = BPoint(frame.right, frame.top);
87*54730332SMichael Pfeiffer 	view->FillBezier(points);
88*54730332SMichael Pfeiffer }
89*54730332SMichael Pfeiffer 
90*54730332SMichael Pfeiffer static void testStrokeBezier(BView *view, BRect frame)
91*54730332SMichael Pfeiffer {
92*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
93*54730332SMichael Pfeiffer 	BPoint points[4];
94*54730332SMichael Pfeiffer 	points[0] = BPoint(frame.left, frame.bottom);
95*54730332SMichael Pfeiffer 	points[1] = BPoint(frame.left, frame.top);
96*54730332SMichael Pfeiffer 	points[1] = BPoint(frame.left, frame.top);
97*54730332SMichael Pfeiffer 	points[3] = BPoint(frame.right, frame.top);
98*54730332SMichael Pfeiffer 	view->StrokeBezier(points);
99*54730332SMichael Pfeiffer }
100*54730332SMichael Pfeiffer 
101*54730332SMichael Pfeiffer static void testFillEllipse(BView *view, BRect frame)
102*54730332SMichael Pfeiffer {
103*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
104*54730332SMichael Pfeiffer 	view->FillEllipse(frame);
105*54730332SMichael Pfeiffer 
106*54730332SMichael Pfeiffer 	view->SetHighColor(kRed);
107*54730332SMichael Pfeiffer 	float r = frame.Width() / 3;
108*54730332SMichael Pfeiffer 	float s = frame.Height() / 4;
109*54730332SMichael Pfeiffer 	view->FillEllipse(centerPoint(frame), r, s);
110*54730332SMichael Pfeiffer }
111*54730332SMichael Pfeiffer 
112*54730332SMichael Pfeiffer static void testStrokeEllipse(BView *view, BRect frame)
113*54730332SMichael Pfeiffer {
114*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
115*54730332SMichael Pfeiffer 	view->StrokeEllipse(frame);
116*54730332SMichael Pfeiffer 
117*54730332SMichael Pfeiffer 	view->SetHighColor(kRed);
118*54730332SMichael Pfeiffer 	float r = frame.Width() / 3;
119*54730332SMichael Pfeiffer 	float s = frame.Height() / 4;
120*54730332SMichael Pfeiffer 	view->StrokeEllipse(centerPoint(frame), r, s);
121*54730332SMichael Pfeiffer }
122*54730332SMichael Pfeiffer 
123*54730332SMichael Pfeiffer static void testFillPolygon(BView *view, BRect frame)
124*54730332SMichael Pfeiffer {
125*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
126*54730332SMichael Pfeiffer 
127*54730332SMichael Pfeiffer 	BPoint points[4];
128*54730332SMichael Pfeiffer 	points[0] = BPoint(frame.left, frame.top);
129*54730332SMichael Pfeiffer 	points[1] = BPoint(frame.right, frame.bottom);
130*54730332SMichael Pfeiffer 	points[2] = BPoint(frame.right, frame.top);
131*54730332SMichael Pfeiffer 	points[3] = BPoint(frame.left, frame.bottom);
132*54730332SMichael Pfeiffer 
133*54730332SMichael Pfeiffer 	view->FillPolygon(points, 4);
134*54730332SMichael Pfeiffer }
135*54730332SMichael Pfeiffer 
136*54730332SMichael Pfeiffer static void testStrokePolygon(BView *view, BRect frame)
137*54730332SMichael Pfeiffer {
138*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
139*54730332SMichael Pfeiffer 
140*54730332SMichael Pfeiffer 	BPoint points[4];
141*54730332SMichael Pfeiffer 	points[0] = BPoint(frame.left, frame.top);
142*54730332SMichael Pfeiffer 	points[1] = BPoint(frame.right, frame.bottom);
143*54730332SMichael Pfeiffer 	points[2] = BPoint(frame.right, frame.top);
144*54730332SMichael Pfeiffer 	points[3] = BPoint(frame.left, frame.bottom);
145*54730332SMichael Pfeiffer 
146*54730332SMichael Pfeiffer 	view->StrokePolygon(points, 4);
147*54730332SMichael Pfeiffer }
148*54730332SMichael Pfeiffer 
149*54730332SMichael Pfeiffer static void testFillRect(BView *view, BRect frame)
150*54730332SMichael Pfeiffer {
151*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
15282afdb09SMichael Pfeiffer 	view->FillRect(frame);
15382afdb09SMichael Pfeiffer }
15482afdb09SMichael Pfeiffer 
155*54730332SMichael Pfeiffer static void testStrokeRect(BView *view, BRect frame)
15682afdb09SMichael Pfeiffer {
15782afdb09SMichael Pfeiffer 	frame.InsetBy(2, 2);
15882afdb09SMichael Pfeiffer 	view->StrokeRect(frame);
15982afdb09SMichael Pfeiffer }
16082afdb09SMichael Pfeiffer 
161*54730332SMichael Pfeiffer static void testFillRegion(BView *view, BRect frame)
16282afdb09SMichael Pfeiffer {
163*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
164*54730332SMichael Pfeiffer 	BRegion region(frame);
165*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
166*54730332SMichael Pfeiffer 	region.Exclude(frame);
167*54730332SMichael Pfeiffer 	view->FillRegion(&region);
168*54730332SMichael Pfeiffer }
169*54730332SMichael Pfeiffer 
170*54730332SMichael Pfeiffer static void testFillRoundRect(BView *view, BRect frame)
171*54730332SMichael Pfeiffer {
172*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
173*54730332SMichael Pfeiffer 	view->FillRoundRect(frame, 5, 3);
174*54730332SMichael Pfeiffer }
175*54730332SMichael Pfeiffer 
176*54730332SMichael Pfeiffer static void testStrokeRoundRect(BView *view, BRect frame)
177*54730332SMichael Pfeiffer {
178*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
179*54730332SMichael Pfeiffer 	view->StrokeRoundRect(frame, 5, 3);
180*54730332SMichael Pfeiffer }
181*54730332SMichael Pfeiffer 
182*54730332SMichael Pfeiffer static void testFillTriangle(BView *view, BRect frame)
183*54730332SMichael Pfeiffer {
184*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
185*54730332SMichael Pfeiffer 	BPoint points[3];
186*54730332SMichael Pfeiffer 	points[0] = BPoint(frame.left, frame.bottom);
187*54730332SMichael Pfeiffer 	points[1] = BPoint(centerPoint(frame).x, frame.top);
188*54730332SMichael Pfeiffer 	points[2] = BPoint(frame.right, frame.bottom);
189*54730332SMichael Pfeiffer 	view->FillTriangle(points[0], points[1], points[2]);
190*54730332SMichael Pfeiffer }
191*54730332SMichael Pfeiffer 
192*54730332SMichael Pfeiffer static void testStrokeTriangle(BView *view, BRect frame)
193*54730332SMichael Pfeiffer {
194*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
195*54730332SMichael Pfeiffer 	BPoint points[3];
196*54730332SMichael Pfeiffer 	points[0] = BPoint(frame.left, frame.bottom);
197*54730332SMichael Pfeiffer 	points[1] = BPoint(centerPoint(frame).x, frame.top);
198*54730332SMichael Pfeiffer 	points[2] = BPoint(frame.right, frame.bottom);
199*54730332SMichael Pfeiffer 	view->StrokeTriangle(points[0], points[1], points[2]);
200*54730332SMichael Pfeiffer }
201*54730332SMichael Pfeiffer 
202*54730332SMichael Pfeiffer static void testStrokeLine(BView *view, BRect frame)
203*54730332SMichael Pfeiffer {
204*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
205*54730332SMichael Pfeiffer 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top));
206*54730332SMichael Pfeiffer 
207*54730332SMichael Pfeiffer 	frame.top += 2;
208*54730332SMichael Pfeiffer 	frame.bottom -= 2;
20982afdb09SMichael Pfeiffer 	view->StrokeLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.bottom));
210*54730332SMichael Pfeiffer 
211*54730332SMichael Pfeiffer 	frame.bottom += 2;;
212*54730332SMichael Pfeiffer 	frame.top = frame.bottom;
213*54730332SMichael Pfeiffer 	view->StrokeLine(BPoint(frame.right, frame.top), BPoint(frame.left, frame.top));
21482afdb09SMichael Pfeiffer }
21582afdb09SMichael Pfeiffer 
216*54730332SMichael Pfeiffer static void testFillShape(BView *view, BRect frame)
21782afdb09SMichael Pfeiffer {
218*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
219*54730332SMichael Pfeiffer 	BShape shape;
220*54730332SMichael Pfeiffer 	shape.MoveTo(BPoint(frame.left, frame.bottom));
221*54730332SMichael Pfeiffer 	shape.LineTo(BPoint(frame.right, frame.top));
222*54730332SMichael Pfeiffer 	shape.LineTo(BPoint(frame.left, frame.top));
223*54730332SMichael Pfeiffer 	shape.LineTo(BPoint(frame.right, frame.bottom));
224*54730332SMichael Pfeiffer 	view->FillShape(&shape);
22582afdb09SMichael Pfeiffer }
22682afdb09SMichael Pfeiffer 
227*54730332SMichael Pfeiffer static void testStrokeShape(BView *view, BRect frame)
228*54730332SMichael Pfeiffer {
229*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
230*54730332SMichael Pfeiffer 	BShape shape;
231*54730332SMichael Pfeiffer 	shape.MoveTo(BPoint(frame.left, frame.bottom));
232*54730332SMichael Pfeiffer 	shape.LineTo(BPoint(frame.right, frame.top));
233*54730332SMichael Pfeiffer 	shape.LineTo(BPoint(frame.left, frame.top));
234*54730332SMichael Pfeiffer 	shape.LineTo(BPoint(frame.right, frame.bottom));
235*54730332SMichael Pfeiffer 	view->StrokeShape(&shape);
236*54730332SMichael Pfeiffer }
237*54730332SMichael Pfeiffer 
238*54730332SMichael Pfeiffer static void testRecordPicture(BView *view, BRect frame)
23982afdb09SMichael Pfeiffer {
24082afdb09SMichael Pfeiffer 	BPicture *picture = new BPicture();
24182afdb09SMichael Pfeiffer 	view->BeginPicture(picture);
24282afdb09SMichael Pfeiffer 	view->FillRect(frame);
24382afdb09SMichael Pfeiffer 	view->EndPicture();
24482afdb09SMichael Pfeiffer 	delete picture;
24582afdb09SMichael Pfeiffer }
24682afdb09SMichael Pfeiffer 
247*54730332SMichael Pfeiffer static void testRecordAndPlayPicture(BView *view, BRect frame)
24882afdb09SMichael Pfeiffer {
24982afdb09SMichael Pfeiffer 	BPicture *picture = new BPicture();
25082afdb09SMichael Pfeiffer 	view->BeginPicture(picture);
25182afdb09SMichael Pfeiffer 	frame.InsetBy(2, 2);
25282afdb09SMichael Pfeiffer 	view->FillRect(frame);
25382afdb09SMichael Pfeiffer 	view->EndPicture();
25482afdb09SMichael Pfeiffer 	view->DrawPicture(picture);
25582afdb09SMichael Pfeiffer 	delete picture;
25682afdb09SMichael Pfeiffer }
25782afdb09SMichael Pfeiffer 
258*54730332SMichael Pfeiffer static void testRecordAndPlayPictureWithOffset(BView *view, BRect frame)
25982afdb09SMichael Pfeiffer {
26082afdb09SMichael Pfeiffer 	BPicture *picture = new BPicture();
26182afdb09SMichael Pfeiffer 	view->BeginPicture(picture);
26282afdb09SMichael Pfeiffer 	frame.InsetBy(frame.Width() / 4, frame.Height() / 4);
26382afdb09SMichael Pfeiffer 	frame.OffsetTo(0, 0);
26482afdb09SMichael Pfeiffer 	view->FillRect(frame);
26582afdb09SMichael Pfeiffer 	view->EndPicture();
26682afdb09SMichael Pfeiffer 
26782afdb09SMichael Pfeiffer 	view->DrawPicture(picture, BPoint(10, 10));
26882afdb09SMichael Pfeiffer 	// color of picture should not change
269*54730332SMichael Pfeiffer 	view->SetLowColor(kGreen);
270*54730332SMichael Pfeiffer 	view->SetLowColor(kRed);
27182afdb09SMichael Pfeiffer 	view->DrawPicture(picture, BPoint(0, 0));
27282afdb09SMichael Pfeiffer 	delete picture;
27382afdb09SMichael Pfeiffer }
27482afdb09SMichael Pfeiffer 
275*54730332SMichael Pfeiffer static void testAppendToPicture(BView *view, BRect frame)
276*54730332SMichael Pfeiffer {
277*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
278*54730332SMichael Pfeiffer 	view->BeginPicture(new BPicture());
279*54730332SMichael Pfeiffer 	view->FillRect(frame);
280*54730332SMichael Pfeiffer 	BPicture* picture = view->EndPicture();
281*54730332SMichael Pfeiffer 	if (picture == NULL)
282*54730332SMichael Pfeiffer 		return;
283*54730332SMichael Pfeiffer 
284*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
285*54730332SMichael Pfeiffer 	view->AppendToPicture(picture);
286*54730332SMichael Pfeiffer 	view->SetHighColor(kRed);
287*54730332SMichael Pfeiffer 	view->FillRect(frame);
288*54730332SMichael Pfeiffer 	if (view->EndPicture() != picture)
289*54730332SMichael Pfeiffer 		return;
290*54730332SMichael Pfeiffer 
291*54730332SMichael Pfeiffer 	view->DrawPicture(picture);
292*54730332SMichael Pfeiffer 	delete picture;
293*54730332SMichael Pfeiffer }
294*54730332SMichael Pfeiffer 
295*54730332SMichael Pfeiffer static void testLineArray(BView *view, BRect frame)
296*54730332SMichael Pfeiffer {
297*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
298*54730332SMichael Pfeiffer 	view->BeginLineArray(3);
299*54730332SMichael Pfeiffer 	view->AddLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.top), kBlack);
300*54730332SMichael Pfeiffer 
301*54730332SMichael Pfeiffer 	frame.top += 2;
302*54730332SMichael Pfeiffer 	frame.bottom -= 2;
303*54730332SMichael Pfeiffer 	view->AddLine(BPoint(frame.left, frame.top), BPoint(frame.right, frame.bottom), kRed);
304*54730332SMichael Pfeiffer 
305*54730332SMichael Pfeiffer 	frame.bottom += 2;;
306*54730332SMichael Pfeiffer 	frame.top = frame.bottom;
307*54730332SMichael Pfeiffer 	view->AddLine(BPoint(frame.right, frame.top), BPoint(frame.left, frame.top), kGreen);
308*54730332SMichael Pfeiffer 
309*54730332SMichael Pfeiffer 	view->EndLineArray();
310*54730332SMichael Pfeiffer }
311*54730332SMichael Pfeiffer 
312*54730332SMichael Pfeiffer static void testCopyBits(BView *view, BRect frame)
313*54730332SMichael Pfeiffer {
314*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
315*54730332SMichael Pfeiffer 	BRect leftHalf(frame);
316*54730332SMichael Pfeiffer 	leftHalf.right = centerPoint(frame).x - 1;
317*54730332SMichael Pfeiffer 
318*54730332SMichael Pfeiffer 	BRect rightHalf(frame);
319*54730332SMichael Pfeiffer 	rightHalf.left = centerPoint(frame).x + 1;
320*54730332SMichael Pfeiffer 
321*54730332SMichael Pfeiffer 	view->StrokeRect(leftHalf);
322*54730332SMichael Pfeiffer 
323*54730332SMichael Pfeiffer 	view->CopyBits(leftHalf, rightHalf);
324*54730332SMichael Pfeiffer }
325*54730332SMichael Pfeiffer 
326*54730332SMichael Pfeiffer static void testInvertRect(BView *view, BRect frame)
327*54730332SMichael Pfeiffer {
328*54730332SMichael Pfeiffer 	frame.InsetBy(2, 2);
329*54730332SMichael Pfeiffer 	view->InvertRect(frame);
330*54730332SMichael Pfeiffer }
331*54730332SMichael Pfeiffer 
332*54730332SMichael Pfeiffer static void testBitmap(BView *view, BRect frame) {
33382afdb09SMichael Pfeiffer 	BBitmap bitmap(frame, B_RGBA32);
33482afdb09SMichael Pfeiffer 	for (int32 y = 0; y < bitmap.Bounds().IntegerHeight(); y ++) {
33582afdb09SMichael Pfeiffer 		for (int32 x = 0; x < bitmap.Bounds().IntegerWidth(); x ++) {
33682afdb09SMichael Pfeiffer 			char *pixel = (char*)bitmap.Bits();
33782afdb09SMichael Pfeiffer 			pixel += bitmap.BytesPerRow() * y + 4 * x;
33882afdb09SMichael Pfeiffer 			// fill with blue
33982afdb09SMichael Pfeiffer 			pixel[0] = 255;
34082afdb09SMichael Pfeiffer 			pixel[1] = 0;
34182afdb09SMichael Pfeiffer 			pixel[2] = 0;
34282afdb09SMichael Pfeiffer 			pixel[3] = 255;
34382afdb09SMichael Pfeiffer 		}
34482afdb09SMichael Pfeiffer 	}
34582afdb09SMichael Pfeiffer 	view->DrawBitmap(&bitmap, BPoint(0, 0));
34682afdb09SMichael Pfeiffer }
34782afdb09SMichael Pfeiffer 
34882afdb09SMichael Pfeiffer TestCase gTestCases[] = {
349*54730332SMichael Pfeiffer 	{ "Test No Operation", testNoOp },
350*54730332SMichael Pfeiffer 	{ "Test DrawChar", testDrawChar },
35182afdb09SMichael Pfeiffer 	{ "Test Draw String", testDrawString },
352*54730332SMichael Pfeiffer 	{ "Test Draw String With Length", testDrawStringWithLength },
353*54730332SMichael Pfeiffer 	{ "Test FillArc", testFillArc },
354*54730332SMichael Pfeiffer 	{ "Test StrokeArc", testStrokeArc },
355*54730332SMichael Pfeiffer 	{ "Test FillBezier", testFillBezier },
356*54730332SMichael Pfeiffer 	{ "Test StrokeBezier", testStrokeBezier },
357*54730332SMichael Pfeiffer 	{ "Test FillEllipse", testFillEllipse },
358*54730332SMichael Pfeiffer 	{ "Test StrokeEllipse", testStrokeEllipse },
359*54730332SMichael Pfeiffer 	{ "Test FillPolygon", testFillPolygon },
360*54730332SMichael Pfeiffer 	{ "Test StrokePolygon", testStrokePolygon },
361*54730332SMichael Pfeiffer 	{ "Test FillRect", testFillRect },
362*54730332SMichael Pfeiffer 	{ "Test StrokeRect", testStrokeRect },
363*54730332SMichael Pfeiffer 	{ "Test FillRegion", testFillRegion },
364*54730332SMichael Pfeiffer 	{ "Test FillRoundRect", testFillRoundRect },
365*54730332SMichael Pfeiffer 	{ "Test StrokeRoundRect", testStrokeRoundRect },
366*54730332SMichael Pfeiffer 	{ "Test FillTriangle", testFillTriangle },
367*54730332SMichael Pfeiffer 	{ "Test StrokeTriangle", testStrokeTriangle },
368*54730332SMichael Pfeiffer 	{ "Test StrokeLine", testStrokeLine },
369*54730332SMichael Pfeiffer 	{ "Test FillShape", testFillShape },
370*54730332SMichael Pfeiffer 	{ "Test StrokeShape", testStrokeShape },
37182afdb09SMichael Pfeiffer 	{ "Test Record Picture", testRecordPicture },
37282afdb09SMichael Pfeiffer 	{ "Test Record And Play Picture", testRecordAndPlayPicture },
37382afdb09SMichael Pfeiffer 	{ "Test Record And Play Picture With Offset", testRecordAndPlayPictureWithOffset },
374*54730332SMichael Pfeiffer 	{ "Test AppendToPicture", testAppendToPicture },
375*54730332SMichael Pfeiffer 	{ "Test LineArray", testLineArray },
376*54730332SMichael Pfeiffer 	// does not work under R5 for pictures!
377*54730332SMichael Pfeiffer 	{ "Test CopyBits*", testCopyBits },
378*54730332SMichael Pfeiffer 	{ "Test InvertRect", testInvertRect },
379*54730332SMichael Pfeiffer 	{ "Test Bitmap", testBitmap },
38082afdb09SMichael Pfeiffer 	{ NULL, NULL }
38182afdb09SMichael Pfeiffer };
38262c7fd0fSMichael Pfeiffer 
383