Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / vcl / backendtest / outputdevice / polypolygon_b2d.cxx
blob808e8637c3d8eb60b1865f0cf10884cbd7225069
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 */
11 #include <test/outputdevice.hxx>
13 namespace vcl
15 namespace test
17 namespace
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);
28 return aPolygon;
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: */