added test for push/pop state (very basic)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27317 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2008-09-04 10:20:07 +00:00
parent 15cf50e010
commit ed70c5f317

View File

@ -684,6 +684,7 @@ static void testSetFontSize(BView *view, BRect frame)
static void testSetDrawingMode(BView *view, BRect frame)
{
frame.InsetBy(2, 2);
view->StrokeLine(frame.LeftTop(), frame.RightBottom());
view->StrokeLine(frame.LeftBottom(), frame.RightTop());
view->SetDrawingMode(B_OP_ALPHA);
@ -693,6 +694,17 @@ static void testSetDrawingMode(BView *view, BRect frame)
view->FillRect(frame, B_SOLID_HIGH);
}
static void testPushPopState(BView *view, BRect frame)
{
frame.InsetBy(2, 2);
view->SetHighColor(kGreen);
view->PushState();
view->SetHighColor(kRed);
view->PopState();
view->FillRect(frame, B_SOLID_HIGH);
}
// TODO
// - blending mode
@ -757,6 +769,7 @@ TestCase gTestCases[] = {
{ "Test SetOriginAndScale5", testSetOriginAndScale5 },
{ "Test SetFontSize", testSetFontSize },
{ "Test SetDrawingMode", testSetDrawingMode },
{ "Test PushPopState", testPushPopState },
{ NULL, NULL }
};