Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / vcl / backendtest / outputdevice / polyline_b2d.cxx
blobb59685c7a817c9ff6de6c41f88162dd14f91c2a3
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>
12 #include <vcl/bitmapex.hxx>
14 namespace vcl
16 namespace test
18 namespace
20 void drawPolyLineOffset(OutputDevice& rDevice, tools::Rectangle const& rRect, int nOffset)
22 basegfx::B2DPolygon aPolygon{
23 basegfx::B2DPoint(rRect.Left() + nOffset, rRect.Top() + nOffset),
24 basegfx::B2DPoint(rRect.Right() - nOffset, rRect.Top() + nOffset),
25 basegfx::B2DPoint(rRect.Right() - nOffset, rRect.Bottom() - nOffset),
26 basegfx::B2DPoint(rRect.Left() + nOffset, rRect.Bottom() - nOffset),
28 aPolygon.setClosed(true);
30 rDevice.DrawPolyLine(aPolygon, 0.0); // draw hairline
33 } // end anonymous namespace
35 Bitmap OutputDeviceTestPolyLineB2D::setupRectangle(bool bEnableAA)
37 initialSetup(13, 13, constBackgroundColor, bEnableAA);
39 mpVirtualDevice->SetLineColor(constLineColor);
40 mpVirtualDevice->SetFillColor();
42 drawPolyLineOffset(*mpVirtualDevice, maVDRectangle, 2);
43 drawPolyLineOffset(*mpVirtualDevice, maVDRectangle, 5);
45 return mpVirtualDevice->GetBitmapEx(maVDRectangle.TopLeft(), maVDRectangle.GetSize())
46 .GetBitmap();
49 } // end namespace vcl::test
51 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */