Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / vcl / backendtest / outputdevice / gradient.cxx
blob58e20e5d609201adeae6aeec2fe664f0c253378e
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/gradient.hxx>
14 namespace vcl {
15 namespace test {
17 Bitmap OutputDeviceTestGradient::setupLinearGradient()
19 initialSetup(12, 12, constBackgroundColor);
21 Gradient aGradient(GradientStyle::Linear, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
22 aGradient.SetAngle(900);
23 tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
24 maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
25 mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
27 return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
30 Bitmap OutputDeviceTestGradient::setupRadialGradient()
32 initialSetup(12, 12, constBackgroundColor);
34 Gradient aGradient(GradientStyle::Radial, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
35 tools::Rectangle aDrawRect(maVDRectangle.Left() + 1, maVDRectangle.Top() + 1,
36 maVDRectangle.Right() - 1, maVDRectangle.Bottom() - 1);
37 mpVirtualDevice->DrawGradient(aDrawRect, aGradient);
39 return mpVirtualDevice->GetBitmap(maVDRectangle.TopLeft(), maVDRectangle.GetSize());
42 }} // end namespace vcl::test
44 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */