Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / vcl / backendtest / outputdevice / pixel.cxx
blobb231396ab7ff4436e92289846c8d420f0cd9c58f
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 {
14 namespace test {
16 namespace
19 void drawPixelOffset(OutputDevice& rDevice, tools::Rectangle const & rRect, int nOffset)
21 for (long x = 0 + nOffset; x < (rRect.GetWidth() - nOffset); ++x)
23 long y1 = nOffset;
24 long y2 = rRect.GetHeight() - nOffset - 1;
26 rDevice.DrawPixel(Point(x, y1));
27 rDevice.DrawPixel(Point(x, y2));
30 for (long y = 0 + nOffset; y < (rRect.GetHeight() - nOffset); ++y)
32 long x1 = nOffset;
33 long x2 = rRect.GetWidth() - nOffset - 1;
35 rDevice.DrawPixel(Point(x1, y));
36 rDevice.DrawPixel(Point(x2, y));
40 } // end anonymous namespace
42 Bitmap OutputDeviceTestPixel::setupRectangle(bool bEnableAA)
44 initialSetup(13, 13, constBackgroundColor, bEnableAA);
46 mpVirtualDevice->SetLineColor(constLineColor);
47 mpVirtualDevice->SetFillColor();
49 drawPixelOffset(*mpVirtualDevice, maVDRectangle, 2);
50 drawPixelOffset(*mpVirtualDevice, maVDRectangle, 5);
52 return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
55 }} // end namespace vcl::test
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */