nss: upgrade to release 3.73
[LibreOffice.git] / vcl / backendtest / outputdevice / pixel.cxx
blobc0fcc47705f57041bd79b77f7c9a70771480b502
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::test
15 namespace
17 void drawPixelOffset(OutputDevice& rDevice, tools::Rectangle const& rRect, int nOffset)
19 for (tools::Long x = 0 + nOffset; x < (rRect.GetWidth() - nOffset); ++x)
21 tools::Long y1 = nOffset;
22 tools::Long y2 = rRect.GetHeight() - nOffset - 1;
24 rDevice.DrawPixel(Point(x, y1));
25 rDevice.DrawPixel(Point(x, y2));
28 for (tools::Long y = 0 + nOffset; y < (rRect.GetHeight() - nOffset); ++y)
30 tools::Long x1 = nOffset;
31 tools::Long x2 = rRect.GetWidth() - nOffset - 1;
33 rDevice.DrawPixel(Point(x1, y));
34 rDevice.DrawPixel(Point(x2, y));
38 } // end anonymous namespace
40 Bitmap OutputDeviceTestPixel::setupRectangle(bool bEnableAA)
42 initialSetup(13, 13, constBackgroundColor, bEnableAA);
44 mpVirtualDevice->SetLineColor(constLineColor);
45 mpVirtualDevice->SetFillColor();
47 drawPixelOffset(*mpVirtualDevice, maVDRectangle, 2);
48 drawPixelOffset(*mpVirtualDevice, maVDRectangle, 5);
50 return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
53 } // end namespace vcl::test
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */