1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 #include <test/outputdevice.hxx>
19 basegfx::B2DPolygon
createPolygonOffset(tools::Rectangle
const& rRect
, int nOffset
)
21 basegfx::B2DPolygon aPolygon
{
22 basegfx::B2DPoint(rRect
.Left() + nOffset
, rRect
.Top() + nOffset
),
23 basegfx::B2DPoint(rRect
.Right() - nOffset
, rRect
.Top() + nOffset
),
24 basegfx::B2DPoint(rRect
.Right() - nOffset
, rRect
.Bottom() - nOffset
),
25 basegfx::B2DPoint(rRect
.Left() + nOffset
, rRect
.Bottom() - nOffset
),
27 aPolygon
.setClosed(true);
31 } // end anonymous namespace
33 Bitmap
OutputDeviceTestPolyPolygonB2D::setupRectangle(bool bEnableAA
)
35 initialSetup(13, 13, constBackgroundColor
, bEnableAA
);
37 mpVirtualDevice
->SetLineColor(constLineColor
);
38 mpVirtualDevice
->SetFillColor();
40 basegfx::B2DPolyPolygon aPolyPolygon
;
41 aPolyPolygon
.append(createPolygonOffset(maVDRectangle
, 2));
42 aPolyPolygon
.append(createPolygonOffset(maVDRectangle
, 5));
44 mpVirtualDevice
->DrawPolyPolygon(aPolyPolygon
);
46 return mpVirtualDevice
->GetBitmap(maVDRectangle
.TopLeft(), maVDRectangle
.GetSize());
49 Bitmap
OutputDeviceTestPolyPolygonB2D::setupFilledRectangle()
51 initialSetup(13, 13, constBackgroundColor
);
53 mpVirtualDevice
->SetLineColor();
54 mpVirtualDevice
->SetFillColor(constFillColor
);
56 basegfx::B2DPolyPolygon
aPolyPolygon(createPolygonOffset(maVDRectangle
, 2));
58 mpVirtualDevice
->DrawPolyPolygon(aPolyPolygon
);
60 return mpVirtualDevice
->GetBitmap(maVDRectangle
.TopLeft(), maVDRectangle
.GetSize());
63 } // end namespace vcl::test
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */