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:
@@ -684,6 +684,7 @@ static void testSetFontSize(BView *view, BRect frame)
|
|||||||
|
|
||||||
static void testSetDrawingMode(BView *view, BRect frame)
|
static void testSetDrawingMode(BView *view, BRect frame)
|
||||||
{
|
{
|
||||||
|
frame.InsetBy(2, 2);
|
||||||
view->StrokeLine(frame.LeftTop(), frame.RightBottom());
|
view->StrokeLine(frame.LeftTop(), frame.RightBottom());
|
||||||
view->StrokeLine(frame.LeftBottom(), frame.RightTop());
|
view->StrokeLine(frame.LeftBottom(), frame.RightTop());
|
||||||
view->SetDrawingMode(B_OP_ALPHA);
|
view->SetDrawingMode(B_OP_ALPHA);
|
||||||
@@ -693,6 +694,17 @@ static void testSetDrawingMode(BView *view, BRect frame)
|
|||||||
view->FillRect(frame, B_SOLID_HIGH);
|
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
|
// TODO
|
||||||
// - blending mode
|
// - blending mode
|
||||||
@@ -757,6 +769,7 @@ TestCase gTestCases[] = {
|
|||||||
{ "Test SetOriginAndScale5", testSetOriginAndScale5 },
|
{ "Test SetOriginAndScale5", testSetOriginAndScale5 },
|
||||||
{ "Test SetFontSize", testSetFontSize },
|
{ "Test SetFontSize", testSetFontSize },
|
||||||
{ "Test SetDrawingMode", testSetDrawingMode },
|
{ "Test SetDrawingMode", testSetDrawingMode },
|
||||||
|
{ "Test PushPopState", testPushPopState },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user