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>
12 #include <svl/svlresid.hxx>
13 #include <svl/svl.hrc>
14 #include <unotools/bootstrap.hxx>
15 #include <vcl/test/GraphicsRenderTests.hxx>
16 #include <vcl/graphicfilter.hxx>
17 #include <tools/stream.hxx>
20 #include <salinst.hxx>
21 #include <strings.hrc>
22 #include <test/GraphicsRenderTests.hxx>
24 #include <unordered_map>
26 #define SHOULD_ASSERT \
27 (aOutDevTest.getRenderBackendName() != "qt5" && aOutDevTest.getRenderBackendName() != "qt5svp" \
28 && aOutDevTest.getRenderBackendName() != "gtk3svp" \
29 && aOutDevTest.getRenderBackendName() != "aqua" \
30 && aOutDevTest.getRenderBackendName() != "gen" \
31 && aOutDevTest.getRenderBackendName() != "genpsp" \
32 && aOutDevTest.getRenderBackendName() != "win")
36 static OUString activeGraphicsRenderTestName
;
37 void setActiveGraphicsRenderTest(const OUString
& name
) { activeGraphicsRenderTestName
= name
; }
38 const OUString
& activeGraphicsRenderTest() { return activeGraphicsRenderTestName
; }
39 } // namespace vcl::test
41 OUString
VclTestResult::getStatus(bool bLocalize
)
42 { // tdf#145919 localize for UI but not in the log file
45 if (m_aTestStatus
== "PASSED")
47 return SvlResId(GRTSTR_PASSED
);
49 else if (m_aTestStatus
== "QUIRKY")
51 return SvlResId(GRTSTR_QUIRKY
);
53 else if (m_aTestStatus
== "FAILED")
55 return SvlResId(GRTSTR_FAILED
);
59 return SvlResId(GRTSTR_SKIPPED
);
68 void exportBitmapExToImage(OUString
const& rImageName
, const BitmapEx
& rBitmapEx
)
70 BitmapEx
aBitmapEx(rBitmapEx
);
71 aBitmapEx
.Scale(Size(500, 500), BmpScaleFlag::Fast
);
72 SvFileStream
aStream(rImageName
, StreamMode::WRITE
| StreamMode::TRUNC
);
73 GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx
, aStream
);
75 bool is32bppSupported() { return ImplGetSVData()->mpDefInst
->supportsBitmap32(); }
77 // Some tests need special handling in drawing code (for example, not smoothscaling
78 // when handling HiDPI bitmaps). Temporarily set up the test name to get such special
80 class GraphicsTestZone
83 GraphicsTestZone(std::u16string_view name
)
85 vcl::test::setActiveGraphicsRenderTest(OUString::Concat("GraphicsRenderTest__") + name
);
87 ~GraphicsTestZone() { vcl::test::setActiveGraphicsRenderTest(""); }
91 OUString
GraphicsRenderTests::returnTestStatus(vcl::test::TestResult
const result
)
95 case vcl::test::TestResult::Passed
:
97 case vcl::test::TestResult::PassedWithQuirks
:
99 case vcl::test::TestResult::Failed
:
105 void GraphicsRenderTests::testDrawRectWithRectangle()
107 OUString aTestName
= "testDrawRectWithRectangle";
108 GraphicsTestZone
zone(aTestName
);
109 vcl::test::OutputDeviceTestRect aOutDevTest
;
110 Bitmap aBitmap
= aOutDevTest
.setupRectangle(false);
111 m_aCurGraphicsBackend
= aOutDevTest
.getRenderBackendName();
114 appendTestResult(aTestName
, "SKIPPED");
117 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
118 appendTestResult(aTestName
, returnTestStatus(eResult
),
119 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
120 if (m_aStoreResultantBitmap
)
122 BitmapEx
aBitmapEx(aBitmap
);
123 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
127 void GraphicsRenderTests::testDrawRectWithPixel()
129 OUString aTestName
= "testDrawRectWithPixel";
130 GraphicsTestZone
zone(aTestName
);
131 vcl::test::OutputDeviceTestPixel aOutDevTest
;
132 Bitmap aBitmap
= aOutDevTest
.setupRectangle(false);
135 appendTestResult(aTestName
, "SKIPPED");
138 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
139 appendTestResult(aTestName
, returnTestStatus(eResult
),
140 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
141 if (m_aStoreResultantBitmap
)
143 BitmapEx
aBitmapEx(aBitmap
);
144 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
148 void GraphicsRenderTests::testDrawRectWithLine()
150 OUString aTestName
= "testDrawRectWithLine";
151 GraphicsTestZone
zone(aTestName
);
152 vcl::test::OutputDeviceTestLine aOutDevTest
;
153 Bitmap aBitmap
= aOutDevTest
.setupRectangle(false);
156 appendTestResult(aTestName
, "SKIPPED");
159 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
160 appendTestResult(aTestName
, returnTestStatus(eResult
),
161 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
162 if (m_aStoreResultantBitmap
)
164 BitmapEx
aBitmapEx(aBitmap
);
165 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
169 void GraphicsRenderTests::testDrawRectWithPolygon()
171 OUString aTestName
= "testDrawRectWithPolygon";
172 GraphicsTestZone
zone(aTestName
);
173 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
174 Bitmap aBitmap
= aOutDevTest
.setupRectangle(false);
177 appendTestResult(aTestName
, "SKIPPED");
180 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
181 appendTestResult(aTestName
, returnTestStatus(eResult
),
182 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
183 if (m_aStoreResultantBitmap
)
185 BitmapEx
aBitmapEx(aBitmap
);
186 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
190 void GraphicsRenderTests::testDrawRectWithPolyLine()
192 OUString aTestName
= "testDrawRectWithPolyLine";
193 GraphicsTestZone
zone(aTestName
);
194 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
195 Bitmap aBitmap
= aOutDevTest
.setupRectangle(false);
198 appendTestResult(aTestName
, "SKIPPED");
201 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
202 appendTestResult(aTestName
, returnTestStatus(eResult
),
203 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
204 if (m_aStoreResultantBitmap
)
206 BitmapEx
aBitmapEx(aBitmap
);
207 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
211 void GraphicsRenderTests::testDrawRectWithPolyLineB2D()
213 OUString aTestName
= "testDrawRectWithPolyLineB2D";
214 GraphicsTestZone
zone(aTestName
);
215 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
216 Bitmap aBitmap
= aOutDevTest
.setupRectangle(false);
219 appendTestResult(aTestName
, "SKIPPED");
222 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
223 appendTestResult(aTestName
, returnTestStatus(eResult
),
224 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
225 if (m_aStoreResultantBitmap
)
227 BitmapEx
aBitmapEx(aBitmap
);
228 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
232 void GraphicsRenderTests::testDrawRectWithPolyPolygon()
234 OUString aTestName
= "testDrawRectWithPolyPolygon";
235 GraphicsTestZone
zone(aTestName
);
236 vcl::test::OutputDeviceTestPolyPolygon aOutDevTest
;
237 Bitmap aBitmap
= aOutDevTest
.setupRectangle(false);
240 appendTestResult(aTestName
, "SKIPPED");
243 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
244 appendTestResult(aTestName
, returnTestStatus(eResult
),
245 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
246 if (m_aStoreResultantBitmap
)
248 BitmapEx
aBitmapEx(aBitmap
);
249 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
253 void GraphicsRenderTests::testDrawRectWithPolyPolygonB2D()
255 OUString aTestName
= "testDrawRectWithPolyPolygonB2D";
256 GraphicsTestZone
zone(aTestName
);
257 vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest
;
258 Bitmap aBitmap
= aOutDevTest
.setupRectangle(false);
261 appendTestResult(aTestName
, "SKIPPED");
264 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
265 appendTestResult(aTestName
, returnTestStatus(eResult
),
266 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
267 if (m_aStoreResultantBitmap
)
269 BitmapEx
aBitmapEx(aBitmap
);
270 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
274 void GraphicsRenderTests::testDrawRectAAWithRectangle()
276 OUString aTestName
= "testDrawRectAAWithRectangle";
277 GraphicsTestZone
zone(aTestName
);
278 vcl::test::OutputDeviceTestRect aOutDevTest
;
279 Bitmap aBitmap
= aOutDevTest
.setupRectangle(true);
282 appendTestResult(aTestName
, "SKIPPED");
285 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap
);
286 appendTestResult(aTestName
, returnTestStatus(eResult
),
287 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
288 if (m_aStoreResultantBitmap
)
290 BitmapEx
aBitmapEx(aBitmap
);
291 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
295 void GraphicsRenderTests::testDrawRectAAWithPixel()
297 OUString aTestName
= "testDrawRectAAWithPixel";
298 GraphicsTestZone
zone(aTestName
);
299 vcl::test::OutputDeviceTestPixel aOutDevTest
;
300 Bitmap aBitmap
= aOutDevTest
.setupRectangle(true);
303 appendTestResult(aTestName
, "SKIPPED");
306 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap
);
307 appendTestResult(aTestName
, returnTestStatus(eResult
),
308 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
309 if (m_aStoreResultantBitmap
)
311 BitmapEx
aBitmapEx(aBitmap
);
312 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
316 void GraphicsRenderTests::testDrawRectAAWithLine()
318 OUString aTestName
= "testDrawRectAAWithLine";
319 GraphicsTestZone
zone(aTestName
);
320 vcl::test::OutputDeviceTestLine aOutDevTest
;
321 Bitmap aBitmap
= aOutDevTest
.setupRectangle(true);
324 appendTestResult(aTestName
, "SKIPPED");
327 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap
);
328 appendTestResult(aTestName
, returnTestStatus(eResult
),
329 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
330 if (m_aStoreResultantBitmap
)
332 BitmapEx
aBitmapEx(aBitmap
);
333 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
337 void GraphicsRenderTests::testDrawRectAAWithPolygon()
339 OUString aTestName
= "testDrawRectAAWithPolygon";
340 GraphicsTestZone
zone(aTestName
);
341 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
342 Bitmap aBitmap
= aOutDevTest
.setupRectangle(true);
345 appendTestResult(aTestName
, "SKIPPED");
348 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap
);
349 appendTestResult(aTestName
, returnTestStatus(eResult
),
350 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
351 if (m_aStoreResultantBitmap
)
353 BitmapEx
aBitmapEx(aBitmap
);
354 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
358 void GraphicsRenderTests::testDrawRectAAWithPolyLine()
360 OUString aTestName
= "testDrawRectAAWithPolyLine";
361 GraphicsTestZone
zone(aTestName
);
362 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
363 Bitmap aBitmap
= aOutDevTest
.setupRectangle(true);
366 appendTestResult(aTestName
, "SKIPPED");
369 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap
);
370 appendTestResult(aTestName
, returnTestStatus(eResult
),
371 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
372 if (m_aStoreResultantBitmap
)
374 BitmapEx
aBitmapEx(aBitmap
);
375 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
379 void GraphicsRenderTests::testDrawRectAAWithPolyLineB2D()
381 OUString aTestName
= "testDrawRectAAWithPolyLineB2D";
382 GraphicsTestZone
zone(aTestName
);
383 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
384 Bitmap aBitmap
= aOutDevTest
.setupRectangle(true);
387 appendTestResult(aTestName
, "SKIPPED");
390 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap
);
391 appendTestResult(aTestName
, returnTestStatus(eResult
),
392 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
393 if (m_aStoreResultantBitmap
)
395 BitmapEx
aBitmapEx(aBitmap
);
396 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
400 void GraphicsRenderTests::testDrawRectAAWithPolyPolygon()
402 OUString aTestName
= "testDrawRectAAWithPolyPolygon";
403 GraphicsTestZone
zone(aTestName
);
404 vcl::test::OutputDeviceTestPolyPolygon aOutDevTest
;
405 Bitmap aBitmap
= aOutDevTest
.setupRectangle(true);
408 appendTestResult(aTestName
, "SKIPPED");
411 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap
);
412 appendTestResult(aTestName
, returnTestStatus(eResult
),
413 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
414 if (m_aStoreResultantBitmap
)
416 BitmapEx
aBitmapEx(aBitmap
);
417 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
421 void GraphicsRenderTests::testDrawRectAAWithPolyPolygonB2D()
423 OUString aTestName
= "testDrawRectAAWithPolyPolygonB2D";
424 GraphicsTestZone
zone(aTestName
);
425 vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest
;
426 Bitmap aBitmap
= aOutDevTest
.setupRectangle(true);
429 appendTestResult(aTestName
, "SKIPPED");
432 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap
);
433 appendTestResult(aTestName
, returnTestStatus(eResult
),
434 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
435 if (m_aStoreResultantBitmap
)
437 BitmapEx
aBitmapEx(aBitmap
);
438 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
442 void GraphicsRenderTests::testDrawFilledRectWithRectangle()
444 OUString aTestName
= "testDrawFilledRectWithRectangle";
445 GraphicsTestZone
zone(aTestName
);
446 vcl::test::OutputDeviceTestRect aOutDevTest
;
447 Bitmap aBitmap
= aOutDevTest
.setupFilledRectangle(false);
450 appendTestResult(aTestName
, "SKIPPED");
453 vcl::test::TestResult eResult
454 = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap
, false);
455 appendTestResult(aTestName
, returnTestStatus(eResult
),
456 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
457 if (m_aStoreResultantBitmap
)
459 BitmapEx
aBitmapEx(aBitmap
);
460 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
462 aTestName
+= "WithAA";
463 aBitmap
= aOutDevTest
.setupFilledRectangle(true);
464 eResult
= vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap
, true);
465 appendTestResult(aTestName
, returnTestStatus(eResult
),
466 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
467 if (m_aStoreResultantBitmap
)
469 BitmapEx
aBitmapEx(aBitmap
);
470 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
474 void GraphicsRenderTests::testDrawFilledRectWithPolygon()
476 OUString aTestName
= "testDrawFilledRectWithPolygon";
477 GraphicsTestZone
zone(aTestName
);
478 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
479 Bitmap aBitmap
= aOutDevTest
.setupFilledRectangle(false);
482 appendTestResult(aTestName
, "SKIPPED");
485 vcl::test::TestResult eResult
486 = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap
, false);
487 appendTestResult(aTestName
, returnTestStatus(eResult
),
488 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
489 if (m_aStoreResultantBitmap
)
491 BitmapEx
aBitmapEx(aBitmap
);
492 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
494 aTestName
+= "WithAA";
495 aBitmap
= aOutDevTest
.setupFilledRectangle(true);
496 eResult
= vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap
, true);
497 appendTestResult(aTestName
, returnTestStatus(eResult
),
498 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
499 if (m_aStoreResultantBitmap
)
501 BitmapEx
aBitmapEx(aBitmap
);
502 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
506 void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon()
508 OUString aTestName
= "testDrawFilledRectWithPolyPolygon";
509 GraphicsTestZone
zone(aTestName
);
510 vcl::test::OutputDeviceTestPolyPolygon aOutDevTest
;
511 Bitmap aBitmap
= aOutDevTest
.setupFilledRectangle(false);
514 appendTestResult(aTestName
, "SKIPPED");
517 vcl::test::TestResult eResult
518 = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap
, false);
519 appendTestResult(aTestName
, returnTestStatus(eResult
),
520 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
521 if (m_aStoreResultantBitmap
)
523 BitmapEx
aBitmapEx(aBitmap
);
524 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
526 aTestName
+= "WithAA";
527 aBitmap
= aOutDevTest
.setupFilledRectangle(true);
528 eResult
= vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap
, true);
529 appendTestResult(aTestName
, returnTestStatus(eResult
),
530 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
531 if (m_aStoreResultantBitmap
)
533 BitmapEx
aBitmapEx(aBitmap
);
534 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
538 void GraphicsRenderTests::testDrawFilledRectWithPolyPolygon2D()
540 OUString aTestName
= "testDrawFilledRectWithPolyPolygon2D";
541 GraphicsTestZone
zone(aTestName
);
542 vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest
;
543 Bitmap aBitmap
= aOutDevTest
.setupFilledRectangle(false);
546 appendTestResult(aTestName
, "SKIPPED");
549 vcl::test::TestResult eResult
550 = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap
, false);
551 appendTestResult(aTestName
, returnTestStatus(eResult
),
552 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
553 if (m_aStoreResultantBitmap
)
555 BitmapEx
aBitmapEx(aBitmap
);
556 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
558 aTestName
+= "WithAA";
559 aBitmap
= aOutDevTest
.setupFilledRectangle(true);
560 eResult
= vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap
, true);
561 appendTestResult(aTestName
, returnTestStatus(eResult
),
562 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
563 if (m_aStoreResultantBitmap
)
565 BitmapEx
aBitmapEx(aBitmap
);
566 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
570 void GraphicsRenderTests::testDrawDiamondWithPolygon()
572 OUString aTestName
= "testDrawDiamondWithPolygon";
573 GraphicsTestZone
zone(aTestName
);
574 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
575 Bitmap aBitmap
= aOutDevTest
.setupDiamond();
578 appendTestResult(aTestName
, "SKIPPED");
581 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkDiamond(aBitmap
);
582 appendTestResult(aTestName
, returnTestStatus(eResult
),
583 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
584 if (m_aStoreResultantBitmap
)
586 BitmapEx
aBitmapEx(aBitmap
);
587 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
591 void GraphicsRenderTests::testDrawDiamondWithLine()
593 OUString aTestName
= "testDrawDiamondWithLine";
594 GraphicsTestZone
zone(aTestName
);
595 vcl::test::OutputDeviceTestLine aOutDevTest
;
596 Bitmap aBitmap
= aOutDevTest
.setupDiamond();
599 appendTestResult(aTestName
, "SKIPPED");
602 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkDiamond(aBitmap
);
603 appendTestResult(aTestName
, returnTestStatus(eResult
),
604 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
605 if (m_aStoreResultantBitmap
)
607 BitmapEx
aBitmapEx(aBitmap
);
608 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
612 void GraphicsRenderTests::testDrawDiamondWithPolyline()
614 OUString aTestName
= "testDrawDiamondWithPolyline";
615 GraphicsTestZone
zone(aTestName
);
616 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
617 Bitmap aBitmap
= aOutDevTest
.setupDiamond();
620 appendTestResult(aTestName
, "SKIPPED");
623 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkDiamond(aBitmap
);
624 appendTestResult(aTestName
, returnTestStatus(eResult
),
625 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
626 if (m_aStoreResultantBitmap
)
628 BitmapEx
aBitmapEx(aBitmap
);
629 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
633 void GraphicsRenderTests::testDrawDiamondWithPolylineB2D()
635 OUString aTestName
= "testDrawDiamondWithPolylineB2D";
636 GraphicsTestZone
zone(aTestName
);
637 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
638 Bitmap aBitmap
= aOutDevTest
.setupDiamond();
641 appendTestResult(aTestName
, "SKIPPED");
644 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkDiamond(aBitmap
);
645 appendTestResult(aTestName
, returnTestStatus(eResult
),
646 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
647 if (m_aStoreResultantBitmap
)
649 BitmapEx
aBitmapEx(aBitmap
);
650 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
654 void GraphicsRenderTests::testDrawInvertWithRectangle()
656 OUString aTestName
= "testDrawInvertWithRectangle";
657 GraphicsTestZone
zone(aTestName
);
658 vcl::test::OutputDeviceTestRect aOutDevTest
;
659 Bitmap aBitmap
= aOutDevTest
.setupInvert_NONE();
662 appendTestResult(aTestName
, "SKIPPED");
665 vcl::test::TestResult eResult
666 = vcl::test::OutputDeviceTestCommon::checkInvertRectangle(aBitmap
);
667 appendTestResult(aTestName
, returnTestStatus(eResult
),
668 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
669 if (m_aStoreResultantBitmap
)
671 BitmapEx
aBitmapEx(aBitmap
);
672 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
676 void GraphicsRenderTests::testDrawInvertN50WithRectangle()
678 OUString aTestName
= "testDrawInvertN50WithRectangle";
679 GraphicsTestZone
zone(aTestName
);
680 vcl::test::OutputDeviceTestRect aOutDevTest
;
681 Bitmap aBitmap
= aOutDevTest
.setupInvert_N50();
684 appendTestResult(aTestName
, "SKIPPED");
687 vcl::test::TestResult eResult
688 = vcl::test::OutputDeviceTestCommon::checkInvertN50Rectangle(aBitmap
);
689 appendTestResult(aTestName
, returnTestStatus(eResult
),
690 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
691 if (m_aStoreResultantBitmap
)
693 BitmapEx
aBitmapEx(aBitmap
);
694 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
698 void GraphicsRenderTests::testDrawInvertTrackFrameWithRectangle()
700 OUString aTestName
= "testDrawInvertTrackFrameWithRectangle";
701 GraphicsTestZone
zone(aTestName
);
702 vcl::test::OutputDeviceTestRect aOutDevTest
;
703 Bitmap aBitmap
= aOutDevTest
.setupInvert_TrackFrame();
704 if (!(SHOULD_ASSERT
&& aOutDevTest
.getRenderBackendName() != "svp"))
706 appendTestResult(aTestName
, "SKIPPED");
709 vcl::test::TestResult eResult
710 = vcl::test::OutputDeviceTestCommon::checkInvertTrackFrameRectangle(aBitmap
);
711 appendTestResult(aTestName
, returnTestStatus(eResult
),
712 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
713 if (m_aStoreResultantBitmap
)
715 BitmapEx
aBitmapEx(aBitmap
);
716 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
720 void GraphicsRenderTests::testDrawDropShapeWithPolyline()
722 OUString aTestName
= "testDrawDropShapeWithPolyline";
723 GraphicsTestZone
zone(aTestName
);
724 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
725 Bitmap aBitmap
= aOutDevTest
.setupDropShape();
728 appendTestResult(aTestName
, "SKIPPED");
731 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkDropShape(aBitmap
);
732 appendTestResult(aTestName
, returnTestStatus(eResult
),
733 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
734 if (m_aStoreResultantBitmap
)
736 BitmapEx
aBitmapEx(aBitmap
);
737 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
741 void GraphicsRenderTests::testDrawDropShapeAAWithPolyline()
743 OUString aTestName
= "testDrawDropShapeAAWithPolyline";
744 GraphicsTestZone
zone(aTestName
);
745 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
746 Bitmap aBitmap
= aOutDevTest
.setupAADropShape();
749 appendTestResult(aTestName
, "SKIPPED");
752 vcl::test::TestResult eResult
753 = vcl::test::OutputDeviceTestCommon::checkDropShape(aBitmap
, true);
754 appendTestResult(aTestName
, returnTestStatus(eResult
),
755 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
756 if (m_aStoreResultantBitmap
)
758 BitmapEx
aBitmapEx(aBitmap
);
759 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
763 void GraphicsRenderTests::testDrawBezierWithPolylineB2D()
765 OUString aTestName
= "testDrawBezierWithPolylineB2D";
766 GraphicsTestZone
zone(aTestName
);
767 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
768 Bitmap aBitmap
= aOutDevTest
.setupBezier();
771 appendTestResult(aTestName
, "SKIPPED");
774 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkBezier(aBitmap
);
775 appendTestResult(aTestName
, returnTestStatus(eResult
),
776 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
777 if (m_aStoreResultantBitmap
)
779 BitmapEx
aBitmapEx(aBitmap
);
780 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
784 void GraphicsRenderTests::testDrawBezierAAWithPolylineB2D()
786 OUString aTestName
= "testDrawBezierAAWithPolylineB2D";
787 GraphicsTestZone
zone(aTestName
);
788 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
789 Bitmap aBitmap
= aOutDevTest
.setupAABezier();
792 appendTestResult(aTestName
, "SKIPPED");
795 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkBezier(aBitmap
);
796 appendTestResult(aTestName
, returnTestStatus(eResult
),
797 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
798 if (m_aStoreResultantBitmap
)
800 BitmapEx
aBitmapEx(aBitmap
);
801 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
805 void GraphicsRenderTests::testDrawDropShapeWithPolygon()
807 OUString aTestName
= "testDrawDropShapeWithPolygon";
808 GraphicsTestZone
zone(aTestName
);
809 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
810 Bitmap aBitmap
= aOutDevTest
.setupDropShape();
813 appendTestResult(aTestName
, "SKIPPED");
816 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkDropShape(aBitmap
);
817 appendTestResult(aTestName
, returnTestStatus(eResult
),
818 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
819 if (m_aStoreResultantBitmap
)
821 BitmapEx
aBitmapEx(aBitmap
);
822 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
826 void GraphicsRenderTests::testDrawDropShapeAAWithPolygon()
828 OUString aTestName
= "testDrawDropShapeAAWithPolygon";
829 GraphicsTestZone
zone(aTestName
);
830 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
831 Bitmap aBitmap
= aOutDevTest
.setupAADropShape();
834 appendTestResult(aTestName
, "SKIPPED");
837 vcl::test::TestResult eResult
838 = vcl::test::OutputDeviceTestCommon::checkDropShape(aBitmap
, true);
839 appendTestResult(aTestName
, returnTestStatus(eResult
),
840 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
841 if (m_aStoreResultantBitmap
)
843 BitmapEx
aBitmapEx(aBitmap
);
844 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
848 void GraphicsRenderTests::testDrawBitmap24bpp()
850 OUString aTestName
= "testDrawBitmap24bpp";
851 GraphicsTestZone
zone(aTestName
);
852 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
853 Bitmap aBitmap
= aOutDevTest
.setupDrawBitmap(vcl::PixelFormat::N24_BPP
);
856 appendTestResult(aTestName
, "SKIPPED");
859 vcl::test::TestResult eResult
860 = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap(aBitmap
);
861 appendTestResult(aTestName
, returnTestStatus(eResult
),
862 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
863 if (m_aStoreResultantBitmap
)
865 BitmapEx
aBitmapEx(aBitmap
);
866 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
870 void GraphicsRenderTests::testDrawTransformedBitmap24bpp()
872 OUString aTestName
= "testDrawTransformedBitmap24bpp";
873 GraphicsTestZone
zone(aTestName
);
874 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
875 Bitmap aBitmap
= aOutDevTest
.setupDrawTransformedBitmap(vcl::PixelFormat::N24_BPP
);
878 appendTestResult(aTestName
, "SKIPPED");
881 vcl::test::TestResult eResult
882 = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap(aBitmap
);
883 appendTestResult(aTestName
, returnTestStatus(eResult
),
884 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
885 if (m_aStoreResultantBitmap
)
887 BitmapEx
aBitmapEx(aBitmap
);
888 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
892 void GraphicsRenderTests::testComplexDrawTransformedBitmap24bpp()
894 OUString aTestName
= "testComplexDrawTransformedBitmap24bpp";
895 GraphicsTestZone
zone(aTestName
);
896 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
897 Bitmap aBitmap
= aOutDevTest
.setupComplexDrawTransformedBitmap(vcl::PixelFormat::N24_BPP
);
900 appendTestResult(aTestName
, "SKIPPED");
903 vcl::test::TestResult eResult
904 = vcl::test::OutputDeviceTestBitmap::checkComplexTransformedBitmap(aBitmap
);
905 appendTestResult(aTestName
, returnTestStatus(eResult
),
906 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
907 if (m_aStoreResultantBitmap
)
909 BitmapEx
aBitmapEx(aBitmap
);
910 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
914 void GraphicsRenderTests::testDrawBitmapExWithAlpha24bpp()
916 OUString aTestName
= "testDrawBitmapExWithAlpha24bpp";
917 GraphicsTestZone
zone(aTestName
);
918 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
919 Bitmap aBitmap
= aOutDevTest
.setupDrawBitmapExWithAlpha(vcl::PixelFormat::N24_BPP
);
922 appendTestResult(aTestName
, "SKIPPED");
925 vcl::test::TestResult eResult
926 = vcl::test::OutputDeviceTestBitmap::checkBitmapExWithAlpha(aBitmap
);
927 appendTestResult(aTestName
, returnTestStatus(eResult
),
928 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
929 if (m_aStoreResultantBitmap
)
931 BitmapEx
aBitmapEx(aBitmap
);
932 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
936 void GraphicsRenderTests::testDrawMask24bpp()
938 OUString aTestName
= "testDrawMask24bpp";
939 GraphicsTestZone
zone(aTestName
);
940 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
941 Bitmap aBitmap
= aOutDevTest
.setupDrawMask(vcl::PixelFormat::N24_BPP
);
944 appendTestResult(aTestName
, "SKIPPED");
947 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestBitmap::checkMask(aBitmap
);
948 appendTestResult(aTestName
, returnTestStatus(eResult
),
949 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
950 if (m_aStoreResultantBitmap
)
952 BitmapEx
aBitmapEx(aBitmap
);
953 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
957 void GraphicsRenderTests::testDrawBlend24bpp()
959 OUString aTestName
= "testDrawBlend24bpp";
960 GraphicsTestZone
zone(aTestName
);
961 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
962 BitmapEx aBitmapEx
= aOutDevTest
.setupDrawBlend(vcl::PixelFormat::N24_BPP
);
965 appendTestResult(aTestName
, "SKIPPED");
968 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmapEx
);
969 appendTestResult(aTestName
, returnTestStatus(eResult
),
970 (m_aStoreResultantBitmap
? aBitmapEx
.GetBitmap() : Bitmap()));
971 if (m_aStoreResultantBitmap
)
973 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
977 void GraphicsRenderTests::testDrawXor()
979 OUString aTestName
= "testDrawXor";
980 GraphicsTestZone
zone(aTestName
);
981 vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest
;
982 Bitmap aBitmap
= aOutDevTest
.setupXOR();
985 appendTestResult(aTestName
, "SKIPPED");
988 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestAnotherOutDev::checkXOR(aBitmap
);
989 appendTestResult(aTestName
, returnTestStatus(eResult
),
990 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
991 if (m_aStoreResultantBitmap
)
993 BitmapEx
aBitmapEx(aBitmap
);
994 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
998 void GraphicsRenderTests::testClipRectangle()
1000 OUString aTestName
= "testClipRectangle";
1001 GraphicsTestZone
zone(aTestName
);
1002 vcl::test::OutputDeviceTestClip aOutDevTest
;
1003 Bitmap aBitmap
= aOutDevTest
.setupClipRectangle();
1006 appendTestResult(aTestName
, "SKIPPED");
1009 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestClip::checkClip(aBitmap
);
1010 appendTestResult(aTestName
, returnTestStatus(eResult
),
1011 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1012 if (m_aStoreResultantBitmap
)
1014 BitmapEx
aBitmapEx(aBitmap
);
1015 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1019 void GraphicsRenderTests::testClipPolygon()
1021 OUString aTestName
= "testClipPolygon";
1022 GraphicsTestZone
zone(aTestName
);
1023 vcl::test::OutputDeviceTestClip aOutDevTest
;
1024 Bitmap aBitmap
= aOutDevTest
.setupClipPolygon();
1027 appendTestResult(aTestName
, "SKIPPED");
1030 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestClip::checkClip(aBitmap
);
1031 appendTestResult(aTestName
, returnTestStatus(eResult
),
1032 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1033 if (m_aStoreResultantBitmap
)
1035 BitmapEx
aBitmapEx(aBitmap
);
1036 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1040 void GraphicsRenderTests::testClipPolyPolygon()
1042 OUString aTestName
= "testClipPolyPolygon";
1043 GraphicsTestZone
zone(aTestName
);
1044 vcl::test::OutputDeviceTestClip aOutDevTest
;
1045 Bitmap aBitmap
= aOutDevTest
.setupClipPolyPolygon();
1048 appendTestResult(aTestName
, "SKIPPED");
1051 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestClip::checkClip(aBitmap
);
1052 appendTestResult(aTestName
, returnTestStatus(eResult
),
1053 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1054 if (m_aStoreResultantBitmap
)
1056 BitmapEx
aBitmapEx(aBitmap
);
1057 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1061 void GraphicsRenderTests::testClipB2DPolyPolygon()
1063 OUString aTestName
= "testClipB2DPolyPolygon";
1064 GraphicsTestZone
zone(aTestName
);
1065 vcl::test::OutputDeviceTestClip aOutDevTest
;
1066 Bitmap aBitmap
= aOutDevTest
.setupClipB2DPolyPolygon();
1069 appendTestResult(aTestName
, "SKIPPED");
1072 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestClip::checkClip(aBitmap
);
1073 appendTestResult(aTestName
, returnTestStatus(eResult
),
1074 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1075 if (m_aStoreResultantBitmap
)
1077 BitmapEx
aBitmapEx(aBitmap
);
1078 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1082 void GraphicsRenderTests::testDrawOutDev()
1084 OUString aTestName
= "testDrawOutDev";
1085 GraphicsTestZone
zone(aTestName
);
1086 vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest
;
1087 Bitmap aBitmap
= aOutDevTest
.setupDrawOutDev();
1090 appendTestResult(aTestName
, "SKIPPED");
1093 vcl::test::TestResult eResult
1094 = vcl::test::OutputDeviceTestAnotherOutDev::checkDrawOutDev(aBitmap
);
1095 appendTestResult(aTestName
, returnTestStatus(eResult
),
1096 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1097 if (m_aStoreResultantBitmap
)
1099 BitmapEx
aBitmapEx(aBitmap
);
1100 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1104 void GraphicsRenderTests::testDrawOutDevScaledClipped()
1106 OUString aTestName
= "testDrawOutDevScaledClipped";
1107 GraphicsTestZone
zone(aTestName
);
1108 vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest
;
1109 Bitmap aBitmap
= aOutDevTest
.setupDrawOutDevScaledClipped();
1112 appendTestResult(aTestName
, "SKIPPED");
1115 vcl::test::TestResult eResult
1116 = vcl::test::OutputDeviceTestAnotherOutDev::checkDrawOutDevScaledClipped(aBitmap
);
1117 appendTestResult(aTestName
, returnTestStatus(eResult
),
1118 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1119 if (m_aStoreResultantBitmap
)
1121 BitmapEx
aBitmapEx(aBitmap
);
1122 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1126 void GraphicsRenderTests::testDrawOutDevSelf()
1128 OUString aTestName
= "testDrawOutDevSelf";
1129 GraphicsTestZone
zone(aTestName
);
1130 vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest
;
1131 Bitmap aBitmap
= aOutDevTest
.setupDrawOutDevSelf();
1134 appendTestResult(aTestName
, "SKIPPED");
1137 vcl::test::TestResult eResult
1138 = vcl::test::OutputDeviceTestAnotherOutDev::checkDrawOutDevSelf(aBitmap
);
1139 appendTestResult(aTestName
, returnTestStatus(eResult
),
1140 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1141 if (m_aStoreResultantBitmap
)
1143 BitmapEx
aBitmapEx(aBitmap
);
1144 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1148 void GraphicsRenderTests::testDashedLine()
1150 OUString aTestName
= "testDashedLine";
1151 GraphicsTestZone
zone(aTestName
);
1152 vcl::test::OutputDeviceTestLine aOutDevTest
;
1153 Bitmap aBitmap
= aOutDevTest
.setupDashedLine();
1156 appendTestResult(aTestName
, "SKIPPED");
1159 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkDashedLine(aBitmap
);
1160 appendTestResult(aTestName
, returnTestStatus(eResult
),
1161 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1162 if (m_aStoreResultantBitmap
)
1164 BitmapEx
aBitmapEx(aBitmap
);
1165 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1169 void GraphicsRenderTests::testLinearGradient()
1171 OUString aTestName
= "testLinearGradient";
1172 GraphicsTestZone
zone(aTestName
);
1173 vcl::test::OutputDeviceTestGradient aOutDevTest
;
1174 Bitmap aBitmap
= aOutDevTest
.setupLinearGradient();
1177 appendTestResult(aTestName
, "SKIPPED");
1180 vcl::test::TestResult eResult
1181 = vcl::test::OutputDeviceTestGradient::checkLinearGradient(aBitmap
);
1182 appendTestResult(aTestName
, returnTestStatus(eResult
),
1183 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1184 if (m_aStoreResultantBitmap
)
1186 BitmapEx
aBitmapEx(aBitmap
);
1187 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1191 void GraphicsRenderTests::testLinearGradientAngled()
1193 OUString aTestName
= "testLinearGradientAngled";
1194 GraphicsTestZone
zone(aTestName
);
1195 vcl::test::OutputDeviceTestGradient aOutDevTest
;
1196 Bitmap aBitmap
= aOutDevTest
.setupLinearGradientAngled();
1199 appendTestResult(aTestName
, "SKIPPED");
1202 vcl::test::TestResult eResult
1203 = vcl::test::OutputDeviceTestGradient::checkLinearGradientAngled(aBitmap
);
1204 appendTestResult(aTestName
, returnTestStatus(eResult
),
1205 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1206 if (m_aStoreResultantBitmap
)
1208 BitmapEx
aBitmapEx(aBitmap
);
1209 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1213 void GraphicsRenderTests::testLinearGradientBorder()
1215 OUString aTestName
= "testLinearGradientBorder";
1216 GraphicsTestZone
zone(aTestName
);
1217 vcl::test::OutputDeviceTestGradient aOutDevTest
;
1218 Bitmap aBitmap
= aOutDevTest
.setupLinearGradientBorder();
1221 appendTestResult(aTestName
, "SKIPPED");
1224 vcl::test::TestResult eResult
1225 = vcl::test::OutputDeviceTestGradient::checkLinearGradientBorder(aBitmap
);
1226 appendTestResult(aTestName
, returnTestStatus(eResult
),
1227 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1228 if (m_aStoreResultantBitmap
)
1230 BitmapEx
aBitmapEx(aBitmap
);
1231 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1235 void GraphicsRenderTests::testLinearGradientIntensity()
1237 OUString aTestName
= "testLinearGradientIntensity";
1238 GraphicsTestZone
zone(aTestName
);
1239 vcl::test::OutputDeviceTestGradient aOutDevTest
;
1240 Bitmap aBitmap
= aOutDevTest
.setupLinearGradientIntensity();
1243 appendTestResult(aTestName
, "SKIPPED");
1246 vcl::test::TestResult eResult
1247 = vcl::test::OutputDeviceTestGradient::checkLinearGradientIntensity(aBitmap
);
1248 appendTestResult(aTestName
, returnTestStatus(eResult
),
1249 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1250 if (m_aStoreResultantBitmap
)
1252 BitmapEx
aBitmapEx(aBitmap
);
1253 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1257 void GraphicsRenderTests::testLinearGradientSteps()
1259 OUString aTestName
= "testLinearGradientSteps";
1260 GraphicsTestZone
zone(aTestName
);
1261 vcl::test::OutputDeviceTestGradient aOutDevTest
;
1262 Bitmap aBitmap
= aOutDevTest
.setupLinearGradientSteps();
1265 appendTestResult(aTestName
, "SKIPPED");
1268 vcl::test::TestResult eResult
1269 = vcl::test::OutputDeviceTestGradient::checkLinearGradientSteps(aBitmap
);
1270 appendTestResult(aTestName
, returnTestStatus(eResult
),
1271 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1272 if (m_aStoreResultantBitmap
)
1274 BitmapEx
aBitmapEx(aBitmap
);
1275 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1279 void GraphicsRenderTests::testAxialGradient()
1281 OUString aTestName
= "testAxialGradient";
1282 GraphicsTestZone
zone(aTestName
);
1283 vcl::test::OutputDeviceTestGradient aOutDevTest
;
1284 Bitmap aBitmap
= aOutDevTest
.setupAxialGradient();
1287 appendTestResult(aTestName
, "SKIPPED");
1290 vcl::test::TestResult eResult
1291 = vcl::test::OutputDeviceTestGradient::checkAxialGradient(aBitmap
);
1292 appendTestResult(aTestName
, returnTestStatus(eResult
),
1293 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1294 if (m_aStoreResultantBitmap
)
1296 BitmapEx
aBitmapEx(aBitmap
);
1297 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1301 void GraphicsRenderTests::testRadialGradient()
1303 OUString aTestName
= "testRadialGradient";
1304 GraphicsTestZone
zone(aTestName
);
1305 vcl::test::OutputDeviceTestGradient aOutDevTest
;
1306 Bitmap aBitmap
= aOutDevTest
.setupRadialGradient();
1309 appendTestResult(aTestName
, "SKIPPED");
1312 vcl::test::TestResult eResult
1313 = vcl::test::OutputDeviceTestGradient::checkRadialGradient(aBitmap
);
1314 appendTestResult(aTestName
, returnTestStatus(eResult
),
1315 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1316 if (m_aStoreResultantBitmap
)
1318 BitmapEx
aBitmapEx(aBitmap
);
1319 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1323 void GraphicsRenderTests::testRadialGradientOfs()
1325 OUString aTestName
= "testRadialGradientOfs";
1326 GraphicsTestZone
zone(aTestName
);
1327 vcl::test::OutputDeviceTestGradient aOutDevTest
;
1328 Bitmap aBitmap
= aOutDevTest
.setupRadialGradientOfs();
1331 appendTestResult(aTestName
, "SKIPPED");
1334 vcl::test::TestResult eResult
1335 = vcl::test::OutputDeviceTestGradient::checkRadialGradientOfs(aBitmap
);
1336 appendTestResult(aTestName
, returnTestStatus(eResult
),
1337 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1340 void GraphicsRenderTests::testLineJoinBevel()
1342 OUString aTestName
= "testLineJoinBevel";
1343 GraphicsTestZone
zone(aTestName
);
1344 vcl::test::OutputDeviceTestLine aOutDevTest
;
1345 Bitmap aBitmap
= aOutDevTest
.setupLineJoinBevel();
1348 appendTestResult(aTestName
, "SKIPPED");
1351 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkLineJoinBevel(aBitmap
);
1352 appendTestResult(aTestName
, returnTestStatus(eResult
),
1353 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1354 if (m_aStoreResultantBitmap
)
1356 BitmapEx
aBitmapEx(aBitmap
);
1357 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1361 void GraphicsRenderTests::testLineJoinRound()
1363 OUString aTestName
= "testLineJoinRound";
1364 GraphicsTestZone
zone(aTestName
);
1365 vcl::test::OutputDeviceTestLine aOutDevTest
;
1366 Bitmap aBitmap
= aOutDevTest
.setupLineJoinRound();
1369 appendTestResult(aTestName
, "SKIPPED");
1372 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkLineJoinRound(aBitmap
);
1373 appendTestResult(aTestName
, returnTestStatus(eResult
),
1374 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1375 if (m_aStoreResultantBitmap
)
1377 BitmapEx
aBitmapEx(aBitmap
);
1378 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1382 void GraphicsRenderTests::testLineJoinMiter()
1384 OUString aTestName
= "testLineJoinMiter";
1385 GraphicsTestZone
zone(aTestName
);
1386 vcl::test::OutputDeviceTestLine aOutDevTest
;
1387 Bitmap aBitmap
= aOutDevTest
.setupLineJoinMiter();
1390 appendTestResult(aTestName
, "SKIPPED");
1393 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkLineJoinMiter(aBitmap
);
1394 appendTestResult(aTestName
, returnTestStatus(eResult
),
1395 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1396 if (m_aStoreResultantBitmap
)
1398 BitmapEx
aBitmapEx(aBitmap
);
1399 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1403 void GraphicsRenderTests::testLineJoinNone()
1405 OUString aTestName
= "testLineJoinNone";
1406 GraphicsTestZone
zone(aTestName
);
1407 vcl::test::OutputDeviceTestLine aOutDevTest
;
1408 Bitmap aBitmap
= aOutDevTest
.setupLineJoinNone();
1411 appendTestResult(aTestName
, "SKIPPED");
1414 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkLineJoinNone(aBitmap
);
1415 appendTestResult(aTestName
, returnTestStatus(eResult
),
1416 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1417 if (m_aStoreResultantBitmap
)
1419 BitmapEx
aBitmapEx(aBitmap
);
1420 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1424 void GraphicsRenderTests::testLineCapRound()
1426 OUString aTestName
= "testLineCapRound";
1427 GraphicsTestZone
zone(aTestName
);
1428 vcl::test::OutputDeviceTestLine aOutDevTest
;
1429 Bitmap aBitmap
= aOutDevTest
.setupLineCapRound();
1432 appendTestResult(aTestName
, "SKIPPED");
1435 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkLineCapRound(aBitmap
);
1436 appendTestResult(aTestName
, returnTestStatus(eResult
),
1437 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1438 if (m_aStoreResultantBitmap
)
1440 BitmapEx
aBitmapEx(aBitmap
);
1441 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1445 void GraphicsRenderTests::testLineCapSquare()
1447 OUString aTestName
= "testLineCapSquare";
1448 GraphicsTestZone
zone(aTestName
);
1449 vcl::test::OutputDeviceTestLine aOutDevTest
;
1450 Bitmap aBitmap
= aOutDevTest
.setupLineCapSquare();
1453 appendTestResult(aTestName
, "SKIPPED");
1456 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkLineCapSquare(aBitmap
);
1457 appendTestResult(aTestName
, returnTestStatus(eResult
),
1458 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1459 if (m_aStoreResultantBitmap
)
1461 BitmapEx
aBitmapEx(aBitmap
);
1462 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1466 void GraphicsRenderTests::testLineCapButt()
1468 OUString aTestName
= "testLineCapButt";
1469 GraphicsTestZone
zone(aTestName
);
1470 vcl::test::OutputDeviceTestLine aOutDevTest
;
1471 Bitmap aBitmap
= aOutDevTest
.setupLineCapButt();
1474 appendTestResult(aTestName
, "SKIPPED");
1477 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkLineCapButt(aBitmap
);
1478 appendTestResult(aTestName
, returnTestStatus(eResult
),
1479 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1480 if (m_aStoreResultantBitmap
)
1482 BitmapEx
aBitmapEx(aBitmap
);
1483 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1487 void GraphicsRenderTests::testHalfEllipseWithPolyLine()
1489 OUString aTestName
= "testHalfEllipseWithPolyLine";
1490 GraphicsTestZone
zone(aTestName
);
1491 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
1492 Bitmap aBitmap
= aOutDevTest
.setupHalfEllipse();
1495 appendTestResult(aTestName
, "SKIPPED");
1498 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkHalfEllipse(aBitmap
);
1499 appendTestResult(aTestName
, returnTestStatus(eResult
),
1500 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1501 if (m_aStoreResultantBitmap
)
1503 BitmapEx
aBitmapEx(aBitmap
);
1504 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1508 void GraphicsRenderTests::testHalfEllipseAAWithPolyLine()
1510 OUString aTestName
= "testHalfEllipseAAWithPolyLine";
1511 GraphicsTestZone
zone(aTestName
);
1512 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
1513 Bitmap aBitmap
= aOutDevTest
.setupHalfEllipse(true);
1516 appendTestResult(aTestName
, "SKIPPED");
1519 vcl::test::TestResult eResult
1520 = vcl::test::OutputDeviceTestLine::checkHalfEllipse(aBitmap
, true);
1521 appendTestResult(aTestName
, returnTestStatus(eResult
),
1522 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1523 if (m_aStoreResultantBitmap
)
1525 BitmapEx
aBitmapEx(aBitmap
);
1526 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1530 void GraphicsRenderTests::testHalfEllipseWithPolyLineB2D()
1532 OUString aTestName
= "testHalfEllipseWithPolyLineB2D";
1533 GraphicsTestZone
zone(aTestName
);
1534 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
1535 Bitmap aBitmap
= aOutDevTest
.setupHalfEllipse();
1538 appendTestResult(aTestName
, "SKIPPED");
1541 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkHalfEllipse(aBitmap
);
1542 appendTestResult(aTestName
, returnTestStatus(eResult
),
1543 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1544 if (m_aStoreResultantBitmap
)
1546 BitmapEx
aBitmapEx(aBitmap
);
1547 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1551 void GraphicsRenderTests::testHalfEllipseAAWithPolyLineB2D()
1553 OUString aTestName
= "testHalfEllipseAAWithPolyLineB2D";
1554 GraphicsTestZone
zone(aTestName
);
1555 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
1556 Bitmap aBitmap
= aOutDevTest
.setupHalfEllipse(true);
1559 appendTestResult(aTestName
, "SKIPPED");
1562 vcl::test::TestResult eResult
1563 = vcl::test::OutputDeviceTestLine::checkHalfEllipse(aBitmap
, true);
1564 appendTestResult(aTestName
, returnTestStatus(eResult
),
1565 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1566 if (m_aStoreResultantBitmap
)
1568 BitmapEx
aBitmapEx(aBitmap
);
1569 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1573 void GraphicsRenderTests::testHalfEllipseWithPolygon()
1575 OUString aTestName
= "testHalfEllipseWithPolygon";
1576 GraphicsTestZone
zone(aTestName
);
1577 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
1578 Bitmap aBitmap
= aOutDevTest
.setupHalfEllipse();
1581 appendTestResult(aTestName
, "SKIPPED");
1584 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkHalfEllipse(aBitmap
);
1585 appendTestResult(aTestName
, returnTestStatus(eResult
),
1586 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1587 if (m_aStoreResultantBitmap
)
1589 BitmapEx
aBitmapEx(aBitmap
);
1590 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1594 void GraphicsRenderTests::testClosedBezierWithPolyline()
1596 OUString aTestName
= "testClosedBezierWithPolyline";
1597 GraphicsTestZone
zone(aTestName
);
1598 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
1599 Bitmap aBitmap
= aOutDevTest
.setupClosedBezier();
1602 appendTestResult(aTestName
, "SKIPPED");
1605 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkClosedBezier(aBitmap
);
1606 appendTestResult(aTestName
, returnTestStatus(eResult
),
1607 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1608 if (m_aStoreResultantBitmap
)
1610 BitmapEx
aBitmapEx(aBitmap
);
1611 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1615 void GraphicsRenderTests::testClosedBezierWithPolygon()
1617 OUString aTestName
= "testClosedBezierWithPolygon";
1618 GraphicsTestZone
zone(aTestName
);
1619 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
1620 Bitmap aBitmap
= aOutDevTest
.setupClosedBezier();
1623 appendTestResult(aTestName
, "SKIPPED");
1626 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkClosedBezier(aBitmap
);
1627 appendTestResult(aTestName
, returnTestStatus(eResult
),
1628 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1629 if (m_aStoreResultantBitmap
)
1631 BitmapEx
aBitmapEx(aBitmap
);
1632 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1636 void GraphicsRenderTests::testHalfEllipseAAWithPolygon()
1638 OUString aTestName
= "testHalfEllipseAAWithPolygon";
1639 GraphicsTestZone
zone(aTestName
);
1640 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
1641 Bitmap aBitmap
= aOutDevTest
.setupHalfEllipse(true);
1644 appendTestResult(aTestName
, "SKIPPED");
1647 vcl::test::TestResult eResult
1648 = vcl::test::OutputDeviceTestLine::checkHalfEllipse(aBitmap
, true);
1649 appendTestResult(aTestName
, returnTestStatus(eResult
),
1650 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1651 if (m_aStoreResultantBitmap
)
1653 BitmapEx
aBitmapEx(aBitmap
);
1654 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1658 void GraphicsRenderTests::testFilledAsymmetricalDropShape()
1660 OUString aTestName
= "testFilledAsymmetricalDropShape";
1661 GraphicsTestZone
zone(aTestName
);
1662 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
1663 Bitmap aBitmap
= aOutDevTest
.setupFilledAsymmetricalDropShape();
1664 vcl::test::TestResult eResult
1665 = vcl::test::OutputDeviceTestLine::checkFilledAsymmetricalDropShape(aBitmap
);
1666 appendTestResult(aTestName
, returnTestStatus(eResult
),
1667 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1668 if (m_aStoreResultantBitmap
)
1670 BitmapEx
aBitmapEx(aBitmap
);
1671 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1675 void GraphicsRenderTests::testTextDrawing()
1677 OUString aTestName
= "testTextDrawing";
1678 GraphicsTestZone
zone(aTestName
);
1679 vcl::test::OutputDeviceTestText aOutDevTest
;
1680 Bitmap aBitmap
= aOutDevTest
.setupTextBitmap();
1683 appendTestResult(aTestName
, "SKIPPED");
1686 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestLine::checkTextLocation(aBitmap
);
1687 appendTestResult(aTestName
, returnTestStatus(eResult
),
1688 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1689 if (m_aStoreResultantBitmap
)
1691 BitmapEx
aBitmapEx(aBitmap
);
1692 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1696 void GraphicsRenderTests::testEvenOddRuleInIntersectingRectsWithPolyPolygon()
1698 OUString aTestName
= "testEvenOddRuleInIntersectingRectsWithPolyPolygon";
1699 GraphicsTestZone
zone(aTestName
);
1700 vcl::test::OutputDeviceTestPolyPolygon aOutDevTest
;
1701 Bitmap aBitmap
= aOutDevTest
.setupIntersectingRectangles();
1704 appendTestResult(aTestName
, "SKIPPED");
1707 vcl::test::TestResult eResult
1708 = vcl::test::OutputDeviceTestLine::checkEvenOddRuleInIntersectingRecs(aBitmap
);
1709 appendTestResult(aTestName
, returnTestStatus(eResult
),
1710 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1711 if (m_aStoreResultantBitmap
)
1713 BitmapEx
aBitmapEx(aBitmap
);
1714 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1718 void GraphicsRenderTests::testEvenOddRuleInIntersectingRectsWithPolyPolygonB2D()
1720 OUString aTestName
= "testEvenOddRuleInIntersectingRectsWithPolyPolygonB2D";
1721 GraphicsTestZone
zone(aTestName
);
1722 vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest
;
1723 Bitmap aBitmap
= aOutDevTest
.setupIntersectingRectangles();
1726 appendTestResult(aTestName
, "SKIPPED");
1729 vcl::test::TestResult eResult
1730 = vcl::test::OutputDeviceTestLine::checkEvenOddRuleInIntersectingRecs(aBitmap
);
1731 appendTestResult(aTestName
, returnTestStatus(eResult
),
1732 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1733 if (m_aStoreResultantBitmap
)
1735 BitmapEx
aBitmapEx(aBitmap
);
1736 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1740 void GraphicsRenderTests::testDrawBitmap8bppGreyScale()
1742 OUString aTestName
= "testDrawBitmap8bppGreyScale";
1743 GraphicsTestZone
zone(aTestName
);
1744 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
1745 Bitmap aBitmap
= aOutDevTest
.setupDrawBitmap(vcl::PixelFormat::N8_BPP
, true);
1748 appendTestResult(aTestName
, "SKIPPED");
1751 vcl::test::TestResult eResult
1752 = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap8bppGreyScale(aBitmap
);
1753 appendTestResult(aTestName
, returnTestStatus(eResult
),
1754 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1755 if (m_aStoreResultantBitmap
)
1757 BitmapEx
aBitmapEx(aBitmap
);
1758 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1762 void GraphicsRenderTests::testDrawTransformedBitmap8bppGreyScale()
1764 OUString aTestName
= "testDrawTransformedBitmap8bppGreyScale";
1765 GraphicsTestZone
zone(aTestName
);
1766 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
1767 Bitmap aBitmap
= aOutDevTest
.setupDrawTransformedBitmap(vcl::PixelFormat::N8_BPP
, true);
1770 appendTestResult(aTestName
, "SKIPPED");
1773 vcl::test::TestResult eResult
1774 = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap8bppGreyScale(aBitmap
);
1775 appendTestResult(aTestName
, returnTestStatus(eResult
),
1776 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1777 if (m_aStoreResultantBitmap
)
1779 BitmapEx
aBitmapEx(aBitmap
);
1780 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1784 void GraphicsRenderTests::testDrawBitmap32bpp()
1786 OUString aTestName
= "testDrawBitmap32bpp";
1787 GraphicsTestZone
zone(aTestName
);
1788 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
1789 Bitmap aBitmap
= aOutDevTest
.setupDrawBitmap(vcl::PixelFormat::N32_BPP
);
1790 if (!SHOULD_ASSERT
|| !is32bppSupported())
1792 appendTestResult(aTestName
, "SKIPPED");
1795 vcl::test::TestResult eResult
1796 = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap(aBitmap
);
1797 appendTestResult(aTestName
, returnTestStatus(eResult
),
1798 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1799 if (m_aStoreResultantBitmap
)
1801 BitmapEx
aBitmapEx(aBitmap
);
1802 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1806 void GraphicsRenderTests::testDrawTransformedBitmap32bpp()
1808 OUString aTestName
= "testDrawTransformedBitmap32bpp";
1809 GraphicsTestZone
zone(aTestName
);
1810 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
1811 Bitmap aBitmap
= aOutDevTest
.setupDrawTransformedBitmap(vcl::PixelFormat::N32_BPP
);
1812 if (!SHOULD_ASSERT
|| !is32bppSupported())
1814 appendTestResult(aTestName
, "SKIPPED");
1817 vcl::test::TestResult eResult
1818 = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap(aBitmap
);
1819 appendTestResult(aTestName
, returnTestStatus(eResult
),
1820 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1821 if (m_aStoreResultantBitmap
)
1823 BitmapEx
aBitmapEx(aBitmap
);
1824 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1828 void GraphicsRenderTests::testDrawBitmapExWithAlpha32bpp()
1830 OUString aTestName
= "testDrawBitmapExWithAlpha32bpp";
1831 GraphicsTestZone
zone(aTestName
);
1832 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
1833 Bitmap aBitmap
= aOutDevTest
.setupDrawBitmapExWithAlpha(vcl::PixelFormat::N32_BPP
);
1834 if (!SHOULD_ASSERT
|| !is32bppSupported())
1836 appendTestResult(aTestName
, "SKIPPED");
1839 vcl::test::TestResult eResult
1840 = vcl::test::OutputDeviceTestBitmap::checkBitmapExWithAlpha(aBitmap
);
1841 appendTestResult(aTestName
, returnTestStatus(eResult
),
1842 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1843 if (m_aStoreResultantBitmap
)
1845 BitmapEx
aBitmapEx(aBitmap
);
1846 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1850 void GraphicsRenderTests::testDrawMask32bpp()
1852 OUString aTestName
= "testDrawMask32bpp";
1853 GraphicsTestZone
zone(aTestName
);
1854 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
1855 Bitmap aBitmap
= aOutDevTest
.setupDrawMask(vcl::PixelFormat::N32_BPP
);
1856 if (!SHOULD_ASSERT
|| !is32bppSupported())
1858 appendTestResult(aTestName
, "SKIPPED");
1861 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestBitmap::checkMask(aBitmap
);
1862 appendTestResult(aTestName
, returnTestStatus(eResult
),
1863 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1864 if (m_aStoreResultantBitmap
)
1866 BitmapEx
aBitmapEx(aBitmap
);
1867 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1871 void GraphicsRenderTests::testDrawBlend32bpp()
1873 OUString aTestName
= "testDrawBlend32bpp";
1874 GraphicsTestZone
zone(aTestName
);
1875 vcl::test::OutputDeviceTestBitmap aOutDevTest
;
1876 BitmapEx aBitmapEx
= aOutDevTest
.setupDrawBlend(vcl::PixelFormat::N32_BPP
);
1877 if (!SHOULD_ASSERT
|| !is32bppSupported())
1879 appendTestResult(aTestName
, "SKIPPED");
1882 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmapEx
);
1883 appendTestResult(aTestName
, returnTestStatus(eResult
),
1884 (m_aStoreResultantBitmap
? aBitmapEx
.GetBitmap() : Bitmap()));
1885 if (m_aStoreResultantBitmap
)
1887 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1891 void GraphicsRenderTests::testDrawRectangleOnSize1028WithRect()
1893 OUString aTestName
= "testDrawRectangleOnSize1028WithRect";
1894 GraphicsTestZone
zone(aTestName
);
1895 vcl::test::OutputDeviceTestRect aOutDevTest
;
1896 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize1028();
1897 m_aCurGraphicsBackend
= aOutDevTest
.getRenderBackendName();
1900 appendTestResult(aTestName
, "SKIPPED");
1903 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
1904 appendTestResult(aTestName
, returnTestStatus(eResult
),
1905 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1906 if (m_aStoreResultantBitmap
)
1908 BitmapEx
aBitmapEx(aBitmap
);
1909 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1913 void GraphicsRenderTests::testDrawRectangleOnSize4096WithRect()
1915 OUString aTestName
= "testDrawRectangleOnSize4096WithRect";
1916 GraphicsTestZone
zone(aTestName
);
1917 vcl::test::OutputDeviceTestRect aOutDevTest
;
1918 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize4096();
1919 m_aCurGraphicsBackend
= aOutDevTest
.getRenderBackendName();
1922 appendTestResult(aTestName
, "SKIPPED");
1925 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
1926 appendTestResult(aTestName
, returnTestStatus(eResult
),
1927 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1928 if (m_aStoreResultantBitmap
)
1930 BitmapEx
aBitmapEx(aBitmap
);
1931 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1935 void GraphicsRenderTests::testDrawRectangleOnSize1028WithPixel()
1937 OUString aTestName
= "testDrawRectangleOnSize1028WithPixel";
1938 GraphicsTestZone
zone(aTestName
);
1939 vcl::test::OutputDeviceTestPixel aOutDevTest
;
1940 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize1028();
1943 appendTestResult(aTestName
, "SKIPPED");
1946 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
1947 appendTestResult(aTestName
, returnTestStatus(eResult
),
1948 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1949 if (m_aStoreResultantBitmap
)
1951 BitmapEx
aBitmapEx(aBitmap
);
1952 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1956 void GraphicsRenderTests::testDrawRectangleOnSize4096WithPixel()
1958 OUString aTestName
= "testDrawRectangleOnSize4096WithPixel";
1959 GraphicsTestZone
zone(aTestName
);
1960 vcl::test::OutputDeviceTestPixel aOutDevTest
;
1961 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize4096();
1964 appendTestResult(aTestName
, "SKIPPED");
1967 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
1968 appendTestResult(aTestName
, returnTestStatus(eResult
),
1969 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1970 if (m_aStoreResultantBitmap
)
1972 BitmapEx
aBitmapEx(aBitmap
);
1973 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1977 void GraphicsRenderTests::testDrawRectangleOnSize1028WithLine()
1979 OUString aTestName
= "testDrawRectangleOnSize1028WithLine";
1980 GraphicsTestZone
zone(aTestName
);
1981 vcl::test::OutputDeviceTestLine aOutDevTest
;
1982 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize1028();
1985 appendTestResult(aTestName
, "SKIPPED");
1988 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
1989 appendTestResult(aTestName
, returnTestStatus(eResult
),
1990 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
1991 if (m_aStoreResultantBitmap
)
1993 BitmapEx
aBitmapEx(aBitmap
);
1994 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
1998 void GraphicsRenderTests::testDrawRectangleOnSize4096WithLine()
2000 OUString aTestName
= "testDrawRectangleOnSize4096WithLine";
2001 GraphicsTestZone
zone(aTestName
);
2002 vcl::test::OutputDeviceTestLine aOutDevTest
;
2003 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize4096();
2006 appendTestResult(aTestName
, "SKIPPED");
2009 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2010 appendTestResult(aTestName
, returnTestStatus(eResult
),
2011 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2012 if (m_aStoreResultantBitmap
)
2014 BitmapEx
aBitmapEx(aBitmap
);
2015 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2019 void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyLine()
2021 OUString aTestName
= "testDrawRectangleOnSize1028WithPolyLine";
2022 GraphicsTestZone
zone(aTestName
);
2023 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
2024 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize1028();
2027 appendTestResult(aTestName
, "SKIPPED");
2030 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2031 appendTestResult(aTestName
, returnTestStatus(eResult
),
2032 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2033 if (m_aStoreResultantBitmap
)
2035 BitmapEx
aBitmapEx(aBitmap
);
2036 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2040 void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolyLine()
2042 OUString aTestName
= "testDrawRectangleOnSize4096WithPolyLine";
2043 GraphicsTestZone
zone(aTestName
);
2044 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
2045 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize4096();
2048 appendTestResult(aTestName
, "SKIPPED");
2051 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2052 appendTestResult(aTestName
, returnTestStatus(eResult
),
2053 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2054 if (m_aStoreResultantBitmap
)
2056 BitmapEx
aBitmapEx(aBitmap
);
2057 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2061 void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolygon()
2063 OUString aTestName
= "testDrawRectangleOnSize1028WithPolygon";
2064 GraphicsTestZone
zone(aTestName
);
2065 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
2066 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize1028();
2069 appendTestResult(aTestName
, "SKIPPED");
2072 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2073 appendTestResult(aTestName
, returnTestStatus(eResult
),
2074 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2075 if (m_aStoreResultantBitmap
)
2077 BitmapEx
aBitmapEx(aBitmap
);
2078 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2082 void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolygon()
2084 OUString aTestName
= "testDrawRectangleOnSize4096WithPolygon";
2085 GraphicsTestZone
zone(aTestName
);
2086 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
2087 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize4096();
2090 appendTestResult(aTestName
, "SKIPPED");
2093 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2094 appendTestResult(aTestName
, returnTestStatus(eResult
),
2095 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2096 if (m_aStoreResultantBitmap
)
2098 BitmapEx
aBitmapEx(aBitmap
);
2099 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2103 void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyLineB2D()
2105 OUString aTestName
= "testDrawRectangleOnSize1028WithPolyLineB2D";
2106 GraphicsTestZone
zone(aTestName
);
2107 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
2108 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize1028();
2111 appendTestResult(aTestName
, "SKIPPED");
2114 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2115 appendTestResult(aTestName
, returnTestStatus(eResult
),
2116 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2117 if (m_aStoreResultantBitmap
)
2119 BitmapEx
aBitmapEx(aBitmap
);
2120 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2124 void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolyLineB2D()
2126 OUString aTestName
= "testDrawRectangleOnSize4096WithPolyLineB2D";
2127 GraphicsTestZone
zone(aTestName
);
2128 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
2129 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize4096();
2132 appendTestResult(aTestName
, "SKIPPED");
2135 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2136 appendTestResult(aTestName
, returnTestStatus(eResult
),
2137 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2138 if (m_aStoreResultantBitmap
)
2140 BitmapEx
aBitmapEx(aBitmap
);
2141 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2145 void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyPolygon()
2147 OUString aTestName
= "testDrawRectangleOnSize1028WithPolyPolygon";
2148 GraphicsTestZone
zone(aTestName
);
2149 vcl::test::OutputDeviceTestPolyPolygon aOutDevTest
;
2150 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize1028();
2153 appendTestResult(aTestName
, "SKIPPED");
2156 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2157 appendTestResult(aTestName
, returnTestStatus(eResult
),
2158 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2159 if (m_aStoreResultantBitmap
)
2161 BitmapEx
aBitmapEx(aBitmap
);
2162 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2166 void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolyPolygon()
2168 OUString aTestName
= "testDrawRectangleOnSize4096WithPolyPolygon";
2169 GraphicsTestZone
zone(aTestName
);
2170 vcl::test::OutputDeviceTestPolyPolygon aOutDevTest
;
2171 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize4096();
2174 appendTestResult(aTestName
, "SKIPPED");
2177 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2178 appendTestResult(aTestName
, returnTestStatus(eResult
),
2179 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2180 if (m_aStoreResultantBitmap
)
2182 BitmapEx
aBitmapEx(aBitmap
);
2183 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2187 void GraphicsRenderTests::testDrawRectangleOnSize1028WithPolyPolygonB2D()
2189 OUString aTestName
= "testDrawRectangleOnSize1028WithPolyPolygonB2D";
2190 GraphicsTestZone
zone(aTestName
);
2191 vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest
;
2192 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize1028();
2195 appendTestResult(aTestName
, "SKIPPED");
2198 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2199 appendTestResult(aTestName
, returnTestStatus(eResult
),
2200 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2201 if (m_aStoreResultantBitmap
)
2203 BitmapEx
aBitmapEx(aBitmap
);
2204 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2208 void GraphicsRenderTests::testDrawRectangleOnSize4096WithPolygonPolygonB2D()
2210 OUString aTestName
= "testDrawRectangleOnSize4096WithPolygonPolygonB2D";
2211 GraphicsTestZone
zone(aTestName
);
2212 vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest
;
2213 Bitmap aBitmap
= aOutDevTest
.setupRectangleOnSize4096();
2216 appendTestResult(aTestName
, "SKIPPED");
2219 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkRectangles(aBitmap
);
2220 appendTestResult(aTestName
, returnTestStatus(eResult
),
2221 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2222 if (m_aStoreResultantBitmap
)
2224 BitmapEx
aBitmapEx(aBitmap
);
2225 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2229 void GraphicsRenderTests::testDrawOpenPolygonWithPolyLine()
2231 OUString aTestName
= "testDrawOpenPolygonWithPolyLine";
2232 GraphicsTestZone
zone(aTestName
);
2233 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
2234 Bitmap aBitmap
= aOutDevTest
.setupOpenPolygon();
2237 appendTestResult(aTestName
, "SKIPPED");
2240 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap
);
2241 appendTestResult(aTestName
, returnTestStatus(eResult
),
2242 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2243 if (m_aStoreResultantBitmap
)
2245 BitmapEx
aBitmapEx(aBitmap
);
2246 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2250 void GraphicsRenderTests::testDrawOpenPolygonWithPolyLineB2D()
2252 OUString aTestName
= "testDrawOpenPolygonWithPolyLineB2D";
2253 GraphicsTestZone
zone(aTestName
);
2254 vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest
;
2255 Bitmap aBitmap
= aOutDevTest
.setupOpenPolygon();
2258 appendTestResult(aTestName
, "SKIPPED");
2261 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap
);
2262 appendTestResult(aTestName
, returnTestStatus(eResult
),
2263 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2264 if (m_aStoreResultantBitmap
)
2266 BitmapEx
aBitmapEx(aBitmap
);
2267 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2271 void GraphicsRenderTests::testDrawOpenPolygonWithPolygon()
2273 OUString aTestName
= "testDrawOpenPolygonWithPolygon";
2274 GraphicsTestZone
zone(aTestName
);
2275 vcl::test::OutputDeviceTestPolygon aOutDevTest
;
2276 Bitmap aBitmap
= aOutDevTest
.setupOpenPolygon();
2279 appendTestResult(aTestName
, "SKIPPED");
2282 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap
);
2283 appendTestResult(aTestName
, returnTestStatus(eResult
),
2284 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2285 if (m_aStoreResultantBitmap
)
2287 BitmapEx
aBitmapEx(aBitmap
);
2288 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2292 void GraphicsRenderTests::testDrawOpenPolygonWithPolyPolygon()
2294 OUString aTestName
= "testDrawOpenPolygonWithPolyPolygon";
2295 GraphicsTestZone
zone(aTestName
);
2296 vcl::test::OutputDeviceTestPolyPolygon aOutDevTest
;
2297 Bitmap aBitmap
= aOutDevTest
.setupOpenPolygon();
2300 appendTestResult(aTestName
, "SKIPPED");
2303 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap
);
2304 appendTestResult(aTestName
, returnTestStatus(eResult
),
2305 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2306 if (m_aStoreResultantBitmap
)
2308 BitmapEx
aBitmapEx(aBitmap
);
2309 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2313 void GraphicsRenderTests::testDrawOpenPolygonWithPolyPolygonB2D()
2315 OUString aTestName
= "testDrawOpenPolygonWithPolyPolygonB2D";
2316 GraphicsTestZone
zone(aTestName
);
2317 vcl::test::OutputDeviceTestPolyPolygon aOutDevTest
;
2318 Bitmap aBitmap
= aOutDevTest
.setupOpenPolygon();
2321 appendTestResult(aTestName
, "SKIPPED");
2324 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkOpenPolygon(aBitmap
);
2325 appendTestResult(aTestName
, returnTestStatus(eResult
),
2326 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2327 if (m_aStoreResultantBitmap
)
2329 BitmapEx
aBitmapEx(aBitmap
);
2330 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2334 void GraphicsRenderTests::testDrawOpenBezierWithPolyLine()
2336 OUString aTestName
= "testDrawOpenBezierWithPolyLine";
2337 GraphicsTestZone
zone(aTestName
);
2338 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
2339 Bitmap aBitmap
= aOutDevTest
.setupOpenBezier();
2342 appendTestResult(aTestName
, "SKIPPED");
2345 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkOpenBezier(aBitmap
);
2346 appendTestResult(aTestName
, returnTestStatus(eResult
),
2347 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2348 if (m_aStoreResultantBitmap
)
2350 BitmapEx
aBitmapEx(aBitmap
);
2351 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2355 void GraphicsRenderTests::testDrawOpenBezierWithPolyLineB2D()
2357 OUString aTestName
= "testDrawOpenBezierWithPolyLineB2D";
2358 GraphicsTestZone
zone(aTestName
);
2359 vcl::test::OutputDeviceTestPolyLine aOutDevTest
;
2360 Bitmap aBitmap
= aOutDevTest
.setupOpenBezier();
2363 appendTestResult(aTestName
, "SKIPPED");
2366 vcl::test::TestResult eResult
= vcl::test::OutputDeviceTestCommon::checkOpenBezier(aBitmap
);
2367 appendTestResult(aTestName
, returnTestStatus(eResult
),
2368 (m_aStoreResultantBitmap
? aBitmap
: Bitmap()));
2369 if (m_aStoreResultantBitmap
)
2371 BitmapEx
aBitmapEx(aBitmap
);
2372 exportBitmapExToImage(m_aUserInstallPath
+ aTestName
+ ".png", aBitmapEx
);
2376 void GraphicsRenderTests::runALLTests()
2378 testDrawRectWithRectangle();
2379 testDrawRectWithPixel();
2380 testDrawRectWithLine();
2381 testDrawRectWithPolygon();
2382 testDrawRectWithPolyLine();
2383 testDrawRectWithPolyLineB2D();
2384 testDrawRectWithPolyPolygon();
2385 testDrawRectWithPolyPolygonB2D();
2386 testDrawRectAAWithRectangle();
2387 testDrawRectAAWithPixel();
2388 testDrawRectAAWithLine();
2389 testDrawRectAAWithPolygon();
2390 testDrawRectAAWithPolyLine();
2391 testDrawRectAAWithPolyLineB2D();
2392 testDrawRectAAWithPolyPolygon();
2393 testDrawRectAAWithPolyPolygonB2D();
2394 testDrawFilledRectWithRectangle();
2395 testDrawFilledRectWithPolygon();
2396 testDrawFilledRectWithPolyPolygon();
2397 testDrawFilledRectWithPolyPolygon2D();
2398 testDrawDiamondWithPolygon();
2399 testDrawDiamondWithLine();
2400 testDrawDiamondWithPolyline();
2401 testDrawDiamondWithPolylineB2D();
2402 testDrawInvertWithRectangle();
2403 testDrawInvertN50WithRectangle();
2404 testDrawInvertTrackFrameWithRectangle();
2405 testDrawBezierWithPolylineB2D();
2406 testDrawBezierAAWithPolylineB2D();
2407 testDrawBitmap24bpp();
2408 testDrawTransformedBitmap24bpp();
2409 testComplexDrawTransformedBitmap24bpp();
2410 testDrawBitmapExWithAlpha24bpp();
2411 testDrawMask24bpp();
2412 testDrawBlend24bpp();
2414 testClipRectangle();
2416 testClipPolyPolygon();
2417 testClipB2DPolyPolygon();
2419 testDrawOutDevScaledClipped();
2420 testDrawOutDevSelf();
2422 testLinearGradient();
2423 testLinearGradientAngled();
2424 testLinearGradientBorder();
2425 testLinearGradientIntensity();
2426 testLinearGradientSteps();
2427 testAxialGradient();
2428 testRadialGradient();
2429 testRadialGradientOfs();
2430 testLineJoinBevel();
2431 testLineJoinRound();
2432 testLineJoinMiter();
2435 testLineCapSquare();
2437 testDrawDropShapeWithPolyline();
2438 testDrawDropShapeAAWithPolyline();
2439 testDrawDropShapeWithPolygon();
2440 testDrawDropShapeAAWithPolygon();
2441 testHalfEllipseWithPolyLine();
2442 testHalfEllipseAAWithPolyLine();
2443 testHalfEllipseWithPolyLineB2D();
2444 testHalfEllipseAAWithPolyLineB2D();
2445 testHalfEllipseWithPolygon();
2446 testHalfEllipseAAWithPolygon();
2447 testClosedBezierWithPolyline();
2448 testClosedBezierWithPolygon();
2449 testFilledAsymmetricalDropShape();
2451 testEvenOddRuleInIntersectingRectsWithPolyPolygon();
2452 testEvenOddRuleInIntersectingRectsWithPolyPolygonB2D();
2453 testDrawBitmap8bppGreyScale();
2454 testDrawTransformedBitmap8bppGreyScale();
2455 testDrawBitmap32bpp();
2456 testDrawTransformedBitmap32bpp();
2457 testDrawBitmapExWithAlpha32bpp();
2458 testDrawMask32bpp();
2459 testDrawBlend32bpp();
2460 testDrawRectangleOnSize1028WithRect();
2461 testDrawRectangleOnSize4096WithRect();
2462 testDrawRectangleOnSize1028WithPixel();
2463 testDrawRectangleOnSize4096WithPixel();
2464 testDrawRectangleOnSize1028WithLine();
2465 testDrawRectangleOnSize4096WithLine();
2466 testDrawRectangleOnSize1028WithPolyLine();
2467 testDrawRectangleOnSize4096WithPolyLine();
2468 testDrawRectangleOnSize1028WithPolygon();
2469 testDrawRectangleOnSize4096WithPolygon();
2470 testDrawRectangleOnSize1028WithPolyLineB2D();
2471 testDrawRectangleOnSize4096WithPolyLineB2D();
2472 testDrawRectangleOnSize1028WithPolyPolygon();
2473 testDrawRectangleOnSize4096WithPolyPolygon();
2474 testDrawRectangleOnSize1028WithPolyPolygonB2D();
2475 testDrawRectangleOnSize4096WithPolygonPolygonB2D();
2476 testDrawOpenPolygonWithPolyLine();
2477 testDrawOpenPolygonWithPolyLineB2D();
2478 testDrawOpenPolygonWithPolygon();
2479 testDrawOpenPolygonWithPolyPolygon();
2480 testDrawOpenPolygonWithPolyPolygonB2D();
2481 testDrawOpenBezierWithPolyLine();
2482 testDrawOpenBezierWithPolyLineB2D();
2485 void GraphicsRenderTests::appendTestResult(OUString aTestName
, OUString aTestStatus
,
2488 m_aTestResult
.push_back(VclTestResult(aTestName
, aTestStatus
, aTestBitmap
));
2491 std::vector
<VclTestResult
>& GraphicsRenderTests::getTestResults() { return m_aTestResult
; }
2493 OUString
GraphicsRenderTests::getResultString(bool bLocalize
)
2495 std::vector
<int> testResults(4);
2496 for (VclTestResult
& test
: m_aTestResult
)
2498 if (test
.getStatus() == "PASSED")
2502 else if (test
.getStatus() == "QUIRKY")
2506 else if (test
.getStatus() == "FAILED")
2515 // tdf#145919 localize for UI but not in the log file
2516 OUString resultString
;
2520 = VclResId(STR_GBU
).replaceFirst("%1", m_aCurGraphicsBackend
) + "\n"
2521 + VclResId(STR_PASSED
).replaceFirst("%1", OUString::number(testResults
[0])) + "\n"
2522 + VclResId(STR_QUIRKY
).replaceFirst("%1", OUString::number(testResults
[1])) + "\n"
2523 + VclResId(STR_FAILED
).replaceFirst("%1", OUString::number(testResults
[2])) + "\n"
2524 + VclResId(STR_SKIPPED
).replaceFirst("%1", OUString::number(testResults
[3])) + "\n";
2528 resultString
= "Graphics Backend used: " + m_aCurGraphicsBackend
2529 + "\nPassed Tests: " + OUString::number(testResults
[0])
2530 + "\nQuirky Tests: " + OUString::number(testResults
[1])
2531 + "\nFailed Tests: " + OUString::number(testResults
[2])
2532 + "\nSkipped Tests: " + OUString::number(testResults
[3]) + "\n";
2534 return resultString
;
2537 void GraphicsRenderTests::run(bool storeResultBitmap
)
2539 m_aStoreResultantBitmap
= storeResultBitmap
;
2540 ::utl::Bootstrap::locateUserInstallation(m_aUserInstallPath
);
2541 if (storeResultBitmap
)
2543 m_aUserInstallPath
+= "/user/GraphicTestResults/";
2547 m_aUserInstallPath
+= "/user/";
2550 //Storing the test's results in the main user installation directory.
2551 SvFileStream
logFile(m_aUserInstallPath
+ "GraphicsRenderTests.log",
2552 StreamMode::WRITE
| StreamMode::TRUNC
);
2553 std::unordered_map
<OUString
, std::vector
<OUString
>> aTests
;
2554 for (VclTestResult
& tests
: m_aTestResult
)
2556 aTests
[tests
.getStatus()].push_back(tests
.getTestName());
2558 OUString writeResult
= getResultString() + "\n---Name of the tests that failed---\n";
2559 if (static_cast<int>(aTests
["FAILED"].size()) > 0)
2561 for (const class OUString
& tests
: aTests
["FAILED"])
2563 writeResult
+= tests
+ "\n";
2568 writeResult
+= "No test has been failed.\n";
2570 writeResult
+= "\n---Name of the tests that were Quirky---\n";
2571 if (static_cast<int>(aTests
["QUIRKY"].size()) > 0)
2573 for (const class OUString
& tests
: aTests
["QUIRKY"])
2575 writeResult
+= tests
+ "\n";
2580 writeResult
+= "No test was Quirky.\n";
2582 writeResult
+= "\n---Name of the tests that were Skipped---\n";
2583 if (static_cast<int>(aTests
["SKIPPED"].size()) > 0)
2585 for (const class OUString
& tests
: aTests
["SKIPPED"])
2587 writeResult
+= tests
+ "\n";
2592 writeResult
+= "No test was Skipped.";
2594 logFile
.WriteOString(OUStringToOString(writeResult
, RTL_TEXTENCODING_UTF8
));