From 7cf26360d9c0757f8e1f163b8ca7d85834435794 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 18 Sep 2015 22:57:13 +0200 Subject: [PATCH] FlattenPictureTest: Add failing test InvertRect, when mixed with SetDrawingMode calls, fails to draw correctly to a BPicture. --- .../interface/flatten_picture/PictureTestCases.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tests/kits/interface/flatten_picture/PictureTestCases.cpp b/src/tests/kits/interface/flatten_picture/PictureTestCases.cpp index 8b03950a11..ee74301617 100644 --- a/src/tests/kits/interface/flatten_picture/PictureTestCases.cpp +++ b/src/tests/kits/interface/flatten_picture/PictureTestCases.cpp @@ -404,6 +404,16 @@ static void testInvertRect(BView *view, BRect frame) view->InvertRect(frame); } +static void testInvertRectSetDrawingMode(BView *view, BRect frame) +{ + view->SetDrawingMode(B_OP_ALPHA); + view->SetHighColor(128, 128, 128, 128); + frame.InsetBy(2, 2); + view->InvertRect(frame); + frame.InsetBy(10, 10); + view->FillRect(frame, B_SOLID_HIGH); +} + static bool isBorder(int32 x, int32 y, int32 width, int32 height) { return x == 0 || y == 0 || x == width - 1 || y == height - 1; } @@ -877,6 +887,7 @@ TestCase gTestCases[] = { { "Test Draw Scaled Picture", testDrawScaledPicture }, { "Test LineArray", testLineArray }, { "Test InvertRect", testInvertRect }, + { "Test InvertRectSetDrawingMode", testInvertRectSetDrawingMode }, { "Test DrawBitmap", testDrawBitmap }, { "Test DrawBitmapAtPoint", testDrawBitmapAtPoint }, { "Test DrawBitmapAtRect", testDrawBitmapAtRect },