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 void drawPixelOffset(OutputDevice
& rDevice
, tools::Rectangle
const & rRect
, int nOffset
)
21 for (long x
= 0 + nOffset
; x
< (rRect
.GetWidth() - nOffset
); ++x
)
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
)
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: */