From bf3c84f718454f84b2ffbfa7fd1c7998bb5b01c2 Mon Sep 17 00:00:00 2001 From: aavit Date: Wed, 29 Jun 2011 13:24:37 +0200 Subject: Cleaning up the QPainter/arthur testing stuff This removes various remains of historical test tools, and the entire tests/arthur directory. The living parts are now: tests/auto/lancelot - including the suite of qps scripts. The script engine now lives here. tests/baselineserver - moved to toplevel since not arthur-specific. tests/manual/lance - for manual running and editing of qps scripts. Change-Id: I7c7f5df9197f4984a918dd1f9b31f42ee80d6152 Reviewed-on: http://codereview.qt.nokia.com/895 Reviewed-by: Qt Sanity Bot Reviewed-by: Gunnar Sletta --- tests/arthur/.gitattributes | 2 - tests/arthur/.gitignore | 2 - tests/arthur/README | 84 - tests/arthur/arthurtester.pri | 21 - tests/arthur/arthurtester.pro | 6 - tests/arthur/baselineserver/.gitignore | 2 - tests/arthur/baselineserver/bin/runserver | 13 - tests/arthur/baselineserver/src/baselineserver.cpp | 576 - tests/arthur/baselineserver/src/baselineserver.h | 141 - tests/arthur/baselineserver/src/baselineserver.pro | 30 - tests/arthur/baselineserver/src/baselineserver.qrc | 5 - tests/arthur/baselineserver/src/main.cpp | 70 - tests/arthur/baselineserver/src/report.cpp | 311 - tests/arthur/baselineserver/src/report.h | 91 - .../arthur/baselineserver/src/templates/view.html | 79 - tests/arthur/common/baselineprotocol.cpp | 527 - tests/arthur/common/baselineprotocol.h | 193 - tests/arthur/common/baselineprotocol.pri | 11 - tests/arthur/common/common.pri | 18 - tests/arthur/common/common.pro | 20 - tests/arthur/common/framework.cpp | 130 - tests/arthur/common/framework.h | 76 - tests/arthur/common/images.qrc | 34 - tests/arthur/common/images/alpha.png | Bin 2422 -> 0 bytes tests/arthur/common/images/alpha2x2.png | Bin 169 -> 0 bytes tests/arthur/common/images/bitmap.png | Bin 254 -> 0 bytes tests/arthur/common/images/border.png | Bin 182 -> 0 bytes tests/arthur/common/images/borderimage.png | Bin 826 -> 0 bytes tests/arthur/common/images/dome_argb32.png | Bin 18234 -> 0 bytes tests/arthur/common/images/dome_indexed.png | Bin 7946 -> 0 bytes tests/arthur/common/images/dome_indexed_mask.png | Bin 5411 -> 0 bytes tests/arthur/common/images/dome_mono.png | Bin 1391 -> 0 bytes tests/arthur/common/images/dome_mono_128.png | Bin 2649 -> 0 bytes tests/arthur/common/images/dome_mono_palette.png | Bin 1404 -> 0 bytes tests/arthur/common/images/dome_rgb32.png | Bin 17890 -> 0 bytes tests/arthur/common/images/dot.png | Bin 287 -> 0 bytes tests/arthur/common/images/face.png | Bin 2414 -> 0 bytes tests/arthur/common/images/gam030.png | Bin 213 -> 0 bytes tests/arthur/common/images/gam045.png | Bin 216 -> 0 bytes tests/arthur/common/images/gam056.png | Bin 216 -> 0 bytes tests/arthur/common/images/gam100.png | Bin 205 -> 0 bytes tests/arthur/common/images/gam200.png | Bin 187 -> 0 bytes tests/arthur/common/images/image.png | Bin 169554 -> 0 bytes tests/arthur/common/images/mask.png | Bin 274 -> 0 bytes tests/arthur/common/images/mask_100.png | Bin 319 -> 0 bytes tests/arthur/common/images/masked.png | Bin 788 -> 0 bytes tests/arthur/common/images/sign.png | Bin 10647 -> 0 bytes tests/arthur/common/images/solid.png | Bin 607 -> 0 bytes tests/arthur/common/images/solid2x2.png | Bin 169 -> 0 bytes tests/arthur/common/images/struct-image-01.jpg | Bin 4751 -> 0 bytes tests/arthur/common/images/struct-image-01.png | Bin 63238 -> 0 bytes tests/arthur/common/images/zebra.png | Bin 426 -> 0 bytes tests/arthur/common/lookup3.cpp | 786 - tests/arthur/common/paintcommands.cpp | 2586 --- tests/arthur/common/paintcommands.h | 334 - tests/arthur/common/qbaselinetest.cpp | 193 - tests/arthur/common/qbaselinetest.h | 77 - tests/arthur/common/qbaselinetest.pri | 13 - tests/arthur/common/qengines.cpp | 733 - tests/arthur/common/qengines.h | 241 - tests/arthur/common/xmldata.cpp | 110 - tests/arthur/common/xmldata.h | 153 - tests/arthur/data/1.1/color-prop-03-t.svg | 101 - tests/arthur/data/1.1/coords-trans-01-b.svg | 240 - tests/arthur/data/1.1/coords-trans-02-t.svg | 178 - tests/arthur/data/1.1/coords-trans-03-t.svg | 100 - tests/arthur/data/1.1/coords-trans-04-t.svg | 69 - tests/arthur/data/1.1/coords-trans-05-t.svg | 89 - tests/arthur/data/1.1/coords-trans-06-t.svg | 83 - tests/arthur/data/1.1/fonts-elem-01-t.svg | 103 - tests/arthur/data/1.1/fonts-elem-02-t.svg | 107 - tests/arthur/data/1.1/interact-zoom-01-t.svg | 71 - tests/arthur/data/1.1/linking-a-04-t.svg | 124 - tests/arthur/data/1.1/linking-uri-03-t.svg | 74 - tests/arthur/data/1.1/metadata-example-01-b.svg | 175 - tests/arthur/data/1.1/painting-fill-01-t.svg | 80 - tests/arthur/data/1.1/painting-fill-02-t.svg | 80 - tests/arthur/data/1.1/painting-fill-03-t.svg | 77 - tests/arthur/data/1.1/painting-fill-04-t.svg | 57 - tests/arthur/data/1.1/painting-stroke-01-t.svg | 55 - tests/arthur/data/1.1/painting-stroke-02-t.svg | 56 - tests/arthur/data/1.1/painting-stroke-03-t.svg | 57 - tests/arthur/data/1.1/painting-stroke-04-t.svg | 71 - tests/arthur/data/1.1/paths-data-01-t.svg | 158 - tests/arthur/data/1.1/paths-data-02-t.svg | 132 - tests/arthur/data/1.1/paths-data-04-t.svg | 92 - tests/arthur/data/1.1/paths-data-05-t.svg | 89 - tests/arthur/data/1.1/paths-data-06-t.svg | 72 - tests/arthur/data/1.1/paths-data-07-t.svg | 72 - tests/arthur/data/1.1/pservers-grad-07-b.svg | 74 - tests/arthur/data/1.1/pservers-grad-11-b.svg | 100 - tests/arthur/data/1.1/render-elems-01-t.svg | 54 - tests/arthur/data/1.1/render-elems-02-t.svg | 75 - tests/arthur/data/1.1/render-elems-03-t.svg | 57 - tests/arthur/data/1.1/render-elems-06-t.svg | 75 - tests/arthur/data/1.1/render-elems-07-t.svg | 76 - tests/arthur/data/1.1/render-elems-08-t.svg | 78 - tests/arthur/data/1.1/render-groups-03-t.svg | 117 - tests/arthur/data/1.1/shapes-circle-01-t.svg | 56 - tests/arthur/data/1.1/shapes-ellipse-01-t.svg | 72 - tests/arthur/data/1.1/shapes-line-01-t.svg | 80 - tests/arthur/data/1.1/shapes-polygon-01-t.svg | 73 - tests/arthur/data/1.1/shapes-polyline-01-t.svg | 84 - tests/arthur/data/1.1/shapes-rect-01-t.svg | 72 - tests/arthur/data/1.1/struct-cond-01-t.svg | 75 - tests/arthur/data/1.1/struct-cond-02-t.svg | 574 - tests/arthur/data/1.1/struct-defs-01-t.svg | 85 - tests/arthur/data/1.1/struct-group-01-t.svg | 71 - tests/arthur/data/1.1/struct-image-01-t.svg | 65 - tests/arthur/data/1.1/struct-image-03-t.svg | 54 - tests/arthur/data/1.1/struct-image-04-t.svg | 126 - tests/arthur/data/1.1/styling-pres-01-t.svg | 38 - tests/arthur/data/1.1/text-fonts-01-t.svg | 98 - tests/arthur/data/1.1/text-fonts-02-t.svg | 73 - tests/arthur/data/1.1/text-intro-01-t.svg | 69 - tests/arthur/data/1.1/text-intro-04-t.svg | 68 - tests/arthur/data/1.1/text-ws-01-t.svg | 99 - tests/arthur/data/1.1/text-ws-02-t.svg | 104 - tests/arthur/data/1.2/07_07.svg | 40 - tests/arthur/data/1.2/07_12.svg | 21 - tests/arthur/data/1.2/08_02.svg | 26 - tests/arthur/data/1.2/08_03.svg | 28 - tests/arthur/data/1.2/08_04.svg | 19 - tests/arthur/data/1.2/09_02.svg | 14 - tests/arthur/data/1.2/09_03.svg | 10 - tests/arthur/data/1.2/09_04.svg | 15 - tests/arthur/data/1.2/09_05.svg | 20 - tests/arthur/data/1.2/09_06.svg | 16 - tests/arthur/data/1.2/09_07.svg | 15 - tests/arthur/data/1.2/10_03.svg | 15 - tests/arthur/data/1.2/10_04.svg | 20 - tests/arthur/data/1.2/10_05.svg | 21 - tests/arthur/data/1.2/10_06.svg | 20 - tests/arthur/data/1.2/10_07.svg | 20 - tests/arthur/data/1.2/10_08.svg | 23 - tests/arthur/data/1.2/10_09.svg | 30 - tests/arthur/data/1.2/10_10.svg | 23 - tests/arthur/data/1.2/10_11.svg | 24 - tests/arthur/data/1.2/11_01.svg | 20 - tests/arthur/data/1.2/11_02.svg | 9 - tests/arthur/data/1.2/11_03.svg | 11 - tests/arthur/data/1.2/13_01.svg | 20 - tests/arthur/data/1.2/13_02.svg | 22 - tests/arthur/data/1.2/19_01.svg | 51 - tests/arthur/data/1.2/19_02.svg | 25 - tests/arthur/data/1.2/animation.svg | 11 - tests/arthur/data/1.2/cubic02.svg | 77 - tests/arthur/data/1.2/fillrule-evenodd.svg | 38 - tests/arthur/data/1.2/fillrule-nonzero.svg | 38 - tests/arthur/data/1.2/linecap.svg | 32 - tests/arthur/data/1.2/linejoin.svg | 29 - tests/arthur/data/1.2/media01.svg | 20 - tests/arthur/data/1.2/media02.svg | 13 - tests/arthur/data/1.2/media03.svg | 13 - tests/arthur/data/1.2/media04.svg | 24 - tests/arthur/data/1.2/media05.svg | 27 - tests/arthur/data/1.2/mpath01.svg | 10 - tests/arthur/data/1.2/non-scaling-stroke.svg | 15 - tests/arthur/data/1.2/noonoo.svg | 13 - tests/arthur/data/1.2/referencedRect.svg | 9 - tests/arthur/data/1.2/referencedRect2.svg | 9 - tests/arthur/data/1.2/solidcolor.svg | 16 - tests/arthur/data/1.2/textArea01.svg | 10 - tests/arthur/data/1.2/timed-lyrics.svg | 22 - tests/arthur/data/1.2/use.svg | 22 - tests/arthur/data/bugs/.gitattributes | 2 - tests/arthur/data/bugs/gradient-defaults.svg | 18 - tests/arthur/data/bugs/gradient_pen_fill.svg | 32 - tests/arthur/data/bugs/openglcurve.svg | 35 - tests/arthur/data/bugs/org_module.svg | 389 - tests/arthur/data/bugs/resolve_linear.svg | 29 - tests/arthur/data/bugs/resolve_radial.svg | 36 - tests/arthur/data/bugs/text_pens.svg | 7 - tests/arthur/data/framework.ini | 22 - tests/arthur/data/images/alpha.png | Bin 2422 -> 0 bytes tests/arthur/data/images/bitmap.png | Bin 254 -> 0 bytes tests/arthur/data/images/border.png | Bin 182 -> 0 bytes tests/arthur/data/images/dome_argb32.png | Bin 18234 -> 0 bytes tests/arthur/data/images/dome_indexed.png | Bin 7946 -> 0 bytes tests/arthur/data/images/dome_indexed_mask.png | Bin 5411 -> 0 bytes tests/arthur/data/images/dome_mono.png | Bin 1391 -> 0 bytes tests/arthur/data/images/dome_mono_128.png | Bin 2649 -> 0 bytes tests/arthur/data/images/dome_mono_palette.png | Bin 1404 -> 0 bytes tests/arthur/data/images/dome_rgb32.png | Bin 17890 -> 0 bytes tests/arthur/data/images/dot.png | Bin 287 -> 0 bytes tests/arthur/data/images/face.png | Bin 2414 -> 0 bytes tests/arthur/data/images/gam030.png | Bin 213 -> 0 bytes tests/arthur/data/images/gam045.png | Bin 216 -> 0 bytes tests/arthur/data/images/gam056.png | Bin 216 -> 0 bytes tests/arthur/data/images/gam100.png | Bin 205 -> 0 bytes tests/arthur/data/images/gam200.png | Bin 187 -> 0 bytes tests/arthur/data/images/image.png | Bin 169554 -> 0 bytes tests/arthur/data/images/mask.png | Bin 274 -> 0 bytes tests/arthur/data/images/mask_100.png | Bin 319 -> 0 bytes tests/arthur/data/images/masked.png | Bin 788 -> 0 bytes tests/arthur/data/images/paths.qps | 32 - tests/arthur/data/images/pens.qps | 96 - tests/arthur/data/images/sign.png | Bin 10647 -> 0 bytes tests/arthur/data/images/solid.png | Bin 607 -> 0 bytes tests/arthur/data/images/struct-image-01.jpg | Bin 4751 -> 0 bytes tests/arthur/data/images/struct-image-01.png | Bin 63238 -> 0 bytes tests/arthur/data/qps/aliasing.qps | 156 - tests/arthur/data/qps/aliasing_qps.png | Bin 30531 -> 0 bytes tests/arthur/data/qps/alphas.qps | 63 - tests/arthur/data/qps/alphas_qps.png | Bin 45840 -> 0 bytes tests/arthur/data/qps/arcs.qps | 65 - tests/arthur/data/qps/arcs2.qps | 44 - tests/arthur/data/qps/arcs2_qps.png | Bin 9136 -> 0 bytes tests/arthur/data/qps/arcs_qps.png | Bin 110658 -> 0 bytes tests/arthur/data/qps/background.qps | 133 - tests/arthur/data/qps/background_brush.qps | 2 - tests/arthur/data/qps/background_brush_qps.png | Bin 62149 -> 0 bytes tests/arthur/data/qps/background_qps.png | Bin 53461 -> 0 bytes tests/arthur/data/qps/beziers.qps | 144 - tests/arthur/data/qps/beziers_qps.png | Bin 57610 -> 0 bytes tests/arthur/data/qps/bitmaps.qps | 163 - tests/arthur/data/qps/bitmaps_qps.png | Bin 89888 -> 0 bytes tests/arthur/data/qps/borderimage.qps | 164 - tests/arthur/data/qps/borderimage_qps.png | Bin 91838 -> 0 bytes tests/arthur/data/qps/brush_pens.qps | 101 - tests/arthur/data/qps/brush_pens_qps.png | Bin 77823 -> 0 bytes tests/arthur/data/qps/brushes.qps | 77 - tests/arthur/data/qps/brushes_qps.png | Bin 134906 -> 0 bytes tests/arthur/data/qps/clippaths.qps | 58 - tests/arthur/data/qps/clippaths_qps.png | Bin 6484 -> 0 bytes tests/arthur/data/qps/clipping.qps | 179 - tests/arthur/data/qps/clipping_qps.png | Bin 14424 -> 0 bytes tests/arthur/data/qps/clipping_state.qps | 72 - tests/arthur/data/qps/clipping_state_qps.png | Bin 5133 -> 0 bytes tests/arthur/data/qps/cliprects.qps | 57 - tests/arthur/data/qps/cliprects_qps.png | Bin 6484 -> 0 bytes tests/arthur/data/qps/conical_gradients.qps | 82 - .../data/qps/conical_gradients_perspectives.qps | 61 - .../qps/conical_gradients_perspectives_qps.png | Bin 115264 -> 0 bytes tests/arthur/data/qps/conical_gradients_qps.png | Bin 108982 -> 0 bytes tests/arthur/data/qps/dashes.qps | 265 - tests/arthur/data/qps/dashes_qps.png | Bin 48344 -> 0 bytes tests/arthur/data/qps/degeneratebeziers.qps | 7 - tests/arthur/data/qps/degeneratebeziers_qps.png | Bin 5503 -> 0 bytes tests/arthur/data/qps/deviceclipping.qps | 45 - tests/arthur/data/qps/deviceclipping_qps.png | Bin 12919 -> 0 bytes tests/arthur/data/qps/drawpoints.qps | 98 - tests/arthur/data/qps/drawpoints_qps.png | Bin 8224 -> 0 bytes tests/arthur/data/qps/drawtext.qps | 85 - tests/arthur/data/qps/drawtext_qps.png | Bin 55646 -> 0 bytes tests/arthur/data/qps/ellipses.qps | 83 - tests/arthur/data/qps/ellipses_qps.png | Bin 36197 -> 0 bytes tests/arthur/data/qps/filltest.qps | 410 - tests/arthur/data/qps/filltest_qps.png | Bin 22602 -> 0 bytes tests/arthur/data/qps/fonts.qps | 64 - tests/arthur/data/qps/fonts_qps.png | Bin 75853 -> 0 bytes tests/arthur/data/qps/gradients.qps | 41 - tests/arthur/data/qps/gradients_qps.png | Bin 41596 -> 0 bytes tests/arthur/data/qps/image_formats.qps | 78 - tests/arthur/data/qps/image_formats_qps.png | Bin 275242 -> 0 bytes tests/arthur/data/qps/images.qps | 103 - tests/arthur/data/qps/images2.qps | 143 - tests/arthur/data/qps/images2_qps.png | Bin 182146 -> 0 bytes tests/arthur/data/qps/images_qps.png | Bin 322000 -> 0 bytes tests/arthur/data/qps/join_cap_styles.qps | 60 - .../join_cap_styles_duplicate_control_points.qps | 65 - ...oin_cap_styles_duplicate_control_points_qps.png | Bin 42237 -> 0 bytes tests/arthur/data/qps/join_cap_styles_qps.png | Bin 37518 -> 0 bytes tests/arthur/data/qps/linear_gradients.qps | 141 - .../data/qps/linear_gradients_perspectives.qps | 60 - .../data/qps/linear_gradients_perspectives_qps.png | Bin 77944 -> 0 bytes tests/arthur/data/qps/linear_gradients_qps.png | Bin 162643 -> 0 bytes .../arthur/data/qps/linear_resolving_gradients.qps | 75 - .../data/qps/linear_resolving_gradients_qps.png | Bin 76697 -> 0 bytes tests/arthur/data/qps/lineconsistency.qps | 70 - tests/arthur/data/qps/lineconsistency_qps.png | Bin 12388 -> 0 bytes tests/arthur/data/qps/linedashes.qps | 92 - tests/arthur/data/qps/linedashes2.qps | 151 - tests/arthur/data/qps/linedashes2_aa.qps | 2 - tests/arthur/data/qps/linedashes2_aa_qps.png | Bin 28418 -> 0 bytes tests/arthur/data/qps/linedashes2_qps.png | Bin 12182 -> 0 bytes tests/arthur/data/qps/linedashes_qps.png | Bin 11801 -> 0 bytes tests/arthur/data/qps/lines.qps | 555 - tests/arthur/data/qps/lines2.qps | 176 - tests/arthur/data/qps/lines2_qps.png | Bin 36623 -> 0 bytes tests/arthur/data/qps/lines_qps.png | Bin 113575 -> 0 bytes tests/arthur/data/qps/object_bounding_mode.qps | 35 - tests/arthur/data/qps/object_bounding_mode_qps.png | Bin 85460 -> 0 bytes tests/arthur/data/qps/pathfill.qps | 35 - tests/arthur/data/qps/pathfill_qps.png | Bin 198538 -> 0 bytes tests/arthur/data/qps/paths.qps | 32 - tests/arthur/data/qps/paths_aa.qps | 2 - tests/arthur/data/qps/paths_aa_qps.png | Bin 92147 -> 0 bytes tests/arthur/data/qps/paths_qps.png | Bin 20392 -> 0 bytes tests/arthur/data/qps/pens.qps | 130 - tests/arthur/data/qps/pens_aa.qps | 3 - tests/arthur/data/qps/pens_aa_qps.png | Bin 30813 -> 0 bytes tests/arthur/data/qps/pens_cosmetic.qps | 107 - tests/arthur/data/qps/pens_cosmetic_qps.png | Bin 47487 -> 0 bytes tests/arthur/data/qps/pens_qps.png | Bin 11822 -> 0 bytes tests/arthur/data/qps/perspectives.qps | 70 - tests/arthur/data/qps/perspectives2.qps | 307 - tests/arthur/data/qps/perspectives2_qps.png | Bin 234054 -> 0 bytes tests/arthur/data/qps/perspectives_qps.png | Bin 491494 -> 0 bytes tests/arthur/data/qps/pixmap_rotation.qps | 27 - tests/arthur/data/qps/pixmap_rotation_qps.png | Bin 8141 -> 0 bytes tests/arthur/data/qps/pixmap_scaling.qps | 527 - tests/arthur/data/qps/pixmap_subpixel.qps | 115 - tests/arthur/data/qps/pixmap_subpixel_qps.png | Bin 5317 -> 0 bytes tests/arthur/data/qps/pixmaps.qps | 103 - tests/arthur/data/qps/pixmaps_qps.png | Bin 321685 -> 0 bytes tests/arthur/data/qps/porter_duff.qps | 248 - tests/arthur/data/qps/porter_duff2.qps | 256 - tests/arthur/data/qps/porter_duff2_qps.png | Bin 99167 -> 0 bytes tests/arthur/data/qps/porter_duff_qps.png | Bin 39375 -> 0 bytes tests/arthur/data/qps/primitives.qps | 198 - tests/arthur/data/qps/primitives_qps.png | Bin 104235 -> 0 bytes tests/arthur/data/qps/radial_gradients.qps | 96 - .../arthur/data/qps/radial_gradients_extended.qps | 95 - .../data/qps/radial_gradients_extended_qps.png | Bin 107978 -> 0 bytes .../data/qps/radial_gradients_perspectives.qps | 60 - .../data/qps/radial_gradients_perspectives_qps.png | Bin 131744 -> 0 bytes tests/arthur/data/qps/radial_gradients_qps.png | Bin 161009 -> 0 bytes tests/arthur/data/qps/rasterops.qps | 84 - tests/arthur/data/qps/rasterops_qps.png | Bin 11059 -> 0 bytes tests/arthur/data/qps/sizes.qps | 87 - tests/arthur/data/qps/sizes_qps.png | Bin 42355 -> 0 bytes tests/arthur/data/qps/text.qps | 122 - tests/arthur/data/qps/text_perspectives.qps | 100 - tests/arthur/data/qps/text_perspectives_qps.png | Bin 116847 -> 0 bytes tests/arthur/data/qps/text_qps.png | Bin 32991 -> 0 bytes tests/arthur/data/qps/tiled_pixmap.qps | 82 - tests/arthur/data/qps/tiled_pixmap_qps.png | Bin 376370 -> 0 bytes tests/arthur/data/random/arcs02.svg | 59 - tests/arthur/data/random/atop.svg | 55 - tests/arthur/data/random/clinton.svg | 370 - tests/arthur/data/random/cowboy.svg | 4110 ----- tests/arthur/data/random/gear_is_rising.svg | 702 - tests/arthur/data/random/gearflowers.svg | 8342 ---------- tests/arthur/data/random/kde-look.svg | 16674 ------------------- tests/arthur/data/random/linear_grad_transform.svg | 51 - tests/arthur/data/random/longhorn.svg | 1595 -- tests/arthur/data/random/multiply.svg | 48 - tests/arthur/data/random/picasso.svg | 2842 ---- tests/arthur/data/random/porterduff.svg | 298 - tests/arthur/data/random/radial_grad_transform.svg | 59 - tests/arthur/data/random/solidcolor.svg | 15 - tests/arthur/data/random/spiral.svg | 536 - tests/arthur/data/random/tests.svg | 36 - tests/arthur/data/random/tests2.svg | 12 - tests/arthur/data/random/tiger.svg | 728 - tests/arthur/data/random/uluru.png | Bin 11749 -> 0 bytes tests/arthur/data/random/worldcup.svg | 14668 ---------------- tests/arthur/datagenerator/datagenerator.cpp | 481 - tests/arthur/datagenerator/datagenerator.h | 103 - tests/arthur/datagenerator/datagenerator.pri | 2 - tests/arthur/datagenerator/datagenerator.pro | 21 - tests/arthur/datagenerator/main.cpp | 54 - tests/arthur/datagenerator/xmlgenerator.cpp | 262 - tests/arthur/datagenerator/xmlgenerator.h | 73 - tests/arthur/htmlgenerator/htmlgenerator.cpp | 518 - tests/arthur/htmlgenerator/htmlgenerator.h | 126 - tests/arthur/htmlgenerator/htmlgenerator.pro | 19 - tests/arthur/htmlgenerator/main.cpp | 54 - tests/arthur/lance/enum.png | Bin 4619 -> 0 bytes tests/arthur/lance/icons.qrc | 6 - tests/arthur/lance/interactivewidget.cpp | 202 - tests/arthur/lance/interactivewidget.h | 80 - tests/arthur/lance/lance.pro | 22 - tests/arthur/lance/main.cpp | 670 - tests/arthur/lance/tools.png | Bin 4424 -> 0 bytes tests/arthur/lance/widgets.h | 354 - tests/arthur/performancediff/main.cpp | 54 - tests/arthur/performancediff/performancediff.cpp | 219 - tests/arthur/performancediff/performancediff.h | 73 - tests/arthur/performancediff/performancediff.pro | 19 - tests/arthur/shower/main.cpp | 99 - tests/arthur/shower/shower.cpp | 125 - tests/arthur/shower/shower.h | 73 - tests/arthur/shower/shower.pro | 17 - tests/auto/baselineexample/baselineexample.pro | 2 +- tests/auto/lancelot/images.qrc | 34 + tests/auto/lancelot/images/alpha.png | Bin 0 -> 2422 bytes tests/auto/lancelot/images/alpha2x2.png | Bin 0 -> 169 bytes tests/auto/lancelot/images/bitmap.png | Bin 0 -> 254 bytes tests/auto/lancelot/images/border.png | Bin 0 -> 182 bytes tests/auto/lancelot/images/borderimage.png | Bin 0 -> 826 bytes tests/auto/lancelot/images/dome_argb32.png | Bin 0 -> 18234 bytes tests/auto/lancelot/images/dome_indexed.png | Bin 0 -> 7946 bytes tests/auto/lancelot/images/dome_indexed_mask.png | Bin 0 -> 5411 bytes tests/auto/lancelot/images/dome_mono.png | Bin 0 -> 1391 bytes tests/auto/lancelot/images/dome_mono_128.png | Bin 0 -> 2649 bytes tests/auto/lancelot/images/dome_mono_palette.png | Bin 0 -> 1404 bytes tests/auto/lancelot/images/dome_rgb32.png | Bin 0 -> 17890 bytes tests/auto/lancelot/images/dot.png | Bin 0 -> 287 bytes tests/auto/lancelot/images/face.png | Bin 0 -> 2414 bytes tests/auto/lancelot/images/gam030.png | Bin 0 -> 213 bytes tests/auto/lancelot/images/gam045.png | Bin 0 -> 216 bytes tests/auto/lancelot/images/gam056.png | Bin 0 -> 216 bytes tests/auto/lancelot/images/gam100.png | Bin 0 -> 205 bytes tests/auto/lancelot/images/gam200.png | Bin 0 -> 187 bytes tests/auto/lancelot/images/image.png | Bin 0 -> 169554 bytes tests/auto/lancelot/images/mask.png | Bin 0 -> 274 bytes tests/auto/lancelot/images/mask_100.png | Bin 0 -> 319 bytes tests/auto/lancelot/images/masked.png | Bin 0 -> 788 bytes tests/auto/lancelot/images/sign.png | Bin 0 -> 10647 bytes tests/auto/lancelot/images/solid.png | Bin 0 -> 607 bytes tests/auto/lancelot/images/solid2x2.png | Bin 0 -> 169 bytes tests/auto/lancelot/images/struct-image-01.jpg | Bin 0 -> 4751 bytes tests/auto/lancelot/images/struct-image-01.png | Bin 0 -> 63238 bytes tests/auto/lancelot/images/zebra.png | Bin 0 -> 426 bytes tests/auto/lancelot/lancelot.pro | 8 +- tests/auto/lancelot/paintcommands.cpp | 2586 +++ tests/auto/lancelot/paintcommands.h | 334 + tests/baselineserver/.gitignore | 2 + tests/baselineserver/bin/runserver | 13 + tests/baselineserver/shared/baselineprotocol.cpp | 527 + tests/baselineserver/shared/baselineprotocol.h | 193 + tests/baselineserver/shared/baselineprotocol.pri | 11 + tests/baselineserver/shared/lookup3.cpp | 786 + tests/baselineserver/shared/qbaselinetest.cpp | 193 + tests/baselineserver/shared/qbaselinetest.h | 77 + tests/baselineserver/shared/qbaselinetest.pri | 13 + tests/baselineserver/src/baselineserver.cpp | 576 + tests/baselineserver/src/baselineserver.h | 141 + tests/baselineserver/src/baselineserver.pro | 30 + tests/baselineserver/src/baselineserver.qrc | 5 + tests/baselineserver/src/main.cpp | 70 + tests/baselineserver/src/report.cpp | 311 + tests/baselineserver/src/report.h | 91 + tests/baselineserver/src/templates/view.html | 79 + tests/manual/lance/README | 6 + tests/manual/lance/enum.png | Bin 0 -> 4619 bytes tests/manual/lance/icons.qrc | 6 + tests/manual/lance/interactivewidget.cpp | 202 + tests/manual/lance/interactivewidget.h | 80 + tests/manual/lance/lance.pro | 26 + tests/manual/lance/main.cpp | 670 + tests/manual/lance/tools.png | Bin 0 -> 4424 bytes tests/manual/lance/widgets.h | 354 + 435 files changed, 7421 insertions(+), 77138 deletions(-) delete mode 100644 tests/arthur/.gitattributes delete mode 100644 tests/arthur/.gitignore delete mode 100644 tests/arthur/README delete mode 100644 tests/arthur/arthurtester.pri delete mode 100644 tests/arthur/arthurtester.pro delete mode 100644 tests/arthur/baselineserver/.gitignore delete mode 100755 tests/arthur/baselineserver/bin/runserver delete mode 100644 tests/arthur/baselineserver/src/baselineserver.cpp delete mode 100644 tests/arthur/baselineserver/src/baselineserver.h delete mode 100644 tests/arthur/baselineserver/src/baselineserver.pro delete mode 100644 tests/arthur/baselineserver/src/baselineserver.qrc delete mode 100644 tests/arthur/baselineserver/src/main.cpp delete mode 100644 tests/arthur/baselineserver/src/report.cpp delete mode 100644 tests/arthur/baselineserver/src/report.h delete mode 100644 tests/arthur/baselineserver/src/templates/view.html delete mode 100644 tests/arthur/common/baselineprotocol.cpp delete mode 100644 tests/arthur/common/baselineprotocol.h delete mode 100644 tests/arthur/common/baselineprotocol.pri delete mode 100644 tests/arthur/common/common.pri delete mode 100644 tests/arthur/common/common.pro delete mode 100644 tests/arthur/common/framework.cpp delete mode 100644 tests/arthur/common/framework.h delete mode 100644 tests/arthur/common/images.qrc delete mode 100644 tests/arthur/common/images/alpha.png delete mode 100644 tests/arthur/common/images/alpha2x2.png delete mode 100644 tests/arthur/common/images/bitmap.png delete mode 100644 tests/arthur/common/images/border.png delete mode 100644 tests/arthur/common/images/borderimage.png delete mode 100644 tests/arthur/common/images/dome_argb32.png delete mode 100644 tests/arthur/common/images/dome_indexed.png delete mode 100644 tests/arthur/common/images/dome_indexed_mask.png delete mode 100644 tests/arthur/common/images/dome_mono.png delete mode 100644 tests/arthur/common/images/dome_mono_128.png delete mode 100644 tests/arthur/common/images/dome_mono_palette.png delete mode 100644 tests/arthur/common/images/dome_rgb32.png delete mode 100644 tests/arthur/common/images/dot.png delete mode 100644 tests/arthur/common/images/face.png delete mode 100644 tests/arthur/common/images/gam030.png delete mode 100644 tests/arthur/common/images/gam045.png delete mode 100644 tests/arthur/common/images/gam056.png delete mode 100644 tests/arthur/common/images/gam100.png delete mode 100644 tests/arthur/common/images/gam200.png delete mode 100644 tests/arthur/common/images/image.png delete mode 100644 tests/arthur/common/images/mask.png delete mode 100644 tests/arthur/common/images/mask_100.png delete mode 100644 tests/arthur/common/images/masked.png delete mode 100644 tests/arthur/common/images/sign.png delete mode 100644 tests/arthur/common/images/solid.png delete mode 100644 tests/arthur/common/images/solid2x2.png delete mode 100644 tests/arthur/common/images/struct-image-01.jpg delete mode 100644 tests/arthur/common/images/struct-image-01.png delete mode 100644 tests/arthur/common/images/zebra.png delete mode 100644 tests/arthur/common/lookup3.cpp delete mode 100644 tests/arthur/common/paintcommands.cpp delete mode 100644 tests/arthur/common/paintcommands.h delete mode 100644 tests/arthur/common/qbaselinetest.cpp delete mode 100644 tests/arthur/common/qbaselinetest.h delete mode 100644 tests/arthur/common/qbaselinetest.pri delete mode 100644 tests/arthur/common/qengines.cpp delete mode 100644 tests/arthur/common/qengines.h delete mode 100644 tests/arthur/common/xmldata.cpp delete mode 100644 tests/arthur/common/xmldata.h delete mode 100644 tests/arthur/data/1.1/color-prop-03-t.svg delete mode 100644 tests/arthur/data/1.1/coords-trans-01-b.svg delete mode 100644 tests/arthur/data/1.1/coords-trans-02-t.svg delete mode 100644 tests/arthur/data/1.1/coords-trans-03-t.svg delete mode 100644 tests/arthur/data/1.1/coords-trans-04-t.svg delete mode 100644 tests/arthur/data/1.1/coords-trans-05-t.svg delete mode 100644 tests/arthur/data/1.1/coords-trans-06-t.svg delete mode 100644 tests/arthur/data/1.1/fonts-elem-01-t.svg delete mode 100644 tests/arthur/data/1.1/fonts-elem-02-t.svg delete mode 100644 tests/arthur/data/1.1/interact-zoom-01-t.svg delete mode 100644 tests/arthur/data/1.1/linking-a-04-t.svg delete mode 100644 tests/arthur/data/1.1/linking-uri-03-t.svg delete mode 100644 tests/arthur/data/1.1/metadata-example-01-b.svg delete mode 100644 tests/arthur/data/1.1/painting-fill-01-t.svg delete mode 100644 tests/arthur/data/1.1/painting-fill-02-t.svg delete mode 100644 tests/arthur/data/1.1/painting-fill-03-t.svg delete mode 100644 tests/arthur/data/1.1/painting-fill-04-t.svg delete mode 100644 tests/arthur/data/1.1/painting-stroke-01-t.svg delete mode 100644 tests/arthur/data/1.1/painting-stroke-02-t.svg delete mode 100644 tests/arthur/data/1.1/painting-stroke-03-t.svg delete mode 100644 tests/arthur/data/1.1/painting-stroke-04-t.svg delete mode 100644 tests/arthur/data/1.1/paths-data-01-t.svg delete mode 100644 tests/arthur/data/1.1/paths-data-02-t.svg delete mode 100644 tests/arthur/data/1.1/paths-data-04-t.svg delete mode 100644 tests/arthur/data/1.1/paths-data-05-t.svg delete mode 100644 tests/arthur/data/1.1/paths-data-06-t.svg delete mode 100644 tests/arthur/data/1.1/paths-data-07-t.svg delete mode 100644 tests/arthur/data/1.1/pservers-grad-07-b.svg delete mode 100644 tests/arthur/data/1.1/pservers-grad-11-b.svg delete mode 100644 tests/arthur/data/1.1/render-elems-01-t.svg delete mode 100644 tests/arthur/data/1.1/render-elems-02-t.svg delete mode 100644 tests/arthur/data/1.1/render-elems-03-t.svg delete mode 100644 tests/arthur/data/1.1/render-elems-06-t.svg delete mode 100644 tests/arthur/data/1.1/render-elems-07-t.svg delete mode 100644 tests/arthur/data/1.1/render-elems-08-t.svg delete mode 100644 tests/arthur/data/1.1/render-groups-03-t.svg delete mode 100644 tests/arthur/data/1.1/shapes-circle-01-t.svg delete mode 100644 tests/arthur/data/1.1/shapes-ellipse-01-t.svg delete mode 100644 tests/arthur/data/1.1/shapes-line-01-t.svg delete mode 100644 tests/arthur/data/1.1/shapes-polygon-01-t.svg delete mode 100644 tests/arthur/data/1.1/shapes-polyline-01-t.svg delete mode 100644 tests/arthur/data/1.1/shapes-rect-01-t.svg delete mode 100644 tests/arthur/data/1.1/struct-cond-01-t.svg delete mode 100644 tests/arthur/data/1.1/struct-cond-02-t.svg delete mode 100644 tests/arthur/data/1.1/struct-defs-01-t.svg delete mode 100644 tests/arthur/data/1.1/struct-group-01-t.svg delete mode 100644 tests/arthur/data/1.1/struct-image-01-t.svg delete mode 100644 tests/arthur/data/1.1/struct-image-03-t.svg delete mode 100644 tests/arthur/data/1.1/struct-image-04-t.svg delete mode 100644 tests/arthur/data/1.1/styling-pres-01-t.svg delete mode 100644 tests/arthur/data/1.1/text-fonts-01-t.svg delete mode 100644 tests/arthur/data/1.1/text-fonts-02-t.svg delete mode 100644 tests/arthur/data/1.1/text-intro-01-t.svg delete mode 100644 tests/arthur/data/1.1/text-intro-04-t.svg delete mode 100644 tests/arthur/data/1.1/text-ws-01-t.svg delete mode 100644 tests/arthur/data/1.1/text-ws-02-t.svg delete mode 100644 tests/arthur/data/1.2/07_07.svg delete mode 100644 tests/arthur/data/1.2/07_12.svg delete mode 100644 tests/arthur/data/1.2/08_02.svg delete mode 100644 tests/arthur/data/1.2/08_03.svg delete mode 100644 tests/arthur/data/1.2/08_04.svg delete mode 100644 tests/arthur/data/1.2/09_02.svg delete mode 100644 tests/arthur/data/1.2/09_03.svg delete mode 100644 tests/arthur/data/1.2/09_04.svg delete mode 100644 tests/arthur/data/1.2/09_05.svg delete mode 100644 tests/arthur/data/1.2/09_06.svg delete mode 100644 tests/arthur/data/1.2/09_07.svg delete mode 100644 tests/arthur/data/1.2/10_03.svg delete mode 100644 tests/arthur/data/1.2/10_04.svg delete mode 100644 tests/arthur/data/1.2/10_05.svg delete mode 100644 tests/arthur/data/1.2/10_06.svg delete mode 100644 tests/arthur/data/1.2/10_07.svg delete mode 100644 tests/arthur/data/1.2/10_08.svg delete mode 100644 tests/arthur/data/1.2/10_09.svg delete mode 100644 tests/arthur/data/1.2/10_10.svg delete mode 100644 tests/arthur/data/1.2/10_11.svg delete mode 100644 tests/arthur/data/1.2/11_01.svg delete mode 100644 tests/arthur/data/1.2/11_02.svg delete mode 100644 tests/arthur/data/1.2/11_03.svg delete mode 100644 tests/arthur/data/1.2/13_01.svg delete mode 100644 tests/arthur/data/1.2/13_02.svg delete mode 100644 tests/arthur/data/1.2/19_01.svg delete mode 100644 tests/arthur/data/1.2/19_02.svg delete mode 100644 tests/arthur/data/1.2/animation.svg delete mode 100644 tests/arthur/data/1.2/cubic02.svg delete mode 100644 tests/arthur/data/1.2/fillrule-evenodd.svg delete mode 100644 tests/arthur/data/1.2/fillrule-nonzero.svg delete mode 100644 tests/arthur/data/1.2/linecap.svg delete mode 100644 tests/arthur/data/1.2/linejoin.svg delete mode 100644 tests/arthur/data/1.2/media01.svg delete mode 100644 tests/arthur/data/1.2/media02.svg delete mode 100644 tests/arthur/data/1.2/media03.svg delete mode 100644 tests/arthur/data/1.2/media04.svg delete mode 100644 tests/arthur/data/1.2/media05.svg delete mode 100644 tests/arthur/data/1.2/mpath01.svg delete mode 100644 tests/arthur/data/1.2/non-scaling-stroke.svg delete mode 100644 tests/arthur/data/1.2/noonoo.svg delete mode 100644 tests/arthur/data/1.2/referencedRect.svg delete mode 100644 tests/arthur/data/1.2/referencedRect2.svg delete mode 100644 tests/arthur/data/1.2/solidcolor.svg delete mode 100644 tests/arthur/data/1.2/textArea01.svg delete mode 100644 tests/arthur/data/1.2/timed-lyrics.svg delete mode 100644 tests/arthur/data/1.2/use.svg delete mode 100644 tests/arthur/data/bugs/.gitattributes delete mode 100644 tests/arthur/data/bugs/gradient-defaults.svg delete mode 100644 tests/arthur/data/bugs/gradient_pen_fill.svg delete mode 100644 tests/arthur/data/bugs/openglcurve.svg delete mode 100644 tests/arthur/data/bugs/org_module.svg delete mode 100644 tests/arthur/data/bugs/resolve_linear.svg delete mode 100644 tests/arthur/data/bugs/resolve_radial.svg delete mode 100644 tests/arthur/data/bugs/text_pens.svg delete mode 100644 tests/arthur/data/framework.ini delete mode 100644 tests/arthur/data/images/alpha.png delete mode 100644 tests/arthur/data/images/bitmap.png delete mode 100644 tests/arthur/data/images/border.png delete mode 100644 tests/arthur/data/images/dome_argb32.png delete mode 100644 tests/arthur/data/images/dome_indexed.png delete mode 100644 tests/arthur/data/images/dome_indexed_mask.png delete mode 100644 tests/arthur/data/images/dome_mono.png delete mode 100644 tests/arthur/data/images/dome_mono_128.png delete mode 100644 tests/arthur/data/images/dome_mono_palette.png delete mode 100644 tests/arthur/data/images/dome_rgb32.png delete mode 100644 tests/arthur/data/images/dot.png delete mode 100644 tests/arthur/data/images/face.png delete mode 100644 tests/arthur/data/images/gam030.png delete mode 100644 tests/arthur/data/images/gam045.png delete mode 100644 tests/arthur/data/images/gam056.png delete mode 100644 tests/arthur/data/images/gam100.png delete mode 100644 tests/arthur/data/images/gam200.png delete mode 100644 tests/arthur/data/images/image.png delete mode 100644 tests/arthur/data/images/mask.png delete mode 100644 tests/arthur/data/images/mask_100.png delete mode 100644 tests/arthur/data/images/masked.png delete mode 100644 tests/arthur/data/images/paths.qps delete mode 100644 tests/arthur/data/images/pens.qps delete mode 100644 tests/arthur/data/images/sign.png delete mode 100644 tests/arthur/data/images/solid.png delete mode 100644 tests/arthur/data/images/struct-image-01.jpg delete mode 100644 tests/arthur/data/images/struct-image-01.png delete mode 100644 tests/arthur/data/qps/aliasing.qps delete mode 100644 tests/arthur/data/qps/aliasing_qps.png delete mode 100644 tests/arthur/data/qps/alphas.qps delete mode 100644 tests/arthur/data/qps/alphas_qps.png delete mode 100644 tests/arthur/data/qps/arcs.qps delete mode 100644 tests/arthur/data/qps/arcs2.qps delete mode 100644 tests/arthur/data/qps/arcs2_qps.png delete mode 100644 tests/arthur/data/qps/arcs_qps.png delete mode 100644 tests/arthur/data/qps/background.qps delete mode 100644 tests/arthur/data/qps/background_brush.qps delete mode 100644 tests/arthur/data/qps/background_brush_qps.png delete mode 100644 tests/arthur/data/qps/background_qps.png delete mode 100644 tests/arthur/data/qps/beziers.qps delete mode 100644 tests/arthur/data/qps/beziers_qps.png delete mode 100644 tests/arthur/data/qps/bitmaps.qps delete mode 100644 tests/arthur/data/qps/bitmaps_qps.png delete mode 100644 tests/arthur/data/qps/borderimage.qps delete mode 100644 tests/arthur/data/qps/borderimage_qps.png delete mode 100644 tests/arthur/data/qps/brush_pens.qps delete mode 100644 tests/arthur/data/qps/brush_pens_qps.png delete mode 100644 tests/arthur/data/qps/brushes.qps delete mode 100644 tests/arthur/data/qps/brushes_qps.png delete mode 100644 tests/arthur/data/qps/clippaths.qps delete mode 100644 tests/arthur/data/qps/clippaths_qps.png delete mode 100644 tests/arthur/data/qps/clipping.qps delete mode 100644 tests/arthur/data/qps/clipping_qps.png delete mode 100644 tests/arthur/data/qps/clipping_state.qps delete mode 100644 tests/arthur/data/qps/clipping_state_qps.png delete mode 100644 tests/arthur/data/qps/cliprects.qps delete mode 100644 tests/arthur/data/qps/cliprects_qps.png delete mode 100644 tests/arthur/data/qps/conical_gradients.qps delete mode 100644 tests/arthur/data/qps/conical_gradients_perspectives.qps delete mode 100644 tests/arthur/data/qps/conical_gradients_perspectives_qps.png delete mode 100644 tests/arthur/data/qps/conical_gradients_qps.png delete mode 100644 tests/arthur/data/qps/dashes.qps delete mode 100644 tests/arthur/data/qps/dashes_qps.png delete mode 100644 tests/arthur/data/qps/degeneratebeziers.qps delete mode 100644 tests/arthur/data/qps/degeneratebeziers_qps.png delete mode 100644 tests/arthur/data/qps/deviceclipping.qps delete mode 100644 tests/arthur/data/qps/deviceclipping_qps.png delete mode 100644 tests/arthur/data/qps/drawpoints.qps delete mode 100644 tests/arthur/data/qps/drawpoints_qps.png delete mode 100644 tests/arthur/data/qps/drawtext.qps delete mode 100644 tests/arthur/data/qps/drawtext_qps.png delete mode 100644 tests/arthur/data/qps/ellipses.qps delete mode 100644 tests/arthur/data/qps/ellipses_qps.png delete mode 100644 tests/arthur/data/qps/filltest.qps delete mode 100644 tests/arthur/data/qps/filltest_qps.png delete mode 100644 tests/arthur/data/qps/fonts.qps delete mode 100644 tests/arthur/data/qps/fonts_qps.png delete mode 100644 tests/arthur/data/qps/gradients.qps delete mode 100644 tests/arthur/data/qps/gradients_qps.png delete mode 100644 tests/arthur/data/qps/image_formats.qps delete mode 100644 tests/arthur/data/qps/image_formats_qps.png delete mode 100644 tests/arthur/data/qps/images.qps delete mode 100644 tests/arthur/data/qps/images2.qps delete mode 100644 tests/arthur/data/qps/images2_qps.png delete mode 100644 tests/arthur/data/qps/images_qps.png delete mode 100644 tests/arthur/data/qps/join_cap_styles.qps delete mode 100644 tests/arthur/data/qps/join_cap_styles_duplicate_control_points.qps delete mode 100644 tests/arthur/data/qps/join_cap_styles_duplicate_control_points_qps.png delete mode 100644 tests/arthur/data/qps/join_cap_styles_qps.png delete mode 100644 tests/arthur/data/qps/linear_gradients.qps delete mode 100644 tests/arthur/data/qps/linear_gradients_perspectives.qps delete mode 100644 tests/arthur/data/qps/linear_gradients_perspectives_qps.png delete mode 100644 tests/arthur/data/qps/linear_gradients_qps.png delete mode 100644 tests/arthur/data/qps/linear_resolving_gradients.qps delete mode 100644 tests/arthur/data/qps/linear_resolving_gradients_qps.png delete mode 100644 tests/arthur/data/qps/lineconsistency.qps delete mode 100644 tests/arthur/data/qps/lineconsistency_qps.png delete mode 100644 tests/arthur/data/qps/linedashes.qps delete mode 100644 tests/arthur/data/qps/linedashes2.qps delete mode 100644 tests/arthur/data/qps/linedashes2_aa.qps delete mode 100644 tests/arthur/data/qps/linedashes2_aa_qps.png delete mode 100644 tests/arthur/data/qps/linedashes2_qps.png delete mode 100644 tests/arthur/data/qps/linedashes_qps.png delete mode 100644 tests/arthur/data/qps/lines.qps delete mode 100644 tests/arthur/data/qps/lines2.qps delete mode 100644 tests/arthur/data/qps/lines2_qps.png delete mode 100644 tests/arthur/data/qps/lines_qps.png delete mode 100644 tests/arthur/data/qps/object_bounding_mode.qps delete mode 100644 tests/arthur/data/qps/object_bounding_mode_qps.png delete mode 100644 tests/arthur/data/qps/pathfill.qps delete mode 100644 tests/arthur/data/qps/pathfill_qps.png delete mode 100644 tests/arthur/data/qps/paths.qps delete mode 100644 tests/arthur/data/qps/paths_aa.qps delete mode 100644 tests/arthur/data/qps/paths_aa_qps.png delete mode 100644 tests/arthur/data/qps/paths_qps.png delete mode 100644 tests/arthur/data/qps/pens.qps delete mode 100644 tests/arthur/data/qps/pens_aa.qps delete mode 100644 tests/arthur/data/qps/pens_aa_qps.png delete mode 100644 tests/arthur/data/qps/pens_cosmetic.qps delete mode 100644 tests/arthur/data/qps/pens_cosmetic_qps.png delete mode 100644 tests/arthur/data/qps/pens_qps.png delete mode 100644 tests/arthur/data/qps/perspectives.qps delete mode 100644 tests/arthur/data/qps/perspectives2.qps delete mode 100644 tests/arthur/data/qps/perspectives2_qps.png delete mode 100644 tests/arthur/data/qps/perspectives_qps.png delete mode 100644 tests/arthur/data/qps/pixmap_rotation.qps delete mode 100644 tests/arthur/data/qps/pixmap_rotation_qps.png delete mode 100644 tests/arthur/data/qps/pixmap_scaling.qps delete mode 100644 tests/arthur/data/qps/pixmap_subpixel.qps delete mode 100644 tests/arthur/data/qps/pixmap_subpixel_qps.png delete mode 100644 tests/arthur/data/qps/pixmaps.qps delete mode 100644 tests/arthur/data/qps/pixmaps_qps.png delete mode 100644 tests/arthur/data/qps/porter_duff.qps delete mode 100644 tests/arthur/data/qps/porter_duff2.qps delete mode 100644 tests/arthur/data/qps/porter_duff2_qps.png delete mode 100644 tests/arthur/data/qps/porter_duff_qps.png delete mode 100644 tests/arthur/data/qps/primitives.qps delete mode 100644 tests/arthur/data/qps/primitives_qps.png delete mode 100644 tests/arthur/data/qps/radial_gradients.qps delete mode 100644 tests/arthur/data/qps/radial_gradients_extended.qps delete mode 100644 tests/arthur/data/qps/radial_gradients_extended_qps.png delete mode 100644 tests/arthur/data/qps/radial_gradients_perspectives.qps delete mode 100644 tests/arthur/data/qps/radial_gradients_perspectives_qps.png delete mode 100644 tests/arthur/data/qps/radial_gradients_qps.png delete mode 100644 tests/arthur/data/qps/rasterops.qps delete mode 100644 tests/arthur/data/qps/rasterops_qps.png delete mode 100644 tests/arthur/data/qps/sizes.qps delete mode 100644 tests/arthur/data/qps/sizes_qps.png delete mode 100644 tests/arthur/data/qps/text.qps delete mode 100644 tests/arthur/data/qps/text_perspectives.qps delete mode 100644 tests/arthur/data/qps/text_perspectives_qps.png delete mode 100644 tests/arthur/data/qps/text_qps.png delete mode 100644 tests/arthur/data/qps/tiled_pixmap.qps delete mode 100644 tests/arthur/data/qps/tiled_pixmap_qps.png delete mode 100644 tests/arthur/data/random/arcs02.svg delete mode 100644 tests/arthur/data/random/atop.svg delete mode 100644 tests/arthur/data/random/clinton.svg delete mode 100644 tests/arthur/data/random/cowboy.svg delete mode 100644 tests/arthur/data/random/gear_is_rising.svg delete mode 100644 tests/arthur/data/random/gearflowers.svg delete mode 100644 tests/arthur/data/random/kde-look.svg delete mode 100644 tests/arthur/data/random/linear_grad_transform.svg delete mode 100644 tests/arthur/data/random/longhorn.svg delete mode 100644 tests/arthur/data/random/multiply.svg delete mode 100644 tests/arthur/data/random/picasso.svg delete mode 100644 tests/arthur/data/random/porterduff.svg delete mode 100644 tests/arthur/data/random/radial_grad_transform.svg delete mode 100644 tests/arthur/data/random/solidcolor.svg delete mode 100644 tests/arthur/data/random/spiral.svg delete mode 100644 tests/arthur/data/random/tests.svg delete mode 100644 tests/arthur/data/random/tests2.svg delete mode 100644 tests/arthur/data/random/tiger.svg delete mode 100644 tests/arthur/data/random/uluru.png delete mode 100644 tests/arthur/data/random/worldcup.svg delete mode 100644 tests/arthur/datagenerator/datagenerator.cpp delete mode 100644 tests/arthur/datagenerator/datagenerator.h delete mode 100644 tests/arthur/datagenerator/datagenerator.pri delete mode 100644 tests/arthur/datagenerator/datagenerator.pro delete mode 100644 tests/arthur/datagenerator/main.cpp delete mode 100644 tests/arthur/datagenerator/xmlgenerator.cpp delete mode 100644 tests/arthur/datagenerator/xmlgenerator.h delete mode 100644 tests/arthur/htmlgenerator/htmlgenerator.cpp delete mode 100644 tests/arthur/htmlgenerator/htmlgenerator.h delete mode 100644 tests/arthur/htmlgenerator/htmlgenerator.pro delete mode 100644 tests/arthur/htmlgenerator/main.cpp delete mode 100644 tests/arthur/lance/enum.png delete mode 100644 tests/arthur/lance/icons.qrc delete mode 100644 tests/arthur/lance/interactivewidget.cpp delete mode 100644 tests/arthur/lance/interactivewidget.h delete mode 100644 tests/arthur/lance/lance.pro delete mode 100644 tests/arthur/lance/main.cpp delete mode 100644 tests/arthur/lance/tools.png delete mode 100644 tests/arthur/lance/widgets.h delete mode 100644 tests/arthur/performancediff/main.cpp delete mode 100644 tests/arthur/performancediff/performancediff.cpp delete mode 100644 tests/arthur/performancediff/performancediff.h delete mode 100644 tests/arthur/performancediff/performancediff.pro delete mode 100644 tests/arthur/shower/main.cpp delete mode 100644 tests/arthur/shower/shower.cpp delete mode 100644 tests/arthur/shower/shower.h delete mode 100644 tests/arthur/shower/shower.pro create mode 100644 tests/auto/lancelot/images.qrc create mode 100644 tests/auto/lancelot/images/alpha.png create mode 100644 tests/auto/lancelot/images/alpha2x2.png create mode 100644 tests/auto/lancelot/images/bitmap.png create mode 100644 tests/auto/lancelot/images/border.png create mode 100644 tests/auto/lancelot/images/borderimage.png create mode 100644 tests/auto/lancelot/images/dome_argb32.png create mode 100644 tests/auto/lancelot/images/dome_indexed.png create mode 100644 tests/auto/lancelot/images/dome_indexed_mask.png create mode 100644 tests/auto/lancelot/images/dome_mono.png create mode 100644 tests/auto/lancelot/images/dome_mono_128.png create mode 100644 tests/auto/lancelot/images/dome_mono_palette.png create mode 100644 tests/auto/lancelot/images/dome_rgb32.png create mode 100644 tests/auto/lancelot/images/dot.png create mode 100644 tests/auto/lancelot/images/face.png create mode 100644 tests/auto/lancelot/images/gam030.png create mode 100644 tests/auto/lancelot/images/gam045.png create mode 100644 tests/auto/lancelot/images/gam056.png create mode 100644 tests/auto/lancelot/images/gam100.png create mode 100644 tests/auto/lancelot/images/gam200.png create mode 100644 tests/auto/lancelot/images/image.png create mode 100644 tests/auto/lancelot/images/mask.png create mode 100644 tests/auto/lancelot/images/mask_100.png create mode 100644 tests/auto/lancelot/images/masked.png create mode 100644 tests/auto/lancelot/images/sign.png create mode 100644 tests/auto/lancelot/images/solid.png create mode 100644 tests/auto/lancelot/images/solid2x2.png create mode 100644 tests/auto/lancelot/images/struct-image-01.jpg create mode 100644 tests/auto/lancelot/images/struct-image-01.png create mode 100644 tests/auto/lancelot/images/zebra.png create mode 100644 tests/auto/lancelot/paintcommands.cpp create mode 100644 tests/auto/lancelot/paintcommands.h create mode 100644 tests/baselineserver/.gitignore create mode 100755 tests/baselineserver/bin/runserver create mode 100644 tests/baselineserver/shared/baselineprotocol.cpp create mode 100644 tests/baselineserver/shared/baselineprotocol.h create mode 100644 tests/baselineserver/shared/baselineprotocol.pri create mode 100644 tests/baselineserver/shared/lookup3.cpp create mode 100644 tests/baselineserver/shared/qbaselinetest.cpp create mode 100644 tests/baselineserver/shared/qbaselinetest.h create mode 100644 tests/baselineserver/shared/qbaselinetest.pri create mode 100644 tests/baselineserver/src/baselineserver.cpp create mode 100644 tests/baselineserver/src/baselineserver.h create mode 100644 tests/baselineserver/src/baselineserver.pro create mode 100644 tests/baselineserver/src/baselineserver.qrc create mode 100644 tests/baselineserver/src/main.cpp create mode 100644 tests/baselineserver/src/report.cpp create mode 100644 tests/baselineserver/src/report.h create mode 100644 tests/baselineserver/src/templates/view.html create mode 100644 tests/manual/lance/README create mode 100644 tests/manual/lance/enum.png create mode 100644 tests/manual/lance/icons.qrc create mode 100644 tests/manual/lance/interactivewidget.cpp create mode 100644 tests/manual/lance/interactivewidget.h create mode 100644 tests/manual/lance/lance.pro create mode 100644 tests/manual/lance/main.cpp create mode 100644 tests/manual/lance/tools.png create mode 100644 tests/manual/lance/widgets.h diff --git a/tests/arthur/.gitattributes b/tests/arthur/.gitattributes deleted file mode 100644 index b7fa3a03c1..0000000000 --- a/tests/arthur/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -data/*/*.svg -crlf -data/qps/*.qps -crlf diff --git a/tests/arthur/.gitignore b/tests/arthur/.gitignore deleted file mode 100644 index 7f0c1fa2cd..0000000000 --- a/tests/arthur/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -bin/shower -lance/lance diff --git a/tests/arthur/README b/tests/arthur/README deleted file mode 100644 index 0178351b95..0000000000 --- a/tests/arthur/README +++ /dev/null @@ -1,84 +0,0 @@ -This is a simple regression testing framework for Arthur. - -There are three parts to it. - -1) datagenerator . which is the main part. it's used to - run all the tests, create output png files, - measure rendering performance and output it in - data.xml file. datagenerator reads in - framework.ini to figure out where to look for tests. - if the framework.ini file isn't in the current directory - you have to specify its location with the -framework - parameter. by default datagenerator generates output in the - current directory - to specify output directory pass in - -output parameter followed by a directory name. if the given - directory doesn't exist it will be created. - - it's recommended to always specify -iterations argument (followed - by the number). if the argument has been specified datagenerator - will try to render all testcases the given amount of times yielding - a lot more precise results. - - if one wants to test just a specified engine -engine argument - should be specified (followed by the desired engine name). - - individual testsuites can be run with -suite paramenter. - individual testcases from testcases can also be reran with - -testcase paramenter. - - given files can also be tested individually. if the option -file - is specified with a SVG file engines will be tested against just - that file and output will be written directly to stdout (not files). - it's useful when optimizing one engine with particular case in - mind. - - Example command line: - ./bin/datagenerator -framework data/framework.ini -output sampleout -iterations 5 -engine [ENGINE] - -2) htmlgenerator. which is used to generate html pages out of - generated output (generated by datagenerator). htmlgenerator also - reads in the framework.ini file. so the option -framework also - applies. but htmlgenerator takes a mandatory directory name as the - second argument. the mandatory directory name is the directory to - which you output the files generated by datagenerator (either - whatever followed the -output or the current directory) - - htmlgenerator will generate html pages that can be viewed to - manually inspect the results. - - Example command line: - ./bin/htmlgenerator -framework data/framework.ini sampleout - -3) performancediff. diffs the performance data between two output - directories. so assuming you already have data for all the engines, - you change something in an engine. to see the performance - difference run - ./bin/datagenerator -framework data/framework.ini -output newoutput -iterations 5 - and then - ./bin/performancediff sampleout newoutput - - The performance results will be printed out. - - The two first columns are in ms. The last one is a - percentage of difference. - - After the percentage a '+' or a '-' sign followed by a - number will be sometimes printed. - - '+' signifies the new results were mathematically better. '-' is of - course just the opposite. - the number following '+' is the minimum rendering time the engine - spent rendering the given file up till this moment. - the number following '-' is the maximum rendering time the engine - spent rendering the given file up till this moment. - - (if the current results are out of the scope from within maximum and - minimum number then the respective sign is printed out.) -------------------------------------------------------------------- - -Note that the generated output directories can be copied from one -machine to the other. htmlgenerator will generate webpages for all -engines with valid data.xml files. So if you want add NativeWin32 and -NativeMac engines you'll have to have someone with a windows and mac -run datagenerator with "-engine NativeWin32" or "-engine NativeMac" -options and then sending you the respective output directories. diff --git a/tests/arthur/arthurtester.pri b/tests/arthur/arthurtester.pri deleted file mode 100644 index 87ca08292e..0000000000 --- a/tests/arthur/arthurtester.pri +++ /dev/null @@ -1,21 +0,0 @@ -DEFINES += QT_COMPAT_WARNINGS QT_NO_CAST_TO_ASCII - -INCLUDEPATH += $$COMMON_FOLDER - -include($$COMMON_FOLDER/common.pri) - -#build_all:!build_pass { -# CONFIG -= build_all -# CONFIG += release -#} -#contains(CONFIG, debug_and_release_target) { -# CONFIG(debug, debug|release) { -# LIBS+=-L$$COMMON_FOLDER/debug -# } else { -# LIBS+=-L$$COMMON_FOLDER/release -# } -#} else { -# LIBS += -L$$COMMON_FOLDER -#} -# -#LIBS += -ltestcommon diff --git a/tests/arthur/arthurtester.pro b/tests/arthur/arthurtester.pro deleted file mode 100644 index 443ec56c30..0000000000 --- a/tests/arthur/arthurtester.pro +++ /dev/null @@ -1,6 +0,0 @@ -# -*-Mode:makefile-*- -TEMPLATE = subdirs -SUBDIRS = datagenerator htmlgenerator \ - performancediff shower lance - - diff --git a/tests/arthur/baselineserver/.gitignore b/tests/arthur/baselineserver/.gitignore deleted file mode 100644 index cc513e0df2..0000000000 --- a/tests/arthur/baselineserver/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -storage -bin/baselineserver diff --git a/tests/arthur/baselineserver/bin/runserver b/tests/arthur/baselineserver/bin/runserver deleted file mode 100755 index 48c5c1d086..0000000000 --- a/tests/arthur/baselineserver/bin/runserver +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -logfile=baselineserver.log - -while true; do - echo >> $logfile - echo -n "***RESTARTING*** " >> $logfile - date >> $logfile - - ./baselineserver 2>&1 | tee -a $logfile - - sleep 2 -done diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp deleted file mode 100644 index 6ff0a0c72d..0000000000 --- a/tests/arthur/baselineserver/src/baselineserver.cpp +++ /dev/null @@ -1,576 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#define QT_USE_FAST_CONCATENATION -#define QT_USE_FAST_OPERATOR_PLUS - -#include "baselineserver.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// extra fields, for use in image metadata storage -const QString PI_ImageChecksum(QLS("ImageChecksum")); -const QString PI_RunId(QLS("RunId")); -const QString PI_CreationDate(QLS("CreationDate")); - -QString BaselineServer::storage; -QString BaselineServer::url; -QString BaselineServer::settingsFile; - -BaselineServer::BaselineServer(QObject *parent) - : QTcpServer(parent), lastRunIdIdx(0) -{ - QFileInfo me(QCoreApplication::applicationFilePath()); - meLastMod = me.lastModified(); - heartbeatTimer = new QTimer(this); - connect(heartbeatTimer, SIGNAL(timeout()), this, SLOT(heartbeat())); - heartbeatTimer->start(HEARTBEAT*1000); -} - -QString BaselineServer::storagePath() -{ - if (storage.isEmpty()) { - storage = QLS(qgetenv("QT_LANCELOT_DIR")); - if (storage.isEmpty()) - storage = QLS("/var/www"); - } - return storage; -} - -QString BaselineServer::baseUrl() -{ - if (url.isEmpty()) { - url = QLS("http://") - + QHostInfo::localHostName().toLatin1() + '.' - + QHostInfo::localDomainName().toLatin1() + '/'; - } - return url; -} - -QString BaselineServer::settingsFilePath() -{ - if (settingsFile.isEmpty()) { - QString exeName = QCoreApplication::applicationFilePath().section(QLC('/'), -1); - settingsFile = storagePath() + QLC('/') + exeName + QLS(".ini"); - } - return settingsFile; -} - -void BaselineServer::incomingConnection(int socketDescriptor) -{ - QString runId = QDateTime::currentDateTime().toString(QLS("MMMdd-hhmmss")); - if (runId == lastRunId) { - runId += QLC('-') + QString::number(++lastRunIdIdx); - } else { - lastRunId = runId; - lastRunIdIdx = 0; - } - qDebug() << "Server: New connection! RunId:" << runId; - BaselineThread *thread = new BaselineThread(runId, socketDescriptor, this); - connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); - thread->start(); -} - -void BaselineServer::heartbeat() -{ - // The idea is to exit to be restarted when modified, as soon as not actually serving - QFileInfo me(QCoreApplication::applicationFilePath()); - if (me.lastModified() == meLastMod) - return; - if (!me.exists() || !me.isExecutable()) - return; - - //# (could close() here to avoid accepting new connections, to avoid livelock) - //# also, could check for a timeout to force exit, to avoid hung threads blocking - bool isServing = false; - foreach(BaselineThread *thread, findChildren()) { - if (thread->isRunning()) { - isServing = true; - break; - } - } - - if (!isServing) - QCoreApplication::exit(); -} - -BaselineThread::BaselineThread(const QString &runId, int socketDescriptor, QObject *parent) - : QThread(parent), runId(runId), socketDescriptor(socketDescriptor) -{ -} - -void BaselineThread::run() -{ - BaselineHandler handler(runId, socketDescriptor); - exec(); -} - - -BaselineHandler::BaselineHandler(const QString &runId, int socketDescriptor) - : QObject(), runId(runId), connectionEstablished(false) -{ - settings = new QSettings(BaselineServer::settingsFilePath(), QSettings::IniFormat, this); - - if (socketDescriptor == -1) - return; - - connect(&proto.socket, SIGNAL(readyRead()), this, SLOT(receiveRequest())); - connect(&proto.socket, SIGNAL(disconnected()), this, SLOT(receiveDisconnect())); - proto.socket.setSocketDescriptor(socketDescriptor); -} - -const char *BaselineHandler::logtime() -{ - return 0; - //return QTime::currentTime().toString(QLS("mm:ss.zzz")); -} - -bool BaselineHandler::establishConnection() -{ - if (!proto.acceptConnection(&plat)) { - qWarning() << runId << logtime() << "Accepting new connection from" << proto.socket.peerAddress().toString() << "failed." << proto.errorMessage(); - proto.sendBlock(BaselineProtocol::Abort, proto.errorMessage().toLatin1()); // In case the client can hear us, tell it what's wrong. - proto.socket.disconnectFromHost(); - return false; - } - QString logMsg; - foreach (QString key, plat.keys()) { - if (key != PI_HostName && key != PI_HostAddress) - logMsg += key + QLS(": '") + plat.value(key) + QLS("', "); - } - qDebug() << runId << logtime() << "Connection established with" << plat.value(PI_HostName) - << "[" << qPrintable(plat.value(PI_HostAddress)) << "]" << logMsg; - - settings->beginGroup("ClientFilters"); - if (!settings->childKeys().isEmpty() && !plat.value(PI_PulseGitBranch).isEmpty()) { // i.e. not adhoc client - // Abort if client does not match the filters - foreach (QString filterKey, settings->childKeys()) { - QString filter = settings->value(filterKey).toString(); - QString platVal = plat.value(filterKey); - if (filter.isEmpty() || platVal.isEmpty()) - continue; // tbd: add a syntax for specifying a "value-must-be-present" filter - if (!platVal.contains(filter)) { - qDebug() << runId << logtime() << "Did not pass client filter on" << filterKey << "; disconnecting."; - proto.sendBlock(BaselineProtocol::Abort, QByteArray("Configured to not do testing for this client or repo, ref. ") + BaselineServer::settingsFilePath().toLatin1()); - proto.socket.disconnectFromHost(); - return false; - } - } - } - settings->endGroup(); - - proto.sendBlock(BaselineProtocol::Ack, QByteArray()); - - report.init(this, runId, plat); - return true; -} - -void BaselineHandler::receiveRequest() -{ - if (!connectionEstablished) { - connectionEstablished = establishConnection(); - return; - } - - QByteArray block; - BaselineProtocol::Command cmd; - if (!proto.receiveBlock(&cmd, &block)) { - qWarning() << runId << logtime() << "Command reception failed. "<< proto.errorMessage(); - QThread::currentThread()->exit(1); - return; - } - - switch(cmd) { - case BaselineProtocol::RequestBaselineChecksums: - provideBaselineChecksums(block); - break; - case BaselineProtocol::AcceptNewBaseline: - storeImage(block, true); - break; - case BaselineProtocol::AcceptMismatch: - storeImage(block, false); - break; - default: - qWarning() << runId << logtime() << "Unknown command received. " << proto.errorMessage(); - proto.sendBlock(BaselineProtocol::UnknownError, QByteArray()); - } -} - - -void BaselineHandler::provideBaselineChecksums(const QByteArray &itemListBlock) -{ - ImageItemList itemList; - QDataStream ds(itemListBlock); - ds >> itemList; - qDebug() << runId << logtime() << "Received request for checksums for" << itemList.count() - << "items in test function" << itemList.at(0).testFunction; - - for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) { - i->imageChecksums.clear(); - i->status = ImageItem::BaselineNotFound; - QString prefix = pathForItem(*i, true); - PlatformInfo itemData = fetchItemMetadata(prefix); - if (itemData.contains(PI_ImageChecksum)) { - bool ok = false; - quint64 checksum = itemData.value(PI_ImageChecksum).toULongLong(&ok, 16); - if (ok) { - i->imageChecksums.prepend(checksum); - i->status = ImageItem::Ok; - } - } - } - - // Find and mark blacklisted items - QString context = pathForItem(itemList.at(0), true, false).section(QLC('/'), 0, -2); - if (itemList.count() > 0) { - QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST")); - if (file.open(QIODevice::ReadOnly)) { - QTextStream in(&file); - do { - QString itemName = in.readLine(); - if (!itemName.isNull()) { - for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) { - if (i->itemName == itemName) - i->status = ImageItem::IgnoreItem; - } - } - } while (!in.atEnd()); - } - } - - QByteArray block; - QDataStream ods(&block, QIODevice::WriteOnly); - ods << itemList; - proto.sendBlock(BaselineProtocol::Ack, block); - report.addItems(itemList); -} - - -void BaselineHandler::storeImage(const QByteArray &itemBlock, bool isBaseline) -{ - QDataStream ds(itemBlock); - ImageItem item; - ds >> item; - - QString prefix = pathForItem(item, isBaseline); - qDebug() << runId << logtime() << "Received" << (isBaseline ? "baseline" : "mismatched") << "image for:" << item.itemName << "Storing in" << prefix; - - QString msg; - if (isBaseline) - msg = QLS("New baseline image stored: ") + pathForItem(item, true, true) + QLS(FileFormat); - else - msg = BaselineServer::baseUrl() + report.filePath(); - proto.sendBlock(BaselineProtocol::Ack, msg.toLatin1()); - - QString dir = prefix.section(QLC('/'), 0, -2); - QDir cwd; - if (!cwd.exists(dir)) - cwd.mkpath(dir); - item.image.save(prefix + QLS(FileFormat), FileFormat); - - PlatformInfo itemData = plat; - itemData.insert(PI_ImageChecksum, QString::number(item.imageChecksums.at(0), 16)); //# Only the first is stored. TBD: get rid of list - itemData.insert(PI_RunId, runId); - itemData.insert(PI_CreationDate, QDateTime::currentDateTime().toString()); - storeItemMetadata(itemData, prefix); - - if (!isBaseline) - report.addMismatch(item); -} - - -void BaselineHandler::storeItemMetadata(const PlatformInfo &metadata, const QString &path) -{ - QFile file(path + QLS(MetadataFileExt)); - if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - qWarning() << runId << logtime() << "ERROR: could not write to file" << file.fileName(); - return; - } - QTextStream out(&file); - PlatformInfo::const_iterator it = metadata.constBegin(); - while (it != metadata.constEnd()) { - out << it.key() << ": " << it.value() << endl; - ++it; - } - file.close(); -} - - -PlatformInfo BaselineHandler::fetchItemMetadata(const QString &path) -{ - PlatformInfo res; - QFile file(path + QLS(MetadataFileExt)); - if (!file.open(QIODevice::ReadOnly)) - return res; - QTextStream in(&file); - do { - QString line = in.readLine(); - int idx = line.indexOf(QLS(": ")); - if (idx > 0) - res.insert(line.left(idx), line.mid(idx+2)); - } while (!in.atEnd()); - return res; -} - - -void BaselineHandler::receiveDisconnect() -{ - qDebug() << runId << logtime() << "Client disconnected."; - report.end(); - QThread::currentThread()->exit(0); -} - - -void BaselineHandler::mapPlatformInfo() const -{ - mapped = plat; - - // Map hostname - QString host = plat.value(PI_HostName).section(QLC('.'), 0, 0); // Filter away domain, if any - if (host.isEmpty() || host == QLS("localhost")) { - host = plat.value(PI_HostAddress); - } else { - if (!plat.value(PI_PulseGitBranch).isEmpty()) { - // i.e. pulse run, so remove index postfix typical of vm hostnames - host.remove(QRegExp(QLS("\\d+$"))); - if (host.endsWith(QLC('-'))) - host.chop(1); - } - } - if (host.isEmpty()) - host = QLS("unknownhost"); - mapped.insert(PI_HostName, host); - - // Map qmakespec - QString mkspec = plat.value(PI_QMakeSpec); - mapped.insert(PI_QMakeSpec, mkspec.replace(QLC('/'), QLC('_'))); - - // Map Qt version - QString ver = plat.value(PI_QtVersion); - mapped.insert(PI_QtVersion, ver.prepend(QLS("Qt-"))); -} - -QString BaselineHandler::pathForItem(const ImageItem &item, bool isBaseline, bool absolute) const -{ - if (mapped.isEmpty()) - mapPlatformInfo(); - - QString itemName = item.itemName.simplified(); - itemName.replace(QLC(' '), QLC('_')); - itemName.replace(QLC('.'), QLC('_')); - itemName.append(QLC('_')); - itemName.append(QString::number(item.itemChecksum, 16).rightJustified(4, QLC('0'))); - - QStringList path; - if (absolute) - path += BaselineServer::storagePath(); - path += mapped.value(PI_TestCase); - path += QLS(isBaseline ? "baselines" : "mismatches"); - path += item.testFunction; - path += mapped.value(PI_QtVersion); - path += mapped.value(PI_QMakeSpec); - path += mapped.value(PI_HostName); - if (!isBaseline) - path += runId; - path += itemName + QLC('.'); - - return path.join(QLS("/")); -} - - -QString BaselineHandler::view(const QString &baseline, const QString &rendered, const QString &compared) -{ - QFile f(":/templates/view.html"); - f.open(QIODevice::ReadOnly); - return QString::fromLatin1(f.readAll()).arg('/'+baseline, '/'+rendered, '/'+compared); -} - - -QString BaselineHandler::clearAllBaselines(const QString &context) -{ - int tot = 0; - int failed = 0; - QDirIterator it(BaselineServer::storagePath() + QLC('/') + context, - QStringList() << QLS("*.") + QLS(FileFormat) << QLS("*.") + QLS(MetadataFileExt)); - while (it.hasNext()) { - tot++; - if (!QFile::remove(it.next())) - failed++; - } - return QString(QLS("%1 of %2 baselines cleared from context ")).arg((tot-failed)/2).arg(tot/2) + context; -} - -QString BaselineHandler::updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile) -{ - int tot = 0; - int failed = 0; - QString storagePrefix = BaselineServer::storagePath() + QLC('/'); - // If itemId is set, update just that one, otherwise, update all: - QString filter = itemFile.isEmpty() ? QLS("*_????.") : itemFile; - QDirIterator it(storagePrefix + mismatchContext, QStringList() << filter + QLS(FileFormat) << filter + QLS(MetadataFileExt)); - while (it.hasNext()) { - tot++; - it.next(); - QString oldFile = storagePrefix + context + QLC('/') + it.fileName(); - QFile::remove(oldFile); // Remove existing baseline file - if (!QFile::copy(it.filePath(), oldFile)) // and replace it with the mismatch - failed++; - } - return QString(QLS("%1 of %2 baselines updated in context %3 from context %4")).arg((tot-failed)/2).arg(tot/2).arg(context, mismatchContext); -} - -QString BaselineHandler::blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist) -{ - QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST")); - QStringList blackList; - if (file.open(QIODevice::ReadWrite)) { - while (!file.atEnd()) - blackList.append(file.readLine().trimmed()); - - if (removeFromBlacklist) - blackList.removeAll(itemId); - else if (!blackList.contains(itemId)) - blackList.append(itemId); - - file.resize(0); - foreach (QString id, blackList) - file.write(id.toLatin1() + '\n'); - file.close(); - return QLS(removeFromBlacklist ? "Whitelisted " : "Blacklisted ") + itemId + QLS(" in context ") + context; - } else { - return QLS("Unable to update blacklisted tests, failed to open ") + file.fileName(); - } -} - - -void BaselineHandler::testPathMapping() -{ - qDebug() << "Storage prefix:" << BaselineServer::storagePath(); - - QStringList hosts; - hosts << QLS("bq-ubuntu910-x86-01") - << QLS("bq-ubuntu910-x86-15") - << QLS("osl-mac-master-5.test.qt.nokia.com") - << QLS("osl-mac-master-6.test.qt.nokia.com") - << QLS("sv-xp-vs-010") - << QLS("sv-xp-vs-011") - << QLS("sv-solaris-sparc-008") - << QLS("macbuilder-02.test.troll.no") - << QLS("bqvm1164") - << QLS("chimera") - << QLS("localhost") - << QLS(""); - - ImageItem item; - item.testFunction = QLS("testPathMapping"); - item.itemName = QLS("arcs.qps"); - item.imageChecksums << 0x0123456789abcdefULL; - item.itemChecksum = 0x0123; - - plat.insert(PI_QtVersion, QLS("5.0.0")); - plat.insert(PI_BuildKey, QLS("(nobuildkey)")); - plat.insert(PI_QMakeSpec, QLS("linux-g++")); - plat.insert(PI_PulseGitBranch, QLS("somebranch")); - foreach(const QString& host, hosts) { - mapped.clear(); - plat.insert(PI_HostName, host); - qDebug() << "Baseline from" << host << "->" << pathForItem(item, true); - qDebug() << "Mismatch from" << host << "->" << pathForItem(item, false); - } -} - - -QString BaselineHandler::computeMismatchScore(const QImage &baseline, const QImage &rendered) -{ - if (baseline.size() != rendered.size() || baseline.format() != rendered.format()) - return QLS("[No score, incomparable images.]"); - if (baseline.depth() != 32) - return QLS("[Score computation not implemented for format.]"); - - int w = baseline.width(); - int h = baseline.height(); - - uint ncd = 0; // number of differing color pixels - uint nad = 0; // number of differing alpha pixels - uint scd = 0; // sum of color pixel difference - uint sad = 0; // sum of alpha pixel difference - - for (int y=0; y -#include -#include -#include -#include -#include -#include -#include - -#include "baselineprotocol.h" -#include "report.h" - -// #seconds between update checks -#define HEARTBEAT 10 -#define MetadataFileExt "metadata" - -class BaselineServer : public QTcpServer -{ - Q_OBJECT - -public: - BaselineServer(QObject *parent = 0); - - static QString storagePath(); - static QString baseUrl(); - static QString settingsFilePath(); - -protected: - void incomingConnection(int socketDescriptor); - -private slots: - void heartbeat(); - -private: - QTimer *heartbeatTimer; - QDateTime meLastMod; - QString lastRunId; - int lastRunIdIdx; - static QString storage; - static QString url; - static QString settingsFile; -}; - - - -class BaselineThread : public QThread -{ - Q_OBJECT - -public: - BaselineThread(const QString &runId, int socketDescriptor, QObject *parent); - void run(); - -private: - QString runId; - int socketDescriptor; -}; - - -class BaselineHandler : public QObject -{ - Q_OBJECT - -public: - BaselineHandler(const QString &runId, int socketDescriptor = -1); - void testPathMapping(); - QString pathForItem(const ImageItem &item, bool isBaseline = true, bool absolute = true) const; - - // CGI callbacks: - static QString view(const QString &baseline, const QString &rendered, const QString &compared); - static QString clearAllBaselines(const QString &context); - static QString updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile); - static QString blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist = false); - -private slots: - void receiveRequest(); - void receiveDisconnect(); - -private: - bool establishConnection(); - void provideBaselineChecksums(const QByteArray &itemListBlock); - void storeImage(const QByteArray &itemBlock, bool isBaseline); - void storeItemMetadata(const PlatformInfo &metadata, const QString &path); - PlatformInfo fetchItemMetadata(const QString &path); - void mapPlatformInfo() const; - const char *logtime(); - QString computeMismatchScore(const QImage& baseline, const QImage& rendered); - - BaselineProtocol proto; - PlatformInfo plat; - mutable PlatformInfo mapped; - QString runId; - bool connectionEstablished; - Report report; - QSettings *settings; -}; - -#endif // BASELINESERVER_H diff --git a/tests/arthur/baselineserver/src/baselineserver.pro b/tests/arthur/baselineserver/src/baselineserver.pro deleted file mode 100644 index 770662b5fd..0000000000 --- a/tests/arthur/baselineserver/src/baselineserver.pro +++ /dev/null @@ -1,30 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2010-08-11T11:51:09 -# -#------------------------------------------------- - -QT += core network - -# gui needed for QImage -# QT -= gui - -TARGET = baselineserver -DESTDIR = ../bin -CONFIG += console -CONFIG -= app_bundle - -TEMPLATE = app - -include(../../common/baselineprotocol.pri) - -SOURCES += main.cpp \ - baselineserver.cpp \ - report.cpp - -HEADERS += \ - baselineserver.h \ - report.h - -RESOURCES += \ - baselineserver.qrc diff --git a/tests/arthur/baselineserver/src/baselineserver.qrc b/tests/arthur/baselineserver/src/baselineserver.qrc deleted file mode 100644 index b5cd6afadb..0000000000 --- a/tests/arthur/baselineserver/src/baselineserver.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - templates/view.html - - diff --git a/tests/arthur/baselineserver/src/main.cpp b/tests/arthur/baselineserver/src/main.cpp deleted file mode 100644 index 8e5fa4e669..0000000000 --- a/tests/arthur/baselineserver/src/main.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include "baselineserver.h" - -int main(int argc, char *argv[]) -{ - QCoreApplication a(argc, argv); - - QString queryString(qgetenv("QUERY_STRING")); - if (!queryString.isEmpty()) { - // run as CGI script - Report::handleCGIQuery(queryString); - return 0; - } - - if (a.arguments().contains(QLatin1String("-testmapping"))) { - BaselineHandler h(QLS("SomeRunId")); - h.testPathMapping(); - return 0; - } - - BaselineServer server; - if (!server.listen(QHostAddress::Any, BaselineProtocol::ServerPort)) { - qWarning("Failed to listen!"); - return 1; - } - - qDebug() << "\n*****" << argv[0] << "started, ready to serve on port" << BaselineProtocol::ServerPort - << "with baseline protocol version" << BaselineProtocol::ProtocolVersion << "*****\n"; - return a.exec(); -} diff --git a/tests/arthur/baselineserver/src/report.cpp b/tests/arthur/baselineserver/src/report.cpp deleted file mode 100644 index 7c2d6ac6df..0000000000 --- a/tests/arthur/baselineserver/src/report.cpp +++ /dev/null @@ -1,311 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "report.h" -#include "baselineprotocol.h" -#include "baselineserver.h" -#include -#include -#include - -Report::Report() - : written(false), numItems(0), numMismatches(0) -{ -} - -Report::~Report() -{ - end(); -} - -QString Report::filePath() -{ - return path; -} - -void Report::init(const BaselineHandler *h, const QString &r, const PlatformInfo &p) -{ - handler = h; - runId = r; - plat = p; - rootDir = BaselineServer::storagePath() + QLC('/'); - reportDir = plat.value(PI_TestCase) + QLC('/') + (plat.value(PI_PulseGitBranch).isEmpty() ? QLS("reports/adhoc/") : QLS("reports/pulse/")); - QString dir = rootDir + reportDir; - QDir cwd; - if (!cwd.exists(dir)) - cwd.mkpath(dir); - path = reportDir + QLS("Report_") + runId + QLS(".html"); -} - -void Report::addItems(const ImageItemList &items) -{ - if (items.isEmpty()) - return; - numItems += items.size(); - QString func = items.at(0).testFunction; - if (!testFunctions.contains(func)) - testFunctions.append(func); - itemLists[func] += items; -} - -void Report::addMismatch(const ImageItem &item) -{ - if (!testFunctions.contains(item.testFunction)) { - qWarning() << "Report::addMismatch: unknown testfunction" << item.testFunction; - return; - } - bool found = false; - ImageItemList &list = itemLists[item.testFunction]; - for (ImageItemList::iterator it = list.begin(); it != list.end(); ++it) { - if (it->itemName == item.itemName && it->itemChecksum == item.itemChecksum) { - it->status = ImageItem::Mismatch; - found = true; - break; - } - } - if (found) - numMismatches++; - else - qWarning() << "Report::addMismatch: unknown item" << item.itemName << "in testfunction" << item.testFunction; -} - -void Report::end() -{ - if (written || !numMismatches) - return; - write(); - written = true; -} - - -void Report::write() -{ - QFile file(rootDir + path); - if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - qWarning() << "Failed to open report file" << file.fileName(); - return; - } - out.setDevice(&file); - - writeHeader(); - foreach(const QString &func, testFunctions) { - writeFunctionResults(itemLists.value(func)); - } - writeFooter(); - file.close(); -} - - -void Report::writeHeader() -{ - QString title = plat.value(PI_TestCase) + QLS(" Qt Baseline Test Report"); - out << "" << title << "\n" - << "

" << title << "

\n" - << "

Note: This is a static page, generated at " << QDateTime::currentDateTime().toString() - << " for the test run with id " << runId << "

\n" - << "

Summary: " << numMismatches << " of " << numItems << " items reported mismatching

\n\n"; - out << "

Platform Info:

\n" - << "\n"; - foreach (QString key, plat.keys()) - out << "\n"; - out << "
" << key << "" << plat.value(key) << "
\n\n"; -} - - -void Report::writeFunctionResults(const ImageItemList &list) -{ - QString testFunction = list.at(0).testFunction; - QString pageUrl = BaselineServer::baseUrl() + path; - QString ctx = handler->pathForItem(list.at(0), true, false).section(QLC('/'), 0, -2); - QString misCtx = handler->pathForItem(list.at(0), false, false).section(QLC('/'), 0, -2); - - - out << "\n

 

Test function: " << testFunction << "

\n"; - out << "

Clear all baselines for this testfunction (They will be recreated by the next run)

\n"; - out << "

Let these mismatching images be the new baselines for this testfunction

\n\n"; - - out << "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n\n"; - - foreach (const ImageItem &item, list) { - out << "\n"; - out << "\n"; - QString prefix = handler->pathForItem(item, true, false); - QString baseline = prefix + QLS(FileFormat); - QString metadata = prefix + QLS(MetadataFileExt); - if (item.status == ImageItem::Mismatch) { - QString rendered = handler->pathForItem(item, false, false) + QLS(FileFormat); - QString itemFile = prefix.section(QLC('/'), -1); - writeItem(baseline, rendered, item, itemFile, ctx, misCtx, metadata); - } - else { - out << "\n" - << "\n" - << "\n"; - } - out << "\n\n"; - } - - out << "
ItemBaselineRenderedComparison (diffs are RED)Info/Action
" << item.itemName << "image infon/a"; - switch (item.status) { - case ImageItem::BaselineNotFound: - out << "Baseline not found/regenerated"; - break; - case ImageItem::IgnoreItem: - out << "Blacklisted " - << "Whitelist this item"; - break; - case ImageItem::Ok: - out << "No mismatch reported"; - break; - default: - out << "?"; - break; - } - out << "
\n"; -} - -void Report::writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, - const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata) -{ - QString compared = generateCompared(baseline, rendered); - QString pageUrl = BaselineServer::baseUrl() + path; - - QStringList images = QStringList() << baseline << rendered << compared; - foreach (const QString& img, images) - out << "\n"; - - out << "\n" - << "

Mismatch reported

\n" - << "

Baseline Info\n" - << "

Let this be the new baseline

\n" - << "

Blacklist this item

\n" - << "

Inspect

\n" - << "\n"; -} - -void Report::writeFooter() -{ - out << "\n\n"; -} - - -QString Report::generateCompared(const QString &baseline, const QString &rendered, bool fuzzy) -{ - QString res = rendered; - QFileInfo fi(res); - res.chop(fi.suffix().length() + 1); - res += QLS(fuzzy ? "_fuzzycompared.png" : "_compared.png"); - QStringList args; - if (fuzzy) - args << QLS("-fuzz") << QLS("5%"); - args << rootDir+baseline << rootDir+rendered << rootDir+res; - QProcess::execute(QLS("compare"), args); - return res; -} - - -QString Report::generateThumbnail(const QString &image) -{ - QString res = image; - QFileInfo imgFI(rootDir+image); - res.chop(imgFI.suffix().length() + 1); - res += QLS("_thumbnail.jpg"); - QFileInfo resFI(rootDir+res); - if (resFI.exists() && resFI.lastModified() > imgFI.lastModified()) - return res; - QStringList args; - args << rootDir+image << QLS("-resize") << QLS("240x240>") << QLS("-quality") << QLS("50") << rootDir+res; - QProcess::execute(QLS("convert"), args); - return res; -} - - -void Report::handleCGIQuery(const QString &query) -{ - QUrl cgiUrl(QLS("http://dummy/cgi-bin/dummy.cgi?") + query); - QTextStream s(stdout); - s << "Content-Type: text/html\r\n\r\n" - << ""; - - QString command(cgiUrl.queryItemValue("cmd")); - - if (command == QLS("view")) { - s << BaselineHandler::view(cgiUrl.queryItemValue(QLS("baseline")), - cgiUrl.queryItemValue(QLS("rendered")), - cgiUrl.queryItemValue(QLS("compared"))); - } - else if (command == QLS("updateSingleBaseline")) { - s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")), - cgiUrl.queryItemValue(QLS("mismatchContext")), - cgiUrl.queryItemValue(QLS("itemFile"))); - } else if (command == QLS("updateAllBaselines")) { - s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")), - cgiUrl.queryItemValue(QLS("mismatchContext")), - QString()); - } else if (command == QLS("clearAllBaselines")) { - s << BaselineHandler::clearAllBaselines(cgiUrl.queryItemValue(QLS("context"))); - } else if (command == QLS("blacklist")) { - // blacklist a test - s << BaselineHandler::blacklistTest(cgiUrl.queryItemValue(QLS("context")), - cgiUrl.queryItemValue(QLS("itemId"))); - } else if (command == QLS("whitelist")) { - // whitelist a test - s << BaselineHandler::blacklistTest(cgiUrl.queryItemValue(QLS("context")), - cgiUrl.queryItemValue(QLS("itemId")), true); - } else { - s << "Unknown query:
" << query << "
"; - } - s << "

Back to report"; - s << ""; -} diff --git a/tests/arthur/baselineserver/src/report.h b/tests/arthur/baselineserver/src/report.h deleted file mode 100644 index d21102d32f..0000000000 --- a/tests/arthur/baselineserver/src/report.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef REPORT_H -#define REPORT_H - -#include "baselineprotocol.h" -#include -#include -#include -#include - -class BaselineHandler; - -class Report -{ -public: - Report(); - ~Report(); - - void init(const BaselineHandler *h, const QString &r, const PlatformInfo &p); - void addItems(const ImageItemList& items); - void addMismatch(const ImageItem& item); - void end(); - - QString filePath(); - - static void handleCGIQuery(const QString &query); - -private: - void write(); - void writeFunctionResults(const ImageItemList &list); - void writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, - const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata); - void writeHeader(); - void writeFooter(); - QString generateCompared(const QString &baseline, const QString &rendered, bool fuzzy = false); - QString generateThumbnail(const QString &image); - - const BaselineHandler *handler; - QString runId; - PlatformInfo plat; - QString rootDir; - QString reportDir; - QString path; - QStringList testFunctions; - QMap itemLists; - bool written; - int numItems; - int numMismatches; - QTextStream out; -}; - -#endif // REPORT_H diff --git a/tests/arthur/baselineserver/src/templates/view.html b/tests/arthur/baselineserver/src/templates/view.html deleted file mode 100644 index c048f4781c..0000000000 --- a/tests/arthur/baselineserver/src/templates/view.html +++ /dev/null @@ -1,79 +0,0 @@ -

Lancelot Viewer

- -

-Zoom: -1x -2x -4x -

- -

- - - - - - - - - - - - -
Baseline%1
Rendered%2
Differences

- - -

- -

- - diff --git a/tests/arthur/common/baselineprotocol.cpp b/tests/arthur/common/baselineprotocol.cpp deleted file mode 100644 index 0fe3aa22a9..0000000000 --- a/tests/arthur/common/baselineprotocol.cpp +++ /dev/null @@ -1,527 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "baselineprotocol.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -const QString PI_TestCase(QLS("TestCase")); -const QString PI_HostName(QLS("HostName")); -const QString PI_HostAddress(QLS("HostAddress")); -const QString PI_OSName(QLS("OSName")); -const QString PI_OSVersion(QLS("OSVersion")); -const QString PI_QtVersion(QLS("QtVersion")); -const QString PI_BuildKey(QLS("BuildKey")); -const QString PI_GitCommit(QLS("GitCommit")); -const QString PI_QMakeSpec(QLS("QMakeSpec")); -const QString PI_PulseGitBranch(QLS("PulseGitBranch")); -const QString PI_PulseTestrBranch(QLS("PulseTestrBranch")); - -#ifndef QMAKESPEC -#define QMAKESPEC "Unknown" -#endif - -#if defined(Q_OS_WIN) -#include -#endif -#if defined(Q_OS_UNIX) -#include -#endif -void BaselineProtocol::sysSleep(int ms) -{ -#if defined(Q_OS_WIN) - Sleep(DWORD(ms)); -#else - struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; - nanosleep(&ts, NULL); -#endif -} - -PlatformInfo::PlatformInfo() - : QMap(), replaceDefault(false) -{ -} - -PlatformInfo PlatformInfo::localHostInfo() -{ - PlatformInfo pi; - pi.insert(PI_HostName, QHostInfo::localHostName()); - pi.insert(PI_QtVersion, QLS(qVersion())); - pi.insert(PI_QMakeSpec, QString(QLS(QMAKESPEC)).remove(QRegExp(QLS("^.*mkspecs/")))); - pi.insert(PI_BuildKey, QLibraryInfo::buildKey()); -#if defined(Q_OS_LINUX) - pi.insert(PI_OSName, QLS("Linux")); - QProcess uname; - uname.start(QLS("uname"), QStringList() << QLS("-r")); - if (uname.waitForFinished(3000)) - pi.insert(PI_OSVersion, QString::fromLocal8Bit(uname.readAllStandardOutput().constData()).simplified()); -#elif defined(Q_OS_WINCE) - pi.insert(PI_OSName, QLS("WinCE")); - pi.insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion())); -#elif defined(Q_OS_WIN) - pi.insert(PI_OSName, QLS("Windows")); - pi.insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion())); -#elif defined(Q_OS_MAC) - pi.insert(PI_OSName, QLS("MacOS")); - pi.insert(PI_OSVersion, QString::number(qMacVersion())); -#elif defined(Q_OS_SYMBIAN) - pi.insert(PI_OSName, QLS("Symbian")); - pi.insert(PI_OSVersion, QString::number(QSysInfo::symbianVersion()); -#else - pi.insert(PI_OSName, QLS("Other")); -#endif - - QProcess git; - QString cmd; - QStringList args; -#if defined(Q_OS_WIN) - cmd = QLS("cmd.exe"); - args << QLS("/c") << QLS("git"); -#else - cmd = QLS("git"); -#endif - args << QLS("log") << QLS("--max-count=1") << QLS("--pretty=%H [%an] [%ad] %s"); - git.start(cmd, args); - git.waitForFinished(3000); - if (!git.exitCode()) - pi.insert(PI_GitCommit, QString::fromLocal8Bit(git.readAllStandardOutput().constData()).simplified()); - else - pi.insert(PI_GitCommit, QLS("Unknown")); - - QByteArray gb = qgetenv("PULSE_GIT_BRANCH"); - if (!gb.isEmpty()) - pi.insert(PI_PulseGitBranch, QString::fromLatin1(gb)); - QByteArray tb = qgetenv("PULSE_TESTR_BRANCH"); - if (!tb.isEmpty()) - pi.insert(PI_PulseTestrBranch, QString::fromLatin1(tb)); - - return pi; -} - - -PlatformInfo::PlatformInfo(const PlatformInfo &other) - : QMap(other) -{ - sigKeys = other.sigKeys; - replaceDefault = other.replaceDefault; -} - - -PlatformInfo &PlatformInfo::operator=(const PlatformInfo &other) -{ - QMap::operator=(other); - sigKeys = other.sigKeys; - replaceDefault = other.replaceDefault; - return *this; -} - - -void PlatformInfo::addSignificantKeys(const QStringList &keys, bool replaceDefaultKeys) -{ - sigKeys = keys; - replaceDefault = replaceDefaultKeys; -} - - -QStringList PlatformInfo::addedKeys() const -{ - return sigKeys; -} - - -bool PlatformInfo::addedKeysReplaceDefault() const -{ - return replaceDefault; -} - - -QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi) -{ - stream << static_cast&>(pi); - stream << pi.sigKeys << pi.replaceDefault; - return stream; -} - - -QDataStream & operator>> (QDataStream &stream, PlatformInfo &pi) -{ - stream >> static_cast&>(pi); - stream >> pi.sigKeys >> pi.replaceDefault; - return stream; -} - - -ImageItem &ImageItem::operator=(const ImageItem &other) -{ - testFunction = other.testFunction; - itemName = other.itemName; - itemChecksum = other.itemChecksum; - status = other.status; - image = other.image; - imageChecksums = other.imageChecksums; - return *this; -} - -// Defined in lookup3.c: -void hashword2 ( -const quint32 *k, /* the key, an array of quint32 values */ -size_t length, /* the length of the key, in quint32s */ -quint32 *pc, /* IN: seed OUT: primary hash value */ -quint32 *pb); /* IN: more seed OUT: secondary hash value */ - -quint64 ImageItem::computeChecksum(const QImage &image) -{ - QImage img(image); - const int bpl = img.bytesPerLine(); - const int padBytes = bpl - (img.width() * img.depth() / 8); - if (padBytes) { - uchar *p = img.bits() + bpl - padBytes; - const int h = img.height(); - for (int y = 0; y < h; ++y) { - qMemSet(p, 0, padBytes); - p += bpl; - } - } - - quint32 h1 = 0xfeedbacc; - quint32 h2 = 0x21604894; - hashword2((const quint32 *)img.constBits(), img.byteCount()/4, &h1, &h2); - return (quint64(h1) << 32) | h2; -} - -#if 0 -QString ImageItem::engineAsString() const -{ - switch (engine) { - case Raster: - return QLS("Raster"); - break; - case OpenGL: - return QLS("OpenGL"); - break; - default: - break; - } - return QLS("Unknown"); -} - -QString ImageItem::formatAsString() const -{ - static const int numFormats = 16; - static const char *formatNames[numFormats] = { - "Invalid", - "Mono", - "MonoLSB", - "Indexed8", - "RGB32", - "ARGB32", - "ARGB32-Premult", - "RGB16", - "ARGB8565-Premult", - "RGB666", - "ARGB6666-Premult", - "RGB555", - "ARGB8555-Premult", - "RGB888", - "RGB444", - "ARGB4444-Premult" - }; - if (renderFormat < 0 || renderFormat >= numFormats) - return QLS("UnknownFormat"); - return QLS(formatNames[renderFormat]); -} -#endif - -void ImageItem::writeImageToStream(QDataStream &out) const -{ - if (image.isNull() || image.format() == QImage::Format_Invalid) { - out << quint8(0); - return; - } - out << quint8('Q') << quint8(image.format()); - out << quint8(QSysInfo::ByteOrder) << quint8(0); // pad to multiple of 4 bytes - out << quint32(image.width()) << quint32(image.height()) << quint32(image.bytesPerLine()); - out << qCompress((const uchar *)image.constBits(), image.byteCount()); - //# can be followed by colormap for formats that use it -} - -void ImageItem::readImageFromStream(QDataStream &in) -{ - quint8 hdr, fmt, endian, pad; - quint32 width, height, bpl; - QByteArray data; - - in >> hdr; - if (hdr != 'Q') { - image = QImage(); - return; - } - in >> fmt >> endian >> pad; - if (!fmt || fmt >= QImage::NImageFormats) { - image = QImage(); - return; - } - if (endian != QSysInfo::ByteOrder) { - qWarning("ImageItem cannot read streamed image with different endianness"); - image = QImage(); - return; - } - in >> width >> height >> bpl; - in >> data; - data = qUncompress(data); - QImage res((const uchar *)data.constData(), width, height, bpl, QImage::Format(fmt)); - image = res.copy(); //# yuck, seems there is currently no way to avoid data copy -} - -QDataStream & operator<< (QDataStream &stream, const ImageItem &ii) -{ - stream << ii.testFunction << ii.itemName << ii.itemChecksum << quint8(ii.status) << ii.imageChecksums << ii.misc; - ii.writeImageToStream(stream); - return stream; -} - -QDataStream & operator>> (QDataStream &stream, ImageItem &ii) -{ - quint8 encStatus; - stream >> ii.testFunction >> ii.itemName >> ii.itemChecksum >> encStatus >> ii.imageChecksums >> ii.misc; - ii.status = ImageItem::ItemStatus(encStatus); - ii.readImageFromStream(stream); - return stream; -} - -BaselineProtocol::BaselineProtocol() -{ -} - -BaselineProtocol::~BaselineProtocol() -{ - socket.close(); - if (socket.state() != QTcpSocket::UnconnectedState) - socket.waitForDisconnected(Timeout); -} - - -bool BaselineProtocol::connect(const QString &testCase, bool *dryrun) -{ - errMsg.clear(); - QByteArray serverName(qgetenv("QT_LANCELOT_SERVER")); - if (serverName.isNull()) - serverName = "lancelot.test.qt.nokia.com"; - - socket.connectToHost(serverName, ServerPort); - if (!socket.waitForConnected(Timeout)) { - sysSleep(Timeout); // Wait a bit and try again, the server might just be restarting - if (!socket.waitForConnected(Timeout)) { - errMsg += QLS("TCP connectToHost failed. Host:") + serverName + QLS(" port:") + QString::number(ServerPort); - return false; - } - } - - PlatformInfo pi = PlatformInfo::localHostInfo(); - pi.insert(PI_TestCase, testCase); - QByteArray block; - QDataStream ds(&block, QIODevice::ReadWrite); - ds << pi; - if (!sendBlock(AcceptPlatformInfo, block)) { - errMsg += QLS("Failed to send data to server."); - return false; - } - - Command cmd = UnknownError; - if (!receiveBlock(&cmd, &block)) { - errMsg.prepend(QLS("Failed to get response from server. ")); - return false; - } - - if (cmd == Abort) { - errMsg += QLS("Server rejected connection. Reason: ") + QString::fromLatin1(block); - return false; - } - - if (dryrun) - *dryrun = (cmd == DoDryRun); - - if (cmd != Ack && cmd != DoDryRun) { - errMsg += QLS("Unexpected response from server."); - return false; - } - - return true; -} - - -bool BaselineProtocol::acceptConnection(PlatformInfo *pi) -{ - errMsg.clear(); - - QByteArray block; - Command cmd = AcceptPlatformInfo; - if (!receiveBlock(&cmd, &block) || cmd != AcceptPlatformInfo) - return false; - - if (pi) { - QDataStream ds(block); - ds >> *pi; - pi->insert(PI_HostAddress, socket.peerAddress().toString()); - } - - return true; -} - - -bool BaselineProtocol::requestBaselineChecksums(const QString &testFunction, ImageItemList *itemList) -{ - errMsg.clear(); - if (!itemList) - return false; - - for(ImageItemList::iterator it = itemList->begin(); it != itemList->end(); it++) - it->testFunction = testFunction; - - QByteArray block; - QDataStream ds(&block, QIODevice::WriteOnly); - ds << *itemList; - if (!sendBlock(RequestBaselineChecksums, block)) - return false; - - Command cmd; - QByteArray rcvBlock; - if (!receiveBlock(&cmd, &rcvBlock) || cmd != BaselineProtocol::Ack) - return false; - QDataStream rds(&rcvBlock, QIODevice::ReadOnly); - rds >> *itemList; - return true; -} - - -bool BaselineProtocol::submitNewBaseline(const ImageItem &item, QByteArray *serverMsg) -{ - Command cmd; - return (sendItem(AcceptNewBaseline, item) && receiveBlock(&cmd, serverMsg) && cmd == Ack); -} - - -bool BaselineProtocol::submitMismatch(const ImageItem &item, QByteArray *serverMsg) -{ - Command cmd; - return (sendItem(AcceptMismatch, item) && receiveBlock(&cmd, serverMsg) && cmd == Ack); -} - - -bool BaselineProtocol::sendItem(Command cmd, const ImageItem &item) -{ - errMsg.clear(); - QBuffer buf; - buf.open(QIODevice::WriteOnly); - QDataStream ds(&buf); - ds << item; - if (!sendBlock(cmd, buf.data())) { - errMsg.prepend(QLS("Failed to submit image to server. ")); - return false; - } - return true; -} - - -bool BaselineProtocol::sendBlock(Command cmd, const QByteArray &block) -{ - QDataStream s(&socket); - // TBD: set qds version as a constant - s << quint16(ProtocolVersion) << quint16(cmd); - s.writeBytes(block.constData(), block.size()); - return true; -} - - -bool BaselineProtocol::receiveBlock(Command *cmd, QByteArray *block) -{ - while (socket.bytesAvailable() < int(2*sizeof(quint16) + sizeof(quint32))) { - if (!socket.waitForReadyRead(Timeout)) - return false; - } - QDataStream ds(&socket); - quint16 rcvProtocolVersion, rcvCmd; - ds >> rcvProtocolVersion >> rcvCmd; - if (rcvProtocolVersion != ProtocolVersion) { - errMsg = QLS("Baseline protocol version mismatch, received:") + QString::number(rcvProtocolVersion) - + QLS(" expected:") + QString::number(ProtocolVersion); - return false; - } - if (cmd) - *cmd = Command(rcvCmd); - - QByteArray uMsg; - quint32 remaining; - ds >> remaining; - uMsg.resize(remaining); - int got = 0; - char* uMsgBuf = uMsg.data(); - do { - got = ds.readRawData(uMsgBuf, remaining); - remaining -= got; - uMsgBuf += got; - } while (remaining && got >= 0 && socket.waitForReadyRead(Timeout)); - - if (got < 0) - return false; - - if (block) - *block = uMsg; - - return true; -} - - -QString BaselineProtocol::errorMessage() -{ - QString ret = errMsg; - if (socket.error() >= 0) - ret += QLS(" Socket state: ") + socket.errorString(); - return ret; -} - diff --git a/tests/arthur/common/baselineprotocol.h b/tests/arthur/common/baselineprotocol.h deleted file mode 100644 index 2d09e683d4..0000000000 --- a/tests/arthur/common/baselineprotocol.h +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BASELINEPROTOCOL_H -#define BASELINEPROTOCOL_H - -#include -#include -#include -#include -#include -#include -#include - -#define QLS QLatin1String -#define QLC QLatin1Char - -#define FileFormat "png" - -extern const QString PI_TestCase; -extern const QString PI_HostName; -extern const QString PI_HostAddress; -extern const QString PI_OSName; -extern const QString PI_OSVersion; -extern const QString PI_QtVersion; -extern const QString PI_BuildKey; -extern const QString PI_GitCommit; -extern const QString PI_QMakeSpec; -extern const QString PI_PulseGitBranch; -extern const QString PI_PulseTestrBranch; - -class PlatformInfo : public QMap -{ -public: - PlatformInfo(); - PlatformInfo(const PlatformInfo &other); - ~PlatformInfo() - {} - PlatformInfo &operator=(const PlatformInfo &other); - - static PlatformInfo localHostInfo(); - - void addSignificantKeys(const QStringList& keys, bool replaceDefaultKeys=false); - QStringList addedKeys() const; - bool addedKeysReplaceDefault() const; - -private: - QStringList sigKeys; - bool replaceDefault; - friend QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi); - friend QDataStream & operator>> (QDataStream &stream, PlatformInfo& pi); -}; -QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi); -QDataStream & operator>> (QDataStream &stream, PlatformInfo& pi); - - -struct ImageItem -{ -public: - ImageItem() - : status(Ok), itemChecksum(0) - {} - ImageItem(const ImageItem &other) - { *this = other; } - ~ImageItem() - {} - ImageItem &operator=(const ImageItem &other); - - static quint64 computeChecksum(const QImage& image); - - enum ItemStatus { - Ok = 0, - BaselineNotFound = 1, - IgnoreItem = 2, - Mismatch = 3 - }; - - QString testFunction; - QString itemName; - ItemStatus status; - QImage image; - QList imageChecksums; - quint16 itemChecksum; - QByteArray misc; - - void writeImageToStream(QDataStream &stream) const; - void readImageFromStream(QDataStream &stream); -}; -QDataStream & operator<< (QDataStream &stream, const ImageItem &ii); -QDataStream & operator>> (QDataStream &stream, ImageItem& ii); - -Q_DECLARE_METATYPE(ImageItem); - -typedef QVector ImageItemList; - - -class BaselineProtocol -{ -public: - BaselineProtocol(); - ~BaselineProtocol(); - - static BaselineProtocol *instance(QObject *parent = 0); - - // **************************************************** - // Important constants here - // **************************************************** - enum Constant { - ProtocolVersion = 5, - ServerPort = 54129, - Timeout = 15000 - }; - - enum Command { - UnknownError = 0, - // Queries - AcceptPlatformInfo = 1, - RequestBaselineChecksums = 2, - AcceptNewBaseline = 4, - AcceptMismatch = 5, - // Responses - Ack = 128, - Abort = 129, - DoDryRun = 130 - }; - - // For client: - - // For advanced client: - bool connect(const QString &testCase, bool *dryrun = 0); - bool requestBaselineChecksums(const QString &testFunction, ImageItemList *itemList); - bool submitNewBaseline(const ImageItem &item, QByteArray *serverMsg); - bool submitMismatch(const ImageItem &item, QByteArray *serverMsg); - - // For server: - bool acceptConnection(PlatformInfo *pi); - - QString errorMessage(); - -private: - bool sendItem(Command cmd, const ImageItem &item); - - bool sendBlock(Command cmd, const QByteArray &block); - bool receiveBlock(Command *cmd, QByteArray *block); - void sysSleep(int ms); - - QString errMsg; - QTcpSocket socket; - - friend class BaselineThread; - friend class BaselineHandler; -}; - - -#endif // BASELINEPROTOCOL_H diff --git a/tests/arthur/common/baselineprotocol.pri b/tests/arthur/common/baselineprotocol.pri deleted file mode 100644 index 62e38a6ab5..0000000000 --- a/tests/arthur/common/baselineprotocol.pri +++ /dev/null @@ -1,11 +0,0 @@ -INCLUDEPATH += $$PWD -DEPENDPATH += $$PWD - -QT *= network - -SOURCES += \ - $$PWD/baselineprotocol.cpp \ - $$PWD/lookup3.cpp - -HEADERS += \ - $$PWD/baselineprotocol.h diff --git a/tests/arthur/common/common.pri b/tests/arthur/common/common.pri deleted file mode 100644 index 1f84904474..0000000000 --- a/tests/arthur/common/common.pri +++ /dev/null @@ -1,18 +0,0 @@ -VPATH+=$$PWD -INCLUDEPATH += $$PWD - -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):DEFINES += BUILD_OPENGL - -SOURCES += \ - xmldata.cpp \ - paintcommands.cpp \ - qengines.cpp \ - framework.cpp - -HEADERS += \ - xmldata.h \ - paintcommands.h \ - qengines.h \ - framework.h - -RESOURCES += images.qrc diff --git a/tests/arthur/common/common.pro b/tests/arthur/common/common.pro deleted file mode 100644 index 2a1f8f04fb..0000000000 --- a/tests/arthur/common/common.pro +++ /dev/null @@ -1,20 +0,0 @@ -# -*- Mode: makefile -*- -# -# not used as a library all binaries include common.pri anyway -# -#COMMON_FOLDER = ../common -#include(../arthurtester.pri) -#TEMPLATE = lib -#CONFIG += static -#QT += xml opengl svg - -#build_all:!build_pass { -# CONFIG -= build_all -# CONFIG += release -#} - -#TARGET = testcommon - -#include(common.pri) - - diff --git a/tests/arthur/common/framework.cpp b/tests/arthur/common/framework.cpp deleted file mode 100644 index cfe996db90..0000000000 --- a/tests/arthur/common/framework.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "framework.h" - -#include -#include -#include -#include -#include - -Framework::Framework() - : qsettings(0) -{ -} - -Framework::Framework(const QString &file) - : qsettings(0) -{ - load(file); -} - -Framework::~Framework() -{ - delete qsettings; - qsettings = 0; -} - -QString Framework::basePath() const -{ - if (!qsettings) - return QString(); - - QFileInfo fi(qsettings->fileName()); - return fi.absolutePath(); -} - - -QStringList Framework::suites() const -{ - if (!qsettings) - return QStringList(); - - QStringList tests = qsettings->childGroups(); - qDebug()<<"here suites "<beginGroup(QString("Blacklist")); - QStringList engines = qsettings->childKeys(); - foreach(QString engineName, engines) { - QStringList testcases = qsettings->value(engineName).toStringList(); - m_blacklist.insert(engineName, testcases); - qDebug()<<"Blacklists for "<endGroup(); - } -} - -QString Framework::outputDir() const -{ - qsettings->beginGroup("General"); - QString outputDirName = qsettings->value("outputDir").toString(); - qsettings->endGroup(); - return outputDirName; -} - -QSettings * Framework::settings() const -{ - return qsettings; -} diff --git a/tests/arthur/common/framework.h b/tests/arthur/common/framework.h deleted file mode 100644 index 0fa496f6cc..0000000000 --- a/tests/arthur/common/framework.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef FRAMEWORK_H -#define FRAMEWORK_H - -#include -#include -#include - -QT_FORWARD_DECLARE_CLASS(QSettings) - -class Framework -{ -public: - Framework(); - Framework(const QString &file); - ~Framework(); - - bool isValid() const; - - void load(const QString &file); - - QSettings *settings() const; - - - QString basePath() const; - QString outputDir() const; - - QStringList suites() const; - - bool isTestBlacklisted(const QString &engineName, - const QString &testcase) const; -private: - QSettings *qsettings; - QMap m_blacklist; -}; - -#endif diff --git a/tests/arthur/common/images.qrc b/tests/arthur/common/images.qrc deleted file mode 100644 index 060b52c85a..0000000000 --- a/tests/arthur/common/images.qrc +++ /dev/null @@ -1,34 +0,0 @@ - - - - images/alpha.png - images/border.png - images/borderimage.png - images/dome_argb32.png - images/dome_indexed.png - images/dome_mono_palette.png - images/dome_rgb32.png - images/face.png - images/gam045.png - images/gam100.png - images/image.png - images/masked.png - images/sign.png - images/struct-image-01.jpg - images/bitmap.png - images/dome_indexed_mask.png - images/dome_mono_128.png - images/dome_mono.png - images/dot.png - images/gam030.png - images/gam056.png - images/gam200.png - images/mask_100.png - images/mask.png - images/solid.png - images/struct-image-01.png - images/zebra.png - images/alpha2x2.png - images/solid2x2.png - - diff --git a/tests/arthur/common/images/alpha.png b/tests/arthur/common/images/alpha.png deleted file mode 100644 index e465b2586d..0000000000 Binary files a/tests/arthur/common/images/alpha.png and /dev/null differ diff --git a/tests/arthur/common/images/alpha2x2.png b/tests/arthur/common/images/alpha2x2.png deleted file mode 100644 index 67ecc04286..0000000000 Binary files a/tests/arthur/common/images/alpha2x2.png and /dev/null differ diff --git a/tests/arthur/common/images/bitmap.png b/tests/arthur/common/images/bitmap.png deleted file mode 100644 index d21f8f51bb..0000000000 Binary files a/tests/arthur/common/images/bitmap.png and /dev/null differ diff --git a/tests/arthur/common/images/border.png b/tests/arthur/common/images/border.png deleted file mode 100644 index a3d2fed0a3..0000000000 Binary files a/tests/arthur/common/images/border.png and /dev/null differ diff --git a/tests/arthur/common/images/borderimage.png b/tests/arthur/common/images/borderimage.png deleted file mode 100644 index f7f6b66227..0000000000 Binary files a/tests/arthur/common/images/borderimage.png and /dev/null differ diff --git a/tests/arthur/common/images/dome_argb32.png b/tests/arthur/common/images/dome_argb32.png deleted file mode 100644 index e3ccba0c13..0000000000 Binary files a/tests/arthur/common/images/dome_argb32.png and /dev/null differ diff --git a/tests/arthur/common/images/dome_indexed.png b/tests/arthur/common/images/dome_indexed.png deleted file mode 100644 index beefcd514e..0000000000 Binary files a/tests/arthur/common/images/dome_indexed.png and /dev/null differ diff --git a/tests/arthur/common/images/dome_indexed_mask.png b/tests/arthur/common/images/dome_indexed_mask.png deleted file mode 100644 index a62f29f40e..0000000000 Binary files a/tests/arthur/common/images/dome_indexed_mask.png and /dev/null differ diff --git a/tests/arthur/common/images/dome_mono.png b/tests/arthur/common/images/dome_mono.png deleted file mode 100644 index 950c2a7494..0000000000 Binary files a/tests/arthur/common/images/dome_mono.png and /dev/null differ diff --git a/tests/arthur/common/images/dome_mono_128.png b/tests/arthur/common/images/dome_mono_128.png deleted file mode 100644 index 77e48aaab7..0000000000 Binary files a/tests/arthur/common/images/dome_mono_128.png and /dev/null differ diff --git a/tests/arthur/common/images/dome_mono_palette.png b/tests/arthur/common/images/dome_mono_palette.png deleted file mode 100644 index dca3f59245..0000000000 Binary files a/tests/arthur/common/images/dome_mono_palette.png and /dev/null differ diff --git a/tests/arthur/common/images/dome_rgb32.png b/tests/arthur/common/images/dome_rgb32.png deleted file mode 100644 index 27bc02a545..0000000000 Binary files a/tests/arthur/common/images/dome_rgb32.png and /dev/null differ diff --git a/tests/arthur/common/images/dot.png b/tests/arthur/common/images/dot.png deleted file mode 100644 index 17a7b6a0ba..0000000000 Binary files a/tests/arthur/common/images/dot.png and /dev/null differ diff --git a/tests/arthur/common/images/face.png b/tests/arthur/common/images/face.png deleted file mode 100644 index 4f6172d83b..0000000000 Binary files a/tests/arthur/common/images/face.png and /dev/null differ diff --git a/tests/arthur/common/images/gam030.png b/tests/arthur/common/images/gam030.png deleted file mode 100644 index 904c9721bd..0000000000 Binary files a/tests/arthur/common/images/gam030.png and /dev/null differ diff --git a/tests/arthur/common/images/gam045.png b/tests/arthur/common/images/gam045.png deleted file mode 100644 index b649a8a54f..0000000000 Binary files a/tests/arthur/common/images/gam045.png and /dev/null differ diff --git a/tests/arthur/common/images/gam056.png b/tests/arthur/common/images/gam056.png deleted file mode 100644 index e5f959dc96..0000000000 Binary files a/tests/arthur/common/images/gam056.png and /dev/null differ diff --git a/tests/arthur/common/images/gam100.png b/tests/arthur/common/images/gam100.png deleted file mode 100644 index 6c7ba5f1ed..0000000000 Binary files a/tests/arthur/common/images/gam100.png and /dev/null differ diff --git a/tests/arthur/common/images/gam200.png b/tests/arthur/common/images/gam200.png deleted file mode 100644 index daa20fcbc4..0000000000 Binary files a/tests/arthur/common/images/gam200.png and /dev/null differ diff --git a/tests/arthur/common/images/image.png b/tests/arthur/common/images/image.png deleted file mode 100644 index 85d486a790..0000000000 Binary files a/tests/arthur/common/images/image.png and /dev/null differ diff --git a/tests/arthur/common/images/mask.png b/tests/arthur/common/images/mask.png deleted file mode 100644 index c3f3b1b6ca..0000000000 Binary files a/tests/arthur/common/images/mask.png and /dev/null differ diff --git a/tests/arthur/common/images/mask_100.png b/tests/arthur/common/images/mask_100.png deleted file mode 100644 index fc950dc7ed..0000000000 Binary files a/tests/arthur/common/images/mask_100.png and /dev/null differ diff --git a/tests/arthur/common/images/masked.png b/tests/arthur/common/images/masked.png deleted file mode 100644 index 6debec534d..0000000000 Binary files a/tests/arthur/common/images/masked.png and /dev/null differ diff --git a/tests/arthur/common/images/sign.png b/tests/arthur/common/images/sign.png deleted file mode 100644 index 6aac7e150a..0000000000 Binary files a/tests/arthur/common/images/sign.png and /dev/null differ diff --git a/tests/arthur/common/images/solid.png b/tests/arthur/common/images/solid.png deleted file mode 100644 index 371e9c1aee..0000000000 Binary files a/tests/arthur/common/images/solid.png and /dev/null differ diff --git a/tests/arthur/common/images/solid2x2.png b/tests/arthur/common/images/solid2x2.png deleted file mode 100644 index ad67cd3e12..0000000000 Binary files a/tests/arthur/common/images/solid2x2.png and /dev/null differ diff --git a/tests/arthur/common/images/struct-image-01.jpg b/tests/arthur/common/images/struct-image-01.jpg deleted file mode 100644 index a74e07223b..0000000000 Binary files a/tests/arthur/common/images/struct-image-01.jpg and /dev/null differ diff --git a/tests/arthur/common/images/struct-image-01.png b/tests/arthur/common/images/struct-image-01.png deleted file mode 100644 index 4ed08406dc..0000000000 Binary files a/tests/arthur/common/images/struct-image-01.png and /dev/null differ diff --git a/tests/arthur/common/images/zebra.png b/tests/arthur/common/images/zebra.png deleted file mode 100644 index ef35f20785..0000000000 Binary files a/tests/arthur/common/images/zebra.png and /dev/null differ diff --git a/tests/arthur/common/lookup3.cpp b/tests/arthur/common/lookup3.cpp deleted file mode 100644 index 1ad2d371c4..0000000000 --- a/tests/arthur/common/lookup3.cpp +++ /dev/null @@ -1,786 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -/* -These functions are based on: - -------------------------------------------------------------------------------- -lookup3.c, by Bob Jenkins, May 2006, Public Domain. - -These are functions for producing 32-bit hashes for hash table lookup. -hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() -are externally useful functions. Routines to test the hash are included -if SELF_TEST is defined. You can use this free for any purpose. It's in -the public domain. It has no warranty. - -You probably want to use hashlittle(). hashlittle() and hashbig() -hash byte arrays. hashlittle() is is faster than hashbig() on -little-endian machines. Intel and AMD are little-endian machines. -On second thought, you probably want hashlittle2(), which is identical to -hashlittle() except it returns two 32-bit hashes for the price of one. -You could implement hashbig2() if you wanted but I haven't bothered here. - -If you want to find a hash of, say, exactly 7 integers, do - a = i1; b = i2; c = i3; - mix(a,b,c); - a += i4; b += i5; c += i6; - mix(a,b,c); - a += i7; - final(a,b,c); -then use c as the hash value. If you have a variable length array of -4-byte integers to hash, use hashword(). If you have a byte array (like -a character string), use hashlittle(). If you have several byte arrays, or -a mix of things, see the comments above hashlittle(). - -Why is this so big? I read 12 bytes at a time into 3 4-byte integers, -then mix those integers. This is fast (you can do a lot more thorough -mixing with 12*3 instructions on 3 integers than you can with 3 instructions -on 1 byte), but shoehorning those bytes into integers efficiently is messy. -------------------------------------------------------------------------------- -*/ - -#include - -#if Q_BYTE_ORDER == Q_BIG_ENDIAN -# define HASH_LITTLE_ENDIAN 0 -# define HASH_BIG_ENDIAN 1 -#else -# define HASH_LITTLE_ENDIAN 1 -# define HASH_BIG_ENDIAN 0 -#endif - -#define hashsize(n) ((quint32)1<<(n)) -#define hashmask(n) (hashsize(n)-1) -#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) - -/* -------------------------------------------------------------------------------- -mix -- mix 3 32-bit values reversibly. - -This is reversible, so any information in (a,b,c) before mix() is -still in (a,b,c) after mix(). - -If four pairs of (a,b,c) inputs are run through mix(), or through -mix() in reverse, there are at least 32 bits of the output that -are sometimes the same for one pair and different for another pair. -This was tested for: -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that -satisfy this are - 4 6 8 16 19 4 - 9 15 3 18 27 15 - 14 9 3 7 17 3 -Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing -for "differ" defined as + with a one-bit base and a two-bit delta. I -used http://burtleburtle.net/bob/hash/avalanche.html to choose -the operations, constants, and arrangements of the variables. - -This does not achieve avalanche. There are input bits of (a,b,c) -that fail to affect some output bits of (a,b,c), especially of a. The -most thoroughly mixed value is c, but it doesn't really even achieve -avalanche in c. - -This allows some parallelism. Read-after-writes are good at doubling -the number of bits affected, so the goal of mixing pulls in the opposite -direction as the goal of parallelism. I did what I could. Rotates -seem to cost as much as shifts on every machine I could lay my hands -on, and rotates are much kinder to the top and bottom bits, so I used -rotates. -------------------------------------------------------------------------------- -*/ -#define mix(a,b,c) \ -{ \ - a -= c; a ^= rot(c, 4); c += b; \ - b -= a; b ^= rot(a, 6); a += c; \ - c -= b; c ^= rot(b, 8); b += a; \ - a -= c; a ^= rot(c,16); c += b; \ - b -= a; b ^= rot(a,19); a += c; \ - c -= b; c ^= rot(b, 4); b += a; \ -} - -/* -------------------------------------------------------------------------------- -final -- final mixing of 3 32-bit values (a,b,c) into c - -Pairs of (a,b,c) values differing in only a few bits will usually -produce values of c that look totally different. This was tested for -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -These constants passed: - 14 11 25 16 4 14 24 - 12 14 25 16 4 14 24 -and these came close: - 4 8 15 26 3 22 24 - 10 8 15 26 3 22 24 - 11 8 15 26 3 22 24 -------------------------------------------------------------------------------- -*/ -#define final(a,b,c) \ -{ \ - c ^= b; c -= rot(b,14); \ - a ^= c; a -= rot(c,11); \ - b ^= a; b -= rot(a,25); \ - c ^= b; c -= rot(b,16); \ - a ^= c; a -= rot(c,4); \ - b ^= a; b -= rot(a,14); \ - c ^= b; c -= rot(b,24); \ -} - -/* --------------------------------------------------------------------- - This works on all machines. To be useful, it requires - -- that the key be an array of quint32's, and - -- that the length be the number of quint32's in the key - - The function hashword() is identical to hashlittle() on little-endian - machines, and identical to hashbig() on big-endian machines, - except that the length has to be measured in quint32s rather than in - bytes. hashlittle() is more complicated than hashword() only because - hashlittle() has to dance around fitting the key bytes into registers. --------------------------------------------------------------------- -*/ -quint32 hashword( -const quint32 *k, /* the key, an array of quint32 values */ -size_t length, /* the length of the key, in quint32s */ -quint32 initval) /* the previous hash, or an arbitrary value */ -{ - quint32 a,b,c; - - /* Set up the internal state */ - a = b = c = 0xdeadbeef + (((quint32)length)<<2) + initval; - - /*------------------------------------------------- handle most of the key */ - while (length > 3) - { - a += k[0]; - b += k[1]; - c += k[2]; - mix(a,b,c); - length -= 3; - k += 3; - } - - /*------------------------------------------- handle the last 3 quint32's */ - switch(length) /* all the case statements fall through */ - { - case 3 : c+=k[2]; - case 2 : b+=k[1]; - case 1 : a+=k[0]; - final(a,b,c); - case 0: /* case 0: nothing left to add */ - break; - } - /*------------------------------------------------------ report the result */ - return c; -} - - -/* --------------------------------------------------------------------- -hashword2() -- same as hashword(), but take two seeds and return two -32-bit values. pc and pb must both be nonnull, and *pc and *pb must -both be initialized with seeds. If you pass in (*pb)==0, the output -(*pc) will be the same as the return value from hashword(). --------------------------------------------------------------------- -*/ -void hashword2 ( -const quint32 *k, /* the key, an array of quint32 values */ -size_t length, /* the length of the key, in quint32s */ -quint32 *pc, /* IN: seed OUT: primary hash value */ -quint32 *pb) /* IN: more seed OUT: secondary hash value */ -{ - quint32 a,b,c; - - /* Set up the internal state */ - a = b = c = 0xdeadbeef + ((quint32)(length<<2)) + *pc; - c += *pb; - - /*------------------------------------------------- handle most of the key */ - while (length > 3) - { - a += k[0]; - b += k[1]; - c += k[2]; - mix(a,b,c); - length -= 3; - k += 3; - } - - /*------------------------------------------- handle the last 3 quint32's */ - switch(length) /* all the case statements fall through */ - { - case 3 : c+=k[2]; - case 2 : b+=k[1]; - case 1 : a+=k[0]; - final(a,b,c); - case 0: /* case 0: nothing left to add */ - break; - } - /*------------------------------------------------------ report the result */ - *pc=c; *pb=b; -} - - -/* -------------------------------------------------------------------------------- -hashlittle() -- hash a variable-length key into a 32-bit value - k : the key (the unaligned variable-length array of bytes) - length : the length of the key, counting by bytes - initval : can be any 4-byte value -Returns a 32-bit value. Every bit of the key affects every bit of -the return value. Two keys differing by one or two bits will have -totally different hash values. - -The best hash table sizes are powers of 2. There is no need to do -mod a prime (mod is sooo slow!). If you need less than 32 bits, -use a bitmask. For example, if you need only 10 bits, do - h = (h & hashmask(10)); -In which case, the hash table should have hashsize(10) elements. - -If you are hashing n strings (quint8 **)k, do it like this: - for (i=0, h=0; i 12) - { - a += k[0]; - b += k[1]; - c += k[2]; - mix(a,b,c); - length -= 12; - k += 3; - } - - /*----------------------------- handle the last (probably partial) block */ - /* - * "k[2]&0xffffff" actually reads beyond the end of the string, but - * then masks off the part it's not allowed to read. Because the - * string is aligned, the masked-off tail is in the same word as the - * rest of the string. Every machine with memory protection I've seen - * does it on word boundaries, so is OK with this. But VALGRIND will - * still catch it and complain. The masking trick does make the hash - * noticably faster for short strings (like English words). - */ -#ifndef VALGRIND - - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; - case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; - case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=k[1]&0xffffff; a+=k[0]; break; - case 6 : b+=k[1]&0xffff; a+=k[0]; break; - case 5 : b+=k[1]&0xff; a+=k[0]; break; - case 4 : a+=k[0]; break; - case 3 : a+=k[0]&0xffffff; break; - case 2 : a+=k[0]&0xffff; break; - case 1 : a+=k[0]&0xff; break; - case 0 : return c; /* zero length strings require no mixing */ - } - -#else /* make valgrind happy */ - - const quint8 *k8 = (const quint8 *)k; - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((quint32)k8[10])<<16; /* fall through */ - case 10: c+=((quint32)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((quint32)k8[6])<<16; /* fall through */ - case 6 : b+=((quint32)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]; break; - case 3 : a+=((quint32)k8[2])<<16; /* fall through */ - case 2 : a+=((quint32)k8[1])<<8; /* fall through */ - case 1 : a+=k8[0]; break; - case 0 : return c; - } - -#endif /* !valgrind */ - - } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const quint16 *k = (const quint16 *)key; /* read 16-bit chunks */ - const quint8 *k8; - - /*--------------- all but last block: aligned reads and different mixing */ - while (length > 12) - { - a += k[0] + (((quint32)k[1])<<16); - b += k[2] + (((quint32)k[3])<<16); - c += k[4] + (((quint32)k[5])<<16); - mix(a,b,c); - length -= 12; - k += 6; - } - - /*----------------------------- handle the last (probably partial) block */ - k8 = (const quint8 *)k; - switch(length) - { - case 12: c+=k[4]+(((quint32)k[5])<<16); - b+=k[2]+(((quint32)k[3])<<16); - a+=k[0]+(((quint32)k[1])<<16); - break; - case 11: c+=((quint32)k8[10])<<16; /* fall through */ - case 10: c+=k[4]; - b+=k[2]+(((quint32)k[3])<<16); - a+=k[0]+(((quint32)k[1])<<16); - break; - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((quint32)k[3])<<16); - a+=k[0]+(((quint32)k[1])<<16); - break; - case 7 : b+=((quint32)k8[6])<<16; /* fall through */ - case 6 : b+=k[2]; - a+=k[0]+(((quint32)k[1])<<16); - break; - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((quint32)k[1])<<16); - break; - case 3 : a+=((quint32)k8[2])<<16; /* fall through */ - case 2 : a+=k[0]; - break; - case 1 : a+=k8[0]; - break; - case 0 : return c; /* zero length requires no mixing */ - } - - } else { /* need to read the key one byte at a time */ - const quint8 *k = (const quint8 *)key; - - /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - a += ((quint32)k[1])<<8; - a += ((quint32)k[2])<<16; - a += ((quint32)k[3])<<24; - b += k[4]; - b += ((quint32)k[5])<<8; - b += ((quint32)k[6])<<16; - b += ((quint32)k[7])<<24; - c += k[8]; - c += ((quint32)k[9])<<8; - c += ((quint32)k[10])<<16; - c += ((quint32)k[11])<<24; - mix(a,b,c); - length -= 12; - k += 12; - } - - /*-------------------------------- last block: affect all 32 bits of (c) */ - switch(length) /* all the case statements fall through */ - { - case 12: c+=((quint32)k[11])<<24; - case 11: c+=((quint32)k[10])<<16; - case 10: c+=((quint32)k[9])<<8; - case 9 : c+=k[8]; - case 8 : b+=((quint32)k[7])<<24; - case 7 : b+=((quint32)k[6])<<16; - case 6 : b+=((quint32)k[5])<<8; - case 5 : b+=k[4]; - case 4 : a+=((quint32)k[3])<<24; - case 3 : a+=((quint32)k[2])<<16; - case 2 : a+=((quint32)k[1])<<8; - case 1 : a+=k[0]; - break; - case 0 : return c; - } - } - - final(a,b,c); - return c; -} - - -/* - * hashlittle2: return 2 32-bit hash values - * - * This is identical to hashlittle(), except it returns two 32-bit hash - * values instead of just one. This is good enough for hash table - * lookup with 2^^64 buckets, or if you want a second hash if you're not - * happy with the first, or if you want a probably-unique 64-bit ID for - * the key. *pc is better mixed than *pb, so use *pc first. If you want - * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)". - */ -void hashlittle2( - const void *key, /* the key to hash */ - size_t length, /* length of the key */ - quint32 *pc, /* IN: primary initval, OUT: primary hash */ - quint32 *pb) /* IN: secondary initval, OUT: secondary hash */ -{ - quint32 a,b,c; /* internal state */ - union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */ - - /* Set up the internal state */ - a = b = c = 0xdeadbeef + ((quint32)length) + *pc; - c += *pb; - - u.ptr = key; - if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { - const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */ - - /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - b += k[1]; - c += k[2]; - mix(a,b,c); - length -= 12; - k += 3; - } - - /*----------------------------- handle the last (probably partial) block */ - /* - * "k[2]&0xffffff" actually reads beyond the end of the string, but - * then masks off the part it's not allowed to read. Because the - * string is aligned, the masked-off tail is in the same word as the - * rest of the string. Every machine with memory protection I've seen - * does it on word boundaries, so is OK with this. But VALGRIND will - * still catch it and complain. The masking trick does make the hash - * noticably faster for short strings (like English words). - */ -#ifndef VALGRIND - - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; - case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; - case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=k[1]&0xffffff; a+=k[0]; break; - case 6 : b+=k[1]&0xffff; a+=k[0]; break; - case 5 : b+=k[1]&0xff; a+=k[0]; break; - case 4 : a+=k[0]; break; - case 3 : a+=k[0]&0xffffff; break; - case 2 : a+=k[0]&0xffff; break; - case 1 : a+=k[0]&0xff; break; - case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ - } - -#else /* make valgrind happy */ - - const quint8 *k8 = (const quint8 *)k; - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((quint32)k8[10])<<16; /* fall through */ - case 10: c+=((quint32)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((quint32)k8[6])<<16; /* fall through */ - case 6 : b+=((quint32)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]; break; - case 3 : a+=((quint32)k8[2])<<16; /* fall through */ - case 2 : a+=((quint32)k8[1])<<8; /* fall through */ - case 1 : a+=k8[0]; break; - case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ - } - -#endif /* !valgrind */ - - } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const quint16 *k = (const quint16 *)key; /* read 16-bit chunks */ - const quint8 *k8; - - /*--------------- all but last block: aligned reads and different mixing */ - while (length > 12) - { - a += k[0] + (((quint32)k[1])<<16); - b += k[2] + (((quint32)k[3])<<16); - c += k[4] + (((quint32)k[5])<<16); - mix(a,b,c); - length -= 12; - k += 6; - } - - /*----------------------------- handle the last (probably partial) block */ - k8 = (const quint8 *)k; - switch(length) - { - case 12: c+=k[4]+(((quint32)k[5])<<16); - b+=k[2]+(((quint32)k[3])<<16); - a+=k[0]+(((quint32)k[1])<<16); - break; - case 11: c+=((quint32)k8[10])<<16; /* fall through */ - case 10: c+=k[4]; - b+=k[2]+(((quint32)k[3])<<16); - a+=k[0]+(((quint32)k[1])<<16); - break; - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((quint32)k[3])<<16); - a+=k[0]+(((quint32)k[1])<<16); - break; - case 7 : b+=((quint32)k8[6])<<16; /* fall through */ - case 6 : b+=k[2]; - a+=k[0]+(((quint32)k[1])<<16); - break; - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((quint32)k[1])<<16); - break; - case 3 : a+=((quint32)k8[2])<<16; /* fall through */ - case 2 : a+=k[0]; - break; - case 1 : a+=k8[0]; - break; - case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ - } - - } else { /* need to read the key one byte at a time */ - const quint8 *k = (const quint8 *)key; - - /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - a += ((quint32)k[1])<<8; - a += ((quint32)k[2])<<16; - a += ((quint32)k[3])<<24; - b += k[4]; - b += ((quint32)k[5])<<8; - b += ((quint32)k[6])<<16; - b += ((quint32)k[7])<<24; - c += k[8]; - c += ((quint32)k[9])<<8; - c += ((quint32)k[10])<<16; - c += ((quint32)k[11])<<24; - mix(a,b,c); - length -= 12; - k += 12; - } - - /*-------------------------------- last block: affect all 32 bits of (c) */ - switch(length) /* all the case statements fall through */ - { - case 12: c+=((quint32)k[11])<<24; - case 11: c+=((quint32)k[10])<<16; - case 10: c+=((quint32)k[9])<<8; - case 9 : c+=k[8]; - case 8 : b+=((quint32)k[7])<<24; - case 7 : b+=((quint32)k[6])<<16; - case 6 : b+=((quint32)k[5])<<8; - case 5 : b+=k[4]; - case 4 : a+=((quint32)k[3])<<24; - case 3 : a+=((quint32)k[2])<<16; - case 2 : a+=((quint32)k[1])<<8; - case 1 : a+=k[0]; - break; - case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ - } - } - - final(a,b,c); - *pc=c; *pb=b; -} - - - -/* - * hashbig(): - * This is the same as hashword() on big-endian machines. It is different - * from hashlittle() on all machines. hashbig() takes advantage of - * big-endian byte ordering. - */ -quint32 hashbig( const void *key, size_t length, quint32 initval) -{ - quint32 a,b,c; - union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */ - - /* Set up the internal state */ - a = b = c = 0xdeadbeef + ((quint32)length) + initval; - - u.ptr = key; - if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) { - const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */ - - /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - b += k[1]; - c += k[2]; - mix(a,b,c); - length -= 12; - k += 3; - } - - /*----------------------------- handle the last (probably partial) block */ - /* - * "k[2]<<8" actually reads beyond the end of the string, but - * then shifts out the part it's not allowed to read. Because the - * string is aligned, the illegal read is in the same word as the - * rest of the string. Every machine with memory protection I've seen - * does it on word boundaries, so is OK with this. But VALGRIND will - * still catch it and complain. The masking trick does make the hash - * noticably faster for short strings (like English words). - */ -#ifndef VALGRIND - - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=k[2]&0xffffff00; b+=k[1]; a+=k[0]; break; - case 10: c+=k[2]&0xffff0000; b+=k[1]; a+=k[0]; break; - case 9 : c+=k[2]&0xff000000; b+=k[1]; a+=k[0]; break; - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=k[1]&0xffffff00; a+=k[0]; break; - case 6 : b+=k[1]&0xffff0000; a+=k[0]; break; - case 5 : b+=k[1]&0xff000000; a+=k[0]; break; - case 4 : a+=k[0]; break; - case 3 : a+=k[0]&0xffffff00; break; - case 2 : a+=k[0]&0xffff0000; break; - case 1 : a+=k[0]&0xff000000; break; - case 0 : return c; /* zero length strings require no mixing */ - } - -#else /* make valgrind happy */ - - const quint8 *k8 = (const quint8 *)k; - switch(length) /* all the case statements fall through */ - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((quint32)k8[10])<<8; /* fall through */ - case 10: c+=((quint32)k8[9])<<16; /* fall through */ - case 9 : c+=((quint32)k8[8])<<24; /* fall through */ - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((quint32)k8[6])<<8; /* fall through */ - case 6 : b+=((quint32)k8[5])<<16; /* fall through */ - case 5 : b+=((quint32)k8[4])<<24; /* fall through */ - case 4 : a+=k[0]; break; - case 3 : a+=((quint32)k8[2])<<8; /* fall through */ - case 2 : a+=((quint32)k8[1])<<16; /* fall through */ - case 1 : a+=((quint32)k8[0])<<24; break; - case 0 : return c; - } - -#endif /* !VALGRIND */ - - } else { /* need to read the key one byte at a time */ - const quint8 *k = (const quint8 *)key; - - /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ - while (length > 12) - { - a += ((quint32)k[0])<<24; - a += ((quint32)k[1])<<16; - a += ((quint32)k[2])<<8; - a += ((quint32)k[3]); - b += ((quint32)k[4])<<24; - b += ((quint32)k[5])<<16; - b += ((quint32)k[6])<<8; - b += ((quint32)k[7]); - c += ((quint32)k[8])<<24; - c += ((quint32)k[9])<<16; - c += ((quint32)k[10])<<8; - c += ((quint32)k[11]); - mix(a,b,c); - length -= 12; - k += 12; - } - - /*-------------------------------- last block: affect all 32 bits of (c) */ - switch(length) /* all the case statements fall through */ - { - case 12: c+=k[11]; - case 11: c+=((quint32)k[10])<<8; - case 10: c+=((quint32)k[9])<<16; - case 9 : c+=((quint32)k[8])<<24; - case 8 : b+=k[7]; - case 7 : b+=((quint32)k[6])<<8; - case 6 : b+=((quint32)k[5])<<16; - case 5 : b+=((quint32)k[4])<<24; - case 4 : a+=k[3]; - case 3 : a+=((quint32)k[2])<<8; - case 2 : a+=((quint32)k[1])<<16; - case 1 : a+=((quint32)k[0])<<24; - break; - case 0 : return c; - } - } - - final(a,b,c); - return c; -} diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp deleted file mode 100644 index 8735baa3f0..0000000000 --- a/tests/arthur/common/paintcommands.cpp +++ /dev/null @@ -1,2586 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "paintcommands.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef QT_NO_OPENGL -#include -#endif - -/********************************************************************************* -** everything to populate static tables -**********************************************************************************/ -const char *PaintCommands::brushStyleTable[] = { - "NoBrush", - "SolidPattern", - "Dense1Pattern", - "Dense2Pattern", - "Dense3Pattern", - "Dense4Pattern", - "Dense5Pattern", - "Dense6Pattern", - "Dense7Pattern", - "HorPattern", - "VerPattern", - "CrossPattern", - "BDiagPattern", - "FDiagPattern", - "DiagCrossPattern", - "LinearGradientPattern" -}; - -const char *PaintCommands::penStyleTable[] = { - "NoPen", - "SolidLine", - "DashLine", - "DotLine", - "DashDotLine", - "DashDotDotLine" -}; - -const char *PaintCommands::fontWeightTable[] = { - "Light", - "Normal", - "DemiBold", - "Bold", - "Black" -}; - -const char *PaintCommands::fontHintingTable[] = { - "Default", - "None", - "Vertical", - "Full" -}; - -const char *PaintCommands::clipOperationTable[] = { - "NoClip", - "ReplaceClip", - "IntersectClip", - "UniteClip" -}; - -const char *PaintCommands::spreadMethodTable[] = { - "PadSpread", - "ReflectSpread", - "RepeatSpread" -}; - -const char *PaintCommands::coordinateMethodTable[] = { - "LogicalMode", - "StretchToDeviceMode", - "ObjectBoundingMode" -}; - -const char *PaintCommands::sizeModeTable[] = { - "AbsoluteSize", - "RelativeSize" -}; - -const char *PaintCommands::compositionModeTable[] = { - "SourceOver", - "DestinationOver", - "Clear", - "Source", - "Destination", - "SourceIn", - "DestinationIn", - "SourceOut", - "DestinationOut", - "SourceAtop", - "DestinationAtop", - "Xor", - "Plus", - "Multiply", - "Screen", - "Overlay", - "Darken", - "Lighten", - "ColorDodge", - "ColorBurn", - "HardLight", - "SoftLight", - "Difference", - "Exclusion", - "SourceOrDestination", - "SourceAndDestination", - "SourceXorDestination", - "NotSourceAndNotDestination", - "NotSourceOrNotDestination", - "NotSourceXorDestination", - "NotSource", - "NotSourceAndDestination", - "SourceAndNotDestination" -}; - -const char *PaintCommands::imageFormatTable[] = { - "Invalid", - "Mono", - "MonoLSB", - "Indexed8", - "RGB32", - "ARGB32", - "ARGB32_Premultiplied", - "Format_RGB16", - "Format_ARGB8565_Premultiplied", - "Format_RGB666", - "Format_ARGB6666_Premultiplied", - "Format_RGB555", - "Format_ARGB8555_Premultiplied", - "Format_RGB888", - "Format_RGB444", - "Format_ARGB4444_Premultiplied" -}; - -int PaintCommands::translateEnum(const char *table[], const QString &pattern, int limit) -{ - QByteArray p = pattern.toLatin1().toLower(); - for (int i=0; i PaintCommands::s_commandInfoTable = QList(); -QList > PaintCommands::s_enumsTable = QList >(); -QMultiHash PaintCommands::s_commandHash; - -#define DECL_PAINTCOMMAND(identifier, method, regexp, syntax, sample) \ - s_commandInfoTable << PaintCommandInfos(QLatin1String(identifier), &PaintCommands::method, QRegExp(regexp), \ - QLatin1String(syntax), QLatin1String(sample) ); - -#define DECL_PAINTCOMMANDSECTION(title) \ - s_commandInfoTable << PaintCommandInfos(QLatin1String(title)); - -#define ADD_ENUMLIST(listCaption, cStrArray) { \ - QStringList list; \ - for (int i=0; i", - "import \"myfile.qrc\""); - DECL_PAINTCOMMAND("begin_block", command_begin_block, - "^begin_block\\s+(\\w*)$", - "begin_block ", - "begin_block blockName"); - DECL_PAINTCOMMAND("end_block", command_end_block, - "^end_block$", - "end_block", - "end_block"); - DECL_PAINTCOMMAND("repeat_block", command_repeat_block, - "^repeat_block\\s+(\\w*)$", - "repeat_block ", - "repeat_block blockName"); - DECL_PAINTCOMMAND("textlayout_draw", command_textlayout_draw, - "^textlayout_draw\\s+\"(.*)\"\\s+([0-9.]*)$", - "textlayout_draw ", - "textlayout_draw \"your text\" 1.0"); - DECL_PAINTCOMMAND("abort", command_abort, - "^abort$", - "abort", - "abort"); - DECL_PAINTCOMMAND("noop", command_noop, - "^$", - "-", - "\n"); - - DECL_PAINTCOMMANDSECTION("setters"); - DECL_PAINTCOMMAND("setBackgroundMode", command_setBgMode, - "^(setBackgroundMode|setBgMode)\\s+(\\w*)$", - "setBackgroundMode ", - "setBackgroundMode TransparentMode"); - DECL_PAINTCOMMAND("setBackground", command_setBackground, - "^setBackground\\s+#?(\\w*)\\s*(\\w*)?$", - "setBackground [brush style enum]", - "setBackground black SolidPattern"); - DECL_PAINTCOMMAND("setOpacity", command_setOpacity, - "^setOpacity\\s+(-?\\d*\\.?\\d*)$", - "setOpacity \n - opacity is in [0,1]", - "setOpacity 1.0"); - DECL_PAINTCOMMAND("path_setFillRule", command_path_setFillRule, - "^path_setFillRule\\s+(\\w*)\\s+(\\w*)$", - "path_setFillRule [Winding|OddEven]", - "path_setFillRule pathName Winding"); - DECL_PAINTCOMMAND("setBrush", command_setBrush, - "^setBrush\\s+(#?[\\w.:\\/]*)\\s*(\\w*)?$", - "setBrush \nsetBrush noBrush\nsetBrush ", - "setBrush white SolidPattern"); - DECL_PAINTCOMMAND("setBrushOrigin", command_setBrushOrigin, - "^setBrushOrigin\\s*(-?\\w*)\\s+(-?\\w*)$", - "setBrushOrigin ", - "setBrushOrigin 0 0"); - DECL_PAINTCOMMAND("brushTranslate", command_brushTranslate, - "^brushTranslate\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "brushTranslate ", - "brushTranslate 0.0 0.0"); - DECL_PAINTCOMMAND("brushScale", command_brushScale, - "^brushScale\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "brushScale ", - "brushScale 0.0 0.0"); - DECL_PAINTCOMMAND("brushRotate", command_brushRotate, - "^brushRotate\\s+(-?[\\w.]*)$", - "brushRotate \n - angle in degrees", - "brushRotate 0.0"); - DECL_PAINTCOMMAND("brushShear", command_brushShear, - "^brushShear\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "brushShear ", - "brushShear 0.0 0.0"); - DECL_PAINTCOMMAND("setCompositionMode", command_setCompositionMode, - "^setCompositionMode\\s+([\\w_0-9]*)$", - "setCompositionMode ", - "setCompositionMode SourceOver"); - DECL_PAINTCOMMAND("setFont", command_setFont, - "^setFont\\s+\"([\\w\\s]*)\"\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)$", - "setFont [size] [font weight|font weight enum] [italic] [hinting enum]\n - font weight is an integer between 0 and 99", - "setFont \"times\" 12"); - DECL_PAINTCOMMAND("setPen", command_setPen, - "^setPen\\s+#?(\\w*)$", - "setPen \nsetPen \nsetPen brush", - "setPen black"); - DECL_PAINTCOMMAND("setPen", command_setPen2, - "^setPen\\s+(#?\\w*)\\s+([\\w.]+)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)$", - "setPen brush| [width] [pen style enum] [FlatCap|SquareCap|RoundCap] [MiterJoin|BevelJoin|RoundJoin]", - "setPen black 1 FlatCap MiterJoin"); - DECL_PAINTCOMMAND("pen_setDashOffset", command_pen_setDashOffset, - "^pen_setDashOffset\\s+(-?[\\w.]+)$", - "pen_setDashOffset \n", - "pen_setDashOffset 1.0"); - DECL_PAINTCOMMAND("pen_setDashPattern", command_pen_setDashPattern, - "^pen_setDashPattern\\s+\\[([\\w\\s.]*)\\]$", - "pen_setDashPattern <[ ... ]>", - "pen_setDashPattern [ 2 1 4 1 3 3 ]"); - DECL_PAINTCOMMAND("pen_setCosmetic", command_pen_setCosmetic, - "^pen_setCosmetic\\s+(\\w*)$", - "pen_setCosmetic ", - "pen_setCosmetic true"); - DECL_PAINTCOMMAND("setRenderHint", command_setRenderHint, - "^setRenderHint\\s+([\\w_0-9]*)\\s*(\\w*)$", - "setRenderHint ", - "setRenderHint Antialiasing true"); - DECL_PAINTCOMMAND("clearRenderHint", command_clearRenderHint, - "^clearRenderHint$", - "clearRenderHint", - "clearRenderHint"); - - DECL_PAINTCOMMANDSECTION("gradients"); - DECL_PAINTCOMMAND("gradient_appendStop", command_gradient_appendStop, - "^gradient_appendStop\\s+([\\w.]*)\\s+#?(\\w*)$", - "gradient_appendStop ", - "gradient_appendStop 1.0 red"); - DECL_PAINTCOMMAND("gradient_clearStops", command_gradient_clearStops, - "^gradient_clearStops$", - "gradient_clearStops", - "gradient_clearStops"); - DECL_PAINTCOMMAND("gradient_setConical", command_gradient_setConical, - "^gradient_setConical\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$", - "gradient_setConical \n - angle in degrees", - "gradient_setConical 5.0 5.0 45.0"); - DECL_PAINTCOMMAND("gradient_setLinear", command_gradient_setLinear, - "^gradient_setLinear\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$", - "gradient_setLinear ", - "gradient_setLinear 1.0 1.0 2.0 2.0"); - DECL_PAINTCOMMAND("gradient_setRadial", command_gradient_setRadial, - "^gradient_setRadial\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)$", - "gradient_setRadial \n - C is the center\n - rad is the radius\n - F is the focal point", - "gradient_setRadial 1.0 1.0 45.0 2.0 2.0"); - DECL_PAINTCOMMAND("gradient_setRadialExtended", command_gradient_setRadialExtended, - "^gradient_setRadialExtended\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)$", - "gradient_setRadialExtended \n - C is the center\n - rad is the center radius\n - F is the focal point\n - frad is the focal radius", - "gradient_setRadialExtended 1.0 1.0 45.0 2.0 2.0 45.0"); - DECL_PAINTCOMMAND("gradient_setLinearPen", command_gradient_setLinearPen, - "^gradient_setLinearPen\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$", - "gradient_setLinearPen ", - "gradient_setLinearPen 1.0 1.0 2.0 2.0"); - DECL_PAINTCOMMAND("gradient_setSpread", command_gradient_setSpread, - "^gradient_setSpread\\s+(\\w*)$", - "gradient_setSpread ", - "gradient_setSpread PadSpread"); - DECL_PAINTCOMMAND("gradient_setCoordinateMode", command_gradient_setCoordinateMode, - "^gradient_setCoordinateMode\\s+(\\w*)$", - "gradient_setCoordinateMode ", - "gradient_setCoordinateMode ObjectBoundingMode"); - DECL_PAINTCOMMANDSECTION("drawing ops"); - DECL_PAINTCOMMAND("drawPoint", command_drawPoint, - "^drawPoint\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "drawPoint ", - "drawPoint 10.0 10.0"); - DECL_PAINTCOMMAND("drawLine", command_drawLine, - "^drawLine\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "drawLine ", - "drawLine 10.0 10.0 20.0 20.0"); - DECL_PAINTCOMMAND("drawRect", command_drawRect, - "^drawRect\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "drawRect ", - "drawRect 10.0 10.0 20.0 20.0"); - DECL_PAINTCOMMAND("drawRoundRect", command_drawRoundRect, - "^drawRoundRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)?\\s*(-?\\w*)?$", - "drawRoundRect [rx] [ry]", - "drawRoundRect 10 10 20 20 3 3"); - DECL_PAINTCOMMAND("drawRoundedRect", command_drawRoundedRect, - "^drawRoundedRect\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s*(\\w*)?$", - "drawRoundedRect [SizeMode enum]", - "drawRoundedRect 10 10 20 20 4 4 AbsoluteSize"); - DECL_PAINTCOMMAND("drawArc", command_drawArc, - "^drawArc\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", - "drawArc \n - angles are expressed in 1/16th of degree", - "drawArc 10 10 20 20 0 5760"); - DECL_PAINTCOMMAND("drawChord", command_drawChord, - "^drawChord\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", - "drawChord \n - angles are expressed in 1/16th of degree", - "drawChord 10 10 20 20 0 5760"); - DECL_PAINTCOMMAND("drawEllipse", command_drawEllipse, - "^drawEllipse\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "drawEllipse ", - "drawEllipse 10.0 10.0 20.0 20.0"); - DECL_PAINTCOMMAND("drawPath", command_drawPath, - "^drawPath\\s+(\\w*)$", - "drawPath ", - "drawPath mypath"); - DECL_PAINTCOMMAND("drawPie", command_drawPie, - "^drawPie\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", - "drawPie \n - angles are expressed in 1/16th of degree", - "drawPie 10 10 20 20 0 5760"); - DECL_PAINTCOMMAND("drawPixmap", command_drawPixmap, - "^drawPixmap\\s+([\\w.:\\-/]*)" - "\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?" // target rect - "\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?$", // source rect - "drawPixmap " - "\n- where t means target and s means source" - "\n- a width or height of -1 means maximum space", - "drawPixmap :/images/face.png 0 0 -1 -1 0 0 -1 -1"); - DECL_PAINTCOMMAND("drawImage", command_drawImage, - "^drawImage\\s+([\\w.:\\/]*)" - "\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?" // target rect - "\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?$", // source rect - "drawImage " - "\n- where t means target and s means source" - "\n- a width or height of -1 means maximum space", - "drawImage :/images/face.png 0 0 -1 -1 0 0 -1 -1"); - DECL_PAINTCOMMAND("drawPolygon", command_drawPolygon, - "^drawPolygon\\s+\\[([\\w\\s-.]*)\\]\\s*(\\w*)$", - "drawPolygon <[ ... ]> ", - "drawPolygon [ 1 4 6 8 5 3 ] Winding"); - DECL_PAINTCOMMAND("drawConvexPolygon", command_drawConvexPolygon, - "^drawConvexPolygon\\s+\\[([\\w\\s-.]*)\\]$", - "drawConvexPolygon <[ ... ]>", - "drawConvexPolygon [ 1 4 6 8 5 3 ]"); - DECL_PAINTCOMMAND("drawPolyline", command_drawPolyline, - "^drawPolyline\\s+\\[([\\w\\s]*)\\]$", - "drawPolyline <[ ... ]>", - "drawPolyline [ 1 4 6 8 5 3 ]"); - DECL_PAINTCOMMAND("drawText", command_drawText, - "^drawText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$", - "drawText ", - "drawText 10 10 \"my text\""); - DECL_PAINTCOMMAND("drawStaticText", command_drawStaticText, - "^drawStaticText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$", - "drawStaticText ", - "drawStaticText 10 10 \"my text\""); - DECL_PAINTCOMMAND("drawTiledPixmap", command_drawTiledPixmap, - "^drawTiledPixmap\\s+([\\w.:\\/]*)" - "\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)\\s*(-?\\w*)" - "\\s*(-?\\w*)\\s*(-?\\w*)$", - "drawTiledPixmap " - "\n - where t means tile" - "\n - and s is an offset in the tile", - "drawTiledPixmap :/images/alpha.png "); - - DECL_PAINTCOMMANDSECTION("painterPaths"); - DECL_PAINTCOMMAND("path_moveTo", command_path_moveTo, - "^path_moveTo\\s+([.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", - "path_moveTo ", - "path_moveTo mypath 1.0 1.0"); - DECL_PAINTCOMMAND("path_lineTo", command_path_lineTo, - "^path_lineTo\\s+([.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", - "path_lineTo ", - "path_lineTo mypath 1.0 1.0"); - DECL_PAINTCOMMAND("path_addEllipse", command_path_addEllipse, - "^path_addEllipse\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", - "path_addEllipse ", - "path_addEllipse mypath 10.0 10.0 20.0 20.0"); - DECL_PAINTCOMMAND("path_addPolygon", command_path_addPolygon, - "^path_addPolygon\\s+(\\w*)\\s+\\[([\\w\\s]*)\\]\\s*(\\w*)$", - "path_addPolygon <[ ... ]>", - "path_addPolygon mypath [ 1 4 6 8 5 3 ]"); - DECL_PAINTCOMMAND("path_addRect", command_path_addRect, - "^path_addRect\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", - "path_addRect ", - "path_addRect mypath 10.0 10.0 20.0 20.0"); - DECL_PAINTCOMMAND("path_addText", command_path_addText, - "^path_addText\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+\"(.*)\"$", - "path_addText ", - "path_addText mypath 10.0 20.0 \"some text\""); - DECL_PAINTCOMMAND("path_arcTo", command_path_arcTo, - "^path_arcTo\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", - "path_arcTo \n - angles are expressed in degrees", - "path_arcTo mypath 0.0 0.0 10.0 10.0 0.0 360.0"); - DECL_PAINTCOMMAND("path_cubicTo", command_path_cubicTo, - "^path_cubicTo\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", - "path_cubicTo ", - "path_cubicTo mypath 0.0 0.0 10.0 10.0 20.0 20.0"); - DECL_PAINTCOMMAND("path_closeSubpath", command_path_closeSubpath, - "^path_closeSubpath\\s+(\\w*)$", - "path_closeSubpath ", - "path_closeSubpath mypath"); - DECL_PAINTCOMMAND("path_createOutline", command_path_createOutline, - "^path_createOutline\\s+(\\w*)\\s+(\\w*)$", - "path_createOutline ", - "path_createOutline mypath myoutline"); - DECL_PAINTCOMMAND("path_debugPrint", command_path_debugPrint, - "^path_debugPrint\\s+(\\w*)$", - "path_debugPrint ", - "path_debugPrint mypath"); - - DECL_PAINTCOMMANDSECTION("regions"); - DECL_PAINTCOMMAND("region_addRect", command_region_addRect, - "^region_addRect\\s+(\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", - "region_addRect ", - "region_addRect myregion 0.0 0.0 10.0 10.0"); - DECL_PAINTCOMMAND("region_addEllipse", command_region_addEllipse, - "^region_addEllipse\\s+(\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", - "region_addEllipse ", - "region_addEllipse myregion 0.0 0.0 10.0 10.0"); - - DECL_PAINTCOMMANDSECTION("clipping"); - DECL_PAINTCOMMAND("region_getClipRegion", command_region_getClipRegion, - "^region_getClipRegion\\s+(\\w*)$", - "region_getClipRegion ", - "region_getClipRegion myregion"); - DECL_PAINTCOMMAND("setClipRegion", command_setClipRegion, - "^setClipRegion\\s+(\\w*)\\s*(\\w*)$", - "setClipRegion ", - "setClipRegion myregion ReplaceClip"); - DECL_PAINTCOMMAND("path_getClipPath", command_path_getClipPath, - "^path_getClipPath\\s+([\\w0-9]*)$", - "path_getClipPath ", - "path_getClipPath mypath"); - DECL_PAINTCOMMAND("setClipPath", command_setClipPath, - "^setClipPath\\s+(\\w*)\\s*(\\w*)$", - "setClipPath ", - "setClipPath mypath ReplaceClip"); - DECL_PAINTCOMMAND("setClipRect", command_setClipRect, - "^setClipRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(\\w*)$", - "setClipRect ", - "setClipRect 0.0 0.0 10.0 10.0 ReplaceClip"); - DECL_PAINTCOMMAND("setClipping", command_setClipping, - "^setClipping\\s+(\\w*)$", - "setClipping ", - "setClipping true"); - - DECL_PAINTCOMMANDSECTION("surface"); - DECL_PAINTCOMMAND("surface_begin", command_surface_begin, - "^surface_begin\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "surface_begin ", - "surface_begin 0.0 0.0 10.0 10.0"); - DECL_PAINTCOMMAND("surface_end", command_surface_end, - "^surface_end$", - "surface_end", - "surface_end"); - - DECL_PAINTCOMMANDSECTION("painter states"); - DECL_PAINTCOMMAND("restore", command_restore, - "^restore$", - "restore", - "restore"); - DECL_PAINTCOMMAND("save", command_save, - "^save$", - "save", - "save"); - - DECL_PAINTCOMMANDSECTION("pixmaps'n'images"); - DECL_PAINTCOMMAND("pixmap_load", command_pixmap_load, - "^pixmap_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$", - "pixmap_load ", - "pixmap_load :/images/face.png myPixmap"); - DECL_PAINTCOMMAND("pixmap_setMask", command_pixmap_setMask, - "^pixmap_setMask\\s+([\\w.:\\/]*)\\s+([\\w.:\\/]*)$", - "pixmap_setMask ", - "pixmap_setMask myPixmap :/images/bitmap.png"); - DECL_PAINTCOMMAND("bitmap_load", command_bitmap_load, - "^bitmap_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$", - "bitmap_load \n - note that the image is stored as a pixmap", - "bitmap_load :/images/bitmap.png myBitmap"); - DECL_PAINTCOMMAND("image_convertToFormat", command_image_convertToFormat, - "^image_convertToFormat\\s+([\\w.:\\/]*)\\s+([\\w.:\\/]+)\\s+([\\w0-9_]*)$", - "image_convertToFormat ", - "image_convertToFormat myImage myNewImage Indexed8"); - DECL_PAINTCOMMAND("image_load", command_image_load, - "^image_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$", - "image_load ", - "image_load :/images/face.png myImage"); - DECL_PAINTCOMMAND("image_setColor", command_image_setColor, - "^image_setColor\\s+([\\w.:\\/]*)\\s+([0-9]*)\\s+#([0-9]*)$", - "image_setColor ", - "image_setColor myImage 0 black"); - DECL_PAINTCOMMAND("image_setColorCount", command_image_setColorCount, - "^image_setColorCount\\s+([\\w.:\\/]*)\\s+([0-9]*)$", - "image_setColorCount ", - "image_setColorCount myImage 128"); - - DECL_PAINTCOMMANDSECTION("transformations"); - DECL_PAINTCOMMAND("resetMatrix", command_resetMatrix, - "^resetMatrix$", - "resetMatrix", - "resetMatrix"); - DECL_PAINTCOMMAND("setMatrix", command_setMatrix, - "^setMatrix\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", - "setMatrix ", - "setMatrix 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0"); - DECL_PAINTCOMMAND("translate", command_translate, - "^translate\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "translate ", - "translate 10.0 10.0"); - DECL_PAINTCOMMAND("rotate", command_rotate, - "^rotate\\s+(-?[\\w.]*)$", - "rotate \n - with angle in degrees", - "rotate 30.0"); - DECL_PAINTCOMMAND("rotate_x", command_rotate_x, - "^rotate_x\\s+(-?[\\w.]*)$", - "rotate_x \n - with angle in degrees", - "rotate_x 30.0"); - DECL_PAINTCOMMAND("rotate_y", command_rotate_y, - "^rotate_y\\s+(-?[\\w.]*)$", - "rotate_y \n - with angle in degrees", - "rotate_y 30.0"); - DECL_PAINTCOMMAND("scale", command_scale, - "^scale\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", - "scale ", - "scale 2.0 1.0"); - DECL_PAINTCOMMAND("mapQuadToQuad", command_mapQuadToQuad, - "^mapQuadToQuad\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", - "mapQuadToQuad " - "\n - where vertices 1 to 4 defines the source quad and 5 to 8 the destination quad", - "mapQuadToQuad 0.0 0.0 1.0 1.0 0.0 0.0 -1.0 -1.0"); - - // populate the command lookup hash - for (int i=0; i T PaintCommands::image_load(const QString &filepath) -{ - T t(filepath); - - if (t.isNull()) - t = T(":images/" + filepath); - - if (t.isNull()) - t = T("images/" + filepath); - - if (t.isNull()) { - QFileInfo fi(filepath); - QDir dir = fi.absoluteDir(); - dir.cdUp(); - dir.cd("images"); - QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(fi.fileName()); - t = T(fileName); - if (t.isNull() && !fileName.endsWith(".png")) { - fileName.append(".png"); - t = T(fileName); - } - } - - return t; -} - -/********************************************************************************* -** setters -**********************************************************************************/ -void PaintCommands::insertAt(int commandIndex, const QStringList &newCommands) -{ - int index = 0; - int left = newCommands.size(); - while (left--) - m_commands.insert(++commandIndex, newCommands.at(index++)); -} - -/********************************************************************************* -** run -**********************************************************************************/ -void PaintCommands::runCommand(const QString &scriptLine) -{ - if (scriptLine.isEmpty()) { - command_noop(QRegExp()); - return; - } - if (scriptLine.startsWith('#')) { - command_comment(QRegExp()); - return; - } - QString firstWord = scriptLine.section(QRegExp("\\s"), 0, 0); - QList indices = s_commandHash.values(firstWord); - foreach(int idx, indices) { - const PaintCommandInfos &command = s_commandInfoTable.at(idx); - if (command.regExp.indexIn(scriptLine) >= 0) { - (this->*(command.paintMethod))(command.regExp); - return; - } - } - qWarning("ERROR: unknown command or argument syntax error in \"%s\"", qPrintable(scriptLine)); -} - -void PaintCommands::runCommands() -{ - staticInit(); - int width = m_painter->window().width(); - int height = m_painter->window().height(); - - if (width <= 0) - width = 800; - if (height <= 0) - height = 800; - - // paint background - if (m_checkers_background) { - QPixmap pm(20, 20); - pm.fill(Qt::white); - QPainter pt(&pm); - pt.fillRect(0, 0, 10, 10, QColor::fromRgba(0xffdfdfdf)); - pt.fillRect(10, 10, 10, 10, QColor::fromRgba(0xffdfdfdf)); - pt.end(); - m_painter->drawTiledPixmap(0, 0, width, height, pm); - } else { - m_painter->fillRect(0, 0, width, height, Qt::white); - } - - // run each command - m_abort = false; - for (int i=0; idevice()->devType() == Qt::Widget) - return m_painter->window().width(); - else - return 800; - } - if (str.toLower() == "height") { - if (m_painter->device()->devType() == Qt::Widget) - return m_painter->window().height(); - else - return 800; - } - if (re.indexIn(str) >= 0) { - int index = re.cap(1).toInt(); - bool is_it_x = re.cap(2) == "x"; - if (index < 0 || index >= m_controlPoints.size()) { - qWarning("ERROR: control point index=%d is out of bounds", index); - return 0; - } - return is_it_x ? m_controlPoints.at(index).x() : m_controlPoints.at(index).y(); - } - return str.toDouble(); -} - -QColor PaintCommands::convertToColor(const QString &str) -{ - static QRegExp alphaColor("#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})"); - static QRegExp opaqueColor("#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})"); - - Q_ASSERT(alphaColor.isValid()); - Q_ASSERT(opaqueColor.isValid()); - - if (alphaColor.indexIn(str) >= 0) { - return QColor(alphaColor.cap(2).toInt(0, 16), - alphaColor.cap(3).toInt(0, 16), - alphaColor.cap(4).toInt(0, 16), - alphaColor.cap(1).toInt(0, 16)); - } else if (opaqueColor.indexIn(str) >= 0) { - return QColor(opaqueColor.cap(1).toInt(0, 16), - opaqueColor.cap(2).toInt(0, 16), - opaqueColor.cap(3).toInt(0, 16)); - } - return QColor(str); -} - -/********************************************************************************* -** command implementations -**********************************************************************************/ -void PaintCommands::command_comment(QRegExp) -{ - if (m_verboseMode) - printf(" -(lance) comment: %s\n", qPrintable(m_currentCommand)); -} - -/***************************************************************************************************/ -void PaintCommands::command_import(QRegExp re) -{ - QString importFile(re.cap(1)); - QFileInfo fi(m_filepath); - QDir dir = fi.absoluteDir(); - QFile *file = new QFile(dir.absolutePath() + QDir::separator() + importFile); - - if (importFile.isEmpty() || !file->exists()) { - dir.cdUp(); - dir.cd("data"); - dir.cd("qps"); - delete file; - file = new QFile(dir.absolutePath() + QDir::separator() + importFile); - } - - if (importFile.isEmpty() || !file->exists()) { - dir.cdUp(); - dir.cd("images"); - delete file; - file = new QFile(dir.absolutePath() + QDir::separator() + importFile); - } - - if (importFile.isEmpty() || !file->exists()) { - printf(" - importing non-existing file at line %d (%s)\n", m_currentCommandIndex, - qPrintable(file->fileName())); - delete file; - return; - } - - if (!file->open(QIODevice::ReadOnly)) { - printf(" - failed to read file: '%s'\n", qPrintable(file->fileName())); - delete file; - return; - } - if (m_verboseMode) - printf(" -(lance) importing file at line %d (%s)\n", m_currentCommandIndex, - qPrintable(fi.fileName())); - - QFileInfo fileinfo(*file); - m_commands[m_currentCommandIndex] = QString("# import file (%1) start").arg(fileinfo.fileName()); - QTextStream textFile(file); - QString rawContent = textFile.readAll(); - QStringList importedData = rawContent.split('\n', QString::SkipEmptyParts); - importedData.append(QString("# import file (%1) end ---").arg(fileinfo.fileName())); - insertAt(m_currentCommandIndex, importedData); - - if (m_verboseMode) { - printf(" -(lance) Command buffer now looks like:\n"); - for (int i = 0; i < m_commands.count(); ++i) - printf(" ---> {%s}\n", qPrintable(m_commands.at(i))); - } - delete file; -} - -/***************************************************************************************************/ -void PaintCommands::command_begin_block(QRegExp re) -{ - const QString &blockName = re.cap(1); - if (m_verboseMode) - printf(" -(lance) begin_block (%s)\n", qPrintable(blockName)); - - m_commands[m_currentCommandIndex] = QString("# begin block (%1)").arg(blockName); - QStringList newBlock; - int i = m_currentCommandIndex + 1; - for (; i < m_commands.count(); ++i) { - const QString &nextCmd = m_commands.at(i); - if (nextCmd.startsWith("end_block")) { - m_commands[i] = QString("# end block (%1)").arg(blockName); - break; - } - newBlock += nextCmd; - } - - if (m_verboseMode) - for (int j = 0; j < newBlock.count(); ++j) - printf(" %d: %s\n", j, qPrintable(newBlock.at(j))); - - if (i >= m_commands.count()) - printf(" - Warning! Block doesn't have an 'end_block' marker!\n"); - - m_blockMap.insert(blockName, newBlock); -} - -/***************************************************************************************************/ -void PaintCommands::command_end_block(QRegExp) -{ - printf(" - end_block should be consumed by begin_block command.\n"); - printf(" You will never see this if your block markers are in sync\n"); - printf(" (noop)\n"); -} - -/***************************************************************************************************/ -void PaintCommands::command_repeat_block(QRegExp re) -{ - QString blockName = re.cap(1); - if (m_verboseMode) - printf(" -(lance) repeating block (%s)\n", qPrintable(blockName)); - - QStringList block = m_blockMap.value(blockName); - if (block.isEmpty()) { - printf(" - repeated block (%s) is empty!\n", qPrintable(blockName)); - return; - } - - m_commands[m_currentCommandIndex] = QString("# repeated block (%1)").arg(blockName); - insertAt(m_currentCommandIndex, block); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawLine(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double x1 = convertToDouble(caps.at(1)); - double y1 = convertToDouble(caps.at(2)); - double x2 = convertToDouble(caps.at(3)); - double y2 = convertToDouble(caps.at(4)); - - if (m_verboseMode) - printf(" -(lance) drawLine((%.2f, %.2f), (%.2f, %.2f))\n", x1, y1, x2, y2); - - m_painter->drawLine(QLineF(x1, y1, x2, y2)); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawPath(QRegExp re) -{ - if (m_verboseMode) - printf(" -(lance) drawPath(name=%s)\n", qPrintable(re.cap(1))); - - QPainterPath &path = m_pathMap[re.cap(1)]; - m_painter->drawPath(path); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawPixmap(QRegExp re) -{ - QPixmap pm; - pm = m_pixmapMap[re.cap(1)]; // try cache first - if (pm.isNull()) - pm = image_load(re.cap(1)); - if (pm.isNull()) { - QFileInfo fi(m_filepath); - QDir dir = fi.absoluteDir(); - dir.cdUp(); - dir.cd("images"); - QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(re.cap(1)); - pm = QPixmap(fileName); - if (pm.isNull() && !fileName.endsWith(".png")) { - fileName.append(".png"); - pm = QPixmap(fileName); - } - } - if (pm.isNull()) { - fprintf(stderr, "ERROR(drawPixmap): failed to load pixmap: '%s'\n", - qPrintable(re.cap(1))); - return; - } - - qreal tx = convertToFloat(re.cap(2)); - qreal ty = convertToFloat(re.cap(3)); - qreal tw = convertToFloat(re.cap(4)); - qreal th = convertToFloat(re.cap(5)); - - qreal sx = convertToFloat(re.cap(6)); - qreal sy = convertToFloat(re.cap(7)); - qreal sw = convertToFloat(re.cap(8)); - qreal sh = convertToFloat(re.cap(9)); - - if (tw == 0) tw = -1; - if (th == 0) th = -1; - if (sw == 0) sw = -1; - if (sh == 0) sh = -1; - - if (m_verboseMode) - printf(" -(lance) drawPixmap('%s' dim=(%d, %d), depth=%d, (%f, %f, %f, %f), (%f, %f, %f, %f)\n", - qPrintable(re.cap(1)), pm.width(), pm.height(), pm.depth(), - tx, ty, tw, th, sx, sy, sw, sh); - - m_painter->drawPixmap(QRectF(tx, ty, tw, th), pm, QRectF(sx, sy, sw, sh)); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawImage(QRegExp re) -{ - QImage im; - im = m_imageMap[re.cap(1)]; // try cache first - if (im.isNull()) - im = image_load(re.cap(1)); - - if (im.isNull()) { - QFileInfo fi(m_filepath); - QDir dir = fi.absoluteDir(); - dir.cdUp(); - dir.cd("images"); - QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(re.cap(1)); - im = QImage(fileName); - if (im.isNull() && !fileName.endsWith(".png")) { - fileName.append(".png"); - im = QImage(fileName); - } - } - if (im.isNull()) { - fprintf(stderr, "ERROR(drawImage): failed to load image: '%s'\n", qPrintable(re.cap(1))); - return; - } - - qreal tx = convertToFloat(re.cap(2)); - qreal ty = convertToFloat(re.cap(3)); - qreal tw = convertToFloat(re.cap(4)); - qreal th = convertToFloat(re.cap(5)); - - qreal sx = convertToFloat(re.cap(6)); - qreal sy = convertToFloat(re.cap(7)); - qreal sw = convertToFloat(re.cap(8)); - qreal sh = convertToFloat(re.cap(9)); - - if (tw == 0) tw = -1; - if (th == 0) th = -1; - if (sw == 0) sw = -1; - if (sh == 0) sh = -1; - - if (m_verboseMode) - printf(" -(lance) drawImage('%s' dim=(%d, %d), (%f, %f, %f, %f), (%f, %f, %f, %f)\n", - qPrintable(re.cap(1)), im.width(), im.height(), tx, ty, tw, th, sx, sy, sw, sh); - - m_painter->drawImage(QRectF(tx, ty, tw, th), im, QRectF(sx, sy, sw, sh), Qt::OrderedDither | Qt::OrderedAlphaDither); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawTiledPixmap(QRegExp re) -{ - QPixmap pm; - pm = m_pixmapMap[re.cap(1)]; // try cache first - if (pm.isNull()) - pm = image_load(re.cap(1)); - if (pm.isNull()) { - QFileInfo fi(m_filepath); - QDir dir = fi.absoluteDir(); - dir.cdUp(); - dir.cd("images"); - QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(re.cap(1)); - pm = QPixmap(fileName); - if (pm.isNull() && !fileName.endsWith(".png")) { - fileName.append(".png"); - pm = QPixmap(fileName); - } - } - if (pm.isNull()) { - fprintf(stderr, "ERROR(drawTiledPixmap): failed to load pixmap: '%s'\n", - qPrintable(re.cap(1))); - return; - } - - int tx = convertToInt(re.cap(2)); - int ty = convertToInt(re.cap(3)); - int tw = convertToInt(re.cap(4)); - int th = convertToInt(re.cap(5)); - - int sx = convertToInt(re.cap(6)); - int sy = convertToInt(re.cap(7)); - - if (tw == 0) tw = -1; - if (th == 0) th = -1; - - if (m_verboseMode) - printf(" -(lance) drawTiledPixmap('%s' dim=(%d, %d), (%d, %d, %d, %d), (%d, %d)\n", - qPrintable(re.cap(1)), pm.width(), pm.height(), tx, ty, tw, th, sx, sy); - - m_painter->drawTiledPixmap(tx, ty, tw, th, pm, sx, sy); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawPoint(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - float x = convertToFloat(caps.at(1)); - float y = convertToFloat(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) drawPoint(%.2f, %.2f)\n", x, y); - - m_painter->drawPoint(QPointF(x, y)); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawPolygon(QRegExp re) -{ - static QRegExp separators("\\s"); - QStringList caps = re.capturedTexts(); - QString cap = caps.at(1); - QStringList numbers = cap.split(separators, QString::SkipEmptyParts); - - QPolygonF array; - for (int i=0; i + 1drawPolygon(array, caps.at(2).toLower() == "winding" ? Qt::WindingFill : Qt::OddEvenFill); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawPolyline(QRegExp re) -{ - static QRegExp separators("\\s"); - QStringList numbers = re.cap(1).split(separators, QString::SkipEmptyParts); - - QPolygonF array; - for (int i=0; i + 1drawPolyline(array.toPolygon()); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawRect(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - float x = convertToFloat(caps.at(1)); - float y = convertToFloat(caps.at(2)); - float w = convertToFloat(caps.at(3)); - float h = convertToFloat(caps.at(4)); - - if (m_verboseMode) - printf(" -(lance) drawRect(%.2f, %.2f, %.2f, %.2f)\n", x, y, w, h); - - m_painter->drawRect(QRectF(x, y, w, h)); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawRoundedRect(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - float x = convertToFloat(caps.at(1)); - float y = convertToFloat(caps.at(2)); - float w = convertToFloat(caps.at(3)); - float h = convertToFloat(caps.at(4)); - float xr = convertToFloat(caps.at(5)); - float yr = convertToFloat(caps.at(6)); - - int mode = translateEnum(sizeModeTable, caps.at(7), sizeof(sizeModeTable)/sizeof(char *)); - if (mode < 0) - mode = Qt::AbsoluteSize; - - if (m_verboseMode) - printf(" -(lance) drawRoundRect(%f, %f, %f, %f, %f, %f, %s)\n", x, y, w, h, xr, yr, mode ? "RelativeSize" : "AbsoluteSize"); - - m_painter->drawRoundedRect(QRectF(x, y, w, h), xr, yr, Qt::SizeMode(mode)); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawRoundRect(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - int x = convertToInt(caps.at(1)); - int y = convertToInt(caps.at(2)); - int w = convertToInt(caps.at(3)); - int h = convertToInt(caps.at(4)); - int xs = caps.at(5).isEmpty() ? 50 : convertToInt(caps.at(5)); - int ys = caps.at(6).isEmpty() ? 50 : convertToInt(caps.at(6)); - - if (m_verboseMode) - printf(" -(lance) drawRoundRect(%d, %d, %d, %d, [%d, %d])\n", x, y, w, h, xs, ys); - - m_painter->drawRoundRect(x, y, w, h, xs, ys); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawEllipse(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - float x = convertToFloat(caps.at(1)); - float y = convertToFloat(caps.at(2)); - float w = convertToFloat(caps.at(3)); - float h = convertToFloat(caps.at(4)); - - if (m_verboseMode) - printf(" -(lance) drawEllipse(%.2f, %.2f, %.2f, %.2f)\n", x, y, w, h); - - m_painter->drawEllipse(QRectF(x, y, w, h)); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawPie(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - int x = convertToInt(caps.at(1)); - int y = convertToInt(caps.at(2)); - int w = convertToInt(caps.at(3)); - int h = convertToInt(caps.at(4)); - int angle = convertToInt(caps.at(5)); - int sweep = convertToInt(caps.at(6)); - - if (m_verboseMode) - printf(" -(lance) drawPie(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep); - - m_painter->drawPie(x, y, w, h, angle, sweep); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawChord(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - int x = convertToInt(caps.at(1)); - int y = convertToInt(caps.at(2)); - int w = convertToInt(caps.at(3)); - int h = convertToInt(caps.at(4)); - int angle = convertToInt(caps.at(5)); - int sweep = convertToInt(caps.at(6)); - - if (m_verboseMode) - printf(" -(lance) drawChord(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep); - - m_painter->drawChord(x, y, w, h, angle, sweep); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawArc(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - int x = convertToInt(caps.at(1)); - int y = convertToInt(caps.at(2)); - int w = convertToInt(caps.at(3)); - int h = convertToInt(caps.at(4)); - int angle = convertToInt(caps.at(5)); - int sweep = convertToInt(caps.at(6)); - - if (m_verboseMode) - printf(" -(lance) drawArc(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep); - - m_painter->drawArc(x, y, w, h, angle, sweep); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawText(QRegExp re) -{ - if (!m_shouldDrawText) - return; - QStringList caps = re.capturedTexts(); - int x = convertToInt(caps.at(1)); - int y = convertToInt(caps.at(2)); - QString txt = caps.at(3); - - if (m_verboseMode) - printf(" -(lance) drawText(%d, %d, %s)\n", x, y, qPrintable(txt)); - - m_painter->drawText(x, y, txt); -} - -void PaintCommands::command_drawStaticText(QRegExp re) -{ - if (!m_shouldDrawText) - return; - QStringList caps = re.capturedTexts(); - int x = convertToInt(caps.at(1)); - int y = convertToInt(caps.at(2)); - QString txt = caps.at(3); - - if (m_verboseMode) - printf(" -(lance) drawStaticText(%d, %d, %s)\n", x, y, qPrintable(txt)); - - m_painter->drawStaticText(x, y, QStaticText(txt)); -} - -/***************************************************************************************************/ -void PaintCommands::command_noop(QRegExp) -{ - if (m_verboseMode) - printf(" -(lance) noop: %s\n", qPrintable(m_currentCommand)); - - if (!m_currentCommand.trimmed().isEmpty()) { - fprintf(stderr, "unknown command: '%s'\n", qPrintable(m_currentCommand.trimmed())); - } -} - -/***************************************************************************************************/ -void PaintCommands::command_path_addText(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - double x = convertToDouble(caps.at(2)); - double y = convertToDouble(caps.at(3)); - QString text = caps.at(4); - - if (m_verboseMode) - printf(" -(lance) path_addText(%s, %.2f, %.2f, text=%s\n", qPrintable(name), x, y, qPrintable(text)); - - m_pathMap[name].addText(x, y, m_painter->font(), text); -} - -/***************************************************************************************************/ -void PaintCommands::command_path_addEllipse(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - double x = convertToDouble(caps.at(2)); - double y = convertToDouble(caps.at(3)); - double w = convertToDouble(caps.at(4)); - double h = convertToDouble(caps.at(5)); - - if (m_verboseMode) - printf(" -(lance) path_addEllipse(%s, %.2f, %.2f, %.2f, %.2f)\n", qPrintable(name), x, y, w, h); - - m_pathMap[name].addEllipse(x, y, w, h); -} - -/***************************************************************************************************/ -void PaintCommands::command_path_addRect(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - double x = convertToDouble(caps.at(2)); - double y = convertToDouble(caps.at(3)); - double w = convertToDouble(caps.at(4)); - double h = convertToDouble(caps.at(5)); - - if (m_verboseMode) - printf(" -(lance) path_addRect(%s, %.2f, %.2f, %.2f, %.2f)\n", qPrintable(name), x, y, w, h); - - m_pathMap[name].addRect(x, y, w, h); -} - -/***************************************************************************************************/ -void PaintCommands::command_path_addPolygon(QRegExp re) -{ - static QRegExp separators("\\s"); - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - QString cap = caps.at(2); - QStringList numbers = cap.split(separators, QString::SkipEmptyParts); - - QPolygonF array; - for (int i=0; i + 1pen(); - - if (m_verboseMode) - printf(" -(lance) path_createOutline(%s, name=%s, width=%d)\n", - qPrintable(name), qPrintable(newName), pen.width()); - - if (!m_pathMap.contains(name)) { - fprintf(stderr, "createOutline(), unknown path: %s\n", qPrintable(name)); - return; - } - QPainterPathStroker stroker; - stroker.setWidth(pen.widthF()); - stroker.setDashPattern(pen.style()); - stroker.setCapStyle(pen.capStyle()); - stroker.setJoinStyle(pen.joinStyle()); - m_pathMap[newName] = stroker.createStroke(m_pathMap[name]); -} - -/***************************************************************************************************/ -void PaintCommands::command_path_cubicTo(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - double x1 = convertToDouble(caps.at(2)); - double y1 = convertToDouble(caps.at(3)); - double x2 = convertToDouble(caps.at(4)); - double y2 = convertToDouble(caps.at(5)); - double x3 = convertToDouble(caps.at(6)); - double y3 = convertToDouble(caps.at(7)); - - if (m_verboseMode) - printf(" -(lance) path_cubicTo(%s, (%.2f, %.2f), (%.2f, %.2f), (%.2f, %.2f))\n", qPrintable(name), x1, y1, x2, y2, x3, y3); - - m_pathMap[name].cubicTo(x1, y1, x2, y2, x3, y3); -} - -/***************************************************************************************************/ -void PaintCommands::command_path_moveTo(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - double x1 = convertToDouble(caps.at(2)); - double y1 = convertToDouble(caps.at(3)); - - if (m_verboseMode) - printf(" -(lance) path_moveTo(%s, (%.2f, %.2f))\n", qPrintable(name), x1, y1); - - m_pathMap[name].moveTo(x1, y1); -} - -/***************************************************************************************************/ -void PaintCommands::command_path_lineTo(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - double x1 = convertToDouble(caps.at(2)); - double y1 = convertToDouble(caps.at(3)); - - if (m_verboseMode) - printf(" -(lance) path_lineTo(%s, (%.2f, %.2f))\n", qPrintable(name), x1, y1); - - m_pathMap[name].lineTo(x1, y1); -} - -/***************************************************************************************************/ -void PaintCommands::command_path_setFillRule(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - bool winding = caps.at(2).toLower() == "winding"; - - if (m_verboseMode) - printf(" -(lance) path_setFillRule(name=%s, winding=%d)\n", qPrintable(name), winding); - - m_pathMap[name].setFillRule(winding ? Qt::WindingFill : Qt::OddEvenFill); -} - -/***************************************************************************************************/ -void PaintCommands::command_path_closeSubpath(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - - if (m_verboseMode) - printf(" -(lance) path_closeSubpath(name=%s)\n", qPrintable(name)); - - m_pathMap[name].closeSubpath(); -} - -/***************************************************************************************************/ -void PaintCommands::command_path_getClipPath(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - - if (m_verboseMode) - printf(" -(lance) path_closeSubpath(name=%s)\n", qPrintable(name)); - - m_pathMap[name] = m_painter->clipPath(); -} - -/***************************************************************************************************/ -static void qt_debug_path(const QPainterPath &path, const QString &name) -{ - const char *names[] = { - "MoveTo ", - "LineTo ", - "CurveTo ", - "CurveToData" - }; - - printf("\nQPainterPath (%s): elementCount=%d\n", qPrintable(name), path.elementCount()); - for (int i=0; i= 0 && e.type <= QPainterPath::CurveToDataElement); - printf(" - %3d:: %s, (%.2f, %.2f)\n", i, names[e.type], e.x, e.y); - } -} - -/***************************************************************************************************/ -void PaintCommands::command_path_debugPrint(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - qt_debug_path(m_pathMap[name], name); -} - -/***************************************************************************************************/ -void PaintCommands::command_region_addRect(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - int x = convertToInt(caps.at(2)); - int y = convertToInt(caps.at(3)); - int w = convertToInt(caps.at(4)); - int h = convertToInt(caps.at(5)); - - if (m_verboseMode) - printf(" -(lance) region_addRect(%s, %d, %d, %d, %d)\n", qPrintable(name), x, y, w, h); - - m_regionMap[name] += QRect(x, y, w, h); -} - -/***************************************************************************************************/ -void PaintCommands::command_region_addEllipse(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - int x = convertToInt(caps.at(2)); - int y = convertToInt(caps.at(3)); - int w = convertToInt(caps.at(4)); - int h = convertToInt(caps.at(5)); - - if (m_verboseMode) - printf(" -(lance) region_addEllipse(%s, %d, %d, %d, %d)\n", qPrintable(name), x, y, w, h); - - m_regionMap[name] += QRegion(x, y, w, h, QRegion::Ellipse); -} - -/***************************************************************************************************/ -void PaintCommands::command_region_getClipRegion(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString name = caps.at(1); - QRegion region = m_painter->clipRegion(); - - if (m_verboseMode) - printf(" -(lance) region_getClipRegion(name=%s), bounds=[%d, %d, %d, %d]\n", qPrintable(name), - region.boundingRect().x(), - region.boundingRect().y(), - region.boundingRect().width(), - region.boundingRect().height()); - - m_regionMap[name] = region; -} - -/***************************************************************************************************/ -void PaintCommands::command_resetMatrix(QRegExp) -{ - if (m_verboseMode) - printf(" -(lance) resetMatrix()\n"); - - m_painter->resetTransform(); -} - -/***************************************************************************************************/ -void PaintCommands::command_restore(QRegExp) -{ - if (m_verboseMode) - printf(" -(lance) restore()\n"); - - m_painter->restore(); -} - -/***************************************************************************************************/ -void PaintCommands::command_rotate(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double angle = convertToDouble(caps.at(1)); - - if (m_verboseMode) - printf(" -(lance) rotate(%.2f)\n", angle); - - m_painter->rotate(angle); -} - -/***************************************************************************************************/ -void PaintCommands::command_rotate_x(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double angle = convertToDouble(caps.at(1)); - - if (m_verboseMode) - printf(" -(lance) rotate_x(%.2f)\n", angle); - - QTransform transform; - transform.rotate(angle, Qt::XAxis); - m_painter->setTransform(transform, true); -} - -/***************************************************************************************************/ -void PaintCommands::command_rotate_y(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double angle = convertToDouble(caps.at(1)); - - if (m_verboseMode) - printf(" -(lance) rotate_y(%.2f)\n", angle); - - QTransform transform; - transform.rotate(angle, Qt::YAxis); - m_painter->setTransform(transform, true); -} - -/***************************************************************************************************/ -void PaintCommands::command_save(QRegExp) -{ - if (m_verboseMode) - printf(" -(lance) save()\n"); - - m_painter->save(); -} - -/***************************************************************************************************/ -void PaintCommands::command_mapQuadToQuad(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double x1 = convertToDouble(caps.at(1)); - double y1 = convertToDouble(caps.at(2)); - double x2 = convertToDouble(caps.at(3)); - double y2 = convertToDouble(caps.at(4)); - double x3 = convertToDouble(caps.at(5)); - double y3 = convertToDouble(caps.at(6)); - double x4 = convertToDouble(caps.at(7)); - double y4 = convertToDouble(caps.at(8)); - QPolygonF poly1(4); - poly1[0] = QPointF(x1, y1); - poly1[1] = QPointF(x2, y2); - poly1[2] = QPointF(x3, y3); - poly1[3] = QPointF(x4, y4); - - double x5 = convertToDouble(caps.at(9)); - double y5 = convertToDouble(caps.at(10)); - double x6 = convertToDouble(caps.at(11)); - double y6 = convertToDouble(caps.at(12)); - double x7 = convertToDouble(caps.at(13)); - double y7 = convertToDouble(caps.at(14)); - double x8 = convertToDouble(caps.at(15)); - double y8 = convertToDouble(caps.at(16)); - QPolygonF poly2(4); - poly2[0] = QPointF(x5, y5); - poly2[1] = QPointF(x6, y6); - poly2[2] = QPointF(x7, y7); - poly2[3] = QPointF(x8, y8); - - if (m_verboseMode) - printf(" -(lance) mapQuadToQuad(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f ->\n\t" - ",%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", - x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6, x7, y7, x8, y8); - - QTransform trans; - - if (!QTransform::quadToQuad(poly1, poly2, trans)) { - qWarning("Couldn't perform quad to quad transformation!"); - } - - m_painter->setTransform(trans, true); -} - -/***************************************************************************************************/ -void PaintCommands::command_setMatrix(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double m11 = convertToDouble(caps.at(1)); - double m12 = convertToDouble(caps.at(2)); - double m13 = convertToDouble(caps.at(3)); - double m21 = convertToDouble(caps.at(4)); - double m22 = convertToDouble(caps.at(5)); - double m23 = convertToDouble(caps.at(6)); - double m31 = convertToDouble(caps.at(7)); - double m32 = convertToDouble(caps.at(8)); - double m33 = convertToDouble(caps.at(9)); - - if (m_verboseMode) - printf(" -(lance) setMatrix(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", - m11, m12, m13, m21, m22, m23, m31, m32, m33); - - QTransform trans; - trans.setMatrix(m11, m12, m13, - m21, m22, m23, - m31, m32, m33); - - m_painter->setTransform(trans, true); -} - -/***************************************************************************************************/ -void PaintCommands::command_scale(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double sx = convertToDouble(caps.at(1)); - double sy = convertToDouble(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) scale(%.2f, %.2f)\n", sx, sy); - - - m_painter->scale(sx, sy); -} - -/***************************************************************************************************/ -void PaintCommands::command_setBackground(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QColor color = convertToColor(caps.at(1)); - QString pattern = caps.at(2); - - int style = translateEnum(brushStyleTable, pattern, Qt::LinearGradientPattern); - if (style < 0) - style = Qt::SolidPattern; - - if (m_verboseMode) - printf(" -(lance) setBackground(%s, %s)\n", qPrintable(color.name()), qPrintable(pattern)); - - m_painter->setBackground(QBrush(color, Qt::BrushStyle(style))); -} - -/***************************************************************************************************/ -void PaintCommands::command_setOpacity(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double opacity = convertToDouble(caps.at(1)); - - if (m_verboseMode) - printf(" -(lance) setOpacity(%lf)\n", opacity); - - m_painter->setOpacity(opacity); -} - -/***************************************************************************************************/ -void PaintCommands::command_setBgMode(QRegExp re) -{ - QString cap = re.cap(2); - Qt::BGMode mode = Qt::TransparentMode; - if (cap.toLower() == QLatin1String("opaquemode") || cap.toLower() == QLatin1String("opaque")) - mode = Qt::OpaqueMode; - - if (m_verboseMode) - printf(" -(lance) setBackgroundMode(%s)\n", mode == Qt::OpaqueMode ? "OpaqueMode" : "TransparentMode"); - - m_painter->setBackgroundMode(mode); -} - -/***************************************************************************************************/ -void PaintCommands::command_setBrush(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - - QPixmap pm = image_load(caps.at(1)); - if (!pm.isNull()) { // Assume pixmap - if (m_verboseMode) - printf(" -(lance) setBrush(pixmap=%s, width=%d, height=%d)\n", - qPrintable(caps.at(1)), pm.width(), pm.height()); - - m_painter->setBrush(QBrush(pm)); - } else if (caps.at(1).toLower() == "nobrush") { - m_painter->setBrush(Qt::NoBrush); - if (m_verboseMode) - printf(" -(lance) setBrush(Qt::NoBrush)\n"); - } else { - QColor color = convertToColor(caps.at(1)); - QString pattern = caps.at(2); - - int style = translateEnum(brushStyleTable, pattern, Qt::LinearGradientPattern); - if (style < 0) - style = Qt::SolidPattern; - - if (m_verboseMode) - printf(" -(lance) setBrush(%s, %s (%d))\n", qPrintable(color.name()), qPrintable(pattern), style); - - m_painter->setBrush(QBrush(color, Qt::BrushStyle(style))); - } -} - -/***************************************************************************************************/ -void PaintCommands::command_setBrushOrigin(QRegExp re) -{ - int x = convertToInt(re.cap(1)); - int y = convertToInt(re.cap(2)); - - if (m_verboseMode) - printf(" -(lance) setBrushOrigin(%d, %d)\n", x, y); - - m_painter->setBrushOrigin(x, y); -} - -/***************************************************************************************************/ -void PaintCommands::command_brushTranslate(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double dx = convertToDouble(caps.at(1)); - double dy = convertToDouble(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) brushTranslate(%f, %f)\n", dx, dy); - - QBrush new_brush = m_painter->brush(); - QTransform brush_matrix = new_brush.transform(); - brush_matrix.translate(dx, dy); - new_brush.setTransform(brush_matrix); - m_painter->setBrush(new_brush); -} - -/***************************************************************************************************/ -void PaintCommands::command_brushScale(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double sx = convertToDouble(caps.at(1)); - double sy = convertToDouble(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) brushScale(%f, %f)\n", sx, sy); - - QBrush new_brush = m_painter->brush(); - QTransform brush_matrix = new_brush.transform(); - brush_matrix.scale(sx, sy); - new_brush.setTransform(brush_matrix); - m_painter->setBrush(new_brush); -} - -/***************************************************************************************************/ -void PaintCommands::command_brushRotate(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double rot = convertToDouble(caps.at(1)); - - if (m_verboseMode) - printf(" -(lance) brushScale(%f)\n", rot); - - QBrush new_brush = m_painter->brush(); - QTransform brush_matrix = new_brush.transform(); - brush_matrix.rotate(rot); - new_brush.setTransform(brush_matrix); - m_painter->setBrush(new_brush); -} - -/***************************************************************************************************/ -void PaintCommands::command_brushShear(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double sx = convertToDouble(caps.at(1)); - double sy = convertToDouble(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) brushShear(%f, %f)\n", sx, sy); - - QBrush new_brush = m_painter->brush(); - QTransform brush_matrix = new_brush.transform(); - brush_matrix.shear(sx, sy); - new_brush.setTransform(brush_matrix); - m_painter->setBrush(new_brush); -} - -/***************************************************************************************************/ -void PaintCommands::command_setClipping(QRegExp re) -{ - bool clipping = re.cap(1).toLower() == "true"; - - if (m_verboseMode) - printf(" -(lance) setClipping(%d)\n", clipping); - - m_painter->setClipping(clipping); -} - -/***************************************************************************************************/ -void PaintCommands::command_setClipRect(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - int x = convertToInt(caps.at(1)); - int y = convertToInt(caps.at(2)); - int w = convertToInt(caps.at(3)); - int h = convertToInt(caps.at(4)); - - int combine = translateEnum(clipOperationTable, caps.at(5), Qt::IntersectClip + 1); - if (combine == -1) - combine = Qt::ReplaceClip; - - if (m_verboseMode) - printf(" -(lance) setClipRect(%d, %d, %d, %d), %s\n", x, y, w, h, clipOperationTable[combine]); - - m_painter->setClipRect(x, y, w, h, Qt::ClipOperation(combine)); -} - -/***************************************************************************************************/ -void PaintCommands::command_setClipPath(QRegExp re) -{ - int combine = translateEnum(clipOperationTable, re.cap(2), Qt::IntersectClip + 1); - if (combine == -1) - combine = Qt::ReplaceClip; - - if (m_verboseMode) - printf(" -(lance) setClipPath(name=%s), %s\n", qPrintable(re.cap(1)), clipOperationTable[combine]); - - if (!m_pathMap.contains(re.cap(1))) - fprintf(stderr, " - setClipPath, no such path"); - m_painter->setClipPath(m_pathMap[re.cap(1)], Qt::ClipOperation(combine)); -} - -/***************************************************************************************************/ -void PaintCommands::command_setClipRegion(QRegExp re) -{ - int combine = translateEnum(clipOperationTable, re.cap(2), Qt::IntersectClip + 1); - if (combine == -1) - combine = Qt::ReplaceClip; - QRegion r = m_regionMap[re.cap(1)]; - - if (m_verboseMode) - printf(" -(lance) setClipRegion(name=%s), bounds=[%d, %d, %d, %d], %s\n", - qPrintable(re.cap(1)), - r.boundingRect().x(), - r.boundingRect().y(), - r.boundingRect().width(), - r.boundingRect().height(), - clipOperationTable[combine]); - - m_painter->setClipRegion(m_regionMap[re.cap(1)], Qt::ClipOperation(combine)); -} - -/***************************************************************************************************/ -void PaintCommands::command_setFont(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QString family = caps.at(1); - int size = convertToInt(caps.at(2)); - - int weight = translateEnum(fontWeightTable, re.cap(3).toLower(), 5); - if (weight != -1) { - switch (weight) { - case 0: weight = QFont::Light; break; - case 1: weight = QFont::Normal; break; - case 2: weight = QFont::DemiBold; break; - case 3: weight = QFont::Bold; break; - case 4: weight = QFont::Black; break; - } - } else { - weight = convertToInt(re.cap(3)); - } - - bool italic = caps.at(4).toLower() == "true" || caps.at(4).toLower() == "italic"; - - QFont font(family, size, weight, italic); - -#if QT_VERSION >= 0x040800 - int hinting = translateEnum(fontHintingTable, caps.at(5), 4); - if (hinting == -1) - hinting = 0; - else - font.setHintingPreference(QFont::HintingPreference(hinting)); -#else - int hinting = 1; -#endif - if (m_verboseMode) - printf(" -(lance) setFont(family=%s, size=%d, weight=%d, italic=%d hinting=%s\n", - qPrintable(family), size, weight, italic, fontHintingTable[hinting]); - - m_painter->setFont(font); -} - -/***************************************************************************************************/ -void PaintCommands::command_setPen(QRegExp re) -{ - QString cap = re.cap(1); - int style = translateEnum(penStyleTable, cap, Qt::DashDotDotLine + 1); - if (style >= 0) { - if (m_verboseMode) - printf(" -(lance) setPen(%s)\n", qPrintable(cap)); - - m_painter->setPen(Qt::PenStyle(style)); - } else if (cap.toLower() == "brush") { - QPen pen(m_painter->brush(), 0); - if (m_verboseMode) { - printf(" -(lance) setPen(brush), style=%d, color=%08x\n", - pen.brush().style(), pen.color().rgba()); - } - m_painter->setPen(pen); - } else { - QColor color = convertToColor(cap); - if (m_verboseMode) - printf(" -(lance) setPen(%s)\n", qPrintable(color.name())); - - m_painter->setPen(color); - } -} - -/***************************************************************************************************/ -void PaintCommands::command_setPen2(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - - QBrush brush; - - if (caps.at(1).toLower() == "brush") - brush = m_painter->brush(); - else - brush = convertToColor(caps.at(1)); - - double width = convertToDouble(caps.at(2)); - int penStyle = translateEnum(penStyleTable, caps.at(3), Qt::DashDotDotLine + 1); - if (penStyle < 0) - penStyle = Qt::SolidLine; - - Qt::PenCapStyle capStyle = Qt::SquareCap; - if (caps.at(4).toLower() == "flatcap") capStyle = Qt::FlatCap; - else if (caps.at(4).toLower() == "squarecap") capStyle = Qt::SquareCap; - else if (caps.at(4).toLower() == "roundcap") capStyle = Qt::RoundCap; - else if (!caps.at(4).isEmpty()) - fprintf(stderr, "ERROR: setPen, unknown capStyle: %s\n", qPrintable(caps.at(4))); - - Qt::PenJoinStyle joinStyle = Qt::BevelJoin; - if (caps.at(5).toLower() == "miterjoin") joinStyle = Qt::MiterJoin; - else if (caps.at(5).toLower() == "beveljoin") joinStyle = Qt::BevelJoin; - else if (caps.at(5).toLower() == "roundjoin") joinStyle = Qt::RoundJoin; - else if (!caps.at(5).isEmpty()) - fprintf(stderr, "ERROR: setPen, unknown joinStyle: %s\n", qPrintable(caps.at(5))); - - if (m_verboseMode) - printf(" -(lance) setPen(%s, width=%f, style=%d, cap=%d, join=%d)\n", - qPrintable(brush.color().name()), width, penStyle, capStyle, joinStyle); - - m_painter->setPen(QPen(brush, width, Qt::PenStyle(penStyle), capStyle, joinStyle)); -} - -/***************************************************************************************************/ -void PaintCommands::command_setRenderHint(QRegExp re) -{ - QString hintString = re.cap(1).toLower(); - bool on = re.cap(2).isEmpty() || re.cap(2).toLower() == "true"; - if (hintString.contains("antialiasing")) { - if (m_verboseMode) - printf(" -(lance) setRenderHint Antialiasing\n"); - - m_painter->setRenderHint(QPainter::Antialiasing, on); - } else if (hintString.contains("smoothpixmaptransform")) { - if (m_verboseMode) - printf(" -(lance) setRenderHint SmoothPixmapTransform\n"); - m_painter->setRenderHint(QPainter::SmoothPixmapTransform, on); - } else { - fprintf(stderr, "ERROR(setRenderHint): unknown hint '%s'\n", qPrintable(hintString)); - } -} - -/***************************************************************************************************/ -void PaintCommands::command_clearRenderHint(QRegExp /*re*/) -{ - m_painter->setRenderHint(QPainter::Antialiasing, false); - m_painter->setRenderHint(QPainter::SmoothPixmapTransform, false); - if (m_verboseMode) - printf(" -(lance) clearRenderHint\n"); -} - -/***************************************************************************************************/ -void PaintCommands::command_setCompositionMode(QRegExp re) -{ - QString modeString = re.cap(1).toLower(); - int mode = translateEnum(compositionModeTable, modeString, 33); - - if (mode < 0 || mode > QPainter::RasterOp_SourceAndNotDestination) { - fprintf(stderr, "ERROR: invalid mode: %s\n", qPrintable(modeString)); - return; - } - - if (m_verboseMode) - printf(" -(lance) setCompositionMode: %d: %s\n", mode, qPrintable(modeString)); - - m_painter->setCompositionMode(QPainter::CompositionMode(mode)); -} - -/***************************************************************************************************/ -void PaintCommands::command_translate(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double dx = convertToDouble(caps.at(1)); - double dy = convertToDouble(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) translate(%f, %f)\n", dx, dy); - - m_painter->translate(dx, dy); -} - -/***************************************************************************************************/ -void PaintCommands::command_pixmap_load(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - - QString fileName = caps.at(1); - QString name = caps.at(2); - - if (name.isEmpty()) - name = fileName; - - QImage im = image_load(fileName); - QPixmap px = QPixmap::fromImage(im, Qt::OrderedDither | Qt::OrderedAlphaDither); - - if (m_verboseMode) - printf(" -(lance) pixmap_load(%s as %s), size=[%d, %d], depth=%d\n", - qPrintable(fileName), qPrintable(name), - px.width(), px.height(), px.depth()); - - m_pixmapMap[name] = px; -} - -/***************************************************************************************************/ -void PaintCommands::command_bitmap_load(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - - QString fileName = caps.at(1); - QString name = caps.at(2); - - if (name.isEmpty()) - name = fileName; - - QBitmap bm = image_load(fileName); - - if (m_verboseMode) - printf(" -(lance) bitmap_load(%s as %s), size=[%d, %d], depth=%d\n", - qPrintable(fileName), qPrintable(name), - bm.width(), bm.height(), bm.depth()); - - m_pixmapMap[name] = bm; -} - -/***************************************************************************************************/ -void PaintCommands::command_pixmap_setMask(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - QBitmap mask = image_load(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) pixmap_setMask(%s, %s)\n", qPrintable(caps.at(1)), qPrintable(caps.at(2))); - - if (!m_pixmapMap[caps.at(1)].isNull()) - m_pixmapMap[caps.at(1)].setMask(mask); -} - -/***************************************************************************************************/ -void PaintCommands::command_image_load(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - - QString fileName = caps.at(1); - QString name = caps.at(2); - - if (name.isEmpty()) - name = fileName; - - QImage image = image_load(fileName); - - if (m_verboseMode) - printf(" -(lance) image_load(%s as %s), size=[%d, %d], format=%d\n", - qPrintable(fileName), qPrintable(name), - image.width(), image.height(), image.format()); - - m_imageMap[name] = image; -} - -/***************************************************************************************************/ -void PaintCommands::command_image_setColorCount(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - - QString name = caps.at(1); - int count = convertToInt(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) image_setColorCount(%s), %d -> %d\n", - qPrintable(name), m_imageMap[name].colorCount(), count); - - m_imageMap[name].setColorCount(count); -} - -/***************************************************************************************************/ -void PaintCommands::command_image_setColor(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - - QString name = caps.at(1); - int index = convertToInt(caps.at(2)); - QColor color = convertToColor(caps.at(3)); - - if (m_verboseMode) - printf(" -(lance) image_setColor(%s), %d = %08x\n", qPrintable(name), index, color.rgba()); - - m_imageMap[name].setColor(index, color.rgba()); -} - -/***************************************************************************************************/ -void PaintCommands::command_abort(QRegExp) -{ - m_abort = true; -} - -/***************************************************************************************************/ -void PaintCommands::command_gradient_clearStops(QRegExp) -{ - if (m_verboseMode) - printf(" -(lance) gradient_clearStops\n"); - m_gradientStops.clear(); -} - -/***************************************************************************************************/ -void PaintCommands::command_gradient_appendStop(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double pos = convertToDouble(caps.at(1)); - QColor color = convertToColor(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) gradient_appendStop(%.2f, %x)\n", pos, color.rgba()); - - m_gradientStops << QGradientStop(pos, color); -} - -/***************************************************************************************************/ -void PaintCommands::command_gradient_setLinear(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double x1 = convertToDouble(caps.at(1)); - double y1 = convertToDouble(caps.at(2)); - double x2 = convertToDouble(caps.at(3)); - double y2 = convertToDouble(caps.at(4)); - - if (m_verboseMode) - printf(" -(lance) gradient_setLinear (%.2f, %.2f), (%.2f, %.2f), spread=%d\n", - x1, y1, x2, y2, m_gradientSpread); - - QLinearGradient lg(QPointF(x1, y1), QPointF(x2, y2)); - lg.setStops(m_gradientStops); - lg.setSpread(m_gradientSpread); - lg.setCoordinateMode(m_gradientCoordinate); - QBrush brush(lg); - QTransform brush_matrix = m_painter->brush().transform(); - brush.setTransform(brush_matrix); - m_painter->setBrush(brush); -} - -/***************************************************************************************************/ -void PaintCommands::command_gradient_setLinearPen(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double x1 = convertToDouble(caps.at(1)); - double y1 = convertToDouble(caps.at(2)); - double x2 = convertToDouble(caps.at(3)); - double y2 = convertToDouble(caps.at(4)); - - if (m_verboseMode) - printf(" -(lance) gradient_setLinear (%.2f, %.2f), (%.2f, %.2f), spread=%d\n", - x1, y1, x2, y2, m_gradientSpread); - - QLinearGradient lg(QPointF(x1, y1), QPointF(x2, y2)); - lg.setStops(m_gradientStops); - lg.setSpread(m_gradientSpread); - lg.setCoordinateMode(m_gradientCoordinate); - QPen pen = m_painter->pen(); - pen.setBrush(lg); - m_painter->setPen(pen); -} - -/***************************************************************************************************/ -void PaintCommands::command_gradient_setRadial(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double cx = convertToDouble(caps.at(1)); - double cy = convertToDouble(caps.at(2)); - double rad = convertToDouble(caps.at(3)); - double fx = convertToDouble(caps.at(4)); - double fy = convertToDouble(caps.at(5)); - - if (m_verboseMode) - printf(" -(lance) gradient_setRadial center=(%.2f, %.2f), radius=%.2f, focal=(%.2f, %.2f), " - "spread=%d\n", - cx, cy, rad, fx, fy, m_gradientSpread); - - QRadialGradient rg(QPointF(cx, cy), rad, QPointF(fx, fy)); - rg.setStops(m_gradientStops); - rg.setSpread(m_gradientSpread); - rg.setCoordinateMode(m_gradientCoordinate); - QBrush brush(rg); - QTransform brush_matrix = m_painter->brush().transform(); - brush.setTransform(brush_matrix); - m_painter->setBrush(brush); -} - -/***************************************************************************************************/ -void PaintCommands::command_gradient_setRadialExtended(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double cx = convertToDouble(caps.at(1)); - double cy = convertToDouble(caps.at(2)); - double rad = convertToDouble(caps.at(3)); - double fx = convertToDouble(caps.at(4)); - double fy = convertToDouble(caps.at(5)); - double frad = convertToDouble(caps.at(6)); - - if (m_verboseMode) - printf(" -(lance) gradient_setRadialExtended center=(%.2f, %.2f), radius=%.2f, focal=(%.2f, %.2f), " - "focal radius=%.2f, spread=%d\n", - cx, cy, rad, fx, fy, frad, m_gradientSpread); - - QRadialGradient rg(QPointF(cx, cy), rad, QPointF(fx, fy), frad); - rg.setStops(m_gradientStops); - rg.setSpread(m_gradientSpread); - rg.setCoordinateMode(m_gradientCoordinate); - QBrush brush(rg); - QTransform brush_matrix = m_painter->brush().transform(); - brush.setTransform(brush_matrix); - m_painter->setBrush(brush); -} - -/***************************************************************************************************/ -void PaintCommands::command_gradient_setConical(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double cx = convertToDouble(caps.at(1)); - double cy = convertToDouble(caps.at(2)); - double angle = convertToDouble(caps.at(3)); - - if (m_verboseMode) { - printf(" -(lance) gradient_setConical center=(%.2f, %.2f), angle=%.2f\n, spread=%d", - cx, cy, angle, m_gradientSpread); - } - - QConicalGradient cg(QPointF(cx, cy), angle); - cg.setStops(m_gradientStops); - cg.setSpread(m_gradientSpread); - cg.setCoordinateMode(m_gradientCoordinate); - QBrush brush(cg); - QTransform brush_matrix = m_painter->brush().transform(); - brush.setTransform(brush_matrix); - m_painter->setBrush(brush); -} - -/***************************************************************************************************/ -void PaintCommands::command_gradient_setSpread(QRegExp re) -{ - int spreadMethod = translateEnum(spreadMethodTable, re.cap(1), 3); - - if (m_verboseMode) - printf(" -(lance) gradient_setSpread %d=[%s]\n", spreadMethod, spreadMethodTable[spreadMethod]); - - m_gradientSpread = QGradient::Spread(spreadMethod); -} - -void PaintCommands::command_gradient_setCoordinateMode(QRegExp re) -{ - int coord = translateEnum(coordinateMethodTable, re.cap(1), 3); - - if (m_verboseMode) - printf(" -(lance) gradient_setCoordinateMode %d=[%s]\n", coord, - coordinateMethodTable[coord]); - - m_gradientCoordinate = QGradient::CoordinateMode(coord); -} - -/***************************************************************************************************/ -void PaintCommands::command_surface_begin(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double x = convertToDouble(caps.at(1)); - double y = convertToDouble(caps.at(2)); - double w = convertToDouble(caps.at(3)); - double h = convertToDouble(caps.at(4)); - - if (m_surface_painter) { - fprintf(stderr, "ERROR: surface already active"); - return; - } - - if (m_verboseMode) - printf(" -(lance) surface_begin, pos=[%.2f, %.2f], size=[%.2f, %.2f]\n", x, y, w, h); - - m_surface_painter = m_painter; - - if (m_type == OpenGLType || m_type == OpenGLPBufferType) { -#ifndef QT_NO_OPENGL - m_surface_pbuffer = new QGLPixelBuffer(qRound(w), qRound(h)); - m_painter = new QPainter(m_surface_pbuffer); - m_painter->fillRect(QRect(0, 0, qRound(w), qRound(h)), Qt::transparent); -#endif -#ifdef Q_WS_X11 - } else if (m_type == WidgetType) { - m_surface_pixmap = QPixmap(qRound(w), qRound(h)); - m_surface_pixmap.fill(Qt::transparent); - m_painter = new QPainter(&m_surface_pixmap); -#endif - } else { - m_surface_image = QImage(qRound(w), qRound(h), QImage::Format_ARGB32_Premultiplied); - m_surface_image.fill(0); - m_painter = new QPainter(&m_surface_image); - } - m_surface_rect = QRectF(x, y, w, h); -} - -/***************************************************************************************************/ -void PaintCommands::command_surface_end(QRegExp) -{ - if (!m_surface_painter) { - fprintf(stderr, "ERROR: surface not active"); - return; - } - - if (m_verboseMode) - printf(" -(lance) surface_end, pos=[%.2f, %.2f], size=[%.2f, %.2f]\n", - m_surface_rect.x(), - m_surface_rect.y(), - m_surface_rect.width(), - m_surface_rect.height()); - m_painter->end(); - - delete m_painter; - m_painter = m_surface_painter; - m_surface_painter = 0; - - if (m_type == OpenGLType || m_type == OpenGLPBufferType) { -#ifndef QT_NO_OPENGL - QImage image = m_surface_pbuffer->toImage(); - QImage new_image(image.bits(), image.width(), - image.height(), QImage::Format_ARGB32_Premultiplied); - QPaintDevice *pdev = m_painter->device(); - if (pdev->devType() == QInternal::Widget) { - QWidget *w = static_cast(pdev); - static_cast(w)->makeCurrent(); - } else if (pdev->devType() == QInternal::Pbuffer) { - static_cast(pdev)->makeCurrent(); - } - - m_painter->drawImage(m_surface_rect, new_image); - - delete m_surface_pbuffer; - m_surface_pbuffer = 0; -#endif -#ifdef Q_WS_X11 - } else if (m_type == WidgetType) { - m_painter->drawPixmap(m_surface_rect.topLeft(), m_surface_pixmap); - m_surface_pixmap = QPixmap(); -#endif - } else { - m_painter->drawImage(m_surface_rect, m_surface_image); - m_surface_image = QImage(); - } - m_surface_rect = QRectF(); -} - -/***************************************************************************************************/ -void PaintCommands::command_image_convertToFormat(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - - QString srcName = caps.at(1); - QString destName = caps.at(2); - - if (!m_imageMap.contains(srcName)) { - fprintf(stderr, "ERROR(convertToFormat): no such image '%s'\n", qPrintable(srcName)); - return; - } - - int format = translateEnum(imageFormatTable, caps.at(3), QImage::NImageFormats); - if (format < 0 || format >= QImage::NImageFormats) { - fprintf(stderr, "ERROR(convertToFormat): invalid format %d = '%s'\n", - format, qPrintable(caps.at(3))); - return; - } - - QImage src = m_imageMap[srcName]; - QImage dest = src.convertToFormat(QImage::Format(format), - Qt::OrderedAlphaDither | Qt::OrderedDither); - - if (m_verboseMode) { - printf(" -(lance) convertToFormat %s:%d -> %s:%d\n", - qPrintable(srcName), src.format(), - qPrintable(destName), dest.format()); - } - - m_imageMap[destName] = dest; -} - -/***************************************************************************************************/ -void PaintCommands::command_textlayout_draw(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - - QString text = caps.at(1); - double width = convertToDouble(caps.at(2)); - - if (m_verboseMode) - printf(" -(lance) textlayout_draw text='%s', width=%f\n", - qPrintable(text), width); - - QFont copy = m_painter->font(); - copy.setPointSize(10); - - QTextLayout layout(text, copy, m_painter->device()); - layout.beginLayout(); - - double y_offset = 0; - - while (true) { - QTextLine line = layout.createLine(); - if (!line.isValid()) - break; - line.setLineWidth(width); - line.setPosition(QPointF(0, y_offset)); - - y_offset += line.height(); - } - - layout.draw(m_painter, QPointF(0, 0)); -} - -/***************************************************************************************************/ -void PaintCommands::command_pen_setDashOffset(QRegExp re) -{ - QStringList caps = re.capturedTexts(); - double offset = convertToDouble(caps.at(1)); - - if (m_verboseMode) - printf(" -(lance) setDashOffset(%lf)\n", offset); - - QPen p = m_painter->pen(); - p.setDashOffset(offset); - m_painter->setPen(p); -} - -/***************************************************************************************************/ -void PaintCommands::command_pen_setDashPattern(QRegExp re) -{ - static QRegExp separators("\\s"); - QStringList caps = re.capturedTexts(); - QString cap = caps.at(1); - QStringList numbers = cap.split(separators, QString::SkipEmptyParts); - - QVector pattern; - for (int i=0; ipen(); - p.setDashPattern(pattern); - m_painter->setPen(p); -} - -/***************************************************************************************************/ -void PaintCommands::command_pen_setCosmetic(QRegExp re) -{ - QString hm = re.capturedTexts().at(1); - bool on = hm == "true" || hm == "yes" || hm == "on"; - - if (m_verboseMode) { - printf(" -(lance) pen_setCosmetic(%s)\n", on ? "true" : "false"); - } - - QPen p = m_painter->pen(); - p.setCosmetic(on); - - m_painter->setPen(p); -} - -/***************************************************************************************************/ -void PaintCommands::command_drawConvexPolygon(QRegExp re) -{ - static QRegExp separators("\\s"); - QStringList caps = re.capturedTexts(); - QString cap = caps.at(1); - QStringList numbers = cap.split(separators, QString::SkipEmptyParts); - - QPolygonF array; - for (int i=0; i + 1drawConvexPolygon(array); -} diff --git a/tests/arthur/common/paintcommands.h b/tests/arthur/common/paintcommands.h deleted file mode 100644 index 925a867f2f..0000000000 --- a/tests/arthur/common/paintcommands.h +++ /dev/null @@ -1,334 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef PAINTCOMMANDS_H -#define PAINTCOMMANDS_H - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_FORWARD_DECLARE_CLASS(QPainter) -QT_FORWARD_DECLARE_CLASS(QRegExp) -#ifndef QT_NO_OPENGL -QT_FORWARD_DECLARE_CLASS(QGLPixelBuffer) -#endif - -enum DeviceType { - WidgetType, - BitmapType, - PixmapType, - ImageType, - ImageMonoType, - OpenGLType, - OpenGLPBufferType, - PictureType, - PrinterType, - PdfType, - PsType, - GrabType, - CustomDeviceType, - CustomWidgetType, - ImageWidgetType -}; - -/************************************************************************/ -class PaintCommands -{ -public: - // construction / initialization - PaintCommands(const QStringList &cmds, int w, int h) - : m_painter(0) - , m_surface_painter(0) - , m_commands(cmds) - , m_gradientSpread(QGradient::PadSpread) - , m_gradientCoordinate(QGradient::LogicalMode) - , m_width(w) - , m_height(h) - , m_verboseMode(false) - , m_type(WidgetType) - , m_checkers_background(true) - , m_shouldDrawText(true) - { staticInit(); } - -public: - void setCheckersBackground(bool b) { staticInit(); m_checkers_background = b; } - void setContents(const QStringList &cmds) { - staticInit(); - m_blockMap.clear(); - m_pathMap.clear(); - m_pixmapMap.clear(); - m_imageMap.clear(); - m_regionMap.clear(); - m_gradientStops.clear(); - m_controlPoints.clear(); - m_gradientSpread = QGradient::PadSpread; - m_gradientCoordinate = QGradient::LogicalMode; - m_commands = cmds; - - - } - void setPainter(QPainter *pt) { staticInit(); m_painter = pt; } - void setType(DeviceType t) { staticInit(); m_type = t; } - void setFilePath(const QString &path) { staticInit(); m_filepath = path; } - void setControlPoints(const QVector &points) { staticInit(); m_controlPoints = points; } - void setVerboseMode(bool v) { staticInit(); m_verboseMode = v; } - void insertAt(int commandIndex, const QStringList &newCommands); - void setShouldDrawText(bool drawText) { m_shouldDrawText = drawText; } - - // run - void runCommands(); - -private: - // run - void runCommand(const QString &scriptLine); - - // conversion methods - int convertToInt(const QString &str); - double convertToDouble(const QString &str); - float convertToFloat(const QString &str); - QColor convertToColor(const QString &str); - - // commands: comments - void command_comment(QRegExp re); - - // commands: importer - void command_import(QRegExp re); - - // commands: blocks - void command_begin_block(QRegExp re); - void command_end_block(QRegExp re); - void command_repeat_block(QRegExp re); - - // commands: misc - void command_textlayout_draw(QRegExp re); - void command_abort(QRegExp re); - - // commands: noops - void command_noop(QRegExp re); - - // commands: setters - void command_setBgMode(QRegExp re); - void command_setBackground(QRegExp re); - void command_setOpacity(QRegExp re); - void command_path_setFillRule(QRegExp re); - void command_setBrush(QRegExp re); - void command_setBrushOrigin(QRegExp re); - void command_brushTranslate(QRegExp re); - void command_brushRotate(QRegExp re); - void command_brushScale(QRegExp re); - void command_brushShear(QRegExp re); - void command_setClipPath(QRegExp re); - void command_setClipRect(QRegExp re); - void command_setClipRectangle(QRegExp re); - void command_setClipRegion(QRegExp re); - void command_setClipping(QRegExp re); - void command_setCompositionMode(QRegExp re); - void command_setFont(QRegExp re); - void command_setPen(QRegExp re); - void command_setPen2(QRegExp re); - void command_pen_setDashOffset(QRegExp re); - void command_pen_setDashPattern(QRegExp re); - void command_pen_setCosmetic(QRegExp re); - void command_setRenderHint(QRegExp re); - void command_clearRenderHint(QRegExp re); - void command_gradient_appendStop(QRegExp re); - void command_gradient_clearStops(QRegExp re); - void command_gradient_setConical(QRegExp re); - void command_gradient_setLinear(QRegExp re); - void command_gradient_setRadial(QRegExp re); - void command_gradient_setRadialExtended(QRegExp re); - void command_gradient_setLinearPen(QRegExp re); - void command_gradient_setSpread(QRegExp re); - void command_gradient_setCoordinateMode(QRegExp re); - - // commands: drawing ops - void command_drawArc(QRegExp re); - void command_drawChord(QRegExp re); - void command_drawConvexPolygon(QRegExp re); - void command_drawEllipse(QRegExp re); - void command_drawImage(QRegExp re); - void command_drawLine(QRegExp re); - void command_drawPath(QRegExp re); - void command_drawPie(QRegExp re); - void command_drawPixmap(QRegExp re); - void command_drawPoint(QRegExp re); - void command_drawPolygon(QRegExp re); - void command_drawPolyline(QRegExp re); - void command_drawRect(QRegExp re); - void command_drawRoundedRect(QRegExp re); - void command_drawRoundRect(QRegExp re); - void command_drawText(QRegExp re); - void command_drawStaticText(QRegExp re); - void command_drawTiledPixmap(QRegExp re); - void command_path_addEllipse(QRegExp re); - void command_path_addPolygon(QRegExp re); - void command_path_addRect(QRegExp re); - void command_path_addText(QRegExp re); - void command_path_arcTo(QRegExp re); - void command_path_closeSubpath(QRegExp re); - void command_path_createOutline(QRegExp re); - void command_path_cubicTo(QRegExp re); - void command_path_debugPrint(QRegExp re); - void command_path_lineTo(QRegExp re); - void command_path_moveTo(QRegExp re); - void command_region_addEllipse(QRegExp re); - void command_region_addRect(QRegExp re); - - // getters - void command_region_getClipRegion(QRegExp re); - void command_path_getClipPath(QRegExp re); - - // commands: surface begin/end - void command_surface_begin(QRegExp re); - void command_surface_end(QRegExp re); - - // commands: save/restore painter state - void command_restore(QRegExp re); - void command_save(QRegExp re); - - // commands: pixmap/image - void command_pixmap_load(QRegExp re); - void command_pixmap_setMask(QRegExp re); - void command_bitmap_load(QRegExp re); - void command_image_convertToFormat(QRegExp re); - void command_image_load(QRegExp re); - void command_image_setColor(QRegExp re); - void command_image_setColorCount(QRegExp re); - - // commands: transformation - void command_resetMatrix(QRegExp re); - void command_translate(QRegExp re); - void command_rotate(QRegExp re); - void command_rotate_x(QRegExp re); - void command_rotate_y(QRegExp re); - void command_scale(QRegExp re); - void command_mapQuadToQuad(QRegExp re); - void command_setMatrix(QRegExp re); - - // attributes - QPainter *m_painter; - QPainter *m_surface_painter; - QImage m_surface_image; - QPixmap m_surface_pixmap; -#ifndef QT_NO_OPENGL - QGLPixelBuffer *m_surface_pbuffer; -#endif - QRectF m_surface_rect; - QStringList m_commands; - QString m_currentCommand; - int m_currentCommandIndex; - QString m_filepath; - QMap m_blockMap; - QMap m_pathMap; - QMap m_pixmapMap; - QMap m_imageMap; - QMap m_regionMap; - QGradientStops m_gradientStops; - QGradient::Spread m_gradientSpread; - QGradient::CoordinateMode m_gradientCoordinate; - bool m_abort; - int m_width; - int m_height; - - bool m_verboseMode; - DeviceType m_type; - bool m_checkers_background; - bool m_shouldDrawText; - - QVector m_controlPoints; - - // painter functionalities string tables - static const char *brushStyleTable[]; - static const char *penStyleTable[]; - static const char *fontWeightTable[]; - static const char *fontHintingTable[]; - static const char *clipOperationTable[]; - static const char *spreadMethodTable[]; - static const char *coordinateMethodTable[]; - static const char *compositionModeTable[]; - static const char *imageFormatTable[]; - static const char *sizeModeTable[]; - static int translateEnum(const char *table[], const QString &pattern, int limit); - - // utility - template T image_load(const QString &filepath); - - // commands dictionary management - static void staticInit(); - -public: - struct PaintCommandInfos - { - PaintCommandInfos(QString id, void (PaintCommands::*p)(QRegExp), QRegExp r, QString sy, QString sa) - : identifier(id) - , regExp(r) - , syntax(sy) - , sample(sa) - , paintMethod(p) - {} - PaintCommandInfos(QString title) - : identifier(title), paintMethod(0) {} - bool isSectionHeader() const { return paintMethod == 0; } - QString identifier; - QRegExp regExp; - QString syntax; - QString sample; - void (PaintCommands::*paintMethod)(QRegExp); - }; - - static PaintCommandInfos *findCommandById(const QString &identifier) { - for (int i=0; i s_commandInfoTable; - static QList > s_enumsTable; - static QMultiHash s_commandHash; -}; - -#endif // PAINTCOMMANDS_H diff --git a/tests/arthur/common/qbaselinetest.cpp b/tests/arthur/common/qbaselinetest.cpp deleted file mode 100644 index de3150e080..0000000000 --- a/tests/arthur/common/qbaselinetest.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qbaselinetest.h" -#include "baselineprotocol.h" - -namespace QBaselineTest { - -BaselineProtocol proto; -bool connected = false; -bool triedConnecting = false; - -QByteArray curFunction; -ImageItemList itemList; -bool gotBaselines; - - -bool connect(QByteArray *msg, bool *error) -{ - if (!triedConnecting) { - triedConnecting = true; - if (!proto.connect(QTest::testObject()->metaObject()->className())) { - *msg += "Failed to connect to baseline server: " + proto.errorMessage().toLatin1(); - *error = true; - return false; - } - connected = true; - } - if (!connected) { - *msg = "Not connected to baseline server."; - *error = true; - return false; - } - return true; -} - - -bool compareItem(const ImageItem &baseline, const QImage &img, QByteArray *msg, bool *error) -{ - ImageItem item = baseline; - item.image = img; - item.imageChecksums.clear(); - item.imageChecksums.prepend(ImageItem::computeChecksum(img)); - QByteArray srvMsg; - switch (baseline.status) { - case ImageItem::Ok: - break; - case ImageItem::IgnoreItem : - qDebug() << msg->constData() << "Ignored, blacklisted on server."; - return true; - break; - case ImageItem::BaselineNotFound: - if (proto.submitNewBaseline(item, &srvMsg)) - qDebug() << msg->constData() << "Baseline not found on server. New baseline uploaded."; - else - qDebug() << msg->constData() << "Baseline not found on server. Uploading of new baseline failed:" << srvMsg; - return true; - break; - default: - qWarning() << "Unexpected reply from baseline server."; - return true; - break; - } - *error = false; - // The actual comparison of the given image with the baseline: - if (baseline.imageChecksums.contains(item.imageChecksums.at(0))) - return true; - proto.submitMismatch(item, &srvMsg); - *msg += "Mismatch. See report:\n " + srvMsg; - return false; -} - -bool checkImage(const QImage &img, const char *name, quint16 checksum, QByteArray *msg, bool *error) -{ - if (!connected && !connect(msg, error)) - return true; - - QByteArray itemName; - bool hasName = qstrlen(name); - const char *tag = QTest::currentDataTag(); - if (qstrlen(tag)) { - itemName = tag; - if (hasName) - itemName.append('_').append(name); - } else { - itemName = hasName ? name : "default_name"; - } - - *msg = "Baseline check of image '" + itemName + "': "; - - - ImageItem item; - item.itemName = QString::fromLatin1(itemName); - item.itemChecksum = checksum; - item.testFunction = QString::fromLatin1(QTest::currentTestFunction()); - ImageItemList list; - list.append(item); - if (!proto.requestBaselineChecksums(QLatin1String(QTest::currentTestFunction()), &list) || list.isEmpty()) { - *msg = "Communication with baseline server failed: " + proto.errorMessage().toLatin1(); - *error = true; - return true; - } - - return compareItem(list.at(0), img, msg, error); -} - - -QTestData &newRow(const char *dataTag, quint16 checksum) -{ - if (QTest::currentTestFunction() != curFunction) { - curFunction = QTest::currentTestFunction(); - itemList.clear(); - gotBaselines = false; - } - ImageItem item; - item.itemName = QString::fromLatin1(dataTag); - item.itemChecksum = checksum; - item.testFunction = QString::fromLatin1(QTest::currentTestFunction()); - itemList.append(item); - - return QTest::newRow(dataTag); -} - - -bool testImage(const QImage& img, QByteArray *msg, bool *error) -{ - if (!connected && !connect(msg, error)) - return true; - - if (QTest::currentTestFunction() != curFunction || itemList.isEmpty()) { - qWarning() << "Usage error: QBASELINE_TEST used without corresponding QBaselineTest::newRow()"; - return true; - } - - if (!gotBaselines) { - if (!proto.requestBaselineChecksums(QString::fromLatin1(QTest::currentTestFunction()), &itemList) || itemList.isEmpty()) { - *msg = "Communication with baseline server failed: " + proto.errorMessage().toLatin1(); - *error = true; - return true; - } - gotBaselines = true; - } - - QString curTag = QString::fromLatin1(QTest::currentDataTag()); - ImageItemList::const_iterator it = itemList.constBegin(); - while (it != itemList.constEnd() && it->itemName != curTag) - ++it; - if (it == itemList.constEnd()) { - qWarning() << "Usage error: QBASELINE_TEST used without corresponding QBaselineTest::newRow() for row" << curTag; - return true; - } - return compareItem(*it, img, msg, error); -} - -} diff --git a/tests/arthur/common/qbaselinetest.h b/tests/arthur/common/qbaselinetest.h deleted file mode 100644 index e76c32562f..0000000000 --- a/tests/arthur/common/qbaselinetest.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BASELINETEST_H -#define BASELINETEST_H - -#include - -namespace QBaselineTest { -bool checkImage(const QImage& img, const char *name, quint16 checksum, QByteArray *msg, bool *error); -bool testImage(const QImage& img, QByteArray *msg, bool *error); -QTestData &newRow(const char *dataTag, quint16 checksum = 0); -} - -#define QBASELINE_CHECK_SUM(image, name, checksum)\ -do {\ - QByteArray _msg;\ - bool _err = false;\ - if (!QBaselineTest::checkImage((image), (name), (checksum), &_msg, &_err)) {\ - QFAIL(_msg.constData());\ - } else if (_err) {\ - QSKIP(_msg.constData(), SkipSingle);\ - }\ -} while (0) - -#define QBASELINE_CHECK(image, name) QBASELINE_CHECK_SUM(image, name, 0) - -#define QBASELINE_TEST(image)\ -do {\ - QByteArray _msg;\ - bool _err = false;\ - if (!QBaselineTest::testImage((image), &_msg, &_err)) {\ - QFAIL(_msg.constData());\ - } else if (_err) {\ - QSKIP(_msg.constData(), SkipSingle);\ - }\ -} while (0) - -#endif // BASELINETEST_H diff --git a/tests/arthur/common/qbaselinetest.pri b/tests/arthur/common/qbaselinetest.pri deleted file mode 100644 index 5420c6ed1c..0000000000 --- a/tests/arthur/common/qbaselinetest.pri +++ /dev/null @@ -1,13 +0,0 @@ -QT *= testlib - -SOURCES += \ - $$PWD/qbaselinetest.cpp - -HEADERS += \ - $$PWD/qbaselinetest.h - -win32|symbian*:MKSPEC=$$replace(QMAKESPEC, \\\\, /) -else:MKSPEC=$$QMAKESPEC -DEFINES += QMAKESPEC=\\\"$$MKSPEC\\\" - -include($$PWD/baselineprotocol.pri) diff --git a/tests/arthur/common/qengines.cpp b/tests/arthur/common/qengines.cpp deleted file mode 100644 index 8bd90be5b7..0000000000 --- a/tests/arthur/common/qengines.cpp +++ /dev/null @@ -1,733 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "qengines.h" -#include "paintcommands.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// For QApplicationPrivate::graphics_system_name -#include - -QEngine::~QEngine() -{ -} - -Q_GLOBAL_STATIC(QtEngines, qtengines_global) -QtEngines * QtEngines::self() -{ - return qtengines_global(); -} - - -QList QtEngines::engines() const -{ - return m_engines; -} - - -QList QtEngines::foreignEngines() const -{ - return m_foreignEngines; -} - - -QEngine * QtEngines::defaultEngine() const -{ - return m_defaultEngine; -} - - -QtEngines::QtEngines() -{ - init(); -} - - -void QtEngines::init() -{ - m_defaultEngine = new RasterEngine; - m_engines << m_defaultEngine - << new NativeEngine - << new WidgetEngine; - -#if defined(BUILD_OPENGL) - if (QGLFormat::hasOpenGL()) - m_engines << new GLEngine; -#endif - -#ifndef QT_NO_PRINTER - m_engines << new PDFEngine -#ifdef Q_WS_X11 - << new PSEngine -#endif -#ifdef Q_WS_WIN - << new WinPrintEngine -#endif - ; -#endif //QT_NO_PRINTER - - m_foreignEngines << new RSVGEngine; -} - -RasterEngine::RasterEngine() -{ - -} - -QString RasterEngine::name() const -{ - return QLatin1String("Raster"); -} - - -void RasterEngine::prepare(const QSize &size, const QColor &fillColor) -{ - image = QImage(size, QImage::Format_ARGB32_Premultiplied); - QPainter p(&image); - p.setCompositionMode(QPainter::CompositionMode_Source); - p.fillRect(image.rect(), fillColor); -} - - -void RasterEngine::render(QSvgRenderer *r, const QString &) -{ - QPainter p(&image); - r->render(&p); - p.end(); -} - - -void RasterEngine::render(const QStringList &qpsScript, - const QString &absFilePath) -{ - QPainter pt(&image); - PaintCommands pcmd(qpsScript, 800, 800); - pcmd.setPainter(&pt); - pcmd.setFilePath(absFilePath); - pcmd.runCommands(); - pt.end(); -} - -bool RasterEngine::drawOnPainter(QPainter *p) -{ - p->drawImage(0, 0, image); - return true; -} - -void RasterEngine::save(const QString &file) -{ - image.save(file, "PNG"); -} - - -NativeEngine::NativeEngine() -{ - -} - - -QString NativeEngine::name() const -{ -#ifdef Q_WS_X11 -#ifndef QT_NO_XRENDER - return QLatin1String("NativeXRender"); -#else - return QLatin1String("NativeXLib"); -#endif -#elif (defined Q_WS_WIN32) - return QLatin1String("NativeWin32"); -#elif (defined Q_WS_MAC) - return QLatin1String("NativeMac"); -#elif defined(Q_WS_QWS) - return QLatin1String("NativeEmbedded"); -#endif -} - - -void NativeEngine::prepare(const QSize &size, const QColor &fillColor) -{ - pixmap = QPixmap(size); - pixmap.fill(fillColor); -} - - -void NativeEngine::render(QSvgRenderer *r, const QString &) -{ - QPainter p(&pixmap); - r->render(&p); - p.end(); -} - - -void NativeEngine::render(const QStringList &qpsScript, - const QString &absFilePath) -{ - QPainter pt(&pixmap); - PaintCommands pcmd(qpsScript, 800, 800); - pcmd.setPainter(&pt); - pcmd.setFilePath(absFilePath); - pcmd.runCommands(); - pt.end(); -} - -bool NativeEngine::drawOnPainter(QPainter *p) -{ - p->drawPixmap(0, 0, pixmap); - return true; -} - -void NativeEngine::save(const QString &file) -{ - pixmap.save(file, "PNG"); -} - - -#if defined(BUILD_OPENGL) -GLEngine::GLEngine() - : pbuffer(0), widget(0) -{ - usePixelBuffers = QGLPixelBuffer::hasOpenGLPbuffers(); -} - - -QString GLEngine::name() const -{ - return QLatin1String("OpenGL"); -} - -void GLEngine::prepare(const QSize &_size, const QColor &color) -{ - size = _size; - fillColor = color; - if (usePixelBuffers) { - pbuffer = new QGLPixelBuffer(size, QGLFormat(QGL::SampleBuffers)); - } else { - widget = new QGLWidget(QGLFormat(QGL::SampleBuffers)); - widget->setAutoFillBackground(false); - widget->resize(size); - widget->show(); - QApplication::flush(); - QApplication::syncX(); - } -} - -void GLEngine::render(QSvgRenderer *r, const QString &) -{ - QPainter *p; - if (usePixelBuffers) - p = new QPainter(pbuffer); - else - p = new QPainter(widget); - p->fillRect(0, 0, size.width(), size.height(), fillColor); - r->render(p); - p->end(); - delete p; -} - -void GLEngine::render(const QStringList &qpsScript, - const QString &absFilePath) -{ - QPainter *p; - if (usePixelBuffers) - p = new QPainter(pbuffer); - else - p = new QPainter(widget); - - PaintCommands pcmd(qpsScript, 800, 800); - pcmd.setPainter(p); - pcmd.setFilePath(absFilePath); - pcmd.runCommands(); - p->end(); - delete p; -} - -bool GLEngine::drawOnPainter(QPainter *p) -{ - if (usePixelBuffers) { - QImage img = pbuffer->toImage(); - p->drawImage(0, 0, img); - } else { - QImage img = widget->grabFrameBuffer(); - p->drawImage(0, 0, img); - } - return true; -} - - -void GLEngine::save(const QString &file) -{ - if (usePixelBuffers) { - QImage img = pbuffer->toImage(); - img.save(file, "PNG"); - } else { - QImage img = widget->grabFrameBuffer(); - img.save(file, "PNG"); - } -} - -void GLEngine::cleanup() -{ - delete pbuffer; - delete widget; -} - -#endif - -class WidgetEngineWidget : public QWidget -{ -public: - WidgetEngineWidget(QWidget* =0); - - void paintEvent(QPaintEvent*); - void render(QSvgRenderer*); - void render(QStringList const&,QString const&); - - QSize m_size; - QColor m_fillColor; - -private: - QSvgRenderer* m_svgr; - QStringList m_qpsScript; - QString m_absFilePath; -}; - -WidgetEngineWidget::WidgetEngineWidget(QWidget* parent) - : QWidget(parent) - , m_size() - , m_fillColor() - , m_svgr(0) - , m_qpsScript() - , m_absFilePath() -{} - -void WidgetEngineWidget::render(QSvgRenderer* r) -{ - m_svgr = r; - repaint(); - m_svgr = 0; -} - -void WidgetEngineWidget::render(QStringList const& qpsScript, QString const& absFilePath) -{ - m_qpsScript = qpsScript; - m_absFilePath = absFilePath; - repaint(); - m_qpsScript = QStringList(); - m_absFilePath = QString(); -} - -void WidgetEngineWidget::paintEvent(QPaintEvent*) -{ - if (m_svgr) { - QPainter p(this); - p.fillRect(0, 0, m_size.width(), m_size.height(), m_fillColor); - m_svgr->render(&p); - p.end(); - } - else { - QPainter p(this); - - PaintCommands pcmd(m_qpsScript, 800, 800); - pcmd.setPainter(&p); - pcmd.setFilePath(m_absFilePath); - pcmd.runCommands(); - p.end(); - } -} - -WidgetEngine::WidgetEngine() - : m_widget(0) -{ -} - - -QString WidgetEngine::name() const -{ - QString gs = QApplicationPrivate::graphics_system_name; - if (!gs.isEmpty()) gs[0] = gs[0].toUpper(); - return QString::fromLatin1("Widget") + gs; -} - -void WidgetEngine::prepare(const QSize &size, const QColor &color) -{ - m_widget = new WidgetEngineWidget; - m_widget->m_size = size; - m_widget->m_fillColor = color; - m_widget->setAutoFillBackground(false); - m_widget->resize(size); - m_widget->show(); - QApplication::flush(); - QApplication::syncX(); -} - -void WidgetEngine::render(QSvgRenderer *r, const QString &) -{ - m_widget->render(r); -} - -void WidgetEngine::render(const QStringList &qpsScript, - const QString &absFilePath) -{ - m_widget->render(qpsScript, absFilePath); -} - -bool WidgetEngine::drawOnPainter(QPainter *p) -{ - p->drawPixmap(0, 0, QPixmap::grabWindow(m_widget->winId())); - return true; -} - - -void WidgetEngine::save(const QString &file) -{ - QImage img = QPixmap::grabWindow(m_widget->winId()).toImage(); - img.save(file, "PNG"); -} - -void WidgetEngine::cleanup() -{ - delete m_widget; -} - -#ifndef QT_NO_PRINTER -PDFEngine::PDFEngine() -{ -} - - -QString PDFEngine::name() const -{ - return QLatin1String("PDF"); -} - -void PDFEngine::prepare(const QSize &size, const QColor &fillColor) -{ - Q_UNUSED(fillColor); - - static int i = 1; - - m_size = size; - printer = new QPrinter(QPrinter::ScreenResolution); - printer->setOutputFormat(QPrinter::PdfFormat); - printer->setFullPage(true); - //printer->setOrientation(QPrinter::Landscape); - m_tempFile = QDir::tempPath() + QString("temp%1.pdf").arg(i++); - printer->setOutputFileName(m_tempFile); -} - -void PDFEngine::render(QSvgRenderer *r, const QString &) -{ - QPainter p(printer); - r->render(&p); - p.end(); -} - - -void PDFEngine::render(const QStringList &qpsScript, - const QString &absFilePath) -{ - QPainter pt(printer); - PaintCommands pcmd(qpsScript, 800, 800); - pcmd.setPainter(&pt); - pcmd.setFilePath(absFilePath); - pcmd.runCommands(); - pt.end(); -} - -bool PDFEngine::drawOnPainter(QPainter *) -{ - return false; -} - -void PDFEngine::save(const QString &file) -{ -#ifdef USE_ACROBAT - QString psFile = m_tempFile; - psFile.replace(".pdf", ".ps"); - QProcess toPs; - QStringList args1; - args1 << "-toPostScript" - << "-level3" - << "-transQuality" - << "1"; - args1 << m_tempFile; - toPs.start("acroread", args1); - toPs.waitForFinished(); - - QProcess convert; - QStringList args; - args << psFile; - args << QString("-resize") - << QString("%1x%2") - .arg(m_size.width()) - .arg(m_size.height()); - args << file; - - convert.start("convert", args); - convert.waitForFinished(); - QFile::remove(psFile); -#else - QProcess toPng; - QStringList args1; - args1 << "-sDEVICE=png16m" - << QString("-sOutputFile=") + file - << "-r97x69" - << "-dBATCH" - << "-dNOPAUSE"; - args1 << m_tempFile; - toPng.start("gs", args1); - toPng.waitForFinished(); -#endif - - QString pfile = file; - pfile.replace(".png", ".pdf"); - QFile::rename(m_tempFile, pfile); -// QFile::remove(m_tempFile); -} - -void PDFEngine::cleanup() -{ - delete printer; printer = 0; -} - -#ifdef Q_WS_X11 -PSEngine::PSEngine() -{ -} - - -QString PSEngine::name() const -{ - return QLatin1String("PS"); -} - -void PSEngine::prepare(const QSize &size, const QColor &fillColor) -{ - Q_UNUSED(fillColor); - - static int i = 1; - - m_size = size; - printer = new QPrinter(QPrinter::ScreenResolution); - printer->setOutputFormat(QPrinter::PostScriptFormat); - printer->setFullPage(true); - m_tempFile = QDir::tempPath() + QString("temp%1.ps").arg(i++); - printer->setOutputFileName(m_tempFile); -} - -void PSEngine::render(QSvgRenderer *r, const QString &) -{ - QPainter p(printer); - r->render(&p); - p.end(); -} - - -void PSEngine::render(const QStringList &qpsScript, - const QString &absFilePath) -{ - QPainter pt(printer); - PaintCommands pcmd(qpsScript, 800, 800); - pcmd.setPainter(&pt); - pcmd.setFilePath(absFilePath); - pcmd.runCommands(); - pt.end(); -} - -bool PSEngine::drawOnPainter(QPainter *) -{ - return false; -} - -void PSEngine::save(const QString &file) -{ - QProcess toPng; - QStringList args1; - args1 << "-sDEVICE=png16m" - << QString("-sOutputFile=") + file - << "-r97x69" - << "-dBATCH" - << "-dNOPAUSE"; - args1 << m_tempFile; - toPng.start("gs", args1); - toPng.waitForFinished(); - - QString pfile = file; - pfile.replace(".png", ".ps"); - QFile::rename(m_tempFile, pfile); -} - -void PSEngine::cleanup() -{ - delete printer; printer = 0; -} -#endif -#endif //QT_NO_PRINTER - -RSVGEngine::RSVGEngine() -{ - -} - -QString RSVGEngine::name() const -{ - return QLatin1String("RSVG"); -} - -void RSVGEngine::prepare(const QSize &size, const QColor &fillColor) -{ - Q_UNUSED(fillColor); - - m_size = size; -} - -void RSVGEngine::render(QSvgRenderer *, const QString &fileName) -{ - m_fileName = fileName; -} - -void RSVGEngine::render(const QStringList &, const QString &) -{ -} - -bool RSVGEngine::drawOnPainter(QPainter *) -{ - return false; -} - - -void RSVGEngine::save(const QString &file) -{ - QProcess rsvg; - QStringList args; - args << QString("-w %1").arg(m_size.width()); - args << QString("-h %1").arg(m_size.height()); - args << m_fileName; - args << file; - rsvg.start("rsvg", args); - rsvg.waitForFinished(); -} - -void QEngine::cleanup() -{ -} - -#ifdef Q_WS_WIN -WinPrintEngine::WinPrintEngine() -{ -} - - -QString WinPrintEngine::name() const -{ - return QLatin1String("WinPrint"); -} - -void WinPrintEngine::prepare(const QSize &size, const QColor &fillColor) -{ - Q_UNUSED(fillColor); - - static int i = 1; - - m_size = size; - printer = new QPrinter(QPrinter::ScreenResolution); - printer->setFullPage(true); - printer->setPrinterName("HP 2500C Series PS3"); - m_tempFile = QDir::tempPath() + QString("temp%1.ps").arg(i++); - printer->setOutputFileName(m_tempFile); -} - -void WinPrintEngine::render(QSvgRenderer *r, const QString &) -{ - QPainter p(printer); - r->render(&p); - p.end(); -} - - -void WinPrintEngine::render(const QStringList &qpsScript, - const QString &absFilePath) -{ - QPainter pt(printer); - PaintCommands pcmd(qpsScript, 800, 800); - pcmd.setPainter(&pt); - pcmd.setFilePath(absFilePath); - pcmd.runCommands(); - pt.end(); -} - -bool WinPrintEngine::drawOnPainter(QPainter *) -{ - return false; -} - -void WinPrintEngine::save(const QString &file) -{ - QProcess toPng; - QStringList args1; - args1 << "-sDEVICE=png16m" - << QString("-sOutputFile=") + file - << "-r97x69" - << "-dBATCH" - << "-dNOPAUSE"; - args1 << m_tempFile; - toPng.start("gswin32", args1); - toPng.waitForFinished(); - - QString pfile = file; - pfile.replace(".png", ".ps"); - QFile::rename(m_tempFile, pfile); -} - -void WinPrintEngine::cleanup() -{ - delete printer; printer = 0; -} - -#endif diff --git a/tests/arthur/common/qengines.h b/tests/arthur/common/qengines.h deleted file mode 100644 index 0b648a9d27..0000000000 --- a/tests/arthur/common/qengines.h +++ /dev/null @@ -1,241 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QENGINES_H -#define QENGINES_H - -#if defined(BUILD_OPENGL) -#include -#endif -#include -#include -#include -#include -#include -#include - -QT_FORWARD_DECLARE_CLASS(QSvgRenderer) -QT_FORWARD_DECLARE_CLASS(QGLWidget) - -class QEngine -{ -public: - virtual ~QEngine(); - virtual QString name() const =0; - virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white) =0; - virtual void render(QSvgRenderer *r, const QString &) =0; - virtual void render(const QStringList &qpsScript, - const QString &absFilePath) =0; - virtual bool drawOnPainter(QPainter *p) =0; - virtual void save(const QString &file) =0; - virtual void cleanup(); -}; - -class QtEngines -{ -public: - static QtEngines *self(); - QtEngines(); - - QList engines() const; - QList foreignEngines() const; - - QEngine *defaultEngine() const; -private: - void init(); -private: - QList m_engines; - QList m_foreignEngines; - QEngine *m_defaultEngine; -}; - -class RasterEngine : public QEngine -{ -public: - RasterEngine(); - - virtual QString name() const; - virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white); - virtual void render(QSvgRenderer *r, const QString &); - virtual void render(const QStringList &qpsScript, - const QString &absFilePath); - virtual bool drawOnPainter(QPainter *p); - virtual void save(const QString &file); -private: - QImage image; -}; - -class NativeEngine : public QEngine -{ -public: - NativeEngine(); - - virtual QString name() const; - virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white); - virtual void render(QSvgRenderer *r, const QString &); - virtual void render(const QStringList &qpsScript, - const QString &absFilePath); - virtual bool drawOnPainter(QPainter *p); - virtual void save(const QString &file); -private: - QPixmap pixmap; -}; - - -#if defined(BUILD_OPENGL) -class GLEngine : public QEngine -{ -public: - GLEngine(); - virtual QString name() const; - virtual void prepare(const QSize &_size, const QColor &fillColor = Qt::white); - virtual void render(QSvgRenderer *r, const QString &); - virtual void render(const QStringList &qpsScript, - const QString &absFilePath); - virtual bool drawOnPainter(QPainter *p); - virtual void save(const QString &file); - virtual void cleanup(); -private: - QGLPixelBuffer *pbuffer; - QGLWidget *widget; - bool usePixelBuffers; - QSize size; - QColor fillColor; -}; -#endif - -class WidgetEngineWidget; -class WidgetEngine : public QEngine -{ -public: - WidgetEngine(); - virtual QString name() const; - virtual void prepare(const QSize &_size, const QColor &fillColor = Qt::white); - virtual void render(QSvgRenderer *r, const QString &); - virtual void render(const QStringList &qpsScript, - const QString &absFilePath); - virtual bool drawOnPainter(QPainter *p); - virtual void save(const QString &file); - virtual void cleanup(); -private: - WidgetEngineWidget *m_widget; -}; - -#ifndef QT_NO_PRINTER -class PDFEngine : public QEngine -{ -public: - PDFEngine(); - - virtual QString name() const; - virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white); - virtual void render(QSvgRenderer *r, const QString &); - virtual void render(const QStringList &qpsScript, - const QString &absFilePath); - virtual bool drawOnPainter(QPainter *p); - virtual void save(const QString &file); - virtual void cleanup(); -private: - QPrinter *printer; - QSize m_size; - QString m_tempFile; -}; - -#ifdef Q_WS_X11 -class PSEngine : public QEngine -{ -public: - PSEngine(); - - virtual QString name() const; - virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white); - virtual void render(QSvgRenderer *r, const QString &); - virtual void render(const QStringList &qpsScript, - const QString &absFilePath); - virtual bool drawOnPainter(QPainter *p); - virtual void save(const QString &file); - virtual void cleanup(); -private: - QPrinter *printer; - QSize m_size; - QString m_tempFile; -}; -#endif - -#ifdef Q_WS_WIN -class WinPrintEngine : public QEngine -{ -public: - WinPrintEngine(); - - virtual QString name() const; - virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white); - virtual void render(QSvgRenderer *r, const QString &); - virtual void render(const QStringList &qpsScript, - const QString &absFilePath); - virtual bool drawOnPainter(QPainter *p); - virtual void save(const QString &file); - virtual void cleanup(); -private: - QPrinter *printer; - QSize m_size; - QString m_tempFile; -}; -#endif -#endif //QT_NO_PRINTER - -class RSVGEngine : public QEngine -{ -public: - RSVGEngine(); - - virtual QString name() const; - virtual void prepare(const QSize &size, const QColor &fillColor = Qt::white); - virtual void render(QSvgRenderer *r, const QString &); - virtual void render(const QStringList &qpsScript, - const QString &absFilePath); - virtual bool drawOnPainter(QPainter *p); - virtual void save(const QString &file); -private: - QString m_fileName; - QSize m_size; -}; - -#endif diff --git a/tests/arthur/common/xmldata.cpp b/tests/arthur/common/xmldata.cpp deleted file mode 100644 index dc5ee62750..0000000000 --- a/tests/arthur/common/xmldata.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "xmldata.h" - - -bool XMLReader::startElement(const QString &, const QString &localName, - const QString &, const QXmlAttributes &attributes) -{ - if (localName == "arthur" ) { - QString engineName = attributes.value("engine"); - QString defaultStr = attributes.value("default"); - QString foreignStr = attributes.value("foreign"); - QString referenceStr = attributes.value("reference"); - QString genDate = attributes.value("generationDate"); - engine = new XMLEngine(engineName, defaultStr == "true"); - engine->foreignEngine = (foreignStr == "true"); - engine->referenceEngine = (referenceStr == "true"); - if (!genDate.isEmpty()) - engine->generationDate = QDateTime::fromString(genDate); - else - engine->generationDate = QDateTime::currentDateTime(); - } else if (localName == "suite") { - QString suiteName = attributes.value("dir"); - suite = new XMLSuite(suiteName); - } else if (localName == "file") { - QString testName = attributes.value("name"); - QString outputName = attributes.value("output"); - file = new XMLFile(testName, outputName); - } else if (localName == "data") { - QString dateStr = attributes.value("date"); - QString timeStr = attributes.value("time_to_render"); - QString itrStr = attributes.value("iterations"); - QString detailsStr = attributes.value("details"); - QString maxElapsedStr = attributes.value("maxElapsed"); - QString minElapsedStr = attributes.value("minElapsed"); - XMLData data(dateStr, timeStr.toInt(), - (!itrStr.isEmpty())?itrStr.toInt():1); - data.details = detailsStr; - if (maxElapsedStr.isEmpty()) - data.maxElapsed = data.timeToRender; - else - data.maxElapsed = maxElapsedStr.toInt(); - if (minElapsedStr.isEmpty()) - data.minElapsed = data.timeToRender; - else - data.minElapsed = minElapsedStr.toInt(); - - file->data.append(data); - } else { - qDebug()<<"Error while parsing element :"<suites.insert(suite->name, suite); - } else if (localName == "file") { - suite->files.insert(file->name, file); - } - return true; -} - -bool XMLReader::fatalError(const QXmlParseException &) -{ - return true; -} diff --git a/tests/arthur/common/xmldata.h b/tests/arthur/common/xmldata.h deleted file mode 100644 index 7df1e330f1..0000000000 --- a/tests/arthur/common/xmldata.h +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef XMLDATA_H -#define XMLDATA_H - -#include - -#include -#include - -enum GeneratorFlag { - Normal = 0x1 << 0, - Default = 0x1 << 1, - Foreign = 0x1 << 2, - Reference = 0x1 << 3 -}; -Q_DECLARE_FLAGS(GeneratorFlags, GeneratorFlag); - -struct XMLData -{ - XMLData() - : date(QDateTime::currentDateTime()), - timeToRender(0), iterations(0), maxElapsed(0), - minElapsed(0) - {} - XMLData(const QDateTime &dt, int ttr, int itrs = 1) - : date(dt), timeToRender(ttr), - iterations(itrs), maxElapsed(0), minElapsed(0) - {} - XMLData(const QString &dt, int ttr, int itrs = 1) - : timeToRender(ttr), iterations(itrs), - maxElapsed(0), minElapsed(0) - { - date = QDateTime::fromString(dt); - } - QDateTime date; - int timeToRender; - int iterations; - QString details; - int maxElapsed; - int minElapsed; -}; - -struct XMLFile -{ - XMLFile() - {} - XMLFile(const QString &testcase) - : name(testcase) - {} - XMLFile(const QString &testcase, const QString &img) - : name(testcase), output(img) - {} - - QString name; - QString output; - QList data; -}; - -struct XMLSuite -{ - XMLSuite() - {} - XMLSuite(const QString &n) - : name(n) - {} - - QString name; - QMap files; -}; - -struct XMLEngine -{ - XMLEngine() - : defaultEngine(false), foreignEngine(false), - referenceEngine(false) - {} - XMLEngine(const QString &engine, bool def) - : name(engine), defaultEngine(def), foreignEngine(false), - referenceEngine(false) - {} - - QString name; - bool defaultEngine; - bool foreignEngine; - bool referenceEngine; - QMap suites; - QDateTime generationDate; -}; - - - -class XMLReader : public QXmlDefaultHandler -{ -public: - XMLEngine *xmlEngine() const - { - return engine; - } - - bool startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &attributes); - bool endElement(const QString &namespaceURI, - const QString &localName, - const QString &qName); - bool fatalError(const QXmlParseException &exception); -private: - XMLEngine *engine; - XMLSuite *suite; - XMLFile *file; -}; - -#endif diff --git a/tests/arthur/data/1.1/color-prop-03-t.svg b/tests/arthur/data/1.1/color-prop-03-t.svg deleted file mode 100644 index f8c072e0e7..0000000000 --- a/tests/arthur/data/1.1/color-prop-03-t.svg +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Purpose of test is to determine if the color datatype is supported. There are multiple syntaxes for - specifying the same color, such as #37F and #3377FF. For each of the six groups shown here, - each of the shapes in the group uses one of the syntactical forms and all in the group should - be identical in color. - - - The first row uses five forms - 3-digit hex, 6-digit hex, rbg() integer form, rgb() percentage form, - and named ('HTML') colors. - - The second row uses only four forms - 3-digit hex, 6-digit hex, rbg() integer form, rgb() percentage form - - as there are no HTML or X11 names for those colors. - - - color-prop-03-t.svg - Test that viewer has the basic capability to render colors, specified as CSS attributes, using any of the equivalent forms. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $Revision: 1.4 $ - - diff --git a/tests/arthur/data/1.1/coords-trans-01-b.svg b/tests/arthur/data/1.1/coords-trans-01-b.svg deleted file mode 100644 index 69aa614a36..0000000000 --- a/tests/arthur/data/1.1/coords-trans-01-b.svg +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This test verifies the implementation of transforms. It tests elementary transforms - and transform nesting. - Note that for layout purposes, this test uses nesting of translation with the elementary transforms. - - - The rendered picture should match the reference image exactly except for variations in the labeling text. - - - The test uses the rect element, the fill color (solid primary colors) and transforms. - - - - - coords-trans-01-b - Validates elementary transforms and transformation nesting - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - translate (50, 50) - - - - - rotate(-90) - - - - - skew x (45) - - - - - skew y (45) - - - - - scale (2) - - - - - - - - - - - - - - - - - - - - - - - - - - - scale(25, 95) and translate(2, 2) - - - - - scale(25, 95) then translate(2, 2) - - - - - - - - - $Revision: 1.5 $ - - - diff --git a/tests/arthur/data/1.1/coords-trans-02-t.svg b/tests/arthur/data/1.1/coords-trans-02-t.svg deleted file mode 100644 index cf13b39881..0000000000 --- a/tests/arthur/data/1.1/coords-trans-02-t.svg +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This test verifies the implementation of transforms. It tests elementary transforms - and transform nesting. - Note that for layout purposes, this test uses nesting of translation with the elementary transforms. - - - The rendered picture should match the reference image exactly except for variations in the labeling text. - - - The test uses the rect element, the fill color (solid primary colors) and transforms. - - - - - coords-trans-02-t - Validates elementary transforms and transformation nesting - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - translate (50, 50) - - - - - rotate(-90) - - - - - - - - $Revision: 1.5 $ - - - diff --git a/tests/arthur/data/1.1/coords-trans-03-t.svg b/tests/arthur/data/1.1/coords-trans-03-t.svg deleted file mode 100644 index d03c18acc2..0000000000 --- a/tests/arthur/data/1.1/coords-trans-03-t.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This test verifies the implementation of transforms. It tests elementary transforms - and transform nesting. - Note that for layout purposes, this test uses nesting of translation with the elementary transforms. - - - The rendered picture should match the reference image exactly except for variations in the labeling text. - - - The test uses the rect element, the fill color (solid primary colors) and transforms. - - - - - coords-trans-03-t - Validates elementary transforms and transformation nesting - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - skew x (45) - - - - - skew y (45) - - - - - - - - - $Revision: 1.5 $ - - - diff --git a/tests/arthur/data/1.1/coords-trans-04-t.svg b/tests/arthur/data/1.1/coords-trans-04-t.svg deleted file mode 100644 index fee76c9573..0000000000 --- a/tests/arthur/data/1.1/coords-trans-04-t.svg +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - This test verifies the implementation of transforms. It tests elementary transforms - and transform nesting. - Note that for layout purposes, this test uses nesting of translation with the elementary transforms. - - - The rendered picture should match the reference image exactly except for variations in the labeling text. - - - The test uses the rect element, the fill color (solid primary colors) and transforms. - - - - coords-trans-04-t - Validates elementary transforms and transformation nesting - - - - - - - - - - - - - - - - - - - - - - - - - - - scale (2) - - - - - - - - $Revision: 1.6 $ - - diff --git a/tests/arthur/data/1.1/coords-trans-05-t.svg b/tests/arthur/data/1.1/coords-trans-05-t.svg deleted file mode 100644 index f9ed2d3297..0000000000 --- a/tests/arthur/data/1.1/coords-trans-05-t.svg +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This test verifies the implementation of transforms. It tests elementary transforms - and transform nesting. - Note that for layout purposes, this test uses nesting of translation with the elementary transforms. - - - The rendered picture should match the reference image exactly except for variations in the labeling text. - - - The test uses the rect element, the fill color (solid primary colors) and transforms. - - - - - coords-trans-05-t - Validates elementary transforms and transformation nesting - - - - - - - - - - - - - - - - - - - - - - - - - - scale(25, 95) - translate(2, 2) - - - - - - - - - $Revision: 1.5 $ - - - diff --git a/tests/arthur/data/1.1/coords-trans-06-t.svg b/tests/arthur/data/1.1/coords-trans-06-t.svg deleted file mode 100644 index 5d12b7a142..0000000000 --- a/tests/arthur/data/1.1/coords-trans-06-t.svg +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This test verifies the implementation of transforms. It tests elementary transforms - and transform nesting. - Note that for layout purposes, this test uses nesting of translation with the elementary transforms. - - - The rendered picture should match the reference image exactly except for variations in the labeling text. - - - The test uses the rect element, the fill color (solid primary colors) and transforms. - - - - - coords-trans-06-t - Validates elementary transforms and transformation nesting - - - - - - - - - - - - - - - - - - - - scale(25, 95) then translate(2, 2) - - - - - - - - - $Revision: 1.5 $ - - - diff --git a/tests/arthur/data/1.1/fonts-elem-01-t.svg b/tests/arthur/data/1.1/fonts-elem-01-t.svg deleted file mode 100644 index 29cc875849..0000000000 --- a/tests/arthur/data/1.1/fonts-elem-01-t.svg +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - This is a basic test for embedded SVG fonts. The font "Comic Sans" - (available from Microsoft) has been converted into an SVG font and embedded - in the SVG file. The test contains two text areas, each with the character - string "AyÖ@ç" drawn at the same font size. - - The upper area contains the glyphs from the embedded font placed in - the SVG file as path elements. Each glyph is placed at the location it - would be if rendered using normal text rendering (ie. the horizontal - advance between characters has been preserved). - - The lower area contains the text string rendered using the embedded - SVG font. It should appear exactly the same as the upper text area, - ie. font size, character baseline and horizontal advance should be - the same. - - - - - fonts-elem-01-t - Basic test of embedded fonts using glyph outlines - - - - - - - - - - - - - - - - - - - - - - Basic SVG font element - - - - - Placed Glyphs - - - - - - - - - - - - - - - - - - - - - - - - - - SVG Font - - - AyÖ@ç - - - $Revision: 1.3 $ - - diff --git a/tests/arthur/data/1.1/fonts-elem-02-t.svg b/tests/arthur/data/1.1/fonts-elem-02-t.svg deleted file mode 100644 index 13077e359d..0000000000 --- a/tests/arthur/data/1.1/fonts-elem-02-t.svg +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - This is an accuracy test for embedded SVG fonts. The font "Comic Sans" - (available from Microsoft) has been converted into an SVG font and embedded - in the SVG file. The test contains two text areas, each with the character - string "AyÖ@ç" drawn at the same font size. - - The upper area has the placed glyphs as path elements filled with - white over a solid black background (creating a white cutout). The - embedded SVG font text is then drawn over the cutout. An implementation - that passes this test should completely fill the cutout, leaving - a solid black area (some slight antialiasing effects may remain). - - The lower area is the reverse of the upper area, with the placed - black glyphs filling the cutout created by white SVG font text. - An implementation that passes this test should completely fill the - cutout, leaving a solid black area (some slight antialiasing effects - may remain). - - - - fonts-elem-02-t - Basic test of embedded fonts using glyph outlines - - - - - - - - - - - - - - - - - - - - - - SVG font element accuracy - - SVG over Glyphs - - - - - - - - - - - - - - - - - - - AyÖ@ç - - Glyphs over SVG - - AyÖ@ç - - - - - - - - - - - - - - - - - - - - $Revision: 1.3 $ - - diff --git a/tests/arthur/data/1.1/interact-zoom-01-t.svg b/tests/arthur/data/1.1/interact-zoom-01-t.svg deleted file mode 100644 index 2318ec719b..0000000000 --- a/tests/arthur/data/1.1/interact-zoom-01-t.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Verify correct handling by Dynamic (interactive) viewers for the -"zoomAndPan" attribute on the 'svg' element. This is one of a pair of -tests, and tests the value "disable". - - -The test consists of a set of black circles with a blue stroke. - -After the initial picture is displayed, the user should attempt to use -the magnify controls that are required on conforming Dynamic SVG -viewers. The correct behaviour is that the magnify and pan controls -shall have no effect -- the viewer shall disable them. - - -The rendered picture should match the reference image, except for -possible variations in the labelling text (per CSS2 rules). - - - - interact-zoom-01-t - Test "disable" value of zoomAndPan attribute. - - - - - - Test "disable" value of - zoomAndPan attribute. - - - - - - - - - $Revision: 1.5 $ - - diff --git a/tests/arthur/data/1.1/linking-a-04-t.svg b/tests/arthur/data/1.1/linking-a-04-t.svg deleted file mode 100644 index 6eb6b8c7b8..0000000000 --- a/tests/arthur/data/1.1/linking-a-04-t.svg +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Verify the capability to handle basic links out of SVG content - using the 'a' element, with the xlink:href attributes. - There are three subtests, in each of which one - of three colored arrows comprise the content of an 'a' element. The - link destination is expressed by "xlink:href=". - The initial view of this test contains the three arrows, a colored - circle, labelling text, and the usual template legend and frame. - - - The top-most (yellow) arrow links to an external SVG file, which is - local (in the same directory). The target file contains SVG 'text' elements - which comprise a TOC and brief description of all of the test files - for Linking. Upon clicking the first arrow, the image of the linkingToc-t.svg - file should replace the initial view of this test case in the viewer frame. - - - The middle (green) arrow links to an object in this SVG test file, the yellow - circle (id="internal-circle") immediately to its right, using "#circle-object" - as the value of of the xlink:href attribute. - There should be no change to the viewer frame upon clicking this arrow. - - - The bottom-most (blue) arrow links to remote non-SVG content, the W3C home page - using xlink:href attribute value "http://www.w3.org". For viewers in a Web - browser environment, the W3C home page should replace the initial view - of this test case in the browser/viewer frame. For other viewers (e.g., - interactive but SVG-only standalone viewers), the result is undefined, but could - include such actions as a diagnostic "Error parsing..." message. - - - There are several reference images associated with this test case. The first - illustrates the correct "start" or initial state of the rendered SVG file. - The second illustrates the correct image after the first link is activated - (to the linkingToc.svg file). The third (for browser-environment viewers) - should match the current image of the W3C home page, as viewed with a - conventional browser. (Note. This harness does not yet - provide access to multiple PNGs; the first, initial-state PNG is shown.) - - - The test uses the 'rect' and 'polygon' elements, as well as basic fill (solid simple colors), - stroke (black and colored wide and 1-pixel lines), font-family (Arial) and font-size properties. - - - - - - linking-a-04-t - Verify basic out-bound links and the 'a' element. - - - - - Basic out-bound links and the 'a' element. - - - - - - - - - - - - - - - - - - - - id="internal-circle" - - $Revision: 1.8 $ - - diff --git a/tests/arthur/data/1.1/linking-uri-03-t.svg b/tests/arthur/data/1.1/linking-uri-03-t.svg deleted file mode 100644 index 5009ea579b..0000000000 --- a/tests/arthur/data/1.1/linking-uri-03-t.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - Verify the handling of the allowable xlink attributes on the 'a' element. - The initial view of this test contains a single green triangle, labelling text, - and the usual template legend and frame. - - - There is a link on the triangle, pointing to an external SVG file, which is - local (in the same directory). The target file contains SVG 'text' elements - which comprise a TOC and brief description of all of the BE test files - for Linking. Upon clicking the triangle, the image of the linkingToc-t.svg - file should replace the initial view of this test case in the viewer frame. - - - The purpose of the test is to - verify that viewers tolerate the presence of xlink attributes on the 'a' - element. The presence of the attributes should not change the behavior of - the test in any way. The results of executing the link should be identical - to executing the first (topmost) link of linking-a-01-f. - - - There are two reference images associated with this test case. The first - illustrates the correct "start" or initial state of the rendered SVG file. - The second illustrates the correct image after the link is activated - (to the linkingToc-t.svg file). (Note. This harness does not yet - provide access to multiple PNGs; the first, initial-state PNG is shown.) - - - The test uses the 'rect' element, as well as basic fill (solid simple colors), - stroke (black and colored wide and 1-pixel lines), font-family (Arial) and font-size properties. - - - - linking-uri-03-t - Verify xlink attributes on the 'a' element. - - - - - Simple exercise of xlink attributes on the 'a' element. - - - - Click for TOC - Link to local file - linkingToc-t.svg. - - xlink:type="simple" - xlink:show="replace" - xlink:actuate="onRequest" - xlink:href="linkingToc-t.svg" - xlink:role="figure-out-a-role" - xlink:title="TOC of Linking BE tests." - target="_self" - - $Revision: 1.8 $ - - diff --git a/tests/arthur/data/1.1/metadata-example-01-b.svg b/tests/arthur/data/1.1/metadata-example-01-b.svg deleted file mode 100644 index 24d0613aba..0000000000 --- a/tests/arthur/data/1.1/metadata-example-01-b.svg +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Check that metadata in a variety of namespaces, inside a metadata - element, does not affect rendering in any way. The file is not valid to the DTD, but is well formed. - - The diagram on the table is a visualization of the RDF metadata in the graphic. - The rendered result should match the reference image and there should be - no error messages or warnings - - - metadata-example-01-b - Verify that the viewer is not perturbed by the presence of metadata. - - - - - Line drawing of woman in antique attire, which - looks legal or perhaps mystical. - image/svg+xml - Sibyll Trelawney - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $Revision: 1.6 $ - - diff --git a/tests/arthur/data/1.1/painting-fill-01-t.svg b/tests/arthur/data/1.1/painting-fill-01-t.svg deleted file mode 100644 index 84b87506b3..0000000000 --- a/tests/arthur/data/1.1/painting-fill-01-t.svg +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Verify the basic capability to handle the fill properties fill:none, - and fill with a color (fill:red) - - - There should be two rectangles, the rectangle on the left hollow (fill:none) and the rectangle on the right filled with red. - - - - painting-fill-01-t.svg - - Test that viewer has the basic capability to handle the <fill,fill-rule,fill-opacity properites> - - - - - - - Basic paint: fill properties. - - - - - - - - - - fill:none - fill:red - - - - - $Revision: 1.4 $ - - - diff --git a/tests/arthur/data/1.1/painting-fill-02-t.svg b/tests/arthur/data/1.1/painting-fill-02-t.svg deleted file mode 100644 index 2ecb8822ab..0000000000 --- a/tests/arthur/data/1.1/painting-fill-02-t.svg +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The test uses the fill:currentColor property. - - - The rectangle on the left should be green filled, the rectangle on the right should be blue. - The text above the rectangles should be black. - - - - painting-fill-02-t.svg - - Test that viewer has the basic capability to handle the <fill,fill-rule,fill-opacity properites> - - - - - - - Basic paint: fill properties. - fill="currentColor" - - - - - - - - - green - blue - - - - - $Revision: 1.5 $ - - - diff --git a/tests/arthur/data/1.1/painting-fill-03-t.svg b/tests/arthur/data/1.1/painting-fill-03-t.svg deleted file mode 100644 index 837207b7dd..0000000000 --- a/tests/arthur/data/1.1/painting-fill-03-t.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Verify the basic capability to handle the fill rule properties evenodd and nonzero - - - there should be two red filled stars, the leftmost star should be unfilled in the very center. - - - - painting-fill-03-t.svg - - Test that viewer has the basic capability to handle the <fill,fill-rule,fill-opacity properites> - - - - - - - Basic paint: fill properties. - - - - - - - - fill-rule:evenodd - fill-rule:nonzero - - - - - $Revision: 1.4 $ - - - diff --git a/tests/arthur/data/1.1/painting-fill-04-t.svg b/tests/arthur/data/1.1/painting-fill-04-t.svg deleted file mode 100644 index 49a4f7aa08..0000000000 --- a/tests/arthur/data/1.1/painting-fill-04-t.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - This tests inheritance of 3 properties. Fill, stroke and stroke-width. There is a g element (id=G1) which - sets fill=blue, stroke=red, and stroke-width=5. The first two rectangles on top should inherit all those - properties. The middle left rectangle has fill=yellow and stroke-width=2, it should inherit the stroke=red - from the parent container. The middle rectangle on the right has stroke=yellow, it should inherit fill and - stroke-width from the parent g. The bottom 2 rectangles are in another g element (id=G2) which is a child - of G1. G2 sets fill=yellow. It should inherit the stroke and stroke width from the parent G1. The two - bottom rectangles set no fill or stroke properties, they should inherit through the parents, stroke=red - and stroke-width=5. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - The test uses the 'rect' element, as well as basic fill (solid primary colors), - stroke (black 1-pixel lines), font-family (Arial) and font-size properties. - - - - painting-fill-04-t.svg - Test inheritance of painting properties. - - - - - - - - - - - - - - - - $Revision: 1.7 $ - - diff --git a/tests/arthur/data/1.1/painting-stroke-01-t.svg b/tests/arthur/data/1.1/painting-stroke-01-t.svg deleted file mode 100644 index 722112c5bd..0000000000 --- a/tests/arthur/data/1.1/painting-stroke-01-t.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Verify the basic capability to handle the stroke properties (stroke) - in combination with the rect element . - The pair should be rendered as two blue rectangles, - the upper one without a stroke and the lower with a red stroke. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - The test uses the 'rect' element, as well as basic fill (solid primary colors), - stroke, stroke:red font-family (Arial) and font-size properties. - - - - painting-stroke-01-t - Test that viewer has the basic capability to handle the <stroke properites> - - - - - - - - Basic paint: stroke properties. - - - stroke:none - stroke:red - - - $Revision: 1.8 $ - - - diff --git a/tests/arthur/data/1.1/painting-stroke-02-t.svg b/tests/arthur/data/1.1/painting-stroke-02-t.svg deleted file mode 100644 index ac02fd1261..0000000000 --- a/tests/arthur/data/1.1/painting-stroke-02-t.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Verify the basic capability to handle the stroke properties (stroke, stroke-width - stroke-linejoin)in combination with the rect element and straight-line path commands. - The pair should be rendered as two red rectangles without an interior fill. - The upper rectangle should have a stroke width of 5 with sharp corners. - The lower rectangle should have a stroke width of 5 with round corners. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - The test uses the 'rect' element, as well as basic fill (solid primary colors), - stroke, stroke:red stroke-width:10 stroke-linejoin:round - font-family (Arial) and font-size properties. - - - - painting-stroke-02-t - Test that viewer has the basic capability to handle the <stroke properites> - - - - - - - - Basic paint: stroke properties. - - - stroke-width:20 - stroke-linejoin:round - - - $Revision: 1.8 $ - - - diff --git a/tests/arthur/data/1.1/painting-stroke-03-t.svg b/tests/arthur/data/1.1/painting-stroke-03-t.svg deleted file mode 100644 index 397a1a8d70..0000000000 --- a/tests/arthur/data/1.1/painting-stroke-03-t.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Verify the basic capability to handle the stroke properties (stroke, stroke-width - stroke-linejoin, stroke-linecap, stroke-miter) - in combination with the rect element and straight-line path commands. - The pair should be rendered as as two red line segments. - The upper segment should have round end caps. The lower segment - should be chopped off where the two line segments meet. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - The test uses the 'path' element, as well as basic fill (solid primary colors), - stroke, stroke-width, stroke-linejoin, stroke-linecap, stroke-miter, - font-family (Arial) and font-size properties. - - - - painting-stroke-03-t - Test that viewer has the basic capability to handle the <stroke properties> - - - - - - - - Basic paint: stroke properties. - - - stroke-linecap:round - stroke-miter:1 - - - $Revision: 1.8 $ - - - diff --git a/tests/arthur/data/1.1/painting-stroke-04-t.svg b/tests/arthur/data/1.1/painting-stroke-04-t.svg deleted file mode 100644 index 629026baec..0000000000 --- a/tests/arthur/data/1.1/painting-stroke-04-t.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Verify the dasharray and dashoffset properties. Two lines are drawn, one red - and one black. Both have a dasharray of 10,10 giving a dashed appearance - where the size of the gaps and the size of the dash is equal. The help show this, - the black line has a stroke-dashoffset so that the dashes in the black line match - up with the gaps in the red line. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - The test uses the 'path' element, stroke, stroke-width, stroke-dasharray and stroke-dashoffset, - font-family (Arial) and font-size properties. - - - - painting-stroke-04-t - Test that viewer has the basic capability to handle the <stroke,stroke-opacity properites> - - - - - - - - Basic paint: stroke properties. - - - stroke:dasharray:10, 10 - stroke:dashoffset:10 - - - $Revision: 1.8 $ - - - diff --git a/tests/arthur/data/1.1/paths-data-01-t.svg b/tests/arthur/data/1.1/paths-data-01-t.svg deleted file mode 100644 index da8d7d023c..0000000000 --- a/tests/arthur/data/1.1/paths-data-01-t.svg +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Test that the viewer has the basic capability to handle the 'path' -element and its data (d) attribute in combination with the cubic -Bezier curveto commands, C, c, S, s (plus Mm and Zz). - - -There are 8 subtests, each composed from the cubic Bezier path commands per -the label by the subtest. On-curve control points (i.e., the curve position) -are marked by small blue squares. Subtests are filled, or stroked, or -both, using simple style properties and colors. - - -The rendered picture should match the reference image exactly, except for possible -variations in the labelling text (per CSS2 rules). - - -The test uses the 'rect' element, as well as basic fill (solid primary colors), -stroke (primary color 1-pixel lines), font-family (Arial) and font-size properties. - - - - paths-data-01-t - Test that the viewer has the basic capability to handle the 'path' element and data (d) attribute in combination with the cubic Bezier curveto, both regular and shorthand/smooth forms - C, c, S, s (along with Mm and Zz). - - - - - - - - Cubic bezier curves drawn with commands: - - - - - - - - - - - M, C, S, m, c, s - - - - - - - - - - - - M, c, c, c, C, z - - - - - - - - - - M, C, Z - - - - - - - - - - - M, C, c, Z - - - - - - - - - - - m, c, s - - - - - - - - - - M, C - - - - - - - - - - - - M, c, s, s, s, z - - - - - - - - - - m, c, z - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/paths-data-02-t.svg b/tests/arthur/data/1.1/paths-data-02-t.svg deleted file mode 100644 index 35054c13cd..0000000000 --- a/tests/arthur/data/1.1/paths-data-02-t.svg +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Test that the viewer has the basic capability to handle the 'path' -element and its data (d) attribute in combination with the quadratic -Bezier curveto commands, Q, q, T, t (plus Mm and Zz). - - -There are 7 subtests, each composed from the quadric Bezier path commands per -the label by the subtest. On-curve control points (i.e., the curve position) -are marked by small colored squares. Subtests are filled, or stroked, or -both, using simple style properties and colors. - - -The rendered picture should match the reference image exactly, except for possible -variations in the labelling text (per CSS2 rules). - - -The test uses the 'rect' element, as well as basic fill (solid primary colors), -stroke (primary color wide and 1-pixel lines), font-family (Arial) and font-size properties. - - - - paths-data-02-t - Test that the viewer has the basic capability to handle the 'path' element and data (d) attribute in combination with the quadratic Bezier curveto commands, both regular and shorthand/smooth forms - Q, q, T, t (along with Mm and Zz). - - - - - Quadric bezier curves drawn with commands: - - - - - M, Q, M, q, z - - - - - - - - - m, q, z, m, q, z - - - - - - - - - M, Q, Z - - - - - - - M, Q, T, Q, z - - - - - - - - - M, Q, Q, z - - - - - - - - M, q, t, t, t, t, z - - - - - - - - - - - M, q, Q, q, Q, z - - - - - - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/paths-data-04-t.svg b/tests/arthur/data/1.1/paths-data-04-t.svg deleted file mode 100644 index 0371945033..0000000000 --- a/tests/arthur/data/1.1/paths-data-04-t.svg +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Verify the basic capability to handle the 'path' element, and its data attribute (d) -in combination with the straight-line path commands. -Two pairs of concentric equilateral triangles are drawn using respectively -M,L,Z and m,l,z. The shapes are identical, with one stroked and -one filled. The fill-mode default of "even-odd" means that -the inner triangle is hollow. - - -The rendered picture should match the reference image exactly, except for possible -variations in the labelling text (per CSS2 rules). - - -The test uses the 'path' element, as well as basic fill (solid primary colors), -stroke (black 1-pixel lines), font-family (Arial) and font-size properties. - - - - - paths-data-04-t - Test that viewer has the basic capability to handle the <path> element and data (d) attribute in combination with the moveto, lineto, and closepath commands - M, L, Z, m, l, and z. - - - - - - - - - - M, L, L, L, Z, - subpath - M, L, L, L, Z - - - - - - - - stroked - - - - - - - - filled - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/paths-data-05-t.svg b/tests/arthur/data/1.1/paths-data-05-t.svg deleted file mode 100644 index 2227d9949a..0000000000 --- a/tests/arthur/data/1.1/paths-data-05-t.svg +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Verify the basic capability to handle the 'path' element, and its data attribute (d) -in combination with the straight-line path commands. -Two pairs of concentric equilateral triangles are drawn using respectively -M,L,Z and m,l,z. The shapes in each pair are identical, with one stroked and -one filled. The fill-mode default of "even-odd" means that -the inner triangle is hollow. - - -The rendered picture should match the reference image exactly, except for possible -variations in the labelling text (per CSS2 rules). - - -The test uses the 'path' element, as well as basic fill (solid primary colors), -stroke (black 1-pixel lines), font-family (Arial) and font-size properties. - - - - - paths-data-05-t - Test that viewer has the basic capability to handle the <path> element and data (d) attribute in combination with the moveto, lineto, and closepath commands - M, L, Z, m, l, and z. - - - - - - - - - m, l, l, l, z, - subpath - m, l, l, l, z - - - - - - - - - - - - - - - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/paths-data-06-t.svg b/tests/arthur/data/1.1/paths-data-06-t.svg deleted file mode 100644 index 355ccbef1f..0000000000 --- a/tests/arthur/data/1.1/paths-data-06-t.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - -Verify the basic capability to handle the 'path' element, and its data attribute (d) -in combination with the straight-line path commands. -Two pairs of staircase figures are drawn using -respectively M,H,V,Z and m,h,v,z. The shapes in each pair are identical, with one stroked and -one filled. - - -The rendered picture should match the reference image exactly, except for possible -variations in the labelling text (per CSS2 rules). - - -The test uses the 'path' element, as well as basic fill (solid primary colors), -stroke (black 1-pixel lines), font-family (Arial) and font-size properties. - - - - paths-data-06-t - Test that viewer has the basic capability to handle the <path> element and data (d) attribute in combination with the moveto, lineto, and closepath commands - M, L, Z, m, l, and z. - - - - - - - - - M, H, V, H, - V. H, V, H, - V, Z - - - - - - - - - - - - - - - - - - - - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/paths-data-07-t.svg b/tests/arthur/data/1.1/paths-data-07-t.svg deleted file mode 100644 index 524d5fdb34..0000000000 --- a/tests/arthur/data/1.1/paths-data-07-t.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - -Verify the basic capability to handle the 'path' element, and its data attribute (d) -in combination with the straight-line path commands. -Two pairs of staircase figures are drawn using -respectively M,H,V,Z and m,h,v,z. The shapes in each pair are identical, with one stroked and -one filled. - - -The rendered picture should match the reference image exactly, except for possible -variations in the labelling text (per CSS2 rules). - - -The test uses the 'path' element, as well as basic fill (solid primary colors), -stroke (black 1-pixel lines), font-family (Arial) and font-size properties. - - - - - paths-data-07-t - Test that viewer has the basic capability to handle the <path> element and data (d) attribute in combination with the moveto, lineto, and closepath commands - M, L, Z, m, l, and z. - - - - - - - - - m, h, v, h - v, h, v, h - v, z - - - - - - - - - - - - - - - - - - - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/pservers-grad-07-b.svg b/tests/arthur/data/1.1/pservers-grad-07-b.svg deleted file mode 100644 index 00f295779e..0000000000 --- a/tests/arthur/data/1.1/pservers-grad-07-b.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Test that the viewer has basic capability to handle linear gradients - on fills and stroke of objects and text. - - - This test uses the following elements : <linearGradient>, <stop> - and the following properties : stop-color, fill:url(# ), stroke(url# ) - - - Both elements in this test use the same simple gradient. It is a linear gradient from - blue (left) to red (right). From top-down the appearance of objects is as follows. - - - The top rectangle should be filled with the gradient. - - - The next rectangle has no fill, but has a thick stroke on which the gradient is - applied. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - - pservers-grad-07-b.svg - Test that the viewer has basic capability to handle linear gradients on fills and stroke of objects - . This means it needs to understand the following elements : <linearGradient>, <stop> and the following - properties : stop-color, fill:url(# ), stroke(url# ) - - - - - - - - - - - - - - - - Linear gradient filled rectangle - - - - - Linear gradient on stroke of rectangle - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/pservers-grad-11-b.svg b/tests/arthur/data/1.1/pservers-grad-11-b.svg deleted file mode 100644 index 4007757d85..0000000000 --- a/tests/arthur/data/1.1/pservers-grad-11-b.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Test that the viewer has basic capability to handle radial gradients - on fills and stroke of objects and text. - - - This test uses the following elements : <radialGradient>, <stop> - and the following properties : stop-color, fill:url(# ), stroke(url# ) - - - From top-down (left to right) the appearance of objects is as follows. - - - The top left rectangle should be a radial gradient from black(in) to red(outside). - The gradiant is applied to the fill of the rectangle. - - - The next rectangle has no fill, but has a thick stroke on which the gradient is - applied. The gradient goes from red(in) to yellow (out). - - - The next item is a text with a radial gradient on the fill. The gradient goes - from black (in) to yellow (out). - - - The last item is a text with a 2 user unit stroke on which a black (in) to red - (out) linear gradient is applied. - - - The rendered picture should match the reference image exactly, except for possible - variations in the labelling text (per CSS2 rules). - - - - pservers-grad-11-b.svg - Test that the viewer has basic capability to handle radial gradients on fills and stroke of objects and text. This means it needs to understand the following elements : <radialGradient>, <stop> and the following properties : stop-color, fill:url(# ), stroke(url# ) - - - - - - - - - - - - - Radial gradient on fill of rectangle - - - - - - - - - Radial gradient on stroke of rectangle - - - - - - - - Gradient on text fill - Radial gradient on text, black to yellow - - - - - - - - Gradient on text stroke - Radial gradient on stroke of text, black to red - - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/render-elems-01-t.svg b/tests/arthur/data/1.1/render-elems-01-t.svg deleted file mode 100644 index 245789b3c2..0000000000 --- a/tests/arthur/data/1.1/render-elems-01-t.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Verifies that shapes can be filled. - - - There is one pair of octagons. These are filled. - - - The rendered image should match the reference image except for the text which may - show minor layout differences. - - - The test uses the 'path' element, as well as basic fill (solid primary colors), - stroke (primary color 1-pixel and wide lines), font-family (Arial) and font-size properties - - the common prerequisites. - - - - render-elems-01-t - This test validates that shapes can be both filled. - - - - - - - - - - - Shape fill - - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/render-elems-02-t.svg b/tests/arthur/data/1.1/render-elems-02-t.svg deleted file mode 100644 index c42423c66c..0000000000 --- a/tests/arthur/data/1.1/render-elems-02-t.svg +++ /dev/null @@ -1,75 +0,0 @@ - -"> -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Verifies that shapes can be stroked. - - - There is one pair of octagons. These are stroked. - - - The rendered image should match the reference image except for the text which may - show minor layout differences. - - - The test uses the 'rect' element, as well as basic fill (solid primary colors), - stroke (primary color 1-pixel and wide lines), font-family (Arial) and font-size properties - - the common prerequisites. - - - - render-elems-02-t - This test validates that shapes can be both stroked. - - - - - - - - - - - Shape stroke - - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/render-elems-03-t.svg b/tests/arthur/data/1.1/render-elems-03-t.svg deleted file mode 100644 index 5bfa4b49ec..0000000000 --- a/tests/arthur/data/1.1/render-elems-03-t.svg +++ /dev/null @@ -1,57 +0,0 @@ - -"> -]> - - - - - - - - - - - - - - - - - - Verifies that shapes can be filled, stroked and the order of filling and stroking. - - - There is one pair of octagons. These are filled plus stroked. - - - The rendered image should match the reference image except for the text which may - show minor layout differences. - - - The test uses the 'rect' element, as well as basic fill (solid primary colors), - stroke (primary color 1-pixel and wide lines), font-family (Arial) and font-size properties - - the common prerequisites. - - - - render-elems-03-t - This test validates that shapes can be both filled and stroked. - - - - - - - - - &shape; - &shape; - Shape fill and stroke - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/render-elems-06-t.svg b/tests/arthur/data/1.1/render-elems-06-t.svg deleted file mode 100644 index 85d983401e..0000000000 --- a/tests/arthur/data/1.1/render-elems-06-t.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Verifies that text can be filled. The - test shows two 'A' characters that are filled and not stroked. - - - The rendered image should match the reference image except for the text which may - show minor layout differences. - - - - render-elems-06-t - This test validates that text can be both filled. - - - - - - - - - - - - - - - - Text fill - - A - A - - - $Revision: 1.3 $ - - - diff --git a/tests/arthur/data/1.1/render-elems-07-t.svg b/tests/arthur/data/1.1/render-elems-07-t.svg deleted file mode 100644 index 60427f2fc4..0000000000 --- a/tests/arthur/data/1.1/render-elems-07-t.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Verifies that text can be stroked. The - The test - shows two characters that are stroked and not filled. - - - The rendered image should match the reference image except for the text which may - show minor layout differences. - - - - render-elems-07-t - This test validates that text can be both stroked. - - - - - - - - - - - - - - - - Text stroke - - A - B - - $Revision: 1.3 $ - - - diff --git a/tests/arthur/data/1.1/render-elems-08-t.svg b/tests/arthur/data/1.1/render-elems-08-t.svg deleted file mode 100644 index 0ba2c543ab..0000000000 --- a/tests/arthur/data/1.1/render-elems-08-t.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Verifies that text can be stroked. - The test - shows two 'A' characters that are both stroked and filled. - - - The rendered image should match the reference image except for the text which may - show minor layout differences. - - - - render-elems-08-t - This test validates that text can be both filled and stroked. - - - - - - - - - - - - - - - - - Text fill and stroke - - A - B - - $Revision: 1.3 $ - - - - diff --git a/tests/arthur/data/1.1/render-groups-03-t.svg b/tests/arthur/data/1.1/render-groups-03-t.svg deleted file mode 100644 index 3f1ca22497..0000000000 --- a/tests/arthur/data/1.1/render-groups-03-t.svg +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Verifies implicit rendering order (paragraph 3.3) and grouping mechanism (paragraphs 3.4). - It also validates basic Shape, Image and text rendering. - - - This test renders 3 elements: a text string "SVG", then - a shape, then an image. Because of their definition order and coordinates, the image - should be on top of the rectangle and the rectangle on top of the text. None - of the "SVG" should show through the - rectangle and none of the rectangle should show through the image. - - - Prerequisites: the test assumes proper handling of the fill stroke, stroke-width, - font-size rendering properties. It uses the rect, line, text and image elements, as - well as all the elements required for the test template. To ensure that the text string is - overlapped by the other elements and to avoid a dependency on system fonts, an SVG font is used. - - - The rendered image should match the reference image exactly. - - - - render-groups-03-t - This test validates the rendering order of graphic elements. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SVG - - - - - $Revision: 1.5 $ - - diff --git a/tests/arthur/data/1.1/shapes-circle-01-t.svg b/tests/arthur/data/1.1/shapes-circle-01-t.svg deleted file mode 100644 index d8e5380667..0000000000 --- a/tests/arthur/data/1.1/shapes-circle-01-t.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The rendered picture should match the reference image, except - for possible variations in the labelling text (per CSS2 rules). - - - - - shapes-circle-01-t - Test ability to handle the 'circle' basic shapes element. - - - - - - - - - - - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/shapes-ellipse-01-t.svg b/tests/arthur/data/1.1/shapes-ellipse-01-t.svg deleted file mode 100644 index c86f23762b..0000000000 --- a/tests/arthur/data/1.1/shapes-ellipse-01-t.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The rendered picture should match the reference image, except - for possible variations in the labelling text (per CSS2 rules). - - - - - shapes-ellipse-01-t - Test that viewer has the basic capability to handle the <ellipse> element. - - - - - - - - - - - - - - - - - - - - - - - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/shapes-line-01-t.svg b/tests/arthur/data/1.1/shapes-line-01-t.svg deleted file mode 100644 index e0bffae15b..0000000000 --- a/tests/arthur/data/1.1/shapes-line-01-t.svg +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The rendered picture should match the reference image, except - for possible variations in the labelling text (per CSS2 rules). - - - - - shapes-line-01-t - Test ability to handle the 'line' basic-shapes element. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/shapes-polygon-01-t.svg b/tests/arthur/data/1.1/shapes-polygon-01-t.svg deleted file mode 100644 index 57995b624e..0000000000 --- a/tests/arthur/data/1.1/shapes-polygon-01-t.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The rendered picture should match the reference image, except - for possible variations in the labelling text (per CSS2 rules). - - - - shapes-polygon-01-t - Test that viewer has the basic capability to handle the 'polygon' element. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/shapes-polyline-01-t.svg b/tests/arthur/data/1.1/shapes-polyline-01-t.svg deleted file mode 100644 index 9884cdc5e9..0000000000 --- a/tests/arthur/data/1.1/shapes-polyline-01-t.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The rendered picture should match the reference image, except - for possible variations in the labelling text (per CSS2 rules). - - - - - - shapes-polyline-01-t - Test that viewer has the basic capability to handle the 'polyline' element. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/shapes-rect-01-t.svg b/tests/arthur/data/1.1/shapes-rect-01-t.svg deleted file mode 100644 index 3ea47a6d47..0000000000 --- a/tests/arthur/data/1.1/shapes-rect-01-t.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The rendered picture should match the reference image, except - for possible variations in the labelling text (per CSS2 rules). - - - - - shapes-rect-01-t - Test that viewer has the basic capability to handle the <rect> element. - - - - - - - - - - - - - - - - - - - - - - - - - - $Revision: 1.7 $ - - - diff --git a/tests/arthur/data/1.1/struct-cond-01-t.svg b/tests/arthur/data/1.1/struct-cond-01-t.svg deleted file mode 100644 index cfe8b91ac1..0000000000 --- a/tests/arthur/data/1.1/struct-cond-01-t.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This test evaluates a switch statement. The result should be a - green rectangle in the lower left quarter of the output window. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - The test uses the 'rect' element, as well as basic fill (solid primary colors), - stroke (black 1-pixel lines), font-family (Arial) and font-size properties. - - - - struct-cond-01-t.svg - Test to determine if a simple switch element can be probably evaluated. - - - - - - - - - - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/struct-cond-02-t.svg b/tests/arthur/data/1.1/struct-cond-02-t.svg deleted file mode 100644 index 4a965d3bc1..0000000000 --- a/tests/arthur/data/1.1/struct-cond-02-t.svg +++ /dev/null @@ -1,574 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - This tests ability to use the 'systemLanguage' as a test attribute within a - switch element. To pass, either
    -
  1. the name (in English) of the current - system language, or
  2. -
  3. the names of the three languages (English, French - Japanese) of W3C
  4. -
must appear. The second case - will occur if either the user language is not one of the (60 or so) languages - present in the test, or if there is no user language information available. - - - It is an error to display no output; the last child of switch has no test, so - it will always be taken unless a more suitable child has already evaluated to true. - - - - - In addition, the string "Why don't they just speak <language>" should appear - in the center of the graphic, translated into that language. It is not an error for - some or all of this string to display as 'missing character' glyphs, if no - suitable font is available - however, this is unlikely if the language is indeed - the users primary language. (It can easily occur during testing, however). - - - - struct-cond-02-t - Test that viewer has the basic capability to switch on user langauge - - - - - - - - - - Waarom kan hulle nie net doodgewoon Afrikaans praat nie? - Afrikaans - - - ለáˆáŠ•á‹µáŠá‹ አማርኛ የማይናገሩት᧠- Amharic - - - - لماذا لا يتكلمون اللّغة العربية Ùحسب؟ - Arabic (SA) - - - Защо те проÑто не могат да говорÑÑ‚ българÑки ? - Bulgarian - - - ওরা েকন বাংলা বলেত পাের না ? - Bengali - - - - Per què no poden simplement parlar en català ? - Catalan - - - ProÄ prostÄ› nemluví Äesky ? - Czech - - - Pam dydyn nhw ddim yn siarad Cymraeg ? - Welsh - - - Hvorfor kan de ikke bare tale dansk ? - Danish - - - - Warum sprechen sie nicht einfach Deutsch ? - German (DE) - - - Μα γιατί δεν μποÏοÏν να μιλήσουν Ελληνικά ; - Greek (modern, GR) - - - Why can't they just speak English ? - English (US) - - - ¿Por qué no pueden simplemente hablar en castellano ? - Spanish (ES) - - - Zergatik ezin dute  Euzkeraz bakarrik hitzegin? - Basque - - - خب، چرا Ùارسى صحبت نمى كنند؟ - Farsi - - - Miksi he eivät yksinkertaisesti puhu suomea ? - Finnish - - - - Pourquoi, tout simplement, ne parlent-ils pas en Français ? - French (FR) - - - Carson nach eil iad a'bruidhinn na Gàidhlige ? - Scots Gaelic - - - બદà«àª§àª¾ લોકો ગà«àªœàª°àª¾àª¤à«€ કૅમ નથી બોલતા? - Gujarti (IN) - - - - למה ×”× ×¤×©×•×˜ ×œ× ×ž×“×‘×¨×™× ×¢×‘×¨×™×ª ? - Hebrew (modern) - - - यह लोग हिनà¥à¤¦à¥€ कà¥à¤¯à¥‹à¤‚ नहीं बोल सकते हैं ? - Hindi - - - ZaÅ¡to jednostavno ne govore hrvatski ? - Croatian - - - Miért nem beszélnek egyszerűen magyarul ? - Hungarian - - - Ô»Õ¶Õ¹Õ¸Ö‚Õž Õ¶Ö€Õ¡Õ¶Ö„ Õ¹Õ¥Õ¶ Õ­Õ¸Õ½Õ¸Ö‚Õ´ Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶ - - Armenian - - - Mengapa mereka tidak bisa bicara bahasa Indonesia ? - Indonesian - - - Hvers vegna geta þeir ekki réttlátur tala Ãslenska ? - Icelandic - - - Perchè non possono semplicemente parlare italiano ? - Italian - - - - ᓱᒻᒪᓂᒃᑯአáƒá“„ᒃᑎᑠá‘áƒá“ᓇᔭᙱᓚᑦ - Inuktitut - - - ãªãœã€ã¿ã‚“ãªæ—¥æœ¬èªžã‚’話ã—ã¦ãã‚Œãªã„ã®ã‹ï¼Ÿ - Japanese (JP) - - - Kenapa kok ora nganggo  basa Jawa  wae? - Javanese - - - რáƒáƒ¢áƒáƒ› áƒáƒ  ლáƒáƒžáƒáƒ áƒáƒ™áƒáƒ‘ენ ისინი ქáƒáƒ áƒ—ულáƒáƒ“ ? - Georgian - - - Олар неге қазақ Ñ‚iлiнде Ñойлемейдi? - Kazakh - - - ಅವರೠಕನà³à²¨à²¡ ಮಾತನಾಡಬಹà³à²¦à²²à³à²²à²¾? - Kannada - - - ì„¸ê³„ì˜ ëª¨ë“  ì‚¬ëžŒë“¤ì´ í•œêµ­ì–´ 를 ì´í•´í•œë‹¤ë©´ 얼마나 좋ì„까? - Korean - - - Емне үчүн алар кыргызча Ñүйлбйт? - Kirghiz - - - KodÄ—l gi jie nekalba lietuviÅ¡kai ? - Lithuanian - - - Зошто тие едноÑтавно не говорат македонÑки ? - Macedonian - - - लोकांना मराठी का बोलता येत नाही? - Marathi - - - Waarom spreken ze niet gewoon Nederlands ? - Dutch - - - Hvorfor kan de ikke bare snakke norsk ? - Norwegian - - - ସେମାନେ ଉଡିଯା ରେ କହିନà­à¬•à¬¿ କହିବେ ନହିà¬? - Oriya - - - Dlaczego oni nie mówiÄ… po polsku ? - Polish - - - - Porque é que eles não falam simplesmente em Português ? - Portugese (PT) - - - Porque é que eles não falam em Português (do Brasil) ? - Portugese (BR) - - - Porque é que eles não falam simplesmente em Português ? - Portugese - - - De ce ei nu vorbesc moldoveneÅŸte ? - Romanian - - - Почему же они не говорÑÑ‚ по-руÑÑки ? - Russian - - - ते किं संसà¥à¤•à¥ƒà¤¤à¤ƒ माम वदनà¥à¤¤à¤¿ ? - Sanskrit - - - ZaÅ¡to jednostavno ne govore srpski ? - Serbian - - - අà·à¶ºà·’ ඔවුන්ට ඉංගරිස කත෠ෛනබ ? - Sinhalese - - - - Zakaj vendar ne govorijo slovensko ? - Slovenian - - - Pse nuk duan të flasin vetëm shqip ? - Albanian - - - Varför pratar dom inte bara svenska ? - Swedish - - - அவரà¯à®•à®³à¯ à®à®©à¯ தமிழில௠பேசகà¯à®•à¯‚டாத௠? - Tamil - - - - తెలà±à°—ౠలో à°Žà°‚à°¦à±à°•à± మాటà±à°²à°¾à°¡à°°à±? - Telugu - - - ÄŒaro onho ba zaboni toÄiki gap namezanand? - Tajik - - - ทำไมเขาถึงไม่พูด ภาษาไทย - Thai - - - Bakit hindi na lang sila magsalita ng Tagalog ? - Tagalog (Filipino) - - - Neden Türkçe konuÅŸamıyorlar? - Turkish - - - Ðишләп олар татарча Ñүләша алмыйлар? - Tatar - - - Чому б їм не розмовлÑти українÑькою ? - Ukranian - - - ﻦﻴﻫ ﻰﺘﻠﻭﺒ ﻦﻴﻬﻨ ﻦﻭﻴﻜ ﻮﺪﺭﺃ بس ﻮﻩ ﻟﻮﮒ؟ - Urdu (IN) - - - ﻦﻴﻫ ﻰﺘﻠﻭﺒ ﻦﻴﻬﻨ ﻦﻭﻴﻜ ﻮﺪﺭﺃ بس ﻮﻩ ﻟﻮﮒ؟ - Urdu (PK) - - - - Nega ular uzbek tilinda gapirmaidilar? - Uzbek - - - TaÌ£i sao hoÌ£ không thể chỉ noÌi tiêÌng Việt ? - Vietnamese - - - פֿ×ַרװ×ָס רעדט מען ניט פּשוט ייִדיש ? - Yiddish - - - 他们为什么ä¸è¯´ä¸­æ–‡ (中国) ? - Chinese (CN) - - - 他們爲什麽ä¸èªªä¸­æ–‡ï¼ˆå°ç£ï¼‰ï¼Ÿ - Chinese (TW) - - - - You have no (matching) language preference set - ãªãœã€ã¿ã‚“ãªæ—¥æœ¬èªžã‚’話ã—ã¦ãã‚Œãªã„ã®ã‹ï¼Ÿ - Why can't they just speak English ? - Pourquoi, tout simplement, ne parlent-ils pas en Français ? - - - - - - $Revision: 1.8 $ - - diff --git a/tests/arthur/data/1.1/struct-defs-01-t.svg b/tests/arthur/data/1.1/struct-defs-01-t.svg deleted file mode 100644 index 86ccb5ccf0..0000000000 --- a/tests/arthur/data/1.1/struct-defs-01-t.svg +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Test to verify that the defs element is used as a container correctly. - - - In this test a fill is created which is solid red. The view should be a solid red rectangle - centered in the viewport 100 pixels from from left,top and right,bottom. Also, in the - defs sections there are rectangle defined, one to paint over the entire canvas with - a green fill and the other to obscure most of the red rectangle. The green rectangles - should not show in the view as defs are referenced items and are not rendered. - No green should show. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - The test uses the 'rect' element, as well as basic fill (solid primary colors), - stroke (black 1-pixel lines), font-family (Arial) and font-size properties. - - - - struct-defs-01-t - Test to determine if the defs element is used as a container correctly - - - - - - - - - - - - - $Revision: 1.6 $ - - diff --git a/tests/arthur/data/1.1/struct-group-01-t.svg b/tests/arthur/data/1.1/struct-group-01-t.svg deleted file mode 100644 index f719835c3b..0000000000 --- a/tests/arthur/data/1.1/struct-group-01-t.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The test checks to see that graphics elements (g) can be nested and that the like attributes can be passed to the children. All the g elements for this test are in the g element whose id=allGs. The two red rectangles and the yellow are in the g labeled rects. The reds inherit a fill color the green rect has a fill specified and it should not be overwritten. The two yellow rectangles should inherit the fill color and the transform attribute, they should be yellow and rotated at -20 degrees. These two rectangles are in g "yellowNrotate", that g is nested inside g "gratuitiousG". The black rectangle in the upper right, has no attributes inherited from its parent. The focus is nesting of g elements and passing on of attributes. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - The test uses the 'rect' element, as well as basic fill (solid primary colors), - stroke (black 1-pixel lines), font-family (Arial) and font-size properties. - - - - struct-group-01-t - Test that the g element functions correctly as a container. - - - - - - - - - - - - - - - - - - - - $Revision: 1.4 $ - - - diff --git a/tests/arthur/data/1.1/struct-image-01-t.svg b/tests/arthur/data/1.1/struct-image-01-t.svg deleted file mode 100644 index 14bb6c9c86..0000000000 --- a/tests/arthur/data/1.1/struct-image-01-t.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The image test case checks to see if the basic image formats allowed in - the tiny profile are supported. - The upper right has an JPG image the lower right has a PNG image. They are - the same image. - Those positions are relative to the upper left of the entire canvas. - If any of the components are missing, then an image format is not being - properly supported. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - - struct-image-01-t - Test that the jpg and png image formats are understood. - - - - - - - - $Revision: 1.8 $ - - - diff --git a/tests/arthur/data/1.1/struct-image-03-t.svg b/tests/arthur/data/1.1/struct-image-03-t.svg deleted file mode 100644 index 1c4c7a4477..0000000000 --- a/tests/arthur/data/1.1/struct-image-03-t.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - This test verifies the support for gamma correction of displayed PNG - images. Several different images are displayed one above the other; - if gamma correction is correctly performed based on the values in - the gAMA chunk in the PNG file, the resulting displayed values are - the same in all of the files (except for rounding error, which gives - some artefacts at the right side of the lowest two images due to the - very high levels of gamma correction needed for this test). - - - - struct-image-03-t - Test gamma correction of PNG images based on gAMA - chunk. Derived from original HTML test by Dave Martindale. - - - - - - - - - - - Gamma correction - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/struct-image-04-t.svg b/tests/arthur/data/1.1/struct-image-04-t.svg deleted file mode 100644 index 904000e9ca..0000000000 --- a/tests/arthur/data/1.1/struct-image-04-t.svg +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The image test case checks to see if the basic image formats allowed in - the tiny profile are supported using the data: URI schema and base64 encoding.. - The upper right has an JPG image the lower right has a PNG image. They are - the same image. - Those positions are relative to the upper left of the entire canvas. - If any of the components are missing, then an image format is not being - properly supported. - - - The rendered picture should match the reference image, except for possible - variations in the labelling text (per CSS2 rules). - - - - - struct-image-04-t - - Test that jpg and png image formats are understood when inlined with the data: URI scheme. - - - - - - - - - - - - - - - - - - $Revision: 1.4 $ - - - - - - - diff --git a/tests/arthur/data/1.1/styling-pres-01-t.svg b/tests/arthur/data/1.1/styling-pres-01-t.svg deleted file mode 100644 index 8eb03e6d95..0000000000 --- a/tests/arthur/data/1.1/styling-pres-01-t.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - Check that !important in presentation attribute is an error. - A fill attribute is set to red with !important. It thus has no specified - value, and inherits from its parent a green fill. A green rectangle is displayed. - - - styling-pres-01-t - Check !important in presentation attribute is an error - - - - - - - - - - - - $Revision: 1.2 $ - - diff --git a/tests/arthur/data/1.1/text-fonts-01-t.svg b/tests/arthur/data/1.1/text-fonts-01-t.svg deleted file mode 100644 index c545874adc..0000000000 --- a/tests/arthur/data/1.1/text-fonts-01-t.svg +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Purpose of test is to determine if the font family is being - correctly selected. The top two lines of text test serif fonts; - the top line in maroon tests the generic font family 'serif' - and the second line in black tests a selection of commonly - available named serif fonts. The next two lines of text test - sans-serif fonts; - the top line in maroon tests the generic font family 'sans-serif' - and the second line in black tests a selection of commonly - available named sans serif fonts. The following two lines - of text test monospaced fonts; - the top line in maroon tests the generic font family 'monospaced' - and the second line in black tests a selection of commonly - available named monospaced fonts. The lowercase 'i' and uppercase'W' - should be the same width,for monospaced fonts. - - - The seventh line of text, in green, tests for - three non-existent fonts (nonsense names). There is no fallback - generic font specified. The text must be displayed anyway. - - - The first six lines contain two Japanese characters (画像) - at the end of the line. Both of these characters must be displayed, - although it is compliant to display them with the 'missing glyph' - if no suitable font containing Japanese characters can be found. - Most but not all fonts have a visible missing glyph character. - If the selected font has a visible missing glyph character, it should appear - wherever the corresponding glyph is not available. - - - - - text-fonts-01-t.svg - -Test that viewer has the basic capability to handle different font families - - - - - - A serifed face ç”»åƒ - A sans-serif face ç”»åƒ - A mono (iW) face ç”»åƒ - - A serifed face ç”»åƒ - A sans-serif face ç”»åƒ - A mono (iW) face ç”»åƒ - - This must be displayed - - - - - $Revision: 1.5 $ - - - diff --git a/tests/arthur/data/1.1/text-fonts-02-t.svg b/tests/arthur/data/1.1/text-fonts-02-t.svg deleted file mode 100644 index 7d9a565b49..0000000000 --- a/tests/arthur/data/1.1/text-fonts-02-t.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - Purpose of test is to determine if the font weight is being - correctly rendered. A number of font families are specified. The - numerical weight values (100 to 900) should show the lighter weights - on the lower numbers and the heavier weights on the larger numbers. - Heavier is defined to mean 'no lighter'. - - - If only one font weight is available, they should all display at the - same weight. The transition from black to green figures shows the - correct light to bold transition for the common case where two - weights are available. If three or more weights are available, see - the CSS2 specification for how these are allocated to the nine - weight numbers. - - - The absolute keywords 'normal' and bold' are tested - by the first two lines on the right hand side of the test, - the third line of text tests the to 'bolder' - relative keyword and the fourth tests the - 'lighter' relative keyword. - - - - text-fonts-02-t.svg - -Test that viewer has the basic capability to handle different font weights - - - - - 100 - 200 - 300 - 400 - 500 - 600 - 700 - 800 - 900 - This is bold - This is normal - - Blue is bolder - - - Blue is lighter - - - $Revision: 1.7 $ - - diff --git a/tests/arthur/data/1.1/text-intro-01-t.svg b/tests/arthur/data/1.1/text-intro-01-t.svg deleted file mode 100644 index 7a1ef61f2e..0000000000 --- a/tests/arthur/data/1.1/text-intro-01-t.svg +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Test left-to-right aspect of internationalized text. - - - Various text strings in various languages appear. The main - purpose of the test is to verify that the correct characters - appear and that they appear in the correct order and orientation, even - though the first choice font does not have the right glyphs. - - - Correct rendering requires that each character is rendered. it may be rendered - with the 'missing glyph' if no - glyphs are found in the fonts listed in the content, or in any fallback font - that is available. The first choice font - is a special SVG font that only contains the 'missing glyph'. Missing glyph from - other fonts may conformantly be used, however. - - - - text-intro-01-t - Test left-to-right aspect of internationalized text. - - - - - - - - - - - Test left-to-right text. - - Polish: MogÄ™ jeść szkÅ‚o, i mi ... - Russian: Я могу еÑÑ‚ÑŒ Ñтекло, ... - Greek: ΜποÏÏŽ να φάω ... - Hebrew: ×× ×™ יכול ל×כול זכוכית ... - Yiddish: ×יך קען עסן גל×ָז ×ון ... - - - Chinese:我能åžä¸‹çŽ»ç’ƒè€Œä¸ä¼¤èº«ä½“。 - - - Japanese: ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã¾ã™ã€‚ - - - $Revision: 1.5 $ - - diff --git a/tests/arthur/data/1.1/text-intro-04-t.svg b/tests/arthur/data/1.1/text-intro-04-t.svg deleted file mode 100644 index 22bb4ca817..0000000000 --- a/tests/arthur/data/1.1/text-intro-04-t.svg +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - -]> - - - - - - - - - - - - - - - Test basic aspect of internationalized text. - - - Various text strings in various languages appear. The main - purpose of the test is to verify that the correct characters - appear and that they appear in the correct order and orientation. - - - Correct rendering requires that each character is rendered. It is not required that a given character - be rendered with any particular font; just that it is rendered. - It may be rendered with the 'missing glyph' if no - glyphs are found in the fonts listed in the content, or in any fallback font that is available. - - - A future version of this test - might include all necessary glyphs as an SVG font. - - - - text-intro-04-t - Test basic of internationalized text. - - - - - Test horizontal text. - - Polish: MogÄ™ jeść szkÅ‚o, i mi nie szkodzi. - Russian: Я могу еÑÑ‚ÑŒ Ñтекло, Ñто мне не вредит. - Greek: ΜποÏÏŽ να φάω σπασμένα γυαλιά χωÏίς να πάθω τίποτα. - - Text "×× ×™ יכול ל×כול זכוכית וזה ×œ× ×ž×–×™×§ לי" is in Hebrew - Yiddish: ×יך קען עסן גל×ָז ×ון עס טוט מיר נישט װײ. - Chinese:我能åžä¸‹çŽ»ç’ƒè€Œä¸ä¼¤èº«ä½“。 - Japanese: ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ã€‚ãã‚Œã¯ç§ã‚’å‚·ã¤ã‘ã¾ã›ã‚“。 - - - $Revision: 1.9 $ - - diff --git a/tests/arthur/data/1.1/text-ws-01-t.svg b/tests/arthur/data/1.1/text-ws-01-t.svg deleted file mode 100644 index 8b2d7a8433..0000000000 --- a/tests/arthur/data/1.1/text-ws-01-t.svg +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Test for viewer correct handling of whitespace and the 'xml:space' attribute. - There are two sub-tests, for xml:space value "default". - In each test, the content of the 'text' element is written on - multiple lines. The first test of each pair has indented text with leading - space characters, tabs, etc. The second has no indentation, but a line break - before the content and after it. There are no space (or other whitespace) - characters at the ends of the lines. - - - The two test cases are self-descriptive. From the top; - first, "default" value applied to 3 lines of content with indents, space characters, tabs, etc; - second, "default" applied to two lines content with no indent; - - - In each test, the test string is in blue and the reference - image is in black. - The rendered picture should approximately match the reference image, - however there is some question in the reference image concerning the - exact amount of space in the long-space areas. The third test uses the nbsp unicode character - to force the reference white spaces display, which provides an accurate match if the font in use - has the same metrics for that character and the default white space. - Also, variations are possible in the text fonts and layout (per CSS2 rules). - - - The test also uses the 'rect' element, - as well as basic fill (solid primary colors), - stroke (black 1-pixel lines), font-family (Arial) - and font-size properties. - - - - - text-ws-01-t - Test that viewer correctly handle whitespace and the "space" attribute. - - - - - Basic: xml:space attribute - & whitespace handling. - - - - WS with indented lines. - WS with indented lines. - - xml:space='default' - - - - -WS -non-indented lines. - - WS non-indented lines. - - xml:space='default' - - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.1/text-ws-02-t.svg b/tests/arthur/data/1.1/text-ws-02-t.svg deleted file mode 100644 index 515f503208..0000000000 --- a/tests/arthur/data/1.1/text-ws-02-t.svg +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Test for viewer correct handling of whitespace and the 'xml:space' attribute. - There are two sub-tests, forvalue "preserve". - In each test, the content of the 'text' element is written on - multiple lines. The first test of each pair has indented text with leading - space characters, tabs, etc. The second has no indentation, but a line break - before the content and after it. There are no space (or other whitespace) - characters at the ends of the lines. - - - The two test cases are self-descriptive. From the top; - first, "preserve" applied to essentially the same content as first; - second, "preserve" applied to essentially the same content as second. - - - In each test, the test string is in blue and the reference - image is in black. - The rendered picture should approximately match the reference image, - however there is some question in the reference image concerning the - exact amount of space in the long-space areas. The third test uses the nbsp unicode character - to force the reference white spaces display, which provides an accurate match if the font in use - has the same metrics for that character and the default white space. - Also, variations are possible in the text fonts and layout (per CSS2 rules). - - - The test also uses the 'rect' element, - as well as basic fill (solid primary colors), - stroke (black 1-pixel lines), font-family (Arial) - and font-size properties. - - - - - text-ws-02-t - Test that viewer correctly handle whitespace and the "space" attribute. - - - - - Basic: xml:space attribute - & whitespace handling. - - - - -WS - with - indented lines. - - -  WS   with  indented lines. - - - xml:space='preserve' - - - - WS -non-indented lines. - - WS non-indented lines. - - xml:space='preserve' - - - $Revision: 1.6 $ - - - diff --git a/tests/arthur/data/1.2/07_07.svg b/tests/arthur/data/1.2/07_07.svg deleted file mode 100644 index 11968b2c2d..0000000000 --- a/tests/arthur/data/1.2/07_07.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - Example Nested - Nested transformations - - - - - - - - - - - - - ....Translate(1) - - - - - - - - - ....Rotate(2) - - - - - - - - - ....Translate(3) - - - - - diff --git a/tests/arthur/data/1.2/07_12.svg b/tests/arthur/data/1.2/07_12.svg deleted file mode 100644 index bf372ccd04..0000000000 --- a/tests/arthur/data/1.2/07_12.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - Example ViewBox - uses the viewBox - attribute to automatically create an initial user coordinate - system which causes the graphic to scale to fit into the - viewport no matter what size the viewport is. - - - - - - - Stretch to fit - - diff --git a/tests/arthur/data/1.2/08_02.svg b/tests/arthur/data/1.2/08_02.svg deleted file mode 100644 index 7e3ae41074..0000000000 --- a/tests/arthur/data/1.2/08_02.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - Example cubic01- cubic Bézier commands in path data - Picture showing a simple example of path data - using both a "C" and an "S" command, - along with annotations showing the control points - and end points - - - - - - - - - - - - - - M100,200 C100,100 250,100 250,200 - S400,300 400,200 - diff --git a/tests/arthur/data/1.2/08_03.svg b/tests/arthur/data/1.2/08_03.svg deleted file mode 100644 index 30a240c11b..0000000000 --- a/tests/arthur/data/1.2/08_03.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - Example quad01 - quadratic Bezier commands in path data - Picture showing a "Q" a "T" command, - along with annotations showing the control points - and end points - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/1.2/08_04.svg b/tests/arthur/data/1.2/08_04.svg deleted file mode 100644 index 1d692b708c..0000000000 --- a/tests/arthur/data/1.2/08_04.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - Example arcs01 - arc commands in path data - Picture of a pie chart with two pie wedges and - a picture of a line with arc blips - - - - - diff --git a/tests/arthur/data/1.2/09_02.svg b/tests/arthur/data/1.2/09_02.svg deleted file mode 100644 index 14df36e8b8..0000000000 --- a/tests/arthur/data/1.2/09_02.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - Example rect02 - rounded rectangles - - - - - - - diff --git a/tests/arthur/data/1.2/09_03.svg b/tests/arthur/data/1.2/09_03.svg deleted file mode 100644 index 93c12be0cd..0000000000 --- a/tests/arthur/data/1.2/09_03.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - Example circle01 - circle filled with red and stroked with blue - - - - diff --git a/tests/arthur/data/1.2/09_04.svg b/tests/arthur/data/1.2/09_04.svg deleted file mode 100644 index 69295567eb..0000000000 --- a/tests/arthur/data/1.2/09_04.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - Example ellipse01 - examples of ellipses - - - - - - - diff --git a/tests/arthur/data/1.2/09_05.svg b/tests/arthur/data/1.2/09_05.svg deleted file mode 100644 index a7407bfdba..0000000000 --- a/tests/arthur/data/1.2/09_05.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - Example line01 - lines expressed in user coordinates - - - - - - - - - - diff --git a/tests/arthur/data/1.2/09_06.svg b/tests/arthur/data/1.2/09_06.svg deleted file mode 100644 index eeae2b499e..0000000000 --- a/tests/arthur/data/1.2/09_06.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - Example polyline01 - increasingly larger bars - - - - \ No newline at end of file diff --git a/tests/arthur/data/1.2/09_07.svg b/tests/arthur/data/1.2/09_07.svg deleted file mode 100644 index 209b6870ef..0000000000 --- a/tests/arthur/data/1.2/09_07.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - Example polygon01 - star and hexagon - - - - - diff --git a/tests/arthur/data/1.2/10_03.svg b/tests/arthur/data/1.2/10_03.svg deleted file mode 100644 index 475c9101a6..0000000000 --- a/tests/arthur/data/1.2/10_03.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - Example tspan01 - using tspan to change visual attributes - - - You are - not - a banana. - - - - - diff --git a/tests/arthur/data/1.2/10_04.svg b/tests/arthur/data/1.2/10_04.svg deleted file mode 100644 index e22babe815..0000000000 --- a/tests/arthur/data/1.2/10_04.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - Example tspan02 - using tspan's dx and dy attributes - for incremental positioning adjustments - - - But you - - are - - - a peach! - - - - - - diff --git a/tests/arthur/data/1.2/10_05.svg b/tests/arthur/data/1.2/10_05.svg deleted file mode 100644 index 0871cd1446..0000000000 --- a/tests/arthur/data/1.2/10_05.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - Example tspan03 - using tspan's x and y attributes - for multiline text and precise glyph positioning - - - - Cute and - - - fuzzy - - - - - - diff --git a/tests/arthur/data/1.2/10_06.svg b/tests/arthur/data/1.2/10_06.svg deleted file mode 100644 index 1935f42b93..0000000000 --- a/tests/arthur/data/1.2/10_06.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Referenced character data - - - Example tref01 - inline vs reference text content - - Inline character data - - - - - - - diff --git a/tests/arthur/data/1.2/10_07.svg b/tests/arthur/data/1.2/10_07.svg deleted file mode 100644 index 88f9bd2fd7..0000000000 --- a/tests/arthur/data/1.2/10_07.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - Example textdecoration01 - behavior of 'text-decoration' property - - - Normal text - Text with line-through - Underlined text - - One - word - has - different - underlining - - - diff --git a/tests/arthur/data/1.2/10_08.svg b/tests/arthur/data/1.2/10_08.svg deleted file mode 100644 index 62e7ed0843..0000000000 --- a/tests/arthur/data/1.2/10_08.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - Example toap01 - simple text on a path - - - - We go up, then we go down, then up again - - - - - diff --git a/tests/arthur/data/1.2/10_09.svg b/tests/arthur/data/1.2/10_09.svg deleted file mode 100644 index 2d971fe899..0000000000 --- a/tests/arthur/data/1.2/10_09.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - Example toap02 - tspan within textPath - - - - We go - - up - - - , - - then we go down, then up again - - - - - diff --git a/tests/arthur/data/1.2/10_10.svg b/tests/arthur/data/1.2/10_10.svg deleted file mode 100644 index e2feed5b74..0000000000 --- a/tests/arthur/data/1.2/10_10.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - Example toap03 - text on a path with startOffset attribute - - - - We go up, then we go down, then up again - - - - - diff --git a/tests/arthur/data/1.2/10_11.svg b/tests/arthur/data/1.2/10_11.svg deleted file mode 100644 index 8134ce523d..0000000000 --- a/tests/arthur/data/1.2/10_11.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - Example toap04 - text on a path layout rules - - - - Choose shame or get war - - - - - diff --git a/tests/arthur/data/1.2/11_01.svg b/tests/arthur/data/1.2/11_01.svg deleted file mode 100644 index 2a6d5b5f16..0000000000 --- a/tests/arthur/data/1.2/11_01.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - Gradients apply to leaf nodes - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/1.2/11_02.svg b/tests/arthur/data/1.2/11_02.svg deleted file mode 100644 index 4806892f66..0000000000 --- a/tests/arthur/data/1.2/11_02.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - Everything here has a red background. - The rectangle is not filled, so the red background will show through - - - diff --git a/tests/arthur/data/1.2/11_03.svg b/tests/arthur/data/1.2/11_03.svg deleted file mode 100644 index 219d0759a7..0000000000 --- a/tests/arthur/data/1.2/11_03.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - The viewport has a yellow background. - The rectangle is filled and covers the viewport, so the yellow - background will only show through in the "leftovers" if the - aspect ratio of the viewport differs from thatof the viewBox. - - - diff --git a/tests/arthur/data/1.2/13_01.svg b/tests/arthur/data/1.2/13_01.svg deleted file mode 100644 index d7bba1fe78..0000000000 --- a/tests/arthur/data/1.2/13_01.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - Example lingrad01 - fill a rectangle using a - linear gradient paint server - - - - - - - - - - - - - diff --git a/tests/arthur/data/1.2/13_02.svg b/tests/arthur/data/1.2/13_02.svg deleted file mode 100644 index e7d8b7fd9e..0000000000 --- a/tests/arthur/data/1.2/13_02.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - Example radgrad01 - fill a rectangle by referencing a - radial gradient paint server - - - - - - - - - - - - - - diff --git a/tests/arthur/data/1.2/19_01.svg b/tests/arthur/data/1.2/19_01.svg deleted file mode 100644 index 794ba6f62a..0000000000 --- a/tests/arthur/data/1.2/19_01.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - Example anim01 - demonstrate animation elements - - - - - - - - - - - - - It's alive! - - - - - - - - diff --git a/tests/arthur/data/1.2/19_02.svg b/tests/arthur/data/1.2/19_02.svg deleted file mode 100644 index 69c55d90c6..0000000000 --- a/tests/arthur/data/1.2/19_02.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - Example animMotion01 - demonstrate motion animation computations - - - - - - - - - - - - - - diff --git a/tests/arthur/data/1.2/animation.svg b/tests/arthur/data/1.2/animation.svg deleted file mode 100644 index 7ae56bb3d9..0000000000 --- a/tests/arthur/data/1.2/animation.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/tests/arthur/data/1.2/cubic02.svg b/tests/arthur/data/1.2/cubic02.svg deleted file mode 100644 index 492bb72b8b..0000000000 --- a/tests/arthur/data/1.2/cubic02.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - Example cubic02 - cubic Bezier commands in path data - Picture showing examples of "C" and "S" commands, - along with annotations showing the control points - and end points - - - - - - - - - - - - M100,200 C100,100 400,100 400,200 - - - - - - - - - - M100,500 C25,400 475,400 400,500 - - - - - - - - - - M100,800 C175,700 325,700 400,800 - - - - - - - - - - M600,200 C675,100 975,100 900,200 - - - - - - - - - - M600,500 C600,350 900,650 900,500 - - - - - - - - - - - - - - - M600,800 C625,700 725,700 750,800 - S875,900 900,800 - diff --git a/tests/arthur/data/1.2/fillrule-evenodd.svg b/tests/arthur/data/1.2/fillrule-evenodd.svg deleted file mode 100644 index 0fda125e41..0000000000 --- a/tests/arthur/data/1.2/fillrule-evenodd.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - Example fillrule-evenodd - demonstrates fill-rule:evenodd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/1.2/fillrule-nonzero.svg b/tests/arthur/data/1.2/fillrule-nonzero.svg deleted file mode 100644 index ea71864d76..0000000000 --- a/tests/arthur/data/1.2/fillrule-nonzero.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - Example fillrule-nonzero - demonstrates fill-rule:nonzero - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/1.2/linecap.svg b/tests/arthur/data/1.2/linecap.svg deleted file mode 100644 index af0b82447e..0000000000 --- a/tests/arthur/data/1.2/linecap.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - Example linecap - demonstrates three stroke-linecap values - - - - - - - - - - - - - 'butt' cap - - - - - - 'round' cap - - - - - - 'square' cap - - - diff --git a/tests/arthur/data/1.2/linejoin.svg b/tests/arthur/data/1.2/linejoin.svg deleted file mode 100644 index 265e733b95..0000000000 --- a/tests/arthur/data/1.2/linejoin.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - Example linecap - demonstrates three stroke-linecap values - - - - - - - - - - 'miter' join - - - - - - 'round' join - - - - - - 'bevel' join - - - diff --git a/tests/arthur/data/1.2/media01.svg b/tests/arthur/data/1.2/media01.svg deleted file mode 100644 index 7c2a349319..0000000000 --- a/tests/arthur/data/1.2/media01.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - SVG audio example - - - - - - Press Me - - - - - \ No newline at end of file diff --git a/tests/arthur/data/1.2/media02.svg b/tests/arthur/data/1.2/media02.svg deleted file mode 100644 index 99fa8a0c43..0000000000 --- a/tests/arthur/data/1.2/media02.svg +++ /dev/null @@ -1,13 +0,0 @@ - - SVG 1.2 video example - - - - - - - diff --git a/tests/arthur/data/1.2/media03.svg b/tests/arthur/data/1.2/media03.svg deleted file mode 100644 index 2b3060bb12..0000000000 --- a/tests/arthur/data/1.2/media03.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - Example of two animation elements pointing to the same content. - - - - - diff --git a/tests/arthur/data/1.2/media04.svg b/tests/arthur/data/1.2/media04.svg deleted file mode 100644 index 5c39652059..0000000000 --- a/tests/arthur/data/1.2/media04.svg +++ /dev/null @@ -1,24 +0,0 @@ - - Example of switching on the http://www.w3.org/TR/SVG12/feature#TransformedVideo feature string - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/1.2/media05.svg b/tests/arthur/data/1.2/media05.svg deleted file mode 100644 index e890b02ea1..0000000000 --- a/tests/arthur/data/1.2/media05.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - Example of switching on the http://www.w3.org/TR/SVG12/feature#ComposedVideo feature string - - - - - - - - - Composited title. - - - - - - Non-composited title. - - - diff --git a/tests/arthur/data/1.2/mpath01.svg b/tests/arthur/data/1.2/mpath01.svg deleted file mode 100644 index b77cea64ff..0000000000 --- a/tests/arthur/data/1.2/mpath01.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - mpath example - - - - - diff --git a/tests/arthur/data/1.2/non-scaling-stroke.svg b/tests/arthur/data/1.2/non-scaling-stroke.svg deleted file mode 100644 index fe6af38bd7..0000000000 --- a/tests/arthur/data/1.2/non-scaling-stroke.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - Example non-scaling stroke - - - - - - - - - diff --git a/tests/arthur/data/1.2/noonoo.svg b/tests/arthur/data/1.2/noonoo.svg deleted file mode 100644 index 9e601bd075..0000000000 --- a/tests/arthur/data/1.2/noonoo.svg +++ /dev/null @@ -1,13 +0,0 @@ - - SVG 1.2 video example - - - - - - - diff --git a/tests/arthur/data/1.2/referencedRect.svg b/tests/arthur/data/1.2/referencedRect.svg deleted file mode 100644 index 67473aafab..0000000000 --- a/tests/arthur/data/1.2/referencedRect.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/tests/arthur/data/1.2/referencedRect2.svg b/tests/arthur/data/1.2/referencedRect2.svg deleted file mode 100644 index 383703f6d4..0000000000 --- a/tests/arthur/data/1.2/referencedRect2.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/tests/arthur/data/1.2/solidcolor.svg b/tests/arthur/data/1.2/solidcolor.svg deleted file mode 100644 index 0fc59bbdde..0000000000 --- a/tests/arthur/data/1.2/solidcolor.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - <solidColor> Example - - - - - - - - - - A - - diff --git a/tests/arthur/data/1.2/textArea01.svg b/tests/arthur/data/1.2/textArea01.svg deleted file mode 100644 index 945c34c47f..0000000000 --- a/tests/arthur/data/1.2/textArea01.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - Basic textflow - - - diff --git a/tests/arthur/data/1.2/timed-lyrics.svg b/tests/arthur/data/1.2/timed-lyrics.svg deleted file mode 100644 index 715cd03836..0000000000 --- a/tests/arthur/data/1.2/timed-lyrics.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - This document contains the textual lyrics to synchronize with some video content in the referencing document - - - This is some text - - simulating some lyrics - - displayed synchronously - - with some video - - in a different document - - - diff --git a/tests/arthur/data/1.2/use.svg b/tests/arthur/data/1.2/use.svg deleted file mode 100644 index ae0bce6129..0000000000 --- a/tests/arthur/data/1.2/use.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/arthur/data/bugs/.gitattributes b/tests/arthur/data/bugs/.gitattributes deleted file mode 100644 index d159e22039..0000000000 --- a/tests/arthur/data/bugs/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -openglcurve.svg -crlf -resolve_linear.svg -crlf diff --git a/tests/arthur/data/bugs/gradient-defaults.svg b/tests/arthur/data/bugs/gradient-defaults.svg deleted file mode 100644 index cae3f52c1c..0000000000 --- a/tests/arthur/data/bugs/gradient-defaults.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/arthur/data/bugs/gradient_pen_fill.svg b/tests/arthur/data/bugs/gradient_pen_fill.svg deleted file mode 100644 index 9a76f62149..0000000000 --- a/tests/arthur/data/bugs/gradient_pen_fill.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/bugs/openglcurve.svg b/tests/arthur/data/bugs/openglcurve.svg deleted file mode 100644 index a0b43901e6..0000000000 --- a/tests/arthur/data/bugs/openglcurve.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/arthur/data/bugs/org_module.svg b/tests/arthur/data/bugs/org_module.svg deleted file mode 100644 index 44c90c9528..0000000000 --- a/tests/arthur/data/bugs/org_module.svg +++ /dev/null @@ -1,389 +0,0 @@ - - -]> - - - - -G -main overview -cluster1 - -Qt Library - -cluster1_01 - -QtCore.dll - -cluster1_02 - -QtGui.dll - -cluster2 - -about - -cluster2_01 - -about_dialog.hpp - -cluster2_02 - -ui_about_dialog.hpp - -cluster3 - -editor - -cluster3_01 - -docked_edits.hpp - -cluster3_02 - -tabbed_edits.hpp - -cluster3_03 - -editor_component.hpp - -cluster4 - -highlightner - -cluster4_01 - -hml_reader.hpp - -cluster4_02 - -language_builder.hpp - -cluster4_03 - -entity.hpp - -cluster4_04 - -highlightner.hpp - -cluster5 - -mainwindow - -cluster5_01 - -main_window.hpp - -cluster6 - -menubar_toolbar - -cluster6_01 - -actions.hpp - -cluster6_02 - -icons - -cluster6_02_001 - -icon_loader.hpp - -cluster6_02_002 - -ics_entity.hpp - -cluster6_02_003 - -ics_reader.hpp - -cluster7 - -main.cpp - - -QObject - -QObject - - -QAction - -QAction - - -QApplication - -QApplication - - -QDialog - -QDialog - - -QDockWidget - -QDockWidget - - -QIcon - -QIcon - - -QMainWindow - -QMainWindow - - -QTabWidget - -QTabWidget - - -QTextEdit - -QTextEdit - - -AboutDialog - -AboutDialog - - -AboutDialog->QDialog - - -inherits - - -Ui_AboutDialog - -Ui::AboutDialog - - -AboutDialog->Ui_AboutDialog - - -inherits - - -DockedEdits - -DockedEdits - - -DockedEdits->QDockWidget - - -inherits - - -TabbedEdits - -TabbedEdits - - -DockedEdits->TabbedEdits - - -uses - - -TabbedEdits->QTabWidget - - -inherits - - -EditorComponent - -EditorComponent - - -TabbedEdits->EditorComponent - - -uses - - -EditorComponent->QTextEdit - - -inherits - - -HmlReader - -HmlReader - - -HmlReader->QObject - - -inherits - - -Entity - -Entity - - -HmlReader->Entity - - -uses - - -LanguageBuilder - -LanguageBuilder - - -LanguageBuilder->HmlReader - - -uses - - -LanguageBuilder->Entity - - -uses - - -Highlightner - -Highlightner - - -LanguageBuilder->Highlightner - - -creates - - -Highlightner->QObject - - -inherits - - -MainWindow - -MainWindow - - -MainWindow->QMainWindow - - -inherits - - -MainWindow->AboutDialog - - -uses - - -MainWindow->DockedEdits - - -uses - - -Actions - -Actions - - -MainWindow->Actions - - -uses - - -Actions->QObject - - -inherits - - -Actions->QAction - - -uses - - -IconLoader - -IconLoader - - -IconLoader->QObject - - -inherits - - -IconLoader->QIcon - - -uses - - -IcsReader - -IcsReader - - -IconLoader->IcsReader - - -uses - - -IcsEntity - -IcsEntity - - -IcsReader->QObject - - -inherits - - -IcsReader->IcsEntity - - -uses - - -main - -main - - -main->QApplication - - -uses - - -main->MainWindow - - -uses - - - - diff --git a/tests/arthur/data/bugs/resolve_linear.svg b/tests/arthur/data/bugs/resolve_linear.svg deleted file mode 100644 index c1769b2b5f..0000000000 --- a/tests/arthur/data/bugs/resolve_linear.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - diff --git a/tests/arthur/data/bugs/resolve_radial.svg b/tests/arthur/data/bugs/resolve_radial.svg deleted file mode 100644 index 49fb0f8c3b..0000000000 --- a/tests/arthur/data/bugs/resolve_radial.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - diff --git a/tests/arthur/data/bugs/text_pens.svg b/tests/arthur/data/bugs/text_pens.svg deleted file mode 100644 index 3f7c9eb784..0000000000 --- a/tests/arthur/data/bugs/text_pens.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - Text should be drawn in black - Text should be drawn in red - Text should not be drawn at all - diff --git a/tests/arthur/data/framework.ini b/tests/arthur/data/framework.ini deleted file mode 100644 index d90d1c6a6a..0000000000 --- a/tests/arthur/data/framework.ini +++ /dev/null @@ -1,22 +0,0 @@ -[Blacklist] -PS=gearflowers.svg, kde-look.svg - -[1.1] -dir=1.1 -reference=http://www.w3.org/Graphics/SVG/Test/20030813/png/ -referencePrefix=full- - -[1.2] -dir=1.2 - -[bugs] -dir=bugs - -[qps] -dir=qps - -[random] -dir=random - -[oxygen] -dir=oxygen diff --git a/tests/arthur/data/images/alpha.png b/tests/arthur/data/images/alpha.png deleted file mode 100644 index e465b2586d..0000000000 Binary files a/tests/arthur/data/images/alpha.png and /dev/null differ diff --git a/tests/arthur/data/images/bitmap.png b/tests/arthur/data/images/bitmap.png deleted file mode 100644 index d21f8f51bb..0000000000 Binary files a/tests/arthur/data/images/bitmap.png and /dev/null differ diff --git a/tests/arthur/data/images/border.png b/tests/arthur/data/images/border.png deleted file mode 100644 index a3d2fed0a3..0000000000 Binary files a/tests/arthur/data/images/border.png and /dev/null differ diff --git a/tests/arthur/data/images/dome_argb32.png b/tests/arthur/data/images/dome_argb32.png deleted file mode 100644 index e3ccba0c13..0000000000 Binary files a/tests/arthur/data/images/dome_argb32.png and /dev/null differ diff --git a/tests/arthur/data/images/dome_indexed.png b/tests/arthur/data/images/dome_indexed.png deleted file mode 100644 index beefcd514e..0000000000 Binary files a/tests/arthur/data/images/dome_indexed.png and /dev/null differ diff --git a/tests/arthur/data/images/dome_indexed_mask.png b/tests/arthur/data/images/dome_indexed_mask.png deleted file mode 100644 index a62f29f40e..0000000000 Binary files a/tests/arthur/data/images/dome_indexed_mask.png and /dev/null differ diff --git a/tests/arthur/data/images/dome_mono.png b/tests/arthur/data/images/dome_mono.png deleted file mode 100644 index 950c2a7494..0000000000 Binary files a/tests/arthur/data/images/dome_mono.png and /dev/null differ diff --git a/tests/arthur/data/images/dome_mono_128.png b/tests/arthur/data/images/dome_mono_128.png deleted file mode 100644 index 77e48aaab7..0000000000 Binary files a/tests/arthur/data/images/dome_mono_128.png and /dev/null differ diff --git a/tests/arthur/data/images/dome_mono_palette.png b/tests/arthur/data/images/dome_mono_palette.png deleted file mode 100644 index dca3f59245..0000000000 Binary files a/tests/arthur/data/images/dome_mono_palette.png and /dev/null differ diff --git a/tests/arthur/data/images/dome_rgb32.png b/tests/arthur/data/images/dome_rgb32.png deleted file mode 100644 index 27bc02a545..0000000000 Binary files a/tests/arthur/data/images/dome_rgb32.png and /dev/null differ diff --git a/tests/arthur/data/images/dot.png b/tests/arthur/data/images/dot.png deleted file mode 100644 index 17a7b6a0ba..0000000000 Binary files a/tests/arthur/data/images/dot.png and /dev/null differ diff --git a/tests/arthur/data/images/face.png b/tests/arthur/data/images/face.png deleted file mode 100644 index 4f6172d83b..0000000000 Binary files a/tests/arthur/data/images/face.png and /dev/null differ diff --git a/tests/arthur/data/images/gam030.png b/tests/arthur/data/images/gam030.png deleted file mode 100644 index 904c9721bd..0000000000 Binary files a/tests/arthur/data/images/gam030.png and /dev/null differ diff --git a/tests/arthur/data/images/gam045.png b/tests/arthur/data/images/gam045.png deleted file mode 100644 index b649a8a54f..0000000000 Binary files a/tests/arthur/data/images/gam045.png and /dev/null differ diff --git a/tests/arthur/data/images/gam056.png b/tests/arthur/data/images/gam056.png deleted file mode 100644 index e5f959dc96..0000000000 Binary files a/tests/arthur/data/images/gam056.png and /dev/null differ diff --git a/tests/arthur/data/images/gam100.png b/tests/arthur/data/images/gam100.png deleted file mode 100644 index 6c7ba5f1ed..0000000000 Binary files a/tests/arthur/data/images/gam100.png and /dev/null differ diff --git a/tests/arthur/data/images/gam200.png b/tests/arthur/data/images/gam200.png deleted file mode 100644 index daa20fcbc4..0000000000 Binary files a/tests/arthur/data/images/gam200.png and /dev/null differ diff --git a/tests/arthur/data/images/image.png b/tests/arthur/data/images/image.png deleted file mode 100644 index 85d486a790..0000000000 Binary files a/tests/arthur/data/images/image.png and /dev/null differ diff --git a/tests/arthur/data/images/mask.png b/tests/arthur/data/images/mask.png deleted file mode 100644 index c3f3b1b6ca..0000000000 Binary files a/tests/arthur/data/images/mask.png and /dev/null differ diff --git a/tests/arthur/data/images/mask_100.png b/tests/arthur/data/images/mask_100.png deleted file mode 100644 index fc950dc7ed..0000000000 Binary files a/tests/arthur/data/images/mask_100.png and /dev/null differ diff --git a/tests/arthur/data/images/masked.png b/tests/arthur/data/images/masked.png deleted file mode 100644 index 6debec534d..0000000000 Binary files a/tests/arthur/data/images/masked.png and /dev/null differ diff --git a/tests/arthur/data/images/paths.qps b/tests/arthur/data/images/paths.qps deleted file mode 100644 index 414b1628a2..0000000000 --- a/tests/arthur/data/images/paths.qps +++ /dev/null @@ -1,32 +0,0 @@ -setPen black -setBrush 7f7fff - -path_moveTo star 50 0 -path_lineTo star 30 90 -path_lineTo star 100 60 -path_lineTo star 0 20 -path_lineTo star 80 100 - -setFont "times" 50 -path_addText text 0 50 "ABCD, 1234, abcd, #¤%&" - -path_addRect rectncircle 0 0 75 75 -path_addEllipse rectncircle 25 25 75 75 -path_setFillRule rectncircle winding - -path_moveTo curve 100 0 -path_cubicTo curve 100 100 50 50 0 100 - -begin_block drawing -drawPath star -translate 100 0 -drawPath rectncircle -translate 100 0 -drawPath curve -translate -200 100 -drawPath text -end_block - -translate 50 100 -rotate 10 -repeat_block drawing \ No newline at end of file diff --git a/tests/arthur/data/images/pens.qps b/tests/arthur/data/images/pens.qps deleted file mode 100644 index e73b15f982..0000000000 --- a/tests/arthur/data/images/pens.qps +++ /dev/null @@ -1,96 +0,0 @@ -translate 10 10 - -begin_block penstyles -setPen black 0 solidline flatcap -drawLine 0 0 100 0 -setPen black 0 dashline flatcap -drawLine 100 0 100 40 -setPen black 0 dotline flatcap -drawLine 100 40 200 0 -setPen black 0 dashdotline flatcap -drawLine 200 0 300 0 -setPen black 0 dashdotdotline flatcap -drawLine 300 0 400 40 - -translate 0 50 -setPen blue 2 solidline flatcap -drawLine 0 0 100 0 -setPen blue 2 dashline flatcap -drawLine 100 0 100 40 -setPen blue 2 dotline flatcap -drawLine 100 40 200 0 -setPen blue 2 dashdotline flatcap -drawLine 200 0 300 0 -setPen blue 2 dashdotdotline flatcap -drawLine 300 0 400 40 - -translate 0 50 -setPen red 5 solidline flatcap -drawLine 0 0 100 0 -setPen red 5 dashline flatcap -drawLine 100 0 100 40 -setPen red 5 dotline flatcap -drawLine 100 40 200 0 -setPen red 5 dashdotline flatcap -drawLine 200 0 300 0 -setPen red 5 dashdotdotline flatcap -drawLine 300 0 400 40 -end_block - -translate 0 50 -scale 1 2 -repeat_block penstyles - - -# Test cap styles -resetMatrix -translate 420 10 -setPen green 5 dashdotline flatcap -drawLine 0 0 200 0 -setPen green 5 dashdotline roundcap -drawLine 0 20 200 20 -setPen green 5 dashdotline squarecap -drawLine 0 40 200 40 - - -# Test join styles -resetMatrix -translate 420 80 -setBrush nobrush -begin_block joinstyles -setPen orange 10 solidline flatcap miterjoin -drawPolyline [ 0 0 80 0 80 80 0 80 ] - -translate 0 100 -setPen aquamarine 10 solidline squarecap beveljoin -drawPolyline [ 0 0 80 0 80 80 0 80 ] - -translate 0 100 -setPen purple 10 solidline roundcap roundjoin -drawPolyline [ 0 0 80 0 80 80 0 80 ] -end_block - -translate 130 -200 -scale 2 1 -rotate 1 -repeat_block joinstyles - -# transparent lines -resetMatrix -translate 10 400 -setPen #7f000000 -drawLine 0 0 50 0 -setPen #7f000000 1 SolidLine -drawLine 0 10 50 10 -setPen #7f000000 5 SolidLine -drawLine 0 20 50 20 -setPen #7f000000 10 SolidLine -drawLine 0 30 50 30 -setPen #7f000000 -drawLine 0 0 0 50 -setPen #7f000000 1 SolidLine -drawLine 10 0 10 50 -setPen #7f000000 5 SolidLine -drawLine 20 0 20 50 -setPen #7f000000 10 SolidLine -drawLine 30 0 30 50 diff --git a/tests/arthur/data/images/sign.png b/tests/arthur/data/images/sign.png deleted file mode 100644 index 6aac7e150a..0000000000 Binary files a/tests/arthur/data/images/sign.png and /dev/null differ diff --git a/tests/arthur/data/images/solid.png b/tests/arthur/data/images/solid.png deleted file mode 100644 index 371e9c1aee..0000000000 Binary files a/tests/arthur/data/images/solid.png and /dev/null differ diff --git a/tests/arthur/data/images/struct-image-01.jpg b/tests/arthur/data/images/struct-image-01.jpg deleted file mode 100644 index a74e07223b..0000000000 Binary files a/tests/arthur/data/images/struct-image-01.jpg and /dev/null differ diff --git a/tests/arthur/data/images/struct-image-01.png b/tests/arthur/data/images/struct-image-01.png deleted file mode 100644 index 4ed08406dc..0000000000 Binary files a/tests/arthur/data/images/struct-image-01.png and /dev/null differ diff --git a/tests/arthur/data/qps/aliasing.qps b/tests/arthur/data/qps/aliasing.qps deleted file mode 100644 index 59878f9c4d..0000000000 --- a/tests/arthur/data/qps/aliasing.qps +++ /dev/null @@ -1,156 +0,0 @@ - -path_moveTo convexPath 25 0 -path_lineTo convexPath 50 50 -path_lineTo convexPath 25 25 -path_lineTo convexPath 0 50 -path_closeSubpath convexPath - -pixmap_load border.png pixmap - -setRenderHint LineAntialiasing false -translate 10 10 - -begin_block drawing - setPen black 1 - setBrush 7f7fff - drawPath convexPath - - setFont "monospace" 8 - setPen black - drawText 0 68 "QwErTy@" - - - setPen black 1 - setBrush 7f7fff - drawRect 0 80 10 5 - - setPen black 1 - setBrush noBrush - drawRect 20 80 10 5 - - setPen noPen - setBrush 7f7fff - drawRect 40 80 10 5 - - - setPen black 2 - setBrush 7f7fff - drawRect 0 90 10 5 - - setPen black 2 - setBrush noBrush - drawRect 20 90 10 5 - - setPen noPen - setBrush 7f7fff - drawRect 40 90 10 5 - - - setPen black 3 - setBrush 7f7fff - drawRect 0 100 10 5 - - setPen black 3 - setBrush noBrush - drawRect 20 100 10 5 - - setPen noPen - setBrush 7f7fff - drawRect 40 100 10 5 - - - setPen black 1 - setBrush noBrush - drawLine 10 110 20 120 - drawLine 30 120 40 110 - - setPen black 2 - setBrush noBrush - drawLine 10 120 20 130 - drawLine 30 130 40 120 - - setPen black 3 - setBrush noBrush - drawLine 10 130 20 140 - drawLine 30 140 40 130 - - drawPixmap pixmap 0 150 - - setRenderHint SmoothPixmapTransform false - drawPixmap pixmap 20 150 15 15 0 0 10 10 - -end_block - -translate 0 180 -setRenderHint LineAntialiasing true -repeat_block drawing -drawText 15 185 "0.0" - -resetMatrix -translate 70.2 10.2 -setRenderHint LineAntialiasing false -repeat_block drawing -translate 0 180 -setRenderHint LineAntialiasing true -repeat_block drawing -translate -0.2 -0.2 -drawText 15 185 "0.2" - - -resetMatrix -translate 130.4 10.4 -setRenderHint LineAntialiasing false -repeat_block drawing -translate 0 180 -setRenderHint LineAntialiasing true -repeat_block drawing -translate -0.4 -0.4 -drawText 15 185 "0.4" - - -resetMatrix -translate 190.5 10.5 -setRenderHint LineAntialiasing false -repeat_block drawing -translate 0 180 -setRenderHint LineAntialiasing true -repeat_block drawing -translate -0.5 -0.5 -drawText 15 185 "0.5" - - -resetMatrix -translate 250.6 10.6 -setRenderHint LineAntialiasing false -repeat_block drawing -translate 0 180 -setRenderHint LineAntialiasing true -repeat_block drawing -translate -0.6 -0.6 -drawText 15 185 "0.6" - - -resetMatrix -translate 310.8 10.8 -setRenderHint LineAntialiasing false -repeat_block drawing -translate 0 180 -setRenderHint LineAntialiasing true -repeat_block drawing -translate -0.8 -0.8 -drawText 15 185 "0.8" - - -resetMatrix -translate 371 11 -setRenderHint LineAntialiasing false -repeat_block drawing -translate 0 180 -setRenderHint LineAntialiasing true -repeat_block drawing -drawText 15 185 "1.0" - - -resetMatrix -drawText 430 95 "Aliased" -drawText 430 275 "Anti-Aliased" \ No newline at end of file diff --git a/tests/arthur/data/qps/aliasing_qps.png b/tests/arthur/data/qps/aliasing_qps.png deleted file mode 100644 index 183129b5e7..0000000000 Binary files a/tests/arthur/data/qps/aliasing_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/alphas.qps b/tests/arthur/data/qps/alphas.qps deleted file mode 100644 index 2f72d56203..0000000000 --- a/tests/arthur/data/qps/alphas.qps +++ /dev/null @@ -1,63 +0,0 @@ -# Background --[ start ]--------------- -setPen NoPen - -# Red alpha rect -setBrush #7fff0000 -drawRect 0 0 200 900 -drawRect 400 0 200 900 - -# Blue alpha rect -setBrush #7f0000ff -drawRect 200 0 200 900 -drawRect 600 0 200 900 - - - -# Normal ---------------------------------------- -setBrush #ffff00ff -setPen #ff00ff00 8 SolidLine flatcap miterjoin - -path_moveTo star 100 510 -path_lineTo star 30 590 -path_lineTo star 180 530 -path_lineTo star 20 530 -path_lineTo star 170 590 - -begin_block allItems -drawLine 0 10 200 10 -drawRect 10 50 180 40 -drawEllipse 50 150 100 50 -drawPolygon [ 10 230 50 210 50 280 100 280 150 230 180 280] winding -drawPolyline [ 85 380 50 310 50 360 100 360 150 310 180 360] -drawRoundRect 10 400 80 100 100 100 -drawRoundRect 110 400 80 100 50 50 -drawPath star - -drawPixmap solid.png 10 600 50 50 -drawPixmap alpha.png 10 675 50 50 -drawPixmap masked.png 10 750 50 50 -drawTiledPixmap solid.png 110 600 80 75 80 90 -drawTiledPixmap alpha.png 110 675 80 75 80 90 -drawTiledPixmap masked.png 110 750 80 75 80 90 -end_block - - -# Normal 2nd Quad ------------------------------- -setBrush #ffff00ff -setPen #ff00ff00 10 SolidLine roundcap roundjoin -translate 200 0 -repeat_block allItems - - -# Alpha ----------------------------------------- -setBrush #80ff00ff -setPen #8000ff00 10 SolidLine flatcap miterjoin -translate 200 0 -repeat_block allItems - - -# Alpha 2nd Quad -------------------------------- -setBrush #80ff00ff -setPen #8000ff00 10 SolidLine roundcap roundjoin -translate 200 0 -repeat_block allItems diff --git a/tests/arthur/data/qps/alphas_qps.png b/tests/arthur/data/qps/alphas_qps.png deleted file mode 100644 index 332922a117..0000000000 Binary files a/tests/arthur/data/qps/alphas_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/arcs.qps b/tests/arthur/data/qps/arcs.qps deleted file mode 100644 index 855c6456d3..0000000000 --- a/tests/arthur/data/qps/arcs.qps +++ /dev/null @@ -1,65 +0,0 @@ -setRenderHint LineAntialiasing - -setPen red - -drawEllipse 0 0 600 400 - -path_moveTo arcs 300 200 -path_arcTo arcs 0 0 600 400 0 10 -path_closeSubpath arcs - -path_moveTo arcs 300 200 -path_arcTo arcs 0 0 600 400 20 30 -path_closeSubpath arcs - -path_moveTo arcs 300 200 -path_arcTo arcs 0 0 600 400 60 45 -path_closeSubpath arcs - -path_moveTo arcs 300 200 -path_arcTo arcs 0 0 600 400 115 60 -path_closeSubpath arcs - -path_moveTo arcs 300 200 -path_arcTo arcs 0 0 600 400 180 90 -path_closeSubpath arcs - -path_moveTo arcs 590 200 -path_arcTo arcs 10 10 580 380 0 360 -path_closeSubpath arcs - -path_moveTo arcs 300 200 -path_arcTo arcs 20 20 560 360 0 -10 -path_closeSubpath arcs - -path_moveTo arcs 300 200 -path_arcTo arcs 20 20 560 360 -20 -30 -path_closeSubpath arcs - -path_moveTo arcs 300 200 -path_arcTo arcs 20 20 560 360 -60 -45 -path_closeSubpath arcs - -path_moveTo arcs 300 200 -path_arcTo arcs 20 20 560 360 -115 -60 -path_closeSubpath arcs - -path_moveTo arcs 300 200 -path_arcTo arcs 20 20 560 360 -180 -90 -path_closeSubpath arcs - -setPen black 1 solidline -setBrush #3f00ff00 -drawPath arcs - -# Then again with a matrix set... -translate 200 400 -rotate 10 -scale 0.5 0.5 -setPen red -setBrush nobrush -drawEllipse 0 0 600 400 - -setPen black 1 solidline -setBrush #3f0000ff -drawPath arcs \ No newline at end of file diff --git a/tests/arthur/data/qps/arcs2.qps b/tests/arthur/data/qps/arcs2.qps deleted file mode 100644 index a2227b6129..0000000000 --- a/tests/arthur/data/qps/arcs2.qps +++ /dev/null @@ -1,44 +0,0 @@ -drawArc 100 100 100 100 0 1440 -drawArc 100 100 100 100 1440 1440 -drawArc 100 100 100 100 2880 1440 -drawArc 100 100 100 100 4320 1440 - -drawArc 100 200 100 100 0 -1440 -drawArc 100 200 100 100 -1440 -1440 -drawArc 100 200 100 100 -2880 -1440 -drawArc 100 200 100 100 -4320 -1440 - -drawArc 200 100 100 100 720 1440 -drawArc 200 100 100 100 2160 1440 -drawArc 200 100 100 100 3600 1440 -drawArc 200 100 100 100 5040 1440 - -drawArc 200 200 100 100 -720 -1440 -drawArc 200 200 100 100 -2160 -1440 -drawArc 200 200 100 100 -3600 -1440 -drawArc 200 200 100 100 -5040 -1440 - - -drawArc 300 100 100 100 3840 480 -drawArc 300 200 100 100 -3840 -480 - -drawArc 300 100 100 100 1600 1340 - -setPen black -drawArc 400 100 200 200 0 5760 -setPen white -drawArc 400 100 200 200 960 960 -drawArc 400 100 200 200 2880 960 -drawArc 400 100 200 200 4800 960 - -setPen black -drawArc 100 350 300 300 160 5760 -drawArc 100 350 300 300 320 5760 -drawArc 100 350 300 300 1920 5760 -drawArc 100 350 300 300 2080 5760 -drawArc 100 350 300 300 3680 5760 -drawArc 100 350 300 300 3840 5760 -drawArc 100 350 300 300 5440 5760 -drawArc 100 350 300 300 5600 5760 -setPen white -drawArc 100 350 300 300 0 5760 diff --git a/tests/arthur/data/qps/arcs2_qps.png b/tests/arthur/data/qps/arcs2_qps.png deleted file mode 100644 index 2c51aadaa9..0000000000 Binary files a/tests/arthur/data/qps/arcs2_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/arcs_qps.png b/tests/arthur/data/qps/arcs_qps.png deleted file mode 100644 index 7f4d889ba3..0000000000 Binary files a/tests/arthur/data/qps/arcs_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/background.qps b/tests/arthur/data/qps/background.qps deleted file mode 100644 index 3ea7b32798..0000000000 --- a/tests/arthur/data/qps/background.qps +++ /dev/null @@ -1,133 +0,0 @@ -translate 10 30 -setBackground 7f7fff -setBackgroundMode Transparent -setPen ff7f7f - -path_moveTo path 0 0 -path_lineTo path 25 0 -path_cubicTo path 50 0 25 25 25 50 -path_lineTo path 0 50 - -bitmap_load bitmap.png bitmap - -begin_block drawing - save - drawRect 0 0 50 50 - - translate 60 0 - drawEllipse 0 0 50 50 - - translate 60 0 - drawPolygon [0 0 50 0 25 50 25 25] - - translate 60 0 - drawPath path - - translate 60 0 - drawPie 0 0 50 50 1440 2000 - - translate 60 0 - drawChord 0 0 50 50 1440 2000 - - translate 60 0 - drawLine 0 0 50 0 - drawLine 0 0 50 50 - drawLine 0 0 0 50 - - translate 60 0 - drawPolyline [0 0 50 0 25 50 25 25] - - translate 60 0 - drawArc 0 0 50 50 1440 2000 - - translate 60 0 - drawText 0 10 "Jambi-Bambi" - - translate 80 0 - drawPixmap bitmap 0 0 - restore - - save - setRenderHint Antialiasing - translate 5 55 - drawRect 0 0 50 50 - - translate 60 0 - drawEllipse 0 0 50 50 - - translate 60 0 - drawPolygon [0 0 50 0 25 50 25 25] - - translate 60 0 - drawPath path - - translate 60 0 - drawPie 0 0 50 50 1440 2000 - - translate 60 0 - drawChord 0 0 50 50 1440 2000 - - translate 60 0 - drawLine 0 0 50 0 - drawLine 0 0 50 50 - drawLine 0 0 0 50 - - translate 60 0 - drawPolyline [0 0 50 0 25 50 25 25] - - translate 60 0 - drawArc 0 0 50 50 1440 2000 - - translate 60 0 - drawText 0 10 "Jambi-Bambi" - - translate 80 0 - drawPixmap bitmap 0 0 - restore -end_block - -translate 0 160 -setBackgroundMode Transparent -setPen ff7f7f 0 dotline flatcap beveljoin -repeat_block drawing - -translate 0 160 -setBackgroundMode Opaque -setPen ff7f7f 0 dotline flatcap beveljoin -repeat_block drawing - -translate 0 160 -setBackgroundMode Transparent -setPen ff7f7f 4 dashline flatcap beveljoin -repeat_block drawing - -translate 0 160 -setBackgroundMode OpaqueMode -setPen ff7f7f 4 dashline flatcap beveljoin -repeat_block drawing - -resetMatrix - -translate 5 5 - -setBrush nobrush -setPen black -setBackgroundMode transparent -drawText 10 15 "TransparentMode with solid 0-width pen" -drawRect 0 0 685 135 - -translate 0 160 -drawText 10 15 "TransparentMode with dotted 0-width pen" -drawRect 0 0 685 135 - -translate 0 160 -drawText 10 15 "OpaqueMode with dotted 0-width pen" -drawRect 0 0 685 135 - -translate 0 160 -drawText 10 15 "TransparentMode with dotted 4-width pen" -drawRect 0 0 685 135 - -translate 0 160 -drawText 10 15 "OpaqueMode with solid 4-width pen" -drawRect 0 0 685 135 diff --git a/tests/arthur/data/qps/background_brush.qps b/tests/arthur/data/qps/background_brush.qps deleted file mode 100644 index e542b0670b..0000000000 --- a/tests/arthur/data/qps/background_brush.qps +++ /dev/null @@ -1,2 +0,0 @@ -setBrush #00ff00 crosspattern -import "background.qps" \ No newline at end of file diff --git a/tests/arthur/data/qps/background_brush_qps.png b/tests/arthur/data/qps/background_brush_qps.png deleted file mode 100644 index d16dfcc1e1..0000000000 Binary files a/tests/arthur/data/qps/background_brush_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/background_qps.png b/tests/arthur/data/qps/background_qps.png deleted file mode 100644 index bcd4703b86..0000000000 Binary files a/tests/arthur/data/qps/background_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/beziers.qps b/tests/arthur/data/qps/beziers.qps deleted file mode 100644 index 7bd7ef976d..0000000000 --- a/tests/arthur/data/qps/beziers.qps +++ /dev/null @@ -1,144 +0,0 @@ - -setRenderHint LineAntialiasing - -translate 20 20 -path_moveTo fullSize 0 0 -path_cubicTo fullSize 200 100 -100 100 100 0 - -path_moveTo fullSize 0 200 -path_cubicTo fullSize 0 100 100 100 100 200 - -path_moveTo fullSize 0 250 -path_cubicTo fullSize 50 200 50 200 100 250 -drawPath fullSize - -translate 110 0 -scale 10 10 -path_moveTo medSize 0 0 -path_cubicTo medSize 20 10 -10 10 10 0 - -path_moveTo medSize 0 20 -path_cubicTo medSize 0 10 10 10 10 20 - -path_moveTo medSize 0 25 -path_cubicTo medSize 5 20 5 20 10 25 -drawPath medSize - -resetMatrix -translate 240 20 -scale 100 100 -path_moveTo smallSize 0 0 -path_cubicTo smallSize 2 1 -1 1 1 0 - -path_moveTo smallSize 0 2 -path_cubicTo smallSize 0 1 1 1 1 2 - -path_moveTo smallSize 0 2.5 -path_cubicTo smallSize 0.5 2 0.5 2 1 2.5 -drawPath smallSize - -resetMatrix -translate 20 300 -drawPath medSize - -resetMatrix -translate 250 -100 -path_moveTo maxSize 0 500 -path_cubicTo maxSize 1000 0 -500 0 500 500 -drawPath maxSize - -setRenderHint Antialiasing off -resetMatrix - -path_moveTo path1 0 0 -path_cubicTo path1 10 10 0 10 10 0 - -path_moveTo path2 0 0 -path_cubicTo path2 15 15 -5 15 10 0 - -path_moveTo path3 0 0 -path_cubicTo path3 20 20 -10 20 10 0 - -path_moveTo path4 0 0 -path_cubicTo path4 0 5 10 10 0 15 - -path_moveTo path5 0 10 -path_cubicTo path5 10 10 -10 20 0 0 - -path_moveTo path6 0 0 -path_cubicTo path6 10 5 -10 10 0 15 - -setPen black 2 -setBrush nobrush - -translate 10 500 -scale 3 3 -begin_block paths -save -drawPath path1 -translate 20 0 -drawPath path2 -translate 20 0 -drawPath path3 -translate 20 0 -drawPath path4 -translate 20 0 -drawPath path5 -translate 20 0 -drawPath path6 -restore -end_block - -setPen nopen -setBrush black - -translate 0 20 -repeat_block paths - -setRenderHint Antialiasing - -setPen black 2 -setBrush nobrush - -translate 120 -20 -repeat_block paths - -setPen nopen -setBrush black - -translate 0 20 -repeat_block paths - -resetMatrix -path_moveTo miterPath 20 0 -path_cubicTo miterPath 20 20 0 0 1 0 -path_lineTo miterPath -1 -0.2 - -setBrush nobrush - -translate 50 660 -scale 5 5 - -setPen black 4 solidline flatcap miterjoin -drawPath miterPath -setPen red 0 -drawPath miterPath - -path_moveTo miterPath2 21 0.2 -path_lineTo miterPath2 19 0 -path_cubicTo miterPath2 20 0 0 20 0 0 - -translate 30 0 -setPen black 4 solidline flatcap miterjoin -drawPath miterPath2 -setPen red 0 -drawPath miterPath2 - -path_moveTo wonkyPath 0 0 -path_cubicTo wonkyPath 5 15 20 0 17 0 - -translate 30 0 -setPen black 4 solidline flatcap miterjoin -drawPath wonkyPath -setPen red 0 -drawPath wonkyPath diff --git a/tests/arthur/data/qps/beziers_qps.png b/tests/arthur/data/qps/beziers_qps.png deleted file mode 100644 index 4fb1154f33..0000000000 Binary files a/tests/arthur/data/qps/beziers_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/bitmaps.qps b/tests/arthur/data/qps/bitmaps.qps deleted file mode 100644 index 120242a637..0000000000 --- a/tests/arthur/data/qps/bitmaps.qps +++ /dev/null @@ -1,163 +0,0 @@ - -#setRenderHint SmoothPixmapTransform - -translate 10 50 -setBackground ff7f7f -setPen 3f3f9f - -bitmap_load dome_mono.png the_pixmap - -save - # Draw with opaque pen/bg in transparent/opaque mode - setBackgroundMode Transparent - drawPixmap the_pixmap 0 0 - setBackgroundMode Opaque - drawPixmap the_pixmap 110 0 - - translate 220 0 - - # Draw with alpha pen/bg in transparent/opaque mode - save - setBackground 7fff7f7f - setPen 7f3f3f9f - setBackgroundMode Transparent - drawPixmap the_pixmap 0 0 - setBackgroundMode Opaque - drawPixmap the_pixmap 110 0 - restore - - translate 220 0 - - # Draw with rotated opaque pen/bg in transparent/opaque mode - setBackgroundMode Transparent - save - translate 50 50 - rotate 10 - translate -50 -50 - drawPixmap the_pixmap 0 0 - restore - setBackgroundMode Opaque - translate 110 0 - save - translate 50 50 - rotate 10 - translate -50 -50 - drawPixmap the_pixmap 0 0 - restore -restore - -translate 0 150 - -save - setBackgroundMode Transparent - drawTiledPixmap the_pixmap 0 0 200 100 - setBackgroundMode Opaque - drawTiledPixmap the_pixmap 210 0 200 100 - - translate 440 -10 - save - rotate 10 - drawTiledPixmap the_pixmap 0 0 200 100 - restore -restore - -translate 0 150 -save - setBackgroundMode Transparent - drawTiledPixmap the_pixmap 0 0 200 100 10 20 - setBackgroundMode Opaque - drawTiledPixmap the_pixmap 210 0 200 100 10 20 - - translate 440 -10 - save - rotate 10 - drawTiledPixmap the_pixmap 0 0 200 100 10 20 - restore -restore - - -pixmap_setMask the_pixmap mask_100.png -drawPixmap the_pixmap 0 150 -setBackgroundMode Opaque -drawPixmap the_pixmap 110 150 - -translate 220 150 -save - translate 50 50 - rotate 10 - translate -50 -50 - setBackgroundMode Transparent - drawPixmap the_pixmap 0 0 -restore - -translate 110 0 -save - translate 50 50 - rotate 10 - translate -50 -50 - setBackgroundMode Opaque - drawPixmap the_pixmap 0 0 -restore - -resetMatrix -translate 10 650 -bitmap_load dome_mono.png the_bitmap -setBackgroundMode Transparent - -begin_block draw_subrected - drawPixmap the_bitmap 0 0 50 50 0 0 50 50 - drawPixmap the_bitmap 50 0 50 50 50 0 50 50 - drawPixmap the_bitmap 0 50 50 50 0 50 50 50 - drawPixmap the_bitmap 50 50 50 50 50 50 50 50 -end_block - -translate 110 0 -setBackgroundMode Opaque -repeat_block draw_subrected - -translate 110 0 -save - translate 20 -10 - rotate 10 - setBackgroundMode Transparent - repeat_block draw_subrected -restore - -translate 110 0 -save - translate 20 -10 - rotate 10 - setBackgroundMode Opaque - repeat_block draw_subrected -restore - -# Some helpful texts - -resetMatrix -setPen black -drawText 10 40 "Transparent" -drawText 120 40 "Opaque" -drawText 230 40 "Trans w/alpha" -drawText 340 40 "Opaque w/alpha" -drawText 450 40 "Trans w/xform" -drawText 560 40 "Opaque w/xform" - -drawText 10 190 "Transparent tiled" -drawText 220 190 "Opaque tiled" -drawText 440 190 "Opaque w/xform" - -drawText 10 340 "Transparent tiled w/offset" -drawText 220 340 "Opaque tiled w/offset" -drawText 440 340 "Opaque w/xform w/offset" - -drawText 10 490 "Trans masked" -drawText 120 490 "Opaque masked" -drawText 230 490 "masked w/xform" -drawText 340 490 "masked w/xform" - -drawText 10 640 "Subrected" -drawText 110 640 "Subrected opaque" -drawText 220 640 "subrect w/xform" -drawText 330 640 "subrect w/xform opaque" - - diff --git a/tests/arthur/data/qps/bitmaps_qps.png b/tests/arthur/data/qps/bitmaps_qps.png deleted file mode 100644 index b20d6ba097..0000000000 Binary files a/tests/arthur/data/qps/bitmaps_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/borderimage.qps b/tests/arthur/data/qps/borderimage.qps deleted file mode 100644 index 8d2e54b302..0000000000 --- a/tests/arthur/data/qps/borderimage.qps +++ /dev/null @@ -1,164 +0,0 @@ -image_load borderimage.png borderimage - -translate -128 -128 -begin_block draw_border - -# top -drawImage borderimage 0 0 16 16 0 0 16 16 -drawImage borderimage 16 0 36 16 16 0 32 16 -drawImage borderimage 52 0 16 16 48 0 16 16 - -# sides -drawImage borderimage 0 16 16 16 0 16 16 32 -drawImage borderimage 52 16 16 16 48 16 16 32 - -#bottom -drawImage borderimage 0 32 16 16 0 48 16 16 -drawImage borderimage 16 32 36 16 16 48 32 16 -drawImage borderimage 52 32 16 16 48 48 16 16 - -end_block draw_border - -resetMatrix - -begin_block draw_column - -translate 1 1 -repeat_block draw_border -translate 0.1 64.1 -repeat_block draw_border -translate 0.1 64.1 -repeat_block draw_border -translate 0.1 64.1 -repeat_block draw_border -translate 0.1 64.1 -repeat_block draw_border -translate 0.1 64.1 -repeat_block draw_border -translate 0.1 64.1 -repeat_block draw_border -translate 0.1 64.1 -repeat_block draw_border -translate 0.1 64.1 -repeat_block draw_border -translate 0.1 64.1 -repeat_block draw_border - -end_block draw_column - -setRenderHint Antialiasing - -resetMatrix -translate 72 0 - -repeat_block draw_column - -resetMatrix -scale 1.25 1.25 -translate 144 0 - -repeat_block draw_border - -resetMatrix -scale 1.25 1.25 -translate 246 0 -rotate 30 - -repeat_block draw_border - -setRenderHint SmoothPixmapTransform - -resetMatrix -scale 1.25 1.25 -translate 144 120 - -repeat_block draw_border - -resetMatrix -scale 1.25 1.25 -translate 246 120 -rotate 30 - -repeat_block draw_border - -resetMatrix -translate 215 260 -scale 3.55 3.55 -rotate 30 - -repeat_block draw_border - -resetMatrix -setRenderHint SmoothPixmapTransform off -setRenderHint Antialiasing off - -translate 480 627 -rotate 180 -repeat_block draw_column - -resetMatrix -setRenderHint Antialiasing - -translate 552 627 -rotate 180 -repeat_block draw_column - -resetMatrix -setRenderHint Antialiasing off - -translate 200.1 520.1 - -begin_block one_pixel_border -drawImage borderimage 0 0 16 16 0 0 16 16 -drawImage borderimage 16 0 64 16 16 0 1 1 -drawImage borderimage 80 0 16 16 48 0 16 16 - -drawImage borderimage 0 16 16 64 16 0 1 1 -drawImage borderimage 80 16 16 64 16 0 1 1 - -drawImage borderimage 0 80 16 16 0 48 16 16 -drawImage borderimage 16 80 64 16 16 0 1 1 -drawImage borderimage 80 80 16 16 48 48 16 16 -end_block one_pixel_border - -resetMatrix - -translate 205.1 626.1 -scale 0.4 0.4 - -repeat_block one_pixel_border - -resetMatrix - -translate 255.1 624.1 -scale 0.4 0.4 -rotate 10 - -repeat_block one_pixel_border - -resetMatrix - -setPen red - -drawRect 0 0 70 680 -drawText 10 670 "aa off" - -drawRect 72 0 70 680 -drawText 80 670 "aa on" - -drawRect 409 0 70 680 -drawText 419 650 "rot 180" -drawText 419 670 "aa off" - -drawRect 481 0 70 680 -drawText 491 650 "rot 180" -drawText 491 670 "aa on" - -drawRect 164 0 224 124 -drawText 174 114 "smoothpixmaptransform off" - -drawRect 164 128 224 134 -drawText 174 252 "smoothpixmaptransform on" - -drawRect 200 520 97 188 -drawText 210 698 "1x1 edges" diff --git a/tests/arthur/data/qps/borderimage_qps.png b/tests/arthur/data/qps/borderimage_qps.png deleted file mode 100644 index ed51d5f60d..0000000000 Binary files a/tests/arthur/data/qps/borderimage_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/brush_pens.qps b/tests/arthur/data/qps/brush_pens.qps deleted file mode 100644 index c0177a75c9..0000000000 --- a/tests/arthur/data/qps/brush_pens.qps +++ /dev/null @@ -1,101 +0,0 @@ -path_addRect p 0 0 75 75 -path_addEllipse p 25 25 75 75 - -translate 10 10 - -begin_block setup_gradient - gradient_clearStops - gradient_appendStop 0 red - gradient_appendStop 0.1 blue - gradient_appendStop 0.2 yellow - gradient_appendStop 0.3 cyan - gradient_appendStop 0.4 magenta - gradient_appendStop 0.5 green - gradient_appendStop 0.6 black - gradient_appendStop 0.7 indianred - gradient_appendStop 0.8 white - gradient_appendStop 0.9 orange - gradient_appendStop 1 blue - gradient_setLinear 0 0 100 100 -end_block - -setPen brush 0 -setBrush nobrush - -begin_block drawing - save - drawLine 0 0 100 100 - - translate 0 100 - drawPath p - - translate 0 110 - drawRect 0 0 100 100 - - translate 0 110 - drawPolyline [0 0 100 0 50 50] - - drawPoint 40 40 - drawPoint 41 40 - drawPoint 42 40 - drawPoint 43 40 - drawPoint 44 40 - drawPoint 45 40 - drawPoint 46 40 - drawPoint 47 40 - drawPoint 48 40 - drawPoint 49 40 - drawPoint 50 40 - - restore -end_block - -save - translate 110 0 - save - setRenderHint Antialiasing - repeat_block drawing - restore - - setBrush dome_rgb32.png - setPen brush 0 - setBrush nobrush - - translate 110 0 - repeat_block drawing - - translate 110 0 - save - setRenderHint Antialiasing - repeat_block drawing - restore -restore - -translate 0 0 - -save - repeat_block setup_gradient - setPen brush 5 - setBrush nobrush - translate 0 350 - repeat_block drawing - - translate 110 0 - save - setRenderHint Antialiasing - repeat_block drawing - restore - - setBrush dome_rgb32.png - setPen brush 5 - setBrush nobrush - - translate 110 0 - repeat_block drawing - - translate 110 0 - save - setRenderHint Antialiasing - repeat_block drawing - restore -restore diff --git a/tests/arthur/data/qps/brush_pens_qps.png b/tests/arthur/data/qps/brush_pens_qps.png deleted file mode 100644 index 555cfadecb..0000000000 Binary files a/tests/arthur/data/qps/brush_pens_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/brushes.qps b/tests/arthur/data/qps/brushes.qps deleted file mode 100644 index 2291e29ef4..0000000000 --- a/tests/arthur/data/qps/brushes.qps +++ /dev/null @@ -1,77 +0,0 @@ -# Fill the background -drawRect 0 0 width height - -setRenderHint Antialiasing -setRenderHint SmoothPixmapTransform - -translate 10 10 -# Draw all the pattern types as 40x40 rects using green, transparent background -begin_block drawrects -setBrush green Dense1Pattern -drawRect 0 0 40 40 -setBrush green Dense2Pattern -drawRect 40 0 40 40 -setBrush green Dense3Pattern -drawRect 80 0 40 40 -setBrush green Dense4Pattern -drawRect 120 0 40 40 -setBrush green Dense5Pattern -drawRect 160 0 40 40 -setBrush green Dense6Pattern -drawRect 200 0 40 40 -setBrush green Dense7Pattern -drawRect 240 0 40 40 -setBrush green HorPattern -drawRect 280 0 40 40 -setBrush green VerPattern -drawRect 320 0 40 40 -setBrush green CrossPattern -drawRect 360 0 40 40 -setBrush green BDiagPattern -drawRect 400 0 40 40 -setBrush green FDiagPattern -drawRect 440 0 40 40 -setBrush green DiagCrossPattern -drawRect 480 0 40 40 -setBrush green SolidPattern -drawRect 520 0 40 40 -setBrush green NoBrush -drawRect 560 0 40 40 -gradient_setLinear 0 0 0 40 -drawRect 600 0 40 40 -setBrush face.png -drawRect 640 0 80 40 -end_block - -# Switch to opaque mode -setBackground #7fff7f -setBackgroundMode OpaqueMode -translate 0 50 - -# Draw all the pattern types as 40x40 rects using green, opaque background -repeat_block drawrects - -translate 50 50 -rotate 10 - - -setBackgroundMode TransparentMode -repeat_block drawrects -setBackgroundMode OpaqueMode -translate 0 40 -repeat_block drawrects - - -setBrush dot.png -setPen nopen -resetMatrix -drawRect 0 200 50 50 -drawRect 50 200 50 50 - -setPen red -setBrushOrigin 0 250 -drawRect 0 250 50 50 -setBrushOrigin 50 250 -drawRect 50 250 50 50 - - diff --git a/tests/arthur/data/qps/brushes_qps.png b/tests/arthur/data/qps/brushes_qps.png deleted file mode 100644 index 2ee9648a75..0000000000 Binary files a/tests/arthur/data/qps/brushes_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/clippaths.qps b/tests/arthur/data/qps/clippaths.qps deleted file mode 100644 index 34e77bee9e..0000000000 --- a/tests/arthur/data/qps/clippaths.qps +++ /dev/null @@ -1,58 +0,0 @@ -path_addRect hor 0 0 50 10 -path_addRect ver 0 0 10 50 - -translate 10 10 -setPen NoPen - -begin_block clipping -save - - setBrush 0x7f7fff - save - setClipPath hor - drawRect 0 0 100 100 - - setClipPath ver IntersectClip - setBrush black CrossPattern - drawRect 0 0 100 100 - restore - - translate 100 0 - save - setClipPath hor - drawRect 0 0 100 100 - - setClipPath ver ReplaceClip - setBrush black CrossPattern - drawRect 0 0 100 100 - restore - - translate 100 0 - save - setClipPath hor - drawRect 0 0 100 100 - - setClipPath ver UniteClip - setBrush black CrossPattern - drawRect 0 0 100 100 - restore - -restore -end_block - -translate 300 0 -setRenderHint Antialiasing -repeat_block clipping - -translate -300 100 -setRenderHint Antialiasing false -scale 1.2 1.2 -repeat_block clipping - -translate 300 0 -setRenderHint Antialiasing -setRenderHint SmoothPixmapTransform -repeat_block clipping - - - diff --git a/tests/arthur/data/qps/clippaths_qps.png b/tests/arthur/data/qps/clippaths_qps.png deleted file mode 100644 index 96580917d5..0000000000 Binary files a/tests/arthur/data/qps/clippaths_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/clipping.qps b/tests/arthur/data/qps/clipping.qps deleted file mode 100644 index 09a7e776f0..0000000000 --- a/tests/arthur/data/qps/clipping.qps +++ /dev/null @@ -1,179 +0,0 @@ -region_addRect clip 50 0 90 190 -region_addRect clip 0 50 180 90 - -region_addRect clip2 30 30 60 60 - -region_addRect clip3 10 10 60 60 - -path_cubicTo path 90 0 50 50 90 90 -path_cubicTo path 0 90 50 50 0 0 - -path_addRect path2 0 0 90 90 -path_moveTo path2 90 45 -path_arcTo path2 0 0 90 90 0 -360 - -path_addRect emptypath 0 0 0 0 -region_addRect emptyregion 0 0 0 0 - -# Normal clip rect -setClipRect 0 0 50 150 -begin_block repaint -save -setBrush red -setPen nopen -resetMatrix -region_getClipRegion tmpclip -path_getClipPath tmpclippath -drawRect 0 0 width height -setBrush #3f0000ff -setClipRegion tmpclip -drawRect 0 0 width height -setClipPath tmpclippath -setBrush #3f00ff00 -drawRect 0 0 width height -restore -end_block - -# Rotated clip rect -translate 100 0 -rotate 10 -setClipRect 0 0 50 150 -repeat_block repaint - -# simple clip region -resetMatrix -translate 0 200 -setClipRegion clip -repeat_block repaint - -# simle rotated clip region -translate 250 -10 -rotate 10 -setClipRegion clip -repeat_block repaint - -# verify that clip is not xformed with painter -resetMatrix -translate 200 0 -setClipRegion clip -rotate 30 -setBrush red -setPen nopen -drawRect 0 0 width height - -resetMatrix -translate 0 400 -save -setClipRegion clip -setClipRegion clip2 IntersectClip -repeat_block repaint -translate 0 100 -rotate 10 -setClipRegion clip -setClipRegion clip2 IntersectClip -restore - -translate 100 0 -save -setClipRegion clip3 -setClipRegion clip2 UniteClip -repeat_block repaint -translate 0 100 -rotate 10 -setClipRegion clip3 -setClipRegion clip2 UniteClip -repeat_block repaint -restore - -translate 100 0 -save -setClipPath path -repeat_block repaint -translate 50 100 -rotate 45 -setClipPath path -repeat_block repaint -restore - -translate 100 0 -save -setClipPath path -setClipPath path2 IntersectClip -repeat_block repaint -translate 0 100 -rotate 10 -setClipPath path -setClipPath path2 IntersectClip -repeat_block repaint -restore - -translate 100 0 -save -setClipPath path -setClipPath path2 UniteClip -repeat_block repaint -translate 0 100 -rotate 10 -setClipPath path -setClipPath path2 UniteClip -repeat_block repaint -restore - -translate 100 0 -save -setClipPath path -setClipRegion clip3 IntersectClip -repeat_block repaint -translate 0 100 -rotate 10 -setClipRegion clip3 -setClipPath path IntersectClip -repeat_block repaint -restore - -translate 100 0 -save -setClipPath path -setClipRegion clip3 UniteClip -repeat_block repaint -translate 0 100 -rotate 10 -setClipRegion clip3 -setClipPath path UniteClip -repeat_block repaint -restore - -# test that an empty region is not drawn. -resetMatrix -setClipRegion emptyregion -setBrush #3f00ff00 -drawRect 0 0 300 300 -drawText 50 50 "Text should be clipped away by region" -setClipping false - -setClipPath emptypath -setBrush #3fffff00 -drawRect 50 50 300 300 -drawText 70 80 "Text should be clipped away by path" - -# Test that we can extract a clipregion when a matrix is set too -resetMatrix -translate 500 10 -scale 2 1 -setBrush blue -setClipping false -rotate 5 -drawRect 0 0 100 100 -setClipRect 0 0 100 100 -resetMatrix -rotate 10 -region_getClipRegion xclip -setClipRegion xclip -resetMatrix -setBrush #7f00ff00 -drawRect 0 0 width height - -# the below used to assert in debug mode -setClipRect 10 10 20 20 -setClipping false -setClipping true diff --git a/tests/arthur/data/qps/clipping_qps.png b/tests/arthur/data/qps/clipping_qps.png deleted file mode 100644 index 97094a9e86..0000000000 Binary files a/tests/arthur/data/qps/clipping_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/clipping_state.qps b/tests/arthur/data/qps/clipping_state.qps deleted file mode 100644 index 3a661226a5..0000000000 --- a/tests/arthur/data/qps/clipping_state.qps +++ /dev/null @@ -1,72 +0,0 @@ -path_addRect path1 10 10 50 50 -path_addRect path2 30 30 50 50 - - -# enable/disable a clip path -setPen nopen -setBrush red - -setClipPath path1 -setClipPath path2 UniteClip - -drawRect 0 0 100 100 - -setClipping false - -setBrush #630000ff -drawRect 0 0 100 100 - -setClipping true - -setBrush #6300ff00 -drawRect 0 0 100 100 - - -# enable/disable noclip -translate 150 0 - -setClipPath path1 NoClip - -setClipping false - -setBrush #630000ff -drawRect 0 0 100 100 - -setClipping true - -setBrush #6300ff00 -drawRect 25 25 50 50 - - -# enable/disable full clipping -translate 150 0 - -path_addRect path3 0 0 10 10 -path_addRect path4 20 20 10 10 -setClipPath path3 -setClipPath path4 IntersectClip - -setClipping false - -setBrush #630000ff -drawRect 0 0 100 100 - -setClipping true - -setBrush #6300ff00 -drawRect 25 25 50 50 - -# disable clipping followed by setClipRect -translate 150 0 - -setClipRect 0 0 50 50 ReplaceClip - -setClipping false - -setBrush #630000ff -drawRect 0 0 100 100 - -setClipRect 25 25 75 75 IntersectClip - -setBrush #6300ff00 -drawRect 25 25 50 50 diff --git a/tests/arthur/data/qps/clipping_state_qps.png b/tests/arthur/data/qps/clipping_state_qps.png deleted file mode 100644 index 28bee462c6..0000000000 Binary files a/tests/arthur/data/qps/clipping_state_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/cliprects.qps b/tests/arthur/data/qps/cliprects.qps deleted file mode 100644 index 7f8e674ca3..0000000000 --- a/tests/arthur/data/qps/cliprects.qps +++ /dev/null @@ -1,57 +0,0 @@ - - -translate 10 10 -setPen NoPen - -begin_block clipping -save - - setBrush 0x7f7fff - save - setClipRect 0 0 50 10 - drawRect 0 0 100 100 - - setClipRect 0 0 10 50 IntersectClip - setBrush black CrossPattern - drawRect 0 0 100 100 - restore - - translate 100 0 - save - setClipRect 0 0 50 10 - drawRect 0 0 100 100 - - setClipRect 0 0 10 50 ReplaceClip - setBrush black CrossPattern - drawRect 0 0 100 100 - restore - - translate 100 0 - save - setClipRect 0 0 50 10 - drawRect 0 0 100 100 - - setClipRect 0 0 10 50 UniteClip - setBrush black CrossPattern - drawRect 0 0 100 100 - restore - -restore -end_block - -translate 300 0 -setRenderHint Antialiasing -repeat_block clipping - -translate -300 100 -setRenderHint Antialiasing false -scale 1.2 1.2 -repeat_block clipping - -translate 300 0 -setRenderHint Antialiasing -setRenderHint SmoothPixmapTransform -repeat_block clipping - - - diff --git a/tests/arthur/data/qps/cliprects_qps.png b/tests/arthur/data/qps/cliprects_qps.png deleted file mode 100644 index 96580917d5..0000000000 Binary files a/tests/arthur/data/qps/cliprects_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/conical_gradients.qps b/tests/arthur/data/qps/conical_gradients.qps deleted file mode 100644 index d459ed008d..0000000000 --- a/tests/arthur/data/qps/conical_gradients.qps +++ /dev/null @@ -1,82 +0,0 @@ -path_addRect path 300 0 80 80 -path_addEllipse path 340 40 60 60 - -setRenderHint Antialiasing - -setPen black - -begin_block gradients -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setConical 40 40 50 -drawRect 0 0 100 100 - -gradient_setConical 140 40 230 -drawEllipse 100 0 100 100 - -gradient_clearStops -gradient_appendStop 0 3f7f7fff -gradient_appendStop 0.5 dfdfffff -gradient_appendStop 1 7f00007f - -gradient_setConical 240 40 50 -drawPolygon [200 0 290 0 250 99] - -gradient_setConical 340 40 230 -drawPath path - -end_block - -translate 0 100 -scale 1 2 -repeat_block gradients - -resetMatrix -translate 0 300 -brushTranslate 30 0 -brushScale 0.9 0.9 -brushRotate 20 -repeat_block gradients - -# Some helpful info perhaps? -resetMatrix -setPen black - -drawText 410 50 "No XForm" -drawText 410 200 "scale 1x2" -drawText 410 300 "brush transform" -drawText 10 450 "50 deg" -drawText 110 450 "230 deg" -drawText 210 450 "50 deg w/alpha " -drawText 310 450 "230 deg w/alpha" - -setPen 3f000000 -setBrush nobrush - -begin_block ellipse_draw - setClipRect 0 0 100 100 - drawEllipse 35 35 11 11 - save - translate 40 40 - rotate -50 - drawLine -100 0 100 0 - restore - translate 100 0 -end_block - -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw - -resetMatrix -translate 0 100 -scale 1 2 -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw diff --git a/tests/arthur/data/qps/conical_gradients_perspectives.qps b/tests/arthur/data/qps/conical_gradients_perspectives.qps deleted file mode 100644 index 40af97ec0c..0000000000 --- a/tests/arthur/data/qps/conical_gradients_perspectives.qps +++ /dev/null @@ -1,61 +0,0 @@ - -setRenderHint Antialiasing - -setPen #00ff00 - -translate 10 10 -# standard draw -begin_block gradient -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 0.9 cyan -gradient_appendStop 1 red - -gradient_setSpread PadSpread -gradient_setConical 140 140 100 -drawRect 0 0 300 300 -end_block gradient - -# Rotation w/o smooth xform -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0 - repeat_block gradient -restore -restore - -translate 0 320 - -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0 - repeat_block gradient -restore - -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50 - repeat_block gradient -restore -restore - - -resetMatrix -setPen black -translate 125 20 -drawText 0 0 "No transform" -translate 350 0 -drawText 0 0 "Left Tilted" -resetMatrix -translate 125 350 -drawText 0 0 "Bottom Tilted" -translate 350 0 -drawText 0 0 "Right Tilted" -translate 120 0 diff --git a/tests/arthur/data/qps/conical_gradients_perspectives_qps.png b/tests/arthur/data/qps/conical_gradients_perspectives_qps.png deleted file mode 100644 index 705fa933e4..0000000000 Binary files a/tests/arthur/data/qps/conical_gradients_perspectives_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/conical_gradients_qps.png b/tests/arthur/data/qps/conical_gradients_qps.png deleted file mode 100644 index 9d8e4537c2..0000000000 Binary files a/tests/arthur/data/qps/conical_gradients_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/dashes.qps b/tests/arthur/data/qps/dashes.qps deleted file mode 100644 index d7fa73f385..0000000000 --- a/tests/arthur/data/qps/dashes.qps +++ /dev/null @@ -1,265 +0,0 @@ -translate 20 20 - -begin_block draw -save - save - setPen black 1 SolidLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 SolidLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 SolidLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 2 SolidLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 SolidLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 SolidLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 6 SolidLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 6 SolidLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 6 SolidLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - restore - - - translate 100 0 - save - setPen black 1 DotLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 DotLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 DotLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 2 DotLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 DotLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 DotLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 6 DotLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 6 DotLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 6 DotLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - restore - - translate 100 0 - save - setPen black 1 DashLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 DashLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 DashLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 2 DashLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 DashLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 DashLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 6 DashLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 6 DashLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 6 DashLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - restore - - translate 100 0 - - save - setPen black 1 DashDotLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 DashDotLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 DashDotLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 2 DashDotLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 DashDotLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 DashDotLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 6 DashDotLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 6 DashDotLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 6 DashDotLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - restore - - translate 100 0 - - save - setPen black 1 DashDotDotLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 DashDotDotLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 DashDotDotLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 2 DashDotDotLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 DashDotDotLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 DashDotDotLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 4 DashDotDotLine FlatCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 4 DashDotDotLine SquareCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 4 DashDotDotLine RoundCap BevelJoin - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - restore - - translate 100 0 - - save - setPen black 1 SolidLine FlatCap BevelJoin - pen_setDashPattern [1 4 9 4 27 4] - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 SolidLine SquareCap BevelJoin - pen_setDashPattern [1 4 9 4 27 4] - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 1 SolidLine RoundCap BevelJoin - pen_setDashPattern [1 4 9 4 27 4] - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 2 SolidLine FlatCap BevelJoin - pen_setDashPattern [1 4 9 4 27 4] - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 SolidLine SquareCap BevelJoin - pen_setDashPattern [1 4 9 4 27 4] - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 2 SolidLine RoundCap BevelJoin - pen_setDashPattern [1 4 9 4 27 4] - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - - setPen black 4 SolidLine FlatCap BevelJoin - pen_setDashPattern [1 4 9 4 27 4] - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 4 SolidLine SquareCap BevelJoin - pen_setDashPattern [1 4 9 4 27 4] - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - setPen black 4 SolidLine RoundCap BevelJoin - pen_setDashPattern [1 4 9 4 27 4] - drawPolyline [0 0 80 0 80 30 40 20 0 30] - translate 0 40 - restore - -restore -end_block - -translate 0 400 -setRenderHint Antialiasing -repeat_block draw - -translate 0 -20 -drawText 30 0 "Solid" - -translate 100 0 -drawText 20 0 "DotLine" - -translate 100 0 -drawText 10 0 "DashLine" - -translate 100 0 -drawText 0 0 "DashDotLine" - -translate 100 0 -drawText 0 0 "DashDotDotLine" - -translate 100 0 -drawText 0 0 "CustomDashLine" - -resetMatrix - -translate 620 40 - -begin_block width_and_caps_texts - drawText 0 0 "Width=1, FlatCap" - translate 0 40 - drawText 0 0 "Width=1, SquareCap" - translate 0 40 - drawText 0 0 "Width=1, RoundCap" - translate 0 40 - drawText 0 0 "Width=2, FlatCap" - translate 0 40 - drawText 0 0 "Width=2, SquareCap" - translate 0 40 - drawText 0 0 "Width=2, RoundCap" - translate 0 40 - drawText 0 0 "Width=6, FlatCap" - translate 0 40 - drawText 0 0 "Width=6, SqareCap" - translate 0 40 - drawText 0 0 "Width=6, RoundCap" -end_block - -translate 0 80 -repeat_block width_and_caps_texts diff --git a/tests/arthur/data/qps/dashes_qps.png b/tests/arthur/data/qps/dashes_qps.png deleted file mode 100644 index 2b5ac551df..0000000000 Binary files a/tests/arthur/data/qps/dashes_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/degeneratebeziers.qps b/tests/arthur/data/qps/degeneratebeziers.qps deleted file mode 100644 index d9036dfaa5..0000000000 --- a/tests/arthur/data/qps/degeneratebeziers.qps +++ /dev/null @@ -1,7 +0,0 @@ -path_moveTo degenerate 3427.0918499999997948 3872.1318999999998596 -path_cubicTo degenerate 3427.0918499999997948 3872.1318999999994048 4729.4590867905308187 5176.8613451144155988 5389.9325499999995372 5837.8072499999998399 - -scale 0.05 0.05 -translate -2500 -3000 -setPen black 800 -drawPath degenerate diff --git a/tests/arthur/data/qps/degeneratebeziers_qps.png b/tests/arthur/data/qps/degeneratebeziers_qps.png deleted file mode 100644 index 85aae14a04..0000000000 Binary files a/tests/arthur/data/qps/degeneratebeziers_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/deviceclipping.qps b/tests/arthur/data/qps/deviceclipping.qps deleted file mode 100644 index cc9abe109a..0000000000 --- a/tests/arthur/data/qps/deviceclipping.qps +++ /dev/null @@ -1,45 +0,0 @@ -setBrush 0xff7f7f -setPen 0x7f0000 - -path_moveTo path -1000000 10000 -path_cubicTo path 100 100 100 150 150 400 -path_closeSubpath path - -begin_block drawing - - drawPath ellipse - - drawLine -1000000 200 200 200 - drawLine 200 -1000000 200 200 - drawLine 200 200 1000000 200 - drawLine 200 200 200 1000000 - drawLine -1000000 -1000000 200 200 - - drawPolygon [-1000000 100 100 -1000000 100 100] - drawRect 300 -500000 1000000 1000000 - - drawPath path - -end_block - -save -translate 20 20 -setBrush #0x7f7f7fff -setPen #0x7f00007f -repeat_block drawing - -translate 20 20 -setRenderHint Antialiasing -setBrush #0x7f7fff7f -setPen #0x7f007f00 -repeat_block drawing -restore - -setPen 0x00007f 2 -setRenderHint Antialiasing - -drawLine 0 -200 200 200 - -setPen 0x007f00 10 - -drawLine 0 -200 200 0 diff --git a/tests/arthur/data/qps/deviceclipping_qps.png b/tests/arthur/data/qps/deviceclipping_qps.png deleted file mode 100644 index 20b2d19c06..0000000000 Binary files a/tests/arthur/data/qps/deviceclipping_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/drawpoints.qps b/tests/arthur/data/qps/drawpoints.qps deleted file mode 100644 index 9f234142f2..0000000000 --- a/tests/arthur/data/qps/drawpoints.qps +++ /dev/null @@ -1,98 +0,0 @@ -#setRenderHint Antialiasing - -setPen red 0 solidline -begin_block points -drawPoint 00 00 -drawPoint 10 00 -drawPoint 20 00 -drawPoint 30 00 -drawPoint 40 00 -drawPoint 50 00 -drawPoint 00 10 -drawPoint 10 10 -drawPoint 20 10 -drawPoint 30 10 -drawPoint 40 10 -drawPoint 50 10 -drawPoint 00 20 -drawPoint 10 20 -drawPoint 20 20 -drawPoint 30 20 -drawPoint 40 20 -drawPoint 50 20 -drawPoint 00 30 -drawPoint 10 30 -drawPoint 20 30 -drawPoint 30 30 -drawPoint 40 30 -drawPoint 50 30 -drawPoint 00 40 -drawPoint 10 40 -drawPoint 20 40 -drawPoint 30 40 -drawPoint 40 40 -drawPoint 50 40 -drawPoint 00 50 -drawPoint 10 50 -drawPoint 20 50 -drawPoint 30 50 -drawPoint 40 50 -drawPoint 50 50 -end_block points - -translate 100 0 -setPen blue 1 solidline -repeat_block points - -translate 100 0 -setPen green 5 solidline roundcap -repeat_block points - -resetMatrix - -translate 0 100 -scale 3 3 -setPen red 0 solidline roundcap -repeat_block points - -translate 60 0 -setPen blue 1 solidline roundcap -repeat_block points - -translate 60 0 -setPen green 5 solidline roundcap -repeat_block points - -resetMatrix - -translate 0 300 -scale 3 3 -setPen red 0 solidline flatcap -repeat_block points - -translate 60 0 -setPen blue 1 solidline flatcap -repeat_block points - -translate 60 0 -setPen green 5 solidline flatcap -repeat_block points - -resetMatrix -translate 10 500 -setPen black 1 solidline flatcap -drawPoint 0 0 -setPen black 2 solidline flatcap -drawPoint 3 0 -setPen black 3 solidline flatcap -drawPoint 8 0 -setPen black 4 solidline flatcap -drawPoint 15 0 -setPen black 5 solidline flatcap -drawPoint 24 0 -setPen black 6 solidline flatcap -drawPoint 35 0 -setPen black 7 solidline flatcap -drawPoint 48 0 -setPen black 8 solidline flatcap -drawPoint 63 0 diff --git a/tests/arthur/data/qps/drawpoints_qps.png b/tests/arthur/data/qps/drawpoints_qps.png deleted file mode 100644 index b8b1b45e48..0000000000 Binary files a/tests/arthur/data/qps/drawpoints_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/drawtext.qps b/tests/arthur/data/qps/drawtext.qps deleted file mode 100644 index 668fd8573d..0000000000 --- a/tests/arthur/data/qps/drawtext.qps +++ /dev/null @@ -1,85 +0,0 @@ -setRenderHint Antialiasing - -path_addEllipse path 0 0 width height -setClipPath path - -setFont "times" 3 -drawText 10 10 "This is a very long text that just might become antialiased...." - -setFont "times" 4 -drawText 10 20 "This is a very long text that just might become antialiased...." - -setFont "times" 5 -drawText 10 30 "This is a very long text that just might become antialiased...." - -setFont "times" 6 -drawText 10 40 "This is a very long text that just might become antialiased...." - -setFont "times" 7 -drawText 10 50 "This is a very long text that just might become antialiased...." - -setFont "times" 8 -drawText 10 60 "This is a very long text that just might become antialiased...." - -setFont "times" 9 -drawText 10 70 "This is a very long text that just might become antialiased...." - -setFont "times" 10 -drawText 10 80 "This is a very long text that just might become antialiased...." - -setFont "times" 16 -drawText 10 100 "This is a very long text that just might become antialiased...." - -setFont "times" 17 -drawText 10 120 "This is a very long text that just might become antialiased...." - -setFont "times" 18 -drawText 10 140 "This is a very long text that just might become antialiased...." - -setFont "times" 19 -drawText 10 160 "This is a very long text that just might become antialiased...." - -setFont "times" 20 -drawText 10 180 "This is a very long text that just might become antialiased...." - -translate 0 200 - -setFont "arial" 3 -drawText 10 10 "This is a very long text that just might become antialiased...." - -setFont "arial" 4 -drawText 10 20 "This is a very long text that just might become antialiased...." - -setFont "arial" 5 -drawText 10 30 "This is a very long text that just might become antialiased...." - -setFont "arial" 6 -drawText 10 40 "This is a very long text that just might become antialiased...." - -setFont "arial" 7 -drawText 10 50 "This is a very long text that just might become antialiased...." - -setFont "arial" 8 -drawText 10 60 "This is a very long text that just might become antialiased...." - -setFont "arial" 9 -drawText 10 70 "This is a very long text that just might become antialiased...." - -setFont "arial" 10 -drawText 10 80 "This is a very long text that just might become antialiased...." - -setFont "arial" 16 -drawText 10 100 "This is a very long text that just might become antialiased...." - -setFont "arial" 17 -drawText 10 120 "This is a very long text that just might become antialiased...." - -setFont "arial" 18 -drawText 10 140 "This is a very long text that just might become antialiased...." - -setFont "arial" 19 -drawText 10 160 "This is a very long text that just might become antialiased...." - -setFont "arial" 20 -drawText 10 180 "This is a very long text that just might become antialiased...." - diff --git a/tests/arthur/data/qps/drawtext_qps.png b/tests/arthur/data/qps/drawtext_qps.png deleted file mode 100644 index e1a64045da..0000000000 Binary files a/tests/arthur/data/qps/drawtext_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/ellipses.qps b/tests/arthur/data/qps/ellipses.qps deleted file mode 100644 index 3cec26b587..0000000000 --- a/tests/arthur/data/qps/ellipses.qps +++ /dev/null @@ -1,83 +0,0 @@ - -surface_begin 0 0 600 600 -translate 0 50 - -setPen nopen -setBrush 0x7f000000 -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setRadial 20 20 220 200 - -drawEllipse 10 10 80 80 -drawEllipse 50 50 120 90 - -translate 100 0 -brushTranslate 40 20 -brushScale 0.25 0.25 - -setPen black - -drawEllipse 10 10 80 80 -setOpacity 0.5 -setCompositionMode SourceIn -drawEllipse 50 50 120 90 -setOpacity 1.0 -setRenderHint Antialiasing -setCompositionMode Xor -brushTranslate 70 0 -translate 100 0 -drawEllipse 10 10 80 80 - -setPen nopen -drawEllipse 50 50 120 90 - -setOpacity 0.7 -setBrush red -translate 100 0 -setCompositionMode SourceOver - -drawEllipse 10 10 80 80 - -setOpacity 0.6 -setPen black 5.0 -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setLinear 20 20 120 100 -drawEllipse 50 50 120 90 - - -translate 100 0 - -setOpacity 1.0 -drawEllipse 10 10 80 80 - -setCompositionMode SourceIn -setOpacity 0.7 -setPen black 3.0 -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setLinear 50 50 80 90 -drawEllipse 50 50 120 90 - -surface_end - -drawText 200 220 "Testing Ellipse drawing with varios combinations" -drawText 200 240 "of features such as brushes, pens and composition modes" diff --git a/tests/arthur/data/qps/ellipses_qps.png b/tests/arthur/data/qps/ellipses_qps.png deleted file mode 100644 index f9cc90b11e..0000000000 Binary files a/tests/arthur/data/qps/ellipses_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/filltest.qps b/tests/arthur/data/qps/filltest.qps deleted file mode 100644 index c6112fea24..0000000000 --- a/tests/arthur/data/qps/filltest.qps +++ /dev/null @@ -1,410 +0,0 @@ -setPen nopen -setBrush red -translate 0 4 -begin_block polys -drawPolygon [0 0 2 -2 4 0] -drawPolygon [0 2 2 4 4 2] -end_block polys -translate 6 .5 -repeat_block polys -translate 6.5 0 -repeat_block polys -translate 6 .5 -repeat_block polys - -resetMatrix - -translate 0 12 -setPen black -drawPolygon [0 0 5 0 5 5 0 5] - -translate 10 0 -setPen nopen -drawPolygon [0 0 5 0 5 5 0 5] - -translate 10 0 -drawPolygon [0 0 5 0 5 5 0 5] - -setBrush black -path_addRect stroke -.5 -.5 6 6 -path_addRect stroke .5 .5 4 4 -drawPath stroke - -resetMatrix - -translate 0 65 - -setPen red -drawText 0 0 "path" -drawText 40 0 "rect" -drawText 80 0 "img" -drawText 120 0 "pix" -drawText 160 0 "brush" -setPen nopen - -translate 0 5 - -image_load border.png img -pixmap_load border.png pix - -path_addRect rect 0 0 10 10 -begin_block rects -drawPath rect -drawRect 40 0 10 10 -drawImage img 80 0 -drawPixmap pix 120 0 -setBrush border.png -drawRect 160 0 10 10 -setBrush black -end_block rects - -setPen red -drawText 180 10 "0.0" -setPen nopen - -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "0.1" -setPen nopen -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "0.2" -setPen nopen -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "0.3" -setPen nopen -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "0.4" -setPen nopen -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "0.5" -setPen nopen -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "0.6" -setPen nopen -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "0.7" -setPen nopen -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "0.8" -setPen nopen -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "0.9" -setPen nopen -translate 0.1 20 -repeat_block rects -setPen red -drawText 180 10 "1.0" -setPen nopen - -resetMatrix - -translate 0 400 - -setPen red -drawText 0 10 "path" -drawText 0 30 "rect" -drawText 0 50 "img" -drawText 0 70 "pix" -drawText 0 90 "brush" -drawText 0 110 "stroke" -drawText 0 130 "scale" -drawText 0 170 "rotate" -setPen nopen - -translate 50 0 - -begin_block rects -drawPath rect -drawRect 0 20 10 10 -drawImage img 0 40 -drawPixmap pix 0 60 -save -setBrush border.png -drawRect 0 80 10 10 -translate 0 100 -setBrush red -setPen black -drawRect 0 0 10 10 -setBrush border.png -setPen nopen -translate 0 20 -scale 2 2 -drawRect 0 0 10 10 -translate 10 20 -rotate 90 -drawRect 0 0 10 10 -restore -end_block rects - -setPen red -drawText -5 -10 "0.0" -setPen nopen - -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "0.1" -setPen nopen -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "0.2" -setPen nopen -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "0.3" -setPen nopen -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "0.4" -setPen nopen -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "0.5" -setPen nopen -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "0.6" -setPen nopen -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "0.7" -setPen nopen -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "0.8" -setPen nopen -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "0.9" -setPen nopen -translate 40 0.1 -repeat_block rects -setPen red -drawText -5 -10 "1.0" -setPen nopen - -resetMatrix - -translate 0 620 - -setPen red -drawText 0 10 "path" -setPen nopen - -path_addRect rect2 -5 -5 10 10 - -translate 55 5 -drawPath rect2 - -translate 20 0 -rotate 10 -drawPath rect2 -rotate -10 -translate 20 0 -rotate 20 -drawPath rect2 -rotate -20 -translate 20 0 -rotate 30 -drawPath rect2 -rotate -30 -translate 20 0 -rotate 40 -drawPath rect2 -rotate -40 -translate 20 0 -rotate 50 -drawPath rect2 -rotate -50 -translate 20 0 -rotate 60 -drawPath rect2 -rotate -60 -translate 20 0 -rotate 70 -drawPath rect2 -rotate -70 -translate 20 0 -rotate 80 -drawPath rect2 -rotate -80 -translate 20 0 -rotate 90 -drawPath rect2 -rotate -90 - -resetMatrix - -translate 0 600 - -setPen red -drawText 0 10 "rect" -setPen nopen - -translate 55 5 -drawRect -5 -5 10 10 - -translate 20 0 -rotate 10 -drawRect -5 -5 10 10 -rotate -10 -translate 20 0 -rotate 20 -drawRect -5 -5 10 10 -rotate -20 -translate 20 0 -rotate 30 -drawRect -5 -5 10 10 -rotate -30 -translate 20 0 -rotate 40 -drawRect -5 -5 10 10 -rotate -40 -translate 20 0 -rotate 50 -drawRect -5 -5 10 10 -rotate -50 -translate 20 0 -rotate 60 -drawRect -5 -5 10 10 -rotate -60 -translate 20 0 -rotate 70 -drawRect -5 -5 10 10 -rotate -70 -translate 20 0 -rotate 80 -drawRect -5 -5 10 10 -rotate -80 -translate 20 0 -rotate 90 -drawRect -5 -5 10 10 -rotate -90 - -resetMatrix -path_addRect vertical 0.1 0.1 0.2 10 - -translate 0 320 -drawPath vertical -translate 2.2 0 -drawPath vertical -translate 2.2 0 -drawPath vertical -translate 2.2 0 -drawPath vertical -translate 2.2 0 -drawPath vertical - -resetMatrix -path_addRect horizontal 0.1 0.1 10 0.2 - -translate 0 340 -drawPath horizontal -translate 0 2.2 -drawPath horizontal -translate 0 2.2 -drawPath horizontal -translate 0 2.2 -drawPath horizontal -translate 0 2.2 -drawPath horizontal - -setOpacity 0.8 -resetMatrix - -translate 0.1 24.7 -translate 400 0 -#rotate 88.8 -rotate 89.9 -setBrush red -drawPolygon [0 0 300 0 0 173] -setBrush green -drawPolygon [0 173 300 0 300 173] - -resetMatrix - -translate 410 24 -path_lineTo left 0 273 -path_lineTo left 300 273 -path_cubicTo left 50 273 250 0 0 0 - -path_cubicTo right 250 0 50 273 300 273 -path_lineTo right 300 0 - -translate 310 0 -rotate 90 -setBrush red -drawPath left -setBrush green -drawPath right - -resetMatrix -translate 0.1 680.1 -setPen red -setOpacity 1 -drawText 115 -20 "0.1" -drawText 0 0 "pixmap w/ opacity" -setOpacity 0.6 -drawPixmap pix 120 -10 -translate 0 20 -setOpacity 1 -drawText 0 0 "image w/ opacity" -setOpacity 0.6 -drawImage img 120 -10 - -resetMatrix -path_lineTo fillpath 0 50 -path_lineTo fillpath 50 50 -path_moveTo fillpath 70 50 -path_lineTo fillpath 70 100 -path_lineTo fillpath 40 100 -translate 500 400 -drawPath fillpath - -resetMatrix -path_moveTo vectorarne 50 10 -path_lineTo vectorarne 50 50 -path_lineTo vectorarne 100 50 -path_addEllipse vectorarne 350 20 230 230 -path_moveTo vectorarne 500 500 -path_cubicTo vectorarne 20 20 250 30 50 150 -translate 500 550 -scale 0.4 0.4 -setRenderHint antialiasing -drawPath vectorarne - -resetMatrix -translate 200 730 -setRenderHint antialiasing off -setOpacity 1 -setPen red -drawText 0 0 "outline/fill consistency" -setPen red -setBrush green -translate 80 -30 -drawPolygon [13.6965 -99.1837 -71.4767 13.823 32.4596 -33.1847] diff --git a/tests/arthur/data/qps/filltest_qps.png b/tests/arthur/data/qps/filltest_qps.png deleted file mode 100644 index 523e08a5ab..0000000000 Binary files a/tests/arthur/data/qps/filltest_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/fonts.qps b/tests/arthur/data/qps/fonts.qps deleted file mode 100644 index 5d03308b15..0000000000 --- a/tests/arthur/data/qps/fonts.qps +++ /dev/null @@ -1,64 +0,0 @@ -begin_block drawtexts -setPen red -drawLine 0 20 width 20 -setPen blue - -setFont "times" 12 -drawText 0 20 "(times)" - -setFont "times" 12 bold -drawText 100 20 "(times, 12, bold)" - -setFont "times" 12 normal italic -drawText 250 20 "(times, 12, italic)" - -setFont "times" 12 bold italic -drawText 400 20 "(times, 12, bold, italic)" - -translate 0 20 - -setPen red -drawLine 0 20 width 20 -setPen green - -setFont "helvetica" 12 -drawText 0 20 "(helvetica)" - -setFont "helvetica" 12 bold -drawText 100 20 "(helvetica, 12, bold)" - -setFont "helvetica" 12 normal italic -drawText 250 20 "(helvetica, 12, italic)" - -setFont "helvetica" 12 bold italic -drawText 400 20 "(helvetica, 12, bold, italic)" - -translate 0 20 - -setPen red -drawLine 0 20 width 20 -setPen orange - -setFont "courier" 12 -drawText 0 20 "(courier)" - -setFont "courier" 12 bold -drawText 100 20 "(courier, 12, b)" - -setFont "courier" 12 normal italic -drawText 250 20 "(courier, 12, i)" - -setFont "courier" 12 bold italic -drawText 400 20 "(courier, 12, bi)" -end_block - -# Repeat with scale -translate 0 100 -scale 1 2 -repeat_block drawtexts - -# Repeat with rotation -resetMatrix -translate 100 300 -rotate 20 -repeat_block drawtexts diff --git a/tests/arthur/data/qps/fonts_qps.png b/tests/arthur/data/qps/fonts_qps.png deleted file mode 100644 index cc947233f7..0000000000 Binary files a/tests/arthur/data/qps/fonts_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/gradients.qps b/tests/arthur/data/qps/gradients.qps deleted file mode 100644 index 78750aad34..0000000000 --- a/tests/arthur/data/qps/gradients.qps +++ /dev/null @@ -1,41 +0,0 @@ -drawText 75 20 "Linear" -drawText 176 20 "Radial" -drawText 277 20 "Conical" -translate 0 30 -drawText 0 50 "AA off" -drawText 0 151 "AA on" - -setPen nopen - -gradient_clearStops -gradient_appendStop 0 0x00000000 -gradient_appendStop 0.001 red -gradient_appendStop 0.2 blue -gradient_appendStop 0.4 yellow -gradient_appendStop 0.6 cyan -gradient_appendStop 0.8 green -gradient_appendStop 0.999 red -gradient_appendStop 1 0x00000000 - -gradient_setSpread PadSpread -gradient_setCoordinateMode ObjectBoundingMode - -begin_block row -save -gradient_setLinear 0.1 0.0 0.9 0.0 -drawRect 50 0 100 100 - -gradient_setRadial 0.5 0.5 0.5 0.5 0.5 -translate 101 0 -drawRect 50 0 100 100 - -gradient_setConical 0.5 0.5 45 -translate 101 0 -drawRect 50 0 100 100 -restore -end_block row - -setRenderHint Antialiasing - -translate 0 101 -repeat_block row diff --git a/tests/arthur/data/qps/gradients_qps.png b/tests/arthur/data/qps/gradients_qps.png deleted file mode 100644 index de2342cf96..0000000000 Binary files a/tests/arthur/data/qps/gradients_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/image_formats.qps b/tests/arthur/data/qps/image_formats.qps deleted file mode 100644 index c586893662..0000000000 --- a/tests/arthur/data/qps/image_formats.qps +++ /dev/null @@ -1,78 +0,0 @@ - -image_load dome_argb32.png the_pixmap -image_convertToFormat the_pixmap the_pixmap ARGB32_Premultiplied - -begin_block draw_stuff - save - image_convertToFormat the_pixmap converted ARGB32_Premultiplied - drawImage converted 0 0 - translate 0 110 - - image_convertToFormat the_pixmap converted ARGB32 - drawImage converted 0 0 - translate 0 110 - - image_convertToFormat the_pixmap converted RGB32 - drawImage converted 0 0 - translate 0 110 - - image_convertToFormat the_pixmap converted Indexed8 - drawImage converted 0 0 - translate 0 110 - - image_convertToFormat the_pixmap converted MonoLSB - drawImage converted 0 0 - translate 0 110 - - image_convertToFormat the_pixmap converted Mono - drawImage converted 0 0 - translate 0 110 - restore -end_block - - -image_load dome_argb32.png the_pixmap -translate 110 0 -repeat_block draw_stuff - - -image_load dome_rgb32.png the_pixmap -translate 110 0 -repeat_block draw_stuff - -image_load dome_indexed.png the_pixmap -translate 110 0 -repeat_block draw_stuff - - -image_load dome_mono.png the_pixmap -translate 110 0 -repeat_block draw_stuff - -image_load dome_mono_palette.png the_pixmap -translate 110 0 -repeat_block draw_stuff - -image_load dome_indexed_mask.png the_pixmap -translate 110 0 -repeat_block draw_stuff - - -# helpful texts -resetMatrix -setPen black - -drawText 10 670 "ARGB32_PM" -drawText 120 670 "ARGB32" -drawText 230 670 "RGB32" -drawText 340 670 "Indexed" -drawText 450 670 "Mono" -drawText 560 670 "Mono w/lut" -drawText 670 670 "Indexed w/mask" - -drawText 770 50 "ARGB32_PM" -drawText 770 160 "ARGB32" -drawText 770 270 "RGB32" -drawText 770 380 "Indexed" -drawText 770 490 "MonoLSB" -drawText 770 600 "Mono" diff --git a/tests/arthur/data/qps/image_formats_qps.png b/tests/arthur/data/qps/image_formats_qps.png deleted file mode 100644 index 5aa348e97a..0000000000 Binary files a/tests/arthur/data/qps/image_formats_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/images.qps b/tests/arthur/data/qps/images.qps deleted file mode 100644 index 445980c799..0000000000 --- a/tests/arthur/data/qps/images.qps +++ /dev/null @@ -1,103 +0,0 @@ - -setRenderHint Antialiasing - -setPen #00ff00 - -image_load dome_argb32.png the_image -begin_block draw_stuff - -save - - # standard draw - drawImage the_image 0 0 - - # sub recting - translate 120 0 - drawImage the_image 0 0 40 40 0 0 40 40 - drawImage the_image 60 0 40 40 60 0 40 40 - drawImage the_image 0 60 40 40 0 60 40 40 - drawImage the_image 60 60 40 40 60 60 40 40 - drawImage the_image 0 40 40 20 0 40 40 20 - drawImage the_image 60 40 40 20 60 40 40 20 - drawImage the_image 40 0 20 100 40 0 20 100 - - # subrecting w/scale - translate 120 0 - drawImage the_image 0 0 50 50 0 0 25 25 - drawImage the_image 50 0 50 50 25 0 25 25 - drawImage the_image 0 50 50 50 0 25 25 25 - drawImage the_image 50 50 50 50 25 25 25 25 - - # subrecting w/scale & smooth xform - translate 120 0 - setRenderHint SmoothPixmapTransformation - drawImage the_image 0 0 50 50 0 0 25 25 - drawImage the_image 50 0 50 50 25 0 25 25 - drawImage the_image 0 50 50 50 0 25 25 25 - drawImage the_image 50 50 50 50 25 25 25 25 - - - # Rotation w/o smooth xform - translate 120 0 - save - setRenderHint SmoothPixmapTransform off - rotate 10 - drawImage the_image 0 0 - restore - - # Rotation w smooth xform - translate 120 0 - save - setRenderHint SmoothPixmapTransform - rotate 10 - drawImage the_image 0 0 - restore - -restore - -end_block - - -translate 0 120 -image_load dome_rgb32.png the_image -repeat_block draw_stuff - -translate 0 120 -image_load dome_indexed.png the_image -repeat_block draw_stuff - -translate 0 120 -image_load dome_indexed_mask.png the_image -repeat_block draw_stuff - -translate 0 120 -image_load dome_mono.png the_image -repeat_block draw_stuff - - -resetMatrix -translate 700 60 -setPen black -drawText 0 0 "32 bit w/alpha" -translate 0 120 -drawText 0 0 "32 bit w/o alpha" -translate 0 120 -drawText 0 0 "8 bit indexed" -translate 0 120 -drawText 0 0 "8 bit indexed w/mask" -translate 0 120 -drawText 0 0 "1 bit" -resetMatrix -translate 0 600 -drawText 0 0 "normal" -translate 120 0 -drawText 0 0 "subrect" -translate 120 0 -drawText 0 0 "subrect scale" -translate 120 0 -drawText 0 0 "subrect scale smooth" -translate 120 0 -drawText 0 0 "xform" -translate 120 0 -drawText 0 0 "smooth xform" -translate 120 0 diff --git a/tests/arthur/data/qps/images2.qps b/tests/arthur/data/qps/images2.qps deleted file mode 100644 index a4df446f64..0000000000 --- a/tests/arthur/data/qps/images2.qps +++ /dev/null @@ -1,143 +0,0 @@ -image_load dome_argb32.png the_image -begin_block draw_stuff - -save - # standard draw - drawImage the_image 0 0 - - # flip x - translate 220 0 - scale -1 1 - drawImage the_image 0 0 - scale -1 1 - - # flip y - translate 20 100 - scale 1 -1 - drawImage the_image 0 0 - scale 1 -1 - - # flip x and y - translate 220 0 - scale -1 -1 - drawImage the_image 0 0 - scale -1 -1 - - # flip y and scale - translate 20 10 - save - scale 1 -1.1 - drawImage the_image 0 0 - restore - - # flip y and scale - translate 220 -110 - save - scale -1.1 0.9 - drawImage the_image 0 0 - restore -restore -end_block - -setRenderHint Antialiasing - -resetMatrix -translate 0 120 -repeat_block draw_stuff - -resetMatrix -translate 720 60 -setPen black -drawText 0 0 "aliased" -translate 0 120 -drawText 0 0 "antialiased" -resetMatrix -translate 0 260 -drawText 0 0 "normal" -translate 120 0 -drawText 0 0 "flip x" -translate 120 0 -drawText 0 0 "flip y" -translate 120 0 -drawText 0 0 "flip x and y" -translate 120 0 -drawText 0 0 "flip y and scale" -translate 120 0 -drawText 0 0 "flip x and scale" -translate 120 0 - -setRenderHint SmoothPixmapTransform - -resetMatrix -translate 20 300 -drawImage border.png 0 0 100 100 1 1 8 8 -drawText 0 -5 "subrect color bleeding" -translate 0 120 -drawImage border.png 0 0 100 100 0 0 10 10 - -image_load sign.png the_image -resetMatrix -drawText 240 300 "drawImage() with varying sx/sy offsets" -translate 0 10 -drawRect 240 300 50 50 -drawImage the_image 240 300 50 50 20 0 80 80 -drawRect 300 300 50 50 -drawImage the_image 300 300 50 50 -20 0 80 80 -drawRect 240 370 50 50 -drawImage the_image 240 370 50 50 0 20 80 80 -drawRect 300 370 50 50 -drawImage the_image 300 370 50 50 0 -20 80 80 - -pixmap_load sign.png the_pixmap -translate 220 0 -translate 0 -10 -drawText 240 300 "drawPixmap() with varying sx/sy offsets" -translate 0 10 -drawRect 240 300 50 50 -drawPixmap the_pixmap 240 300 50 50 20 0 80 80 -drawRect 300 300 50 50 -drawPixmap the_pixmap 300 300 50 50 -20 0 80 80 -drawRect 240 370 50 50 -drawPixmap the_pixmap 240 370 50 50 0 20 80 80 -drawRect 300 370 50 50 -drawPixmap the_pixmap 300 370 50 50 0 -20 80 80 - - -resetMatrix -translate 0 170 -drawText 240 300 "drawImage() with varying sx/sy offsets" -translate 0 10 -drawRect 240 300 50 50 -drawImage the_image 240 300 50 50 50 0 50 50 -drawRect 300 300 50 50 -drawImage the_image 300 300 50 50 -20 0 50 50 -drawRect 240 370 50 50 -drawImage the_image 240 370 50 50 0 50 50 50 -drawRect 300 370 50 50 -drawImage the_image 300 370 50 50 0 -20 50 50 - -resetMatrix -translate 220 170 -drawText 240 300 "drawPixmap() with varying sx/sy offsets" -translate 0 10 -drawRect 240 300 50 50 -drawPixmap the_pixmap 240 300 50 50 50 0 50 50 -drawRect 300 300 50 50 -drawPixmap the_pixmap 300 300 50 50 -20 0 50 50 -drawRect 240 370 50 50 -drawPixmap the_pixmap 240 370 50 50 0 50 50 50 -drawRect 300 370 50 50 -drawPixmap the_pixmap 300 370 50 50 0 -20 50 50 - -resetMatrix -drawText 10 620 "drawImage/Pixmap() with negative x/y and sx/sy" -setPen red - -translate 20 640 -drawImage the_image -10 -10 -1 -1 -10 -10 0 0 -drawRect 0 0 80 80 - -translate 100 0 -drawPixmap the_pixmap -10 -10 -1 -1 -10 -10 0 0 -drawRect 0 0 80 80 - diff --git a/tests/arthur/data/qps/images2_qps.png b/tests/arthur/data/qps/images2_qps.png deleted file mode 100644 index ee8936a939..0000000000 Binary files a/tests/arthur/data/qps/images2_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/images_qps.png b/tests/arthur/data/qps/images_qps.png deleted file mode 100644 index af07cc3651..0000000000 Binary files a/tests/arthur/data/qps/images_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/join_cap_styles.qps b/tests/arthur/data/qps/join_cap_styles.qps deleted file mode 100644 index f2a07f5b7f..0000000000 --- a/tests/arthur/data/qps/join_cap_styles.qps +++ /dev/null @@ -1,60 +0,0 @@ - -setRenderHint Antialiasing - -path_moveTo p 20 20 -path_cubicTo p 100 20 100 180 180 100 -path_lineTo p 20 180 -path_lineTo p 180 20 - -setPen black 20 solidline roundcap roundjoin -drawPath p -setPen red -drawPath p - -translate 200 0 -setPen black 20 solidline roundcap miterjoin -drawPath p -setPen red -drawPath p - -translate 200 0 -setPen black 20 solidline roundcap beveljoin -drawPath p -setPen red -drawPath p - -translate -400 200 -setPen black 20 solidline squarecap roundjoin -drawPath p -setPen red -drawPath p - -translate 200 0 -setPen black 20 solidline squarecap miterjoin -drawPath p -setPen red -drawPath p - -translate 200 0 -setPen black 20 solidline squarecap beveljoin -drawPath p -setPen red -drawPath p - -translate -400 200 -setPen black 20 solidline flatcap roundjoin -drawPath p -setPen red -drawPath p - -translate 200 0 -setPen black 20 solidline flatcap miterjoin -drawPath p -setPen red -drawPath p - -translate 200 0 -setPen black 20 solidline flatcap beveljoin -drawPath p -setPen red -drawPath p diff --git a/tests/arthur/data/qps/join_cap_styles_duplicate_control_points.qps b/tests/arthur/data/qps/join_cap_styles_duplicate_control_points.qps deleted file mode 100644 index d03f059fb6..0000000000 --- a/tests/arthur/data/qps/join_cap_styles_duplicate_control_points.qps +++ /dev/null @@ -1,65 +0,0 @@ - -setRenderHint Antialiasing - -path_moveTo p 40 70 -path_lineTo p 20 70 -path_cubicTo p 20 70 40 20 80 80 - -path_moveTo p 20 120 -path_cubicTo p 50 60 80 110 80 110 -path_lineTo p 60 110 - -scale 2 2 - -setPen black 10 solidline roundcap roundjoin -drawPath p -setPen red -drawPath p - -translate 100 0 -setPen black 10 solidline roundcap miterjoin -drawPath p -setPen red -drawPath p - -translate 100 0 -setPen black 10 solidline roundcap beveljoin -drawPath p -setPen red -drawPath p - -translate -200 100 -setPen black 10 solidline squarecap roundjoin -drawPath p -setPen red -drawPath p - -translate 100 0 -setPen black 10 solidline squarecap miterjoin -drawPath p -setPen red -drawPath p - -translate 100 0 -setPen black 10 solidline squarecap beveljoin -drawPath p -setPen red -drawPath p - -translate -200 100 -setPen black 10 solidline flatcap roundjoin -drawPath p -setPen red -drawPath p - -translate 100 0 -setPen black 10 solidline flatcap miterjoin -drawPath p -setPen red -drawPath p - -translate 100 0 -setPen black 10 solidline flatcap beveljoin -drawPath p -setPen red -drawPath p diff --git a/tests/arthur/data/qps/join_cap_styles_duplicate_control_points_qps.png b/tests/arthur/data/qps/join_cap_styles_duplicate_control_points_qps.png deleted file mode 100644 index b94f57222c..0000000000 Binary files a/tests/arthur/data/qps/join_cap_styles_duplicate_control_points_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/join_cap_styles_qps.png b/tests/arthur/data/qps/join_cap_styles_qps.png deleted file mode 100644 index 378d29e781..0000000000 Binary files a/tests/arthur/data/qps/join_cap_styles_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/linear_gradients.qps b/tests/arthur/data/qps/linear_gradients.qps deleted file mode 100644 index 2f3c80f2a6..0000000000 --- a/tests/arthur/data/qps/linear_gradients.qps +++ /dev/null @@ -1,141 +0,0 @@ -path_addRect path 400 0 80 80 -path_addEllipse path 440 40 60 60 - -setRenderHint Antialiasing - -setPen black - -begin_block gradients -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setLinear 20 20 70 70 -drawRect 0 0 100 100 - -gradient_setSpread ReflectSpread -gradient_setLinear 120 20 170 70 -drawEllipse 100 0 100 100 - -gradient_setSpread RepeatSpread -gradient_setLinear 220 20 270 70 -drawRoundRect 200 0 100 100 - -gradient_clearStops -gradient_appendStop 0 3f7f7fff -gradient_appendStop 0.5 dfdfffff -gradient_appendStop 1 7f00007f - -gradient_setSpread PadSpread -gradient_setLinear 320 20 340 40 -drawPolygon [300 0 390 0 350 99] - -gradient_setSpread ReflectSpread -gradient_setLinear 420 20 440 40 -drawPath path - -gradient_setSpread RepeatSpread -gradient_setLinear 520 20 540 40 -drawPie 500 0 100 100 720 4320 -end_block - -translate 0 100 -scale 1 2 -repeat_block gradients - -resetMatrix -translate 0 300 -brushTranslate 30 0 -brushScale 0.9 0.9 -brushRotate 20 -repeat_block gradients - -# Vertical gradient tests -resetMatrix -setBrush noBrush -translate 0 400 - -begin_block vertical_gradients -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setLinear 20 20 20 70 -drawRect 0 0 100 100 - -gradient_setSpread ReflectSpread -gradient_setLinear 120 20 120 70 -drawEllipse 100 0 100 100 - -gradient_setSpread RepeatSpread -gradient_setLinear 220 20 220 70 -drawRoundRect 200 0 100 100 - -gradient_clearStops -gradient_appendStop 0 3f7f7fff -gradient_appendStop 0.5 dfdfffff -gradient_appendStop 1 7f00007f - -gradient_setSpread PadSpread -gradient_setLinear 320 20 320 40 -drawPolygon [300 0 390 0 350 99] - -gradient_setSpread ReflectSpread -gradient_setLinear 420 20 420 40 -drawPath path - -gradient_setSpread RepeatSpread -gradient_setLinear 520 20 520 40 -drawPie 500 0 100 100 720 4320 -end_block - -translate 0 100 -scale 1 1.5 -repeat_block vertical_gradients - -resetMatrix -translate 0 650 -brushTranslate 30 0 -brushScale 0.9 0.9 -brushRotate 20 -repeat_block vertical_gradients - -# Some helpful info perhaps? -resetMatrix -setPen black -# gradient line indicators -drawLine 20 20 70 70 -drawLine 120 20 170 70 -drawLine 220 20 270 70 -drawLine 320 20 340 40 -drawLine 420 20 440 40 -drawLine 520 20 540 40 - -drawLine 20 140 70 240 -drawLine 120 140 170 240 -drawLine 220 140 270 240 -drawLine 320 140 340 180 -drawLine 420 140 440 180 -drawLine 520 140 540 180 - -drawText 610 50 "No XForm" -drawText 610 200 "scale 1x2" -drawText 610 350 "brush transform" -drawText 610 450 "vertical brush" -drawText 610 570 "vertical brush scale 1x1.5" -drawText 610 700 "vertical brush transform" - -drawText 10 780 "Pad" -drawText 110 780 "Reflect" -drawText 210 780 "Repeat" -drawText 310 780 "Pad w/alpha" -drawText 410 780 "Reflect w/alpha" -drawText 510 780 "Repeat w/alpha" diff --git a/tests/arthur/data/qps/linear_gradients_perspectives.qps b/tests/arthur/data/qps/linear_gradients_perspectives.qps deleted file mode 100644 index 4d619b5ccd..0000000000 --- a/tests/arthur/data/qps/linear_gradients_perspectives.qps +++ /dev/null @@ -1,60 +0,0 @@ - -setRenderHint Antialiasing - -setPen #00ff00 - -translate 10 10 -# standard draw -begin_block gradient -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setLinear 10 10 290 290 -drawRect 0 0 300 300 -end_block gradient - -# Rotation w/o smooth xform -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0 - repeat_block gradient -restore -restore - -translate 0 320 - -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0 - repeat_block gradient -restore - -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50 - repeat_block gradient -restore -restore - - -resetMatrix -setPen black -translate 125 20 -drawText 0 0 "No transform" -translate 350 0 -drawText 0 0 "Left Tilted" -resetMatrix -translate 125 350 -drawText 0 0 "Bottom Tilted" -translate 350 0 -drawText 0 0 "Right Tilted" -translate 120 0 diff --git a/tests/arthur/data/qps/linear_gradients_perspectives_qps.png b/tests/arthur/data/qps/linear_gradients_perspectives_qps.png deleted file mode 100644 index 3315ebe498..0000000000 Binary files a/tests/arthur/data/qps/linear_gradients_perspectives_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/linear_gradients_qps.png b/tests/arthur/data/qps/linear_gradients_qps.png deleted file mode 100644 index a4cdc436a7..0000000000 Binary files a/tests/arthur/data/qps/linear_gradients_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/linear_resolving_gradients.qps b/tests/arthur/data/qps/linear_resolving_gradients.qps deleted file mode 100644 index 2ad9c00876..0000000000 --- a/tests/arthur/data/qps/linear_resolving_gradients.qps +++ /dev/null @@ -1,75 +0,0 @@ -setRenderHint Antialiasing - -setPen black - -begin_block gradients -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setCoordinateMode ObjectBoundingMode -gradient_setLinear 0.2 0.2 0.7 0.7 -drawRect 0 0 100 100 - -gradient_setSpread ReflectSpread -gradient_setLinear 0.2 0.2 0.7 0.7 -drawEllipse 100 0 100 100 - -gradient_setSpread RepeatSpread -gradient_setLinear 0.2 0.2 0.7 0.7 -drawRoundRect 200 0 100 100 - -gradient_clearStops -gradient_appendStop 0 3f7f7fff -gradient_appendStop 0.5 dfdfffff -gradient_appendStop 1 7f00007f - -gradient_setSpread PadSpread -gradient_setLinear 0.2 0.2 0.8 0.4 -drawPolygon [300 0 400 0 350 100] - -gradient_setSpread RepeatSpread -gradient_setLinear 0.2 0.2 0.4 0.4 -drawPie 400 0 100 100 720 4320 -end_block - -translate 0 100 -scale 1 2 -repeat_block gradients - -resetMatrix -translate 0 300 -brushTranslate 30 0 -brushScale 0.9 0.9 -brushRotate 20 -repeat_block gradients - -# Some helpful info perhaps? -resetMatrix -setPen black -# gradient line indicators -drawLine 20 20 70 70 -drawLine 120 20 170 70 -drawLine 220 20 270 70 -drawLine 320 20 340 40 -drawLine 420 20 440 40 - -drawLine 20 140 70 240 -drawLine 120 140 170 240 -drawLine 220 140 270 240 -drawLine 320 140 340 180 -drawLine 420 140 440 180 - -drawText 510 50 "No XForm" -drawText 510 200 "scale 1x2" -drawText 510 300 "brush transform" - -drawText 10 450 "Pad" -drawText 110 450 "Reflect" -drawText 210 450 "Repeat" -drawText 310 450 "Pad w/alpha" -drawText 410 450 "Repeat w/alpha" diff --git a/tests/arthur/data/qps/linear_resolving_gradients_qps.png b/tests/arthur/data/qps/linear_resolving_gradients_qps.png deleted file mode 100644 index 2c1c996e92..0000000000 Binary files a/tests/arthur/data/qps/linear_resolving_gradients_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/lineconsistency.qps b/tests/arthur/data/qps/lineconsistency.qps deleted file mode 100644 index c4b9cafb86..0000000000 --- a/tests/arthur/data/qps/lineconsistency.qps +++ /dev/null @@ -1,70 +0,0 @@ -begin_block draw -setPen red -drawPolygon [1.1 1 3.3 30.6 23.1 39.2 38.9 6.5] -setPen black -drawLine 1.1 1 3.3 30.6 -drawLine 3.3 30.6 23.1 39.2 -drawLine 23.1 39.2 38.9 6.5 -drawLine 38.9 6.5 1.1 1 -end_block draw -drawText 0 60 "0.0 aligned" -translate 0.1 80.1 -repeat_block draw -drawText 0 60 "0.1 aligned" -translate 0.1 80.1 -repeat_block draw -drawText 0 60 "0.2 aligned" -translate 0.1 80.1 -repeat_block draw -drawText 0 60 "0.3 aligned" -translate 0.1 80.1 -repeat_block draw -drawText 0 60 "0.4 aligned" -translate 0.1 80.1 -repeat_block draw -drawText 0 60 "0.5 aligned" -translate 0.1 80.1 -repeat_block draw -drawText 0 60 "0.6 aligned" -translate 0.1 80.1 -repeat_block draw -drawText 0 60 "0.7 aligned" -translate 0.1 80.1 -repeat_block draw -drawText 0 60 "0.8 aligned" -translate 0.1 80.1 -repeat_block draw -drawText 0 60 "0.9 aligned" - -resetMatrix -translate 100 0 -setPen black -drawText 0 20 "Line and text, 0.0 aligned" -drawLine 0 21 160 21 -translate 0 40.1 -drawText 0 20 "Line and text, 0.1 aligned" -drawLine 0 21 160 21 -translate 0 40.1 -drawText 0 20 "Line and text, 0.2 aligned" -drawLine 0 21 160 21 -translate 0 40.1 -drawText 0 20 "Line and text, 0.3 aligned" -drawLine 0 21 160 21 -translate 0 40.1 -drawText 0 20 "Line and text, 0.4 aligned" -drawLine 0 21 160 21 -translate 0 40.1 -drawText 0 20 "Line and text, 0.5 aligned" -drawLine 0 21 160 21 -translate 0 40.1 -drawText 0 20 "Line and text, 0.6 aligned" -drawLine 0 21 160 21 -translate 0 40.1 -drawText 0 20 "Line and text, 0.7 aligned" -drawLine 0 21 160 21 -translate 0 40.1 -drawText 0 20 "Line and text, 0.8 aligned" -drawLine 0 21 160 21 -translate 0 40.1 -drawText 0 20 "Line and text, 0.9 aligned" -drawLine 0 21 160 21 diff --git a/tests/arthur/data/qps/lineconsistency_qps.png b/tests/arthur/data/qps/lineconsistency_qps.png deleted file mode 100644 index 9d19a5dffa..0000000000 Binary files a/tests/arthur/data/qps/lineconsistency_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/linedashes.qps b/tests/arthur/data/qps/linedashes.qps deleted file mode 100644 index 60c49eba14..0000000000 --- a/tests/arthur/data/qps/linedashes.qps +++ /dev/null @@ -1,92 +0,0 @@ -translate 10 10 - -setPen 0xffff0000 0 solidline squarecap -translate 50 50 -begin_block draw_lines - save - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - restore -end_block - -setPen 0xffff0000 0 dotline squarecap -translate 100 0 -repeat_block draw_lines -setPen 0xffff0000 0 dashdotline squarecap -translate 100 0 -repeat_block draw_lines -setPen 0xffff0000 0 dashdotdotline squarecap -translate 100 0 -repeat_block draw_lines -setPen 0xffff0000 0 dashline squarecap -translate 100 0 -repeat_block draw_lines diff --git a/tests/arthur/data/qps/linedashes2.qps b/tests/arthur/data/qps/linedashes2.qps deleted file mode 100644 index 3ea2a17bd6..0000000000 --- a/tests/arthur/data/qps/linedashes2.qps +++ /dev/null @@ -1,151 +0,0 @@ -translate -30 10 - -setPen 0xffff0000 0 dashline squarecap -pen_setDashPattern [10 5] - -save -translate 100 100 -begin_block lines -drawLine 100 100 200 100 -drawLine 100 100 200 200 -drawLine 100 100 100 200 -end_block - -setPen 0xffff0000 2 dashline squarecap -translate 150 0 -repeat_block lines -restore - -save -save -begin_block horizontal -drawLine 0 0 50 0 -drawLine 3 10 53 10 -drawLine 6 20 56 20 -drawLine 9 30 59 30 - -translate 0 50 - -drawLine 0 0 50 5 -drawLine 3 10 53 15 -drawLine 6 20 56 25 -drawLine 9 30 59 35 - -translate 0 50 - -drawLine 0 0 50 -5 -drawLine 3 10 53 5 -drawLine 6 20 56 15 -drawLine 9 30 59 25 -end_block -restore - -save -translate 80 0 -repeat_block horizontal -restore -save -translate 800 0 -repeat_block horizontal -restore - -translate 180 -40 -save -begin_block vertical -drawLine 0 0 0 50 -drawLine 10 3 10 53 -drawLine 20 6 20 56 -drawLine 30 9 30 59 - -translate 50 0 - -drawLine 0 0 5 50 -drawLine 10 3 15 53 -drawLine 20 6 25 56 -drawLine 30 9 35 59 - -translate 50 0 - -drawLine 0 0 -5 50 -drawLine 10 3 5 53 -drawLine 20 6 15 56 -drawLine 30 9 25 59 -end_block -restore - -save -translate 0 80 -repeat_block vertical -restore -translate 0 800 -repeat_block vertical -restore - -translate 0 200 - -setPen 0xffff0000 2 dashline squarecap -save -repeat_block horizontal -restore -save -translate 80 0 -repeat_block horizontal -restore -save -translate 780 0 -repeat_block horizontal -restore - -translate 360 -240 -save -repeat_block vertical -restore -save -translate 0 80 -repeat_block vertical -restore -translate 0 780 -repeat_block vertical - -resetMatrix -translate 40 400 -setPen 0xffff0000 5 dashdotline flatcap -pen_setDashPattern [1 1 4 1 1 4] -pen_setDashOffset -4 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset -2 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset 0 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset 2 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset 4 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset 6 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset 8 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset 10 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset 12 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset 14 -drawLine 0 0 300 0 -translate 0 8 -pen_setDashOffset 16 -drawLine 0 0 300 0 - -resetMatrix -setPen black 3 dashdotline -pen_setCosmetic true -translate 0 -150 -drawLine 500 160 500 410 diff --git a/tests/arthur/data/qps/linedashes2_aa.qps b/tests/arthur/data/qps/linedashes2_aa.qps deleted file mode 100644 index 299674c697..0000000000 --- a/tests/arthur/data/qps/linedashes2_aa.qps +++ /dev/null @@ -1,2 +0,0 @@ -setRenderHint LineAntialiasing -import "linedashes2.qps" diff --git a/tests/arthur/data/qps/linedashes2_aa_qps.png b/tests/arthur/data/qps/linedashes2_aa_qps.png deleted file mode 100644 index 54c84b3ea9..0000000000 Binary files a/tests/arthur/data/qps/linedashes2_aa_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/linedashes2_qps.png b/tests/arthur/data/qps/linedashes2_qps.png deleted file mode 100644 index 1d3555e3b0..0000000000 Binary files a/tests/arthur/data/qps/linedashes2_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/linedashes_qps.png b/tests/arthur/data/qps/linedashes_qps.png deleted file mode 100644 index 9eaa7a56df..0000000000 Binary files a/tests/arthur/data/qps/linedashes_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/lines.qps b/tests/arthur/data/qps/lines.qps deleted file mode 100644 index 560d034307..0000000000 --- a/tests/arthur/data/qps/lines.qps +++ /dev/null @@ -1,555 +0,0 @@ - -translate 10 10 - -begin_block draw_lines - save - translate 50 50 - - save - setPen 0x7fff0000 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - restore - - # and then draw the lines the other direction - save - setPen 0x7f0000ff - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - rotate 10 - drawLine 50 0 10 0 - restore - - # and now with a clip - save - setClipRect -30 -30 60 60 - setPen 0x7f00ff00 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - rotate 10 - drawLine 10 0 50 0 - restore - - restore -end_block - -save - translate 100 0 - scale 2 2 - repeat_block draw_lines -restore - -translate 0 10 - -save - translate 0 200 - setRenderHint Antialiasing - repeat_block draw_lines -restore - -save - translate 100 200 - scale 2 2 - setRenderHint Antialiasing - repeat_block draw_lines -restore - -translate 320 0 - -setPen black 0 solidline squarecap - -begin_block lines - -# 0 -> 45 degress -drawLine 100 100 200 90 -drawLine 100 100 200 80 -drawLine 100 100 200 70 -drawLine 100 100 200 60 -drawLine 100 100 200 50 -drawLine 100 100 200 40 -drawLine 100 100 200 30 -drawLine 100 100 200 20 -drawLine 100 100 200 10 - -# 45 -drawLine 100 100 200 0 - -# 45 -> 90 -drawLine 100 100 190 0 -drawLine 100 100 180 0 -drawLine 100 100 170 0 -drawLine 100 100 160 0 -drawLine 100 100 150 0 -drawLine 100 100 140 0 -drawLine 100 100 130 0 -drawLine 100 100 120 0 -drawLine 100 100 110 0 - -# 90 -drawLine 100 100 100 0 - -# 90 -> 135 -drawLine 100 100 90 0 -drawLine 100 100 80 0 -drawLine 100 100 70 0 -drawLine 100 100 60 0 -drawLine 100 100 50 0 -drawLine 100 100 40 0 -drawLine 100 100 30 0 -drawLine 100 100 20 0 -drawLine 100 100 10 0 - -# 135 -drawLine 100 100 0 0 - -# 135 -> 180 degress -drawLine 100 100 0 10 -drawLine 100 100 0 20 -drawLine 100 100 0 30 -drawLine 100 100 0 40 -drawLine 100 100 0 50 -drawLine 100 100 0 60 -drawLine 100 100 0 70 -drawLine 100 100 0 80 -drawLine 100 100 0 90 - -# 180 -drawLine 100 100 0 100 - -# 180 -> 225 -drawLine 100 100 0 110 -drawLine 100 100 0 120 -drawLine 100 100 0 130 -drawLine 100 100 0 140 -drawLine 100 100 0 150 -drawLine 100 100 0 160 -drawLine 100 100 0 170 -drawLine 100 100 0 180 -drawLine 100 100 0 190 - -# 225 -drawLine 100 100 0 200 - -# 225 -> 270 -drawLine 100 100 10 200 -drawLine 100 100 20 200 -drawLine 100 100 30 200 -drawLine 100 100 40 200 -drawLine 100 100 50 200 -drawLine 100 100 60 200 -drawLine 100 100 70 200 -drawLine 100 100 80 200 -drawLine 100 100 90 200 - -# 270 -drawLine 100 100 100 200 - -# 270 -> 315 degrees -drawLine 100 100 110 200 -drawLine 100 100 120 200 -drawLine 100 100 130 200 -drawLine 100 100 140 200 -drawLine 100 100 150 200 -drawLine 100 100 160 200 -drawLine 100 100 170 200 -drawLine 100 100 180 200 -drawLine 100 100 190 200 - -# 315 -drawLine 100 100 200 200 - -# 315 -> 360 degress -drawLine 100 100 200 100 -drawLine 100 100 200 110 -drawLine 100 100 200 120 -drawLine 100 100 200 130 -drawLine 100 100 200 140 -drawLine 100 100 200 150 -drawLine 100 100 200 160 -drawLine 100 100 200 170 -drawLine 100 100 200 180 -drawLine 100 100 200 190 - -end_block - - -setRenderHint Antialiasing -setPen 0x7fff0000 -translate 0.5 0.5 -repeat_block lines - -setPen 0x000000 8 -translate 20 240 -drawText 0 0 "Steep slopes:" - -translate 0 10 - -drawLine 0 0 -8 400 -translate 20 0 -drawLine 0 0 -7 400 -translate 20 0 -drawLine 0 0 -6 400 -translate 20 0 -drawLine 0 0 -5 400 -translate 20 0 -drawLine 0 0 -4 400 -translate 20 0 -drawLine 0 0 -3 400 -translate 20 0 -drawLine 0 0 -2 400 -translate 20 0 -drawLine 0 0 -1 400 -translate 20 0 -drawLine 0 0 0 400 -translate 20 0 -drawLine 0 0 1 400 -translate 20 0 -drawLine 0 0 2 400 -translate 20 0 -drawLine 0 0 3 400 -translate 20 0 -drawLine 0 0 4 400 -translate 20 0 -drawLine 0 0 5 400 -translate 20 0 -drawLine 0 0 6 400 -translate 20 0 -drawLine 0 0 7 400 -translate 20 0 -drawLine 0 0 8 400 - -resetMatrix - -translate 20 450 - -drawText 0 0 "Zero length lines:" - -translate 0 20 -drawText 100 10 "Square cap" -save -begin_block points -setPen 0x000000 1 solidline squarecap -drawLine 0 0 0 0 -setPen 0x000000 2 solidline squarecap -drawLine 8 0 8 0 -setPen 0x000000 3 solidline squarecap -drawLine 16 0 16 0 -setPen 0x000000 4 solidline squarecap -drawLine 24 0 24 0 -setPen 0x000000 5 solidline squarecap -drawLine 32 0 32 0 -setPen 0x000000 6 solidline squarecap -drawLine 40 0 40 0 -setPen 0x000000 7 solidline squarecap -drawLine 48 0 48 0 -setPen 0x000000 8 solidline squarecap -drawLine 57 0 57 0 -setPen 0x000000 9 solidline squarecap -drawLine 67 0 67 0 -setPen 0x000000 10 solidline squarecap -drawLine 78 0 78 0 -end_block points -restore - -translate 0 12 -setRenderHint Antialiasing off -repeat_block points -setRenderHint Antialiasing - -translate 0 20 -drawText 100 10 "Round cap" -save -begin_block points2 -setPen 0x000000 1 solidline roundcap -drawLine 0 0 0 0 -setPen 0x000000 2 solidline roundcap -drawLine 8 0 8 0 -setPen 0x000000 3 solidline roundcap -drawLine 16 0 16 0 -setPen 0x000000 4 solidline roundcap -drawLine 24 0 24 0 -setPen 0x000000 5 solidline roundcap -drawLine 32 0 32 0 -setPen 0x000000 6 solidline roundcap -drawLine 40 0 40 0 -setPen 0x000000 7 solidline roundcap -drawLine 48 0 48 0 -setPen 0x000000 8 solidline roundcap -drawLine 57 0 57 0 -setPen 0x000000 9 solidline roundcap -drawLine 67 0 67 0 -setPen 0x000000 10 solidline roundcap -drawLine 78 0 78 0 -end_block points2 -restore - -translate 0 12 -setRenderHint Antialiasing off -repeat_block points2 -setRenderHint Antialiasing - -translate 0 20 -drawText 100 10 "Flat cap" -save -begin_block points3 -setPen 0x000000 1 solidline flatcap -drawLine 0 0 0 0 -setPen 0x000000 2 solidline flatcap -drawLine 8 0 8 0 -setPen 0x000000 3 solidline flatcap -drawLine 16 0 16 0 -setPen 0x000000 4 solidline flatcap -drawLine 24 0 24 0 -setPen 0x000000 5 solidline flatcap -drawLine 32 0 32 0 -setPen 0x000000 6 solidline flatcap -drawLine 40 0 40 0 -setPen 0x000000 7 solidline flatcap -drawLine 48 0 48 0 -setPen 0x000000 8 solidline flatcap -drawLine 57 0 57 0 -setPen 0x000000 9 solidline flatcap -drawLine 67 0 67 0 -setPen 0x000000 10 solidline flatcap -drawLine 78 0 78 0 -end_block points3 -restore - -translate 0 12 -setRenderHint Antialiasing off -repeat_block points3 - -resetMatrix -translate -220 667.226 -drawText 230 -80 "Task 194266 (should see only one line):" -setPen black -drawRect 230.5 -70.5 122 12 -setRenderHint Antialiasing -setPen red -drawLine 236.842105263 -63.775117299 247.368421053 -63.775437504 - -setRenderHint Antialiasing off -resetMatrix -translate 10 640 -setPen black -drawText 0 -10 "Task 207147 (should see two lines):" -drawRect 0.5 0.5 64 64 -setRenderHint Antialiasing -setPen red - -drawLine 4.5 4.5 4.5001 60.5 -drawLine 4.5 4.5 60.5 4.5001 - -setRenderHint Antialiasing off -resetMatrix -translate 10 730 -setPen black -drawText 0 -10 "Task 229459 (should see one diagonal line):" -drawRect 0.5 0.5 64 64 -setPen red 2 solidline flatcap - -setClipRect 2 2 63 63 -drawLine 1.5 1.5 33560000 33560000 diff --git a/tests/arthur/data/qps/lines2.qps b/tests/arthur/data/qps/lines2.qps deleted file mode 100644 index d1a658c46d..0000000000 --- a/tests/arthur/data/qps/lines2.qps +++ /dev/null @@ -1,176 +0,0 @@ -translate 10 20 -drawText 0 0 "Thin lines" - -translate 60 70 - -save -begin_block lines -translate 0 -60 -translate 0 5 -setPen 0x000000 0.05 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.1 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.15 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.2 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.25 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.3 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.35 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.2 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.25 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.5 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.55 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.6 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.65 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.7 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.75 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.8 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.85 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.9 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 0.95 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.05 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.1 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.15 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.2 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.25 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.3 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.35 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.2 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.25 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.5 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.55 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.6 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.65 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.7 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.75 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.8 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.85 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.9 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 1.95 -drawLine -60 -2 60 2 -translate 0 5 -setPen 0x000000 2 -drawLine -60 -2 60 2 -end_block -restore - -save -translate 150 0 -scale -1 1 -repeat_block lines -restore - -save -translate 80 220 -rotate 90 -repeat_block lines -restore - -save -translate 80 370 -rotate 90 -scale -1 1 -repeat_block lines -restore - -setRenderHint Antialiasing - -translate 300 0 - -save -repeat_block lines -restore - -save -translate 150 0 -scale -1 1 -repeat_block lines -restore - -save -translate 80 220 -rotate 90 -repeat_block lines -restore - -save -translate 80 370 -rotate 90 -scale -1 1 -repeat_block lines -restore diff --git a/tests/arthur/data/qps/lines2_qps.png b/tests/arthur/data/qps/lines2_qps.png deleted file mode 100644 index 54dcd927ce..0000000000 Binary files a/tests/arthur/data/qps/lines2_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/lines_qps.png b/tests/arthur/data/qps/lines_qps.png deleted file mode 100644 index ec8cc19fe4..0000000000 Binary files a/tests/arthur/data/qps/lines_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/object_bounding_mode.qps b/tests/arthur/data/qps/object_bounding_mode.qps deleted file mode 100644 index 3024c28682..0000000000 --- a/tests/arthur/data/qps/object_bounding_mode.qps +++ /dev/null @@ -1,35 +0,0 @@ -setRenderHint Antialiasing - -setPen black 5 - -translate 10 10 - -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setCoordinateMode ObjectBoundingMode -gradient_setLinear 0.2 0.2 0.7 0.7 -gradient_setLinearPen 0.0 0.0 0.0 1.0 - -begin_block objects -drawRect 0 0 100 100 -drawEllipse 100 0 100 100 -drawRoundRect 200 0 100 100 -drawPolygon [300 0 390 0 350 99] -drawPie 400 0 100 100 720 4320 -drawLine 510 10 590 90 -drawRect 610 0 40 100 -drawRect 670 30 100 40 -end_block - -translate 0 120 -repeat_block objects - -translate 10 120 -rotate 10 -repeat_block objects diff --git a/tests/arthur/data/qps/object_bounding_mode_qps.png b/tests/arthur/data/qps/object_bounding_mode_qps.png deleted file mode 100644 index 8066611478..0000000000 Binary files a/tests/arthur/data/qps/object_bounding_mode_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/pathfill.qps b/tests/arthur/data/qps/pathfill.qps deleted file mode 100644 index 70077debd0..0000000000 --- a/tests/arthur/data/qps/pathfill.qps +++ /dev/null @@ -1,35 +0,0 @@ -setPen afff0000 4 - -setBrush dome_rgb32.png -drawEllipse 10 10 200 200 - -setBrush dome_argb32.png -drawEllipse 220 10 200 200 - -setPen NoPen - -setBrush dome_rgb32.png -drawEllipse 10 220 200 200 - -setBrush dome_argb32.png -drawEllipse 220 220 200 200 - -setBrushOrigin -30 -30 - -setPen afff0000 4 -setBrush dome_rgb32.png -drawEllipse 430 10 200 200 - -setBrush dome_argb32.png -drawEllipse 640 10 200 200 - -setPen NoPen -setBrush dome_rgb32.png -drawEllipse 430 220 200 200 - -setBrush dome_argb32.png -drawEllipse 640 220 200 200 - -setPen black -drawText 150 450 "No offset RGB/ARGB" -drawText 550 450 "-30 offset RGB/ARGB" diff --git a/tests/arthur/data/qps/pathfill_qps.png b/tests/arthur/data/qps/pathfill_qps.png deleted file mode 100644 index 66d09ef879..0000000000 Binary files a/tests/arthur/data/qps/pathfill_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/paths.qps b/tests/arthur/data/qps/paths.qps deleted file mode 100644 index 414b1628a2..0000000000 --- a/tests/arthur/data/qps/paths.qps +++ /dev/null @@ -1,32 +0,0 @@ -setPen black -setBrush 7f7fff - -path_moveTo star 50 0 -path_lineTo star 30 90 -path_lineTo star 100 60 -path_lineTo star 0 20 -path_lineTo star 80 100 - -setFont "times" 50 -path_addText text 0 50 "ABCD, 1234, abcd, #¤%&" - -path_addRect rectncircle 0 0 75 75 -path_addEllipse rectncircle 25 25 75 75 -path_setFillRule rectncircle winding - -path_moveTo curve 100 0 -path_cubicTo curve 100 100 50 50 0 100 - -begin_block drawing -drawPath star -translate 100 0 -drawPath rectncircle -translate 100 0 -drawPath curve -translate -200 100 -drawPath text -end_block - -translate 50 100 -rotate 10 -repeat_block drawing \ No newline at end of file diff --git a/tests/arthur/data/qps/paths_aa.qps b/tests/arthur/data/qps/paths_aa.qps deleted file mode 100644 index d63ba30f04..0000000000 --- a/tests/arthur/data/qps/paths_aa.qps +++ /dev/null @@ -1,2 +0,0 @@ -setRenderHint LineAntialiasing -import "paths.qps" \ No newline at end of file diff --git a/tests/arthur/data/qps/paths_aa_qps.png b/tests/arthur/data/qps/paths_aa_qps.png deleted file mode 100644 index e51a4ac400..0000000000 Binary files a/tests/arthur/data/qps/paths_aa_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/paths_qps.png b/tests/arthur/data/qps/paths_qps.png deleted file mode 100644 index 094a84f167..0000000000 Binary files a/tests/arthur/data/qps/paths_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/pens.qps b/tests/arthur/data/qps/pens.qps deleted file mode 100644 index 507a602fc2..0000000000 --- a/tests/arthur/data/qps/pens.qps +++ /dev/null @@ -1,130 +0,0 @@ -translate 10 10 - -begin_block penstyles -setPen black 0 solidline flatcap -drawLine 0 0 100 0 -setPen black 0 dashline flatcap -drawLine 100 0 100 40 -setPen black 0 dotline flatcap -drawLine 100 40 200 0 -setPen black 0 dashdotline flatcap -drawLine 200 0 300 0 -setPen black 0 dashdotdotline flatcap -drawLine 300 0 400 40 - -translate 0 50 -setPen blue 2 solidline flatcap -drawLine 0 0 100 0 -setPen blue 2 dashline flatcap -drawLine 100 0 100 40 -setPen blue 2 dotline flatcap -drawLine 100 40 200 0 -setPen blue 2 dashdotline flatcap -drawLine 200 0 300 0 -setPen blue 2 dashdotdotline flatcap -drawLine 300 0 400 40 - -translate 0 50 -setPen red 5 solidline flatcap -drawLine 0 0 100 0 -setPen red 5 dashline flatcap -drawLine 100 0 100 40 -setPen red 5 dotline flatcap -drawLine 100 40 200 0 -setPen red 5 dashdotline flatcap -drawLine 200 0 300 0 -setPen red 5 dashdotdotline flatcap -drawLine 300 0 400 40 -end_block - -translate 0 50 -scale 1 2 -repeat_block penstyles - - -# Test cap styles -resetMatrix -translate 420 10 -setPen green 5 dashdotline flatcap -drawLine 0 0 200 0 -setPen green 5 dashdotline roundcap -drawLine 0 20 200 20 -setPen green 5 dashdotline squarecap -drawLine 0 40 200 40 - - -# Test join styles -resetMatrix -translate 420 80 -setBrush nobrush -begin_block joinstyles -setPen orange 10 solidline flatcap miterjoin -drawPolyline [ 0 0 80 0 80 80 0 80 ] - -translate 0 100 -setPen aquamarine 10 solidline squarecap beveljoin -drawPolyline [ 0 0 80 0 80 80 0 80 ] - -translate 0 100 -setPen purple 10 solidline roundcap roundjoin -drawPolyline [ 0 0 80 0 80 80 0 80 ] -end_block - -translate 130 -200 -scale 2 1 -rotate 1 -repeat_block joinstyles - -# transparent lines -resetMatrix -translate 10 400 -setPen #7f000000 -drawLine 0 0 50 0 -setPen #7f000000 1 SolidLine -drawLine 0 10 50 10 -setPen #7f000000 5 SolidLine -drawLine 0 20 50 20 -setPen #7f000000 10 SolidLine -drawLine 0 30 50 30 -setPen #7f000000 -drawLine 0 0 0 50 -setPen #7f000000 1 SolidLine -drawLine 10 0 10 50 -setPen #7f000000 5 SolidLine -drawLine 20 0 20 50 -setPen #7f000000 10 SolidLine -drawLine 30 0 30 50 - -# pen styles -resetMatrix -translate 0 500 -setPen black 0 DashLine -drawLine 20 20 100 20 -translate 0 10 -setPen black 0 DotLine -drawLine 20 20 100 20 -translate 0 10 -setPen black 0 DashDotLine -drawLine 20 20 100 20 -translate 0 10 -setPen black 0 DashDotDotLine -drawLine 20 20 100 20 - -# scaling ellipse -resetMatrix -setPen black 0.008 DashLine -translate 250 550 -rotate 30 -scale 250 250 -drawEllipse -0.4 -0.4 0.8 0.8 - -# scaling path -path_addEllipse star -0.3 -0.3 0.6 0.6 - -resetMatrix -setPen black 0.008 DashLine -translate 250 550 -rotate 30 -scale 250 250 -drawPath star - diff --git a/tests/arthur/data/qps/pens_aa.qps b/tests/arthur/data/qps/pens_aa.qps deleted file mode 100644 index 6408e2fee3..0000000000 --- a/tests/arthur/data/qps/pens_aa.qps +++ /dev/null @@ -1,3 +0,0 @@ -setRenderHint LineAntialiasing - -import "pens.qps" \ No newline at end of file diff --git a/tests/arthur/data/qps/pens_aa_qps.png b/tests/arthur/data/qps/pens_aa_qps.png deleted file mode 100644 index edb29eb566..0000000000 Binary files a/tests/arthur/data/qps/pens_aa_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/pens_cosmetic.qps b/tests/arthur/data/qps/pens_cosmetic.qps deleted file mode 100644 index 624739d974..0000000000 --- a/tests/arthur/data/qps/pens_cosmetic.qps +++ /dev/null @@ -1,107 +0,0 @@ -path_addEllipse path 22 0 7 7 -path_addRect path 25 5 4 4 - -translate 20 20 - -begin_block lines - save - drawLine 0 0 10 10 - drawLine 2 0 10 0 - drawLine 0 2 0 10 - drawPolygon [12 0 20 0 15 10] - drawPath path - drawEllipse 32 0 8 8 - drawPoint 36 4 - - translate 100 0 - save - scale 4 1 - drawLine 0 0 10 10 - drawLine 2 0 10 0 - drawLine 0 2 0 10 - drawPolygon [12 0 20 0 15 10] - drawPath path - drawEllipse 32 0 8 8 - drawPoint 36 4 - restore - - translate 200 0 - save - scale 1 4 - drawLine 0 0 10 10 - drawLine 2 0 10 0 - drawLine 0 2 0 10 - drawPolygon [12 0 20 0 15 10] - drawPath path - drawEllipse 32 0 8 8 - drawPoint 36 4 - restore - - translate 100 0 - save - scale 4 4 - drawLine 0 0 10 10 - drawLine 2 0 10 0 - drawLine 0 2 0 10 - drawPolygon [12 0 20 0 15 10] - drawPath path - drawEllipse 32 0 8 8 - drawPoint 36 4 - restore - restore -end_block - -drawText 580 15 "non-cosmetic, 0-width" -translate 0 50 - -setPen black 2 -repeat_block lines -drawText 580 15 "non-cosmetic, 2-width" - -translate 0 20 -translate 0 50 -setPen black 0 -pen_setCosmetic true -repeat_block lines -drawText 580 15 "cosmetic, 0-width" - -translate 0 50 -setPen black 2 -pen_setCosmetic true -repeat_block lines -drawText 580 15 "cosmetic, 2-width" - - -setRenderHint Antialiasing -translate 0 20 - -translate 0 50 -setPen black 0 -repeat_block lines -drawText 580 15 "non-cosmetic, 0-width" - -translate 0 50 - -setPen black 2 -repeat_block lines -drawText 580 15 "non-cosmetic, 2-width" - -translate 0 20 -translate 0 50 -setPen black 0 -pen_setCosmetic true -repeat_block lines -drawText 580 15 "cosmetic, 0-width" - -translate 0 50 -setPen black 2 -pen_setCosmetic true -repeat_block lines -drawText 580 15 "cosmetic, 2-width" - - -translate 0 70 -drawText 0 0 "scale(1, 1)" -drawText 150 0 "scale(4, 1)" -drawText 300 0 "scale(1, 4)" -drawText 450 0 "scale(4, 4)" \ No newline at end of file diff --git a/tests/arthur/data/qps/pens_cosmetic_qps.png b/tests/arthur/data/qps/pens_cosmetic_qps.png deleted file mode 100644 index 1bd72e96f9..0000000000 Binary files a/tests/arthur/data/qps/pens_cosmetic_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/pens_qps.png b/tests/arthur/data/qps/pens_qps.png deleted file mode 100644 index e1d72a7ea5..0000000000 Binary files a/tests/arthur/data/qps/pens_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/perspectives.qps b/tests/arthur/data/qps/perspectives.qps deleted file mode 100644 index 67b5d6d574..0000000000 --- a/tests/arthur/data/qps/perspectives.qps +++ /dev/null @@ -1,70 +0,0 @@ - -setRenderHint Antialiasing - -setPen #00ff00 - -image_load image.png the_image - -translate 10 10 -# standard draw -drawImage the_image 0 0 - -# Rotation w/o smooth xform -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0 - drawImage the_image 0 0 -restore -restore - -translate 0 320 - -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0 - drawImage the_image 0 0 -restore - -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50 - drawImage the_image 0 0 -restore -restore - -setRenderHint SmoothPixmapTransform on -setBrush red -setPen black -resetMatrix -translate 100 720 -rotate_y 85 -scale 7 0.01 -drawRect -150 -150 300 300 - -resetMatrix -setBrush gam030.png -setPen black 30 -translate 700 700 -rotate_y -85 -scale 7 0.01 -drawRect -150 -150 300 300 - -resetMatrix -setPen black -translate 125 20 -drawText 0 0 "No transform" -translate 350 0 -drawText 0 0 "Left Tilted" -resetMatrix -translate 125 350 -drawText 0 0 "Bottom Tilted" -translate 350 0 -drawText 0 0 "Right Tilted" -translate 120 0 -resetMatrix -translate 300 760 -drawText 0 0 "Perspective Clipping" diff --git a/tests/arthur/data/qps/perspectives2.qps b/tests/arthur/data/qps/perspectives2.qps deleted file mode 100644 index cdd78da649..0000000000 --- a/tests/arthur/data/qps/perspectives2.qps +++ /dev/null @@ -1,307 +0,0 @@ -setRenderHint Antialiasing - -image_load zebra.png zebra_png - -image_convertToFormat zebra_png zebra ARGB32_Premultiplied - -translate 75 100 -# standard draw -begin_block row -drawImage zebra -50 -50 - -translate 90 0 -save -rotate_y 50 -drawImage zebra -50 -50 -restore - -translate 65 0 -save -rotate_y 60 -drawImage zebra -50 -50 -restore - -translate 50 0 -save -rotate_y 70 -drawImage zebra -50 -50 -restore - -translate 30 0 -save -rotate_y 80 -drawImage zebra -50 -50 -restore - -translate 24 0 -save -rotate_y 82 -drawImage zebra -50 -50 -restore - -translate 20 0 -save -rotate_y 84 -drawImage zebra -50 -50 -restore - -translate 16 0 -save -rotate_y 86 -drawImage zebra -50 -50 -restore - -translate 12 0 -save -rotate_y 87 -drawImage zebra -50 -50 -restore - -translate 8 0 -save -rotate_y 88 -drawImage zebra -50 -50 -restore - -translate 6 0 -save -rotate_y 89 -drawImage zebra -50 -50 -restore - -translate 6 0 -save -rotate_y 91 -drawImage zebra -50 -50 -restore - -translate 6 0 -save -rotate_y 92 -drawImage zebra -50 -50 -restore - -translate 8 0 -save -rotate_y 93 -drawImage zebra -50 -50 -restore - -translate 12 0 -save -rotate_y 94 -drawImage zebra -50 -50 -restore - -translate 16 0 -save -rotate_y 96 -drawImage zebra -50 -50 -restore - -translate 20 0 -save -rotate_y 98 -drawImage zebra -50 -50 -restore - -translate 24 0 -save -rotate_y 100 -drawImage zebra -50 -50 -restore - -translate 30 0 -save -rotate_y 110 -drawImage zebra -50 -50 -restore - -translate 50 0 -save -rotate_y 120 -drawImage zebra -50 -50 -restore - -translate 65 0 -save -rotate_y 130 -drawImage zebra -50 -50 -restore - -translate 90 0 -save -rotate_y 180 -drawImage zebra -50 -50 -restore -end_block - -resetMatrix -translate 75 280 -setRenderHint SmoothPixmapTransform -repeat_block row - -resetMatrix -setPen black -translate 300 20 -drawText 0 0 "Fast Pixmap Transform" -resetMatrix -translate 300 210 -drawText 0 0 "Smooth Pixmap Transform" - -resetMatrix -translate 0 400 - -image_load dome_argb32.png the_pixmap - -image_convertToFormat the_pixmap dome ARGB32 - -setRenderHint SmoothPixmapTransform false - -translate 75 100 -# standard draw -begin_block row -drawImage dome -50 -50 - -translate 90 0 -save -rotate_y 50 -drawImage dome -50 -50 -restore - -translate 65 0 -save -rotate_y 60 -drawImage dome -50 -50 -restore - -translate 50 0 -save -rotate_y 70 -drawImage dome -50 -50 -restore - -translate 30 0 -save -rotate_y 80 -drawImage dome -50 -50 -restore - -translate 24 0 -save -rotate_y 82 -drawImage dome -50 -50 -restore - -translate 20 0 -save -rotate_y 84 -drawImage dome -50 -50 -restore - -translate 16 0 -save -rotate_y 86 -drawImage dome -50 -50 -restore - -translate 12 0 -save -rotate_y 87 -drawImage dome -50 -50 -restore - -translate 8 0 -save -rotate_y 88 -drawImage dome -50 -50 -restore - -translate 6 0 -save -rotate_y 89 -drawImage dome -50 -50 -restore - -translate 6 0 -save -rotate_y 91 -drawImage dome -50 -50 -restore - -translate 6 0 -save -rotate_y 92 -drawImage dome -50 -50 -restore - -translate 8 0 -save -rotate_y 93 -drawImage dome -50 -50 -restore - -translate 12 0 -save -rotate_y 94 -drawImage dome -50 -50 -restore - -translate 16 0 -save -rotate_y 96 -drawImage dome -50 -50 -restore - -translate 20 0 -save -rotate_y 98 -drawImage dome -50 -50 -restore - -translate 24 0 -save -rotate_y 100 -drawImage dome -50 -50 -restore - -translate 30 0 -save -rotate_y 110 -drawImage dome -50 -50 -restore - -translate 50 0 -save -rotate_y 120 -drawImage dome -50 -50 -restore - -translate 65 0 -save -rotate_y 130 -drawImage dome -50 -50 -restore - -translate 90 0 -save -rotate_y 180 -drawImage dome -50 -50 -restore -end_block - -resetMatrix -translate 0 400 -translate 75 280 -setRenderHint SmoothPixmapTransform -repeat_block row - -resetMatrix -setPen black -translate 0 400 -translate 300 20 -drawText 0 0 "Fast Pixmap Transform" -resetMatrix -translate 0 400 -translate 300 210 -drawText 0 0 "Smooth Pixmap Transform" diff --git a/tests/arthur/data/qps/perspectives2_qps.png b/tests/arthur/data/qps/perspectives2_qps.png deleted file mode 100644 index 34cd570297..0000000000 Binary files a/tests/arthur/data/qps/perspectives2_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/perspectives_qps.png b/tests/arthur/data/qps/perspectives_qps.png deleted file mode 100644 index befcd51621..0000000000 Binary files a/tests/arthur/data/qps/perspectives_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/pixmap_rotation.qps b/tests/arthur/data/qps/pixmap_rotation.qps deleted file mode 100644 index f15fef8765..0000000000 --- a/tests/arthur/data/qps/pixmap_rotation.qps +++ /dev/null @@ -1,27 +0,0 @@ -translate 120 120 - -begin_block drawing -save - rotate 90 - drawPixmap solid.png 0 0 - - rotate 90 - drawPixmap solid.png 0 0 - - rotate 90 - drawPixmap solid.png 0 0 - - rotate 90 - drawPixmap solid.png 0 0 -restore -end_block - -resetMatrix - -translate 340 120 -repeat_block drawing - -resetMatrix - -drawText 50 240 "Normal X form" -drawText 270 240 "Smooth xform" \ No newline at end of file diff --git a/tests/arthur/data/qps/pixmap_rotation_qps.png b/tests/arthur/data/qps/pixmap_rotation_qps.png deleted file mode 100644 index 6d693aae66..0000000000 Binary files a/tests/arthur/data/qps/pixmap_rotation_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/pixmap_scaling.qps b/tests/arthur/data/qps/pixmap_scaling.qps deleted file mode 100644 index c5053adc0a..0000000000 --- a/tests/arthur/data/qps/pixmap_scaling.qps +++ /dev/null @@ -1,527 +0,0 @@ -# Hurra! Force line endings (?) - -translate 5 25 -setFont "arial" 8 - -save - drawText 15 0 "opaque image" - translate 50 50 - save - translate 1 1 - scale 20 20 - drawImage solid2x2.png 0 0 - restore - save - translate -1 1 - scale -20 20 - drawImage solid2x2.png 0 0 - restore - save - translate 1 -1 - scale 20 -20 - drawImage solid2x2.png 0 0 - restore - save - translate -1 -1 - scale -20 -20 - drawImage solid2x2.png 0 0 - restore - - -restore - -save - translate 150 0 - drawText 15 0 "alpha image" - translate 50 50 - save - translate 1 1 - scale 20 20 - drawImage alpha2x2.png 0 0 - restore - save - translate -1 1 - scale -20 20 - drawImage alpha2x2.png 0 0 - restore - save - translate 1 -1 - scale 20 -20 - drawImage alpha2x2.png 0 0 - restore - save - translate -1 -1 - scale -20 -20 - drawImage alpha2x2.png 0 0 - restore -restore - - -save - translate 0 150 - drawText 15 0 "solid pixmap" - translate 50 50 - save - translate 1 1 - scale 20 20 - drawPixmap solid2x2.png 0 0 - restore - save - translate -1 1 - scale -20 20 - drawPixmap solid2x2.png 0 0 - restore - save - translate 1 -1 - scale 20 -20 - drawPixmap solid2x2.png 0 0 - restore - save - translate -1 -1 - scale -20 -20 - drawPixmap solid2x2.png 0 0 - restore -restore - - -save - translate 150 150 - drawText 15 0 "alpha pixmap" - translate 50 50 - save - translate 1 1 - scale 20 20 - drawPixmap alpha2x2.png 0 0 - restore - save - translate -1 1 - scale -20 20 - drawPixmap alpha2x2.png 0 0 - restore - save - translate 1 -1 - scale 20 -20 - drawPixmap alpha2x2.png 0 0 - restore - save - translate -1 -1 - scale -20 -20 - drawPixmap alpha2x2.png 0 0 - restore -restore - - -save - translate 300 10 - save - drawText 0 -10 "subrect solid image" - drawImage solid2x2.png 0 0 50 5 0 0.0 2 0.2 - drawImage solid2x2.png 0 5 50 5 0 0.2 2 0.2 - drawImage solid2x2.png 0 10 50 5 0 0.4 2 0.2 - drawImage solid2x2.png 0 15 50 5 0 0.6 2 0.2 - drawImage solid2x2.png 0 20 50 5 0 0.8 2 0.2 - drawImage solid2x2.png 0 25 50 5 0 1.0 2 0.2 - drawImage solid2x2.png 0 30 50 5 0 1.2 2 0.2 - drawImage solid2x2.png 0 35 50 5 0 1.4 2 0.2 - drawImage solid2x2.png 0 40 50 5 0 1.6 2 0.2 - drawImage solid2x2.png 0 45 50 5 0 1.8 2 0.2 - translate 60 0 - drawImage solid2x2.png 0 0 5 50 0.0 0 0.2 2 - drawImage solid2x2.png 5 0 5 50 0.2 0 0.2 2 - drawImage solid2x2.png 10 0 5 50 0.4 0 0.2 2 - drawImage solid2x2.png 15 0 5 50 0.6 0 0.2 2 - drawImage solid2x2.png 20 0 5 50 0.8 0 0.2 2 - drawImage solid2x2.png 25 0 5 50 1.0 0 0.2 2 - drawImage solid2x2.png 30 0 5 50 1.2 0 0.2 2 - drawImage solid2x2.png 35 0 5 50 1.4 0 0.2 2 - drawImage solid2x2.png 40 0 5 50 1.6 0 0.2 2 - drawImage solid2x2.png 45 0 5 50 1.8 0 0.2 2 - restore - - save - translate 150 0 - drawText 0 -10 "subrect solid image" - drawImage alpha2x2.png 0 0 50 5 0 0.0 2 0.2 - drawImage alpha2x2.png 0 5 50 5 0 0.2 2 0.2 - drawImage alpha2x2.png 0 10 50 5 0 0.4 2 0.2 - drawImage alpha2x2.png 0 15 50 5 0 0.6 2 0.2 - drawImage alpha2x2.png 0 20 50 5 0 0.8 2 0.2 - drawImage alpha2x2.png 0 25 50 5 0 1.0 2 0.2 - drawImage alpha2x2.png 0 30 50 5 0 1.2 2 0.2 - drawImage alpha2x2.png 0 35 50 5 0 1.4 2 0.2 - drawImage alpha2x2.png 0 40 50 5 0 1.6 2 0.2 - drawImage alpha2x2.png 0 45 50 5 0 1.8 2 0.2 - translate 60 0 - drawImage alpha2x2.png 0 0 5 50 0.0 0 0.2 2 - drawImage alpha2x2.png 5 0 5 50 0.2 0 0.2 2 - drawImage alpha2x2.png 10 0 5 50 0.4 0 0.2 2 - drawImage alpha2x2.png 15 0 5 50 0.6 0 0.2 2 - drawImage alpha2x2.png 20 0 5 50 0.8 0 0.2 2 - drawImage alpha2x2.png 25 0 5 50 1.0 0 0.2 2 - drawImage alpha2x2.png 30 0 5 50 1.2 0 0.2 2 - drawImage alpha2x2.png 35 0 5 50 1.4 0 0.2 2 - drawImage alpha2x2.png 40 0 5 50 1.6 0 0.2 2 - drawImage alpha2x2.png 45 0 5 50 1.8 0 0.2 2 - restore - - save - translate 0 100 - drawText 0 -10 "subrect alpha pixmap" - drawPixmap solid2x2.png 0 0 50 5 0 0.0 2 0.2 - drawPixmap solid2x2.png 0 5 50 5 0 0.2 2 0.2 - drawPixmap solid2x2.png 0 10 50 5 0 0.4 2 0.2 - drawPixmap solid2x2.png 0 15 50 5 0 0.6 2 0.2 - drawPixmap solid2x2.png 0 20 50 5 0 0.8 2 0.2 - drawPixmap solid2x2.png 0 25 50 5 0 1.0 2 0.2 - drawPixmap solid2x2.png 0 30 50 5 0 1.2 2 0.2 - drawPixmap solid2x2.png 0 35 50 5 0 1.4 2 0.2 - drawPixmap solid2x2.png 0 40 50 5 0 1.6 2 0.2 - drawPixmap solid2x2.png 0 45 50 5 0 1.8 2 0.2 - translate 60 0 - drawPixmap solid2x2.png 0 0 5 50 0.0 0 0.2 2 - drawPixmap solid2x2.png 5 0 5 50 0.2 0 0.2 2 - drawPixmap solid2x2.png 10 0 5 50 0.4 0 0.2 2 - drawPixmap solid2x2.png 15 0 5 50 0.6 0 0.2 2 - drawPixmap solid2x2.png 20 0 5 50 0.8 0 0.2 2 - drawPixmap solid2x2.png 25 0 5 50 1.0 0 0.2 2 - drawPixmap solid2x2.png 30 0 5 50 1.2 0 0.2 2 - drawPixmap solid2x2.png 35 0 5 50 1.4 0 0.2 2 - drawPixmap solid2x2.png 40 0 5 50 1.6 0 0.2 2 - drawPixmap solid2x2.png 45 0 5 50 1.8 0 0.2 2 - restore - - save - translate 150 100 - drawText 0 -10 "subrect alpha pixmap" - drawPixmap alpha2x2.png 0 0 50 5 0 0.0 2 0.2 - drawPixmap alpha2x2.png 0 5 50 5 0 0.2 2 0.2 - drawPixmap alpha2x2.png 0 10 50 5 0 0.4 2 0.2 - drawPixmap alpha2x2.png 0 15 50 5 0 0.6 2 0.2 - drawPixmap alpha2x2.png 0 20 50 5 0 0.8 2 0.2 - drawPixmap alpha2x2.png 0 25 50 5 0 1.0 2 0.2 - drawPixmap alpha2x2.png 0 30 50 5 0 1.2 2 0.2 - drawPixmap alpha2x2.png 0 35 50 5 0 1.4 2 0.2 - drawPixmap alpha2x2.png 0 40 50 5 0 1.6 2 0.2 - drawPixmap alpha2x2.png 0 45 50 5 0 1.8 2 0.2 - translate 60 0 - drawPixmap alpha2x2.png 0 0 5 50 0.0 0 0.2 2 - drawPixmap alpha2x2.png 5 0 5 50 0.2 0 0.2 2 - drawPixmap alpha2x2.png 10 0 5 50 0.4 0 0.2 2 - drawPixmap alpha2x2.png 15 0 5 50 0.6 0 0.2 2 - drawPixmap alpha2x2.png 20 0 5 50 0.8 0 0.2 2 - drawPixmap alpha2x2.png 25 0 5 50 1.0 0 0.2 2 - drawPixmap alpha2x2.png 30 0 5 50 1.2 0 0.2 2 - drawPixmap alpha2x2.png 35 0 5 50 1.4 0 0.2 2 - drawPixmap alpha2x2.png 40 0 5 50 1.6 0 0.2 2 - drawPixmap alpha2x2.png 45 0 5 50 1.8 0 0.2 2 - restore - -restore - - - -image_load alpha2x2.png alpha2x2 -image_convertToFormat alpha2x2 alpha2x2_argb32 ARGB32 -image_convertToFormat alpha2x2 alpha2x2_argb32pre ARGB32_Premultiplied -image_convertToFormat alpha2x2 alpha2x2_rgb888 Format_RGB888 -image_convertToFormat alpha2x2 alpha2x2_rgb32 RGB32 -image_convertToFormat alpha2x2 alpha2x2_rgb16 Format_RGB16 - -save - translate 0 300 - drawText 15 0 "drawImage - argb32" - translate 50 50 - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_argb32 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_argb32 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_argb32 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_argb32 0 0 - restore -restore - -save - translate 150 300 - drawText 15 0 "drawImage - argb32premul" - translate 50 50 - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_argb32pre 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_argb32pre 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_argb32pre 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_argb32pre 0 0 - restore -restore - - - -save - translate 0 450 - drawText 15 0 "drawImage - rgb888" - translate 50 50 - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_rgb888 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_rgb888 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_rgb888 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_rgb888 0 0 - restore -restore - -save - translate 150 450 - drawText 15 0 "drawImage - rgb32" - translate 50 50 - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_rgb32 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_rgb32 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_rgb32 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_rgb32 0 0 - restore -restore - -save - translate 300 450 - drawText 15 0 "drawImage - rgb16" - translate 50 50 - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_rgb16 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_rgb16 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_rgb16 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_rgb16 0 0 - restore -restore - - - -save - translate 0 600 - drawText 15 0 "clipping - argb32" - translate 50 50 - setClipRect -30 -30 60 60 ReplaceClip - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_argb32 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_argb32 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_argb32 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_argb32 0 0 - restore -restore - -save - translate 150 600 - drawText 15 0 "clipping - argb32premul" - translate 50 50 - setClipRect -30 -30 60 60 ReplaceClip - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_argb32pre 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_argb32pre 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_argb32pre 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_argb32pre 0 0 - restore -restore - -save - translate 300 600 - drawText 15 0 "clipping - rgb16" - translate 50 50 - setClipRect -30 -30 60 60 ReplaceClip - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_rgb16 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_rgb16 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_rgb16 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_rgb16 0 0 - restore -restore - - -path_addEllipse ellipse -30 -30 60 60 - -save - translate 0 750 - drawText 15 0 "clipping - argb32" - translate 50 50 - setClipPath ellipse ReplaceClip - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_argb32 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_argb32 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_argb32 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_argb32 0 0 - restore -restore - -save - translate 150 750 - drawText 15 0 "clipping - argb32premul" - translate 50 50 - setClipPath ellipse ReplaceClip - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_argb32pre 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_argb32pre 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_argb32pre 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_argb32pre 0 0 - restore -restore - -save - translate 300 750 - drawText 15 0 "clipping - rgb16" - translate 50 50 - setClipPath ellipse ReplaceClip - save - translate 0.5 0.5 - scale 20 20 - drawImage alpha2x2_rgb16 0 0 - restore - save - translate -0.5 0.5 - scale -20 20 - drawImage alpha2x2_rgb16 0 0 - restore - save - translate 0.5 -0.5 - scale 20 -20 - drawImage alpha2x2_rgb16 0 0 - restore - save - translate -0.5 -0.5 - scale -20 -20 - drawImage alpha2x2_rgb16 0 0 - restore -restore diff --git a/tests/arthur/data/qps/pixmap_subpixel.qps b/tests/arthur/data/qps/pixmap_subpixel.qps deleted file mode 100644 index f3689433c3..0000000000 --- a/tests/arthur/data/qps/pixmap_subpixel.qps +++ /dev/null @@ -1,115 +0,0 @@ - -translate 50 50 - -# Pixmaps at 0.1 offset, unclipped -begin_block draw_pixmaps -save - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 - drawPixmap border.png 0 0 - translate 20.1 0.1 -restore -end_block - -# Tiled pixmaps at 0.1 offsets, unclipped -translate 0 50 -begin_block draw_tiled -save - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 - drawTiledPixmap border.png 0 0 16 16 0 0 - translate 20.1 0.1 -restore -end_block - - -path_moveTo clip 0 0 -path_lineTo clip width 0 -path_lineTo clip width 400 -path_lineTo clip 0 height -setClipPath clip - -translate 0 50 -# Pixmaps at 0.1 offset, clipped -repeat_block draw_pixmaps - - -# Tiled pixmaps at 0.1 offsets... -translate 0 50 -repeat_block draw_tiled - - diff --git a/tests/arthur/data/qps/pixmap_subpixel_qps.png b/tests/arthur/data/qps/pixmap_subpixel_qps.png deleted file mode 100644 index c691b94b53..0000000000 Binary files a/tests/arthur/data/qps/pixmap_subpixel_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/pixmaps.qps b/tests/arthur/data/qps/pixmaps.qps deleted file mode 100644 index 65734dd322..0000000000 --- a/tests/arthur/data/qps/pixmaps.qps +++ /dev/null @@ -1,103 +0,0 @@ - -setRenderHint Antialiasing - -setPen #00ff00 - -pixmap_load dome_argb32.png the_pixmap -begin_block draw_stuff - -save - - # standard draw - drawPixmap the_pixmap 0 0 - - # sub recting - translate 120 0 - drawPixmap the_pixmap 0 0 40 40 0 0 40 40 - drawPixmap the_pixmap 60 0 40 40 60 0 40 40 - drawPixmap the_pixmap 0 60 40 40 0 60 40 40 - drawPixmap the_pixmap 60 60 40 40 60 60 40 40 - drawPixmap the_pixmap 0 40 40 20 0 40 40 20 - drawPixmap the_pixmap 60 40 40 20 60 40 40 20 - drawPixmap the_pixmap 40 0 20 100 40 0 20 100 - - # subrecting w/scale - translate 120 0 - drawPixmap the_pixmap 0 0 50 50 0 0 25 25 - drawPixmap the_pixmap 50 0 50 50 25 0 25 25 - drawPixmap the_pixmap 0 50 50 50 0 25 25 25 - drawPixmap the_pixmap 50 50 50 50 25 25 25 25 - - # subrecting w/scale & smooth xform - translate 120 0 - setRenderHint SmoothPixmapTransformation - drawPixmap the_pixmap 0 0 50 50 0 0 25 25 - drawPixmap the_pixmap 50 0 50 50 25 0 25 25 - drawPixmap the_pixmap 0 50 50 50 0 25 25 25 - drawPixmap the_pixmap 50 50 50 50 25 25 25 25 - - - # Rotation w/o smooth xform - translate 120 0 - save - setRenderHint SmoothPixmapTransform off - rotate 10 - drawPixmap the_pixmap 0 0 - restore - - # Rotation w smooth xform - translate 120 0 - save - setRenderHint SmoothPixmapTransform - rotate 10 - drawPixmap the_pixmap 0 0 - restore - -restore - -end_block - - -translate 0 120 -pixmap_load dome_rgb32.png the_pixmap -repeat_block draw_stuff - -translate 0 120 -pixmap_load dome_indexed.png the_pixmap -repeat_block draw_stuff - -translate 0 120 -pixmap_load dome_indexed_mask.png the_pixmap -repeat_block draw_stuff - -translate 0 120 -pixmap_load dome_mono.png the_pixmap -repeat_block draw_stuff - - -resetMatrix -translate 700 60 -setPen black -drawText 0 0 "32 bit w/alpha" -translate 0 120 -drawText 0 0 "32 bit w/o alpha" -translate 0 120 -drawText 0 0 "8 bit indexed" -translate 0 120 -drawText 0 0 "8 bit indexed w/mask" -translate 0 120 -drawText 0 0 "1 bit" -resetMatrix -translate 0 600 -drawText 0 0 "normal" -translate 120 0 -drawText 0 0 "subrect" -translate 120 0 -drawText 0 0 "subrect scale" -translate 120 0 -drawText 0 0 "subrect scale smooth" -translate 120 0 -drawText 0 0 "xform" -translate 120 0 -drawText 0 0 "smooth xform" -translate 120 0 diff --git a/tests/arthur/data/qps/pixmaps_qps.png b/tests/arthur/data/qps/pixmaps_qps.png deleted file mode 100644 index 822b5bcd6f..0000000000 Binary files a/tests/arthur/data/qps/pixmaps_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/porter_duff.qps b/tests/arthur/data/qps/porter_duff.qps deleted file mode 100644 index ada4f481e6..0000000000 --- a/tests/arthur/data/qps/porter_duff.qps +++ /dev/null @@ -1,248 +0,0 @@ - -translate 0 50 - -surface_begin 0 0 100 100 - -begin_block predraw -setRenderHint Antialiasing -setPen nopen -setBrush 0x7f000000 -drawEllipse 10 10 80 80 -end_block - -setCompositionMode SourceOver - -begin_block postdraw - - -setBrush 0x1fff0000 -drawRect 0 0 50 50 - -setBrush 0xdf00ff00 -drawRect 50 50 50 50 - -setBrush 0x7f0000ff -drawEllipse 30 30 40 40 - -# a black rectangle around -setCompositionMode SourceOver -setPen black -setBrush nobrush -drawRect 0.5 0.5 99 99 - -end_block -surface_end - - -# Destination over -surface_begin 100 0 100 100 -repeat_block predraw -setCompositionMode DestinationOver -repeat_block postdraw -surface_end - - -# Clear -surface_begin 200 0 100 100 -repeat_block predraw -setCompositionMode Clear -repeat_block postdraw -surface_end - - -# Source -surface_begin 300 0 100 100 -repeat_block predraw -setCompositionMode Source -repeat_block postdraw -surface_end - - -# Destination -surface_begin 400 0 100 100 -repeat_block predraw -setCompositionMode Destination -repeat_block postdraw -surface_end - - -# Source In -surface_begin 500 0 100 100 -repeat_block predraw -setCompositionMode SourceIn -repeat_block postdraw -surface_end - -translate 0 50 - -# Destination In -surface_begin 0 100 100 100 -repeat_block predraw -setCompositionMode DestinationIn -repeat_block postdraw -surface_end - - -# Source Out -surface_begin 100 100 100 100 -repeat_block predraw -setCompositionMode SourceOut -repeat_block postdraw -surface_end - - -# Destination Out -surface_begin 200 100 100 100 -repeat_block predraw -setCompositionMode DestinationOut -repeat_block postdraw -surface_end - - -# SourceAtop -surface_begin 300 100 100 100 -repeat_block predraw -setCompositionMode SourceAtop -repeat_block postdraw -surface_end - - -# DestinationAtop -surface_begin 400 100 100 100 -repeat_block predraw -setCompositionMode DestinationAtop -repeat_block postdraw -surface_end - - -# Xor -surface_begin 500 100 100 100 -repeat_block predraw -setCompositionMode Xor -repeat_block postdraw -surface_end - -translate 0 50 - -# Plus -surface_begin 0 200 100 100 -repeat_block predraw -setCompositionMode Plus -repeat_block postdraw -surface_end - - -# Multiply -surface_begin 100 200 100 100 -repeat_block predraw -setCompositionMode Multiply -repeat_block postdraw -surface_end - - -# Screen -surface_begin 200 200 100 100 -repeat_block predraw -setCompositionMode Screen -repeat_block postdraw -surface_end - - -# Overlay -surface_begin 300 200 100 100 -repeat_block predraw -setCompositionMode Overlay -repeat_block postdraw -surface_end - - -# Darken -surface_begin 400 200 100 100 -repeat_block predraw -setCompositionMode Darken -repeat_block postdraw -surface_end - - -# Lighten -surface_begin 500 200 100 100 -repeat_block predraw -setCompositionMode Lighten -repeat_block postdraw -surface_end - -translate 0 50 - -# ColorDodge -surface_begin 0 300 100 100 -repeat_block predraw -setCompositionMode ColorDodge -repeat_block postdraw -surface_end - - -# Multiply -surface_begin 100 300 100 100 -repeat_block predraw -setCompositionMode ColorBurn -repeat_block postdraw -surface_end - - -# Screen -surface_begin 200 300 100 100 -repeat_block predraw -setCompositionMode HardLight -repeat_block postdraw -surface_end - - -# Overlay -surface_begin 300 300 100 100 -repeat_block predraw -setCompositionMode SoftLight -repeat_block postdraw -surface_end - - -# Darken -surface_begin 400 300 100 100 -repeat_block predraw -setCompositionMode Difference -repeat_block postdraw -surface_end - - -# Lighten -surface_begin 500 300 100 100 -repeat_block predraw -setCompositionMode Exclusion -repeat_block postdraw -surface_end - -resetMatrix - -drawText 0 50 "SourceOver" -drawText 100 50 "DestinationOver" -drawText 200 50 "Clear" -drawText 300 50 "Source" -drawText 400 50 "Destination" -drawText 500 50 "SourceIn" -drawText 0 200 "DestinationIn" -drawText 100 200 "SourceOut" -drawText 200 200 "DestinationOut" -drawText 300 200 "SourceAtop" -drawText 400 200 "DestinationAtop" -drawText 500 200 "Xor" -drawText 0 350 "Plus" -drawText 100 350 "Multiply" -drawText 200 350 "Screen" -drawText 300 350 "Overlay" -drawText 400 350 "Darken" -drawText 500 350 "Lighten" -drawText 0 500 "ColorDodge" -drawText 100 500 "ColorBurn" -drawText 200 500 "HardLight" -drawText 300 500 "SoftLight" -drawText 400 500 "Difference" -drawText 500 500 "Exclusion" diff --git a/tests/arthur/data/qps/porter_duff2.qps b/tests/arthur/data/qps/porter_duff2.qps deleted file mode 100644 index a377cc256c..0000000000 --- a/tests/arthur/data/qps/porter_duff2.qps +++ /dev/null @@ -1,256 +0,0 @@ - -translate 0 50 - -surface_begin 0 0 100 100 - -begin_block predraw -setRenderHint Antialiasing -setPen nopen -gradient_clearStops -gradient_appendStop 0 efff0000 -gradient_appendStop 0.5 dfffff00 -gradient_appendStop 1 ef00ff00 - -gradient_setSpread PadSpread -gradient_setLinear 10 10 90 90 -drawEllipse 10 10 80 80 -end_block - -setCompositionMode SourceOver - -begin_block postdraw - -gradient_clearStops -gradient_appendStop 0 afff0000 -gradient_appendStop 0.5 cf0000ff -gradient_appendStop 1 bf00ff00 - -gradient_setSpread PadSpread -gradient_setLinear 0 0 100 0 -drawEllipse 10 10 30 30 -drawEllipse 10 60 30 30 -drawEllipse 60 60 30 30 -drawEllipse 60 10 30 30 -drawEllipse 35 35 30 30 - -# a black rectangle around -setCompositionMode SourceOver -setPen black -setBrush nobrush -drawRect 0.5 0.5 99 99 - -end_block -surface_end - -# Destination over -surface_begin 100 0 100 100 -repeat_block predraw -setCompositionMode DestinationOver -repeat_block postdraw -surface_end - - -# Clear -surface_begin 200 0 100 100 -repeat_block predraw -setCompositionMode Clear -repeat_block postdraw -surface_end - - -# Source -surface_begin 300 0 100 100 -repeat_block predraw -setCompositionMode Source -repeat_block postdraw -surface_end - - -# Destination -surface_begin 400 0 100 100 -repeat_block predraw -setCompositionMode Destination -repeat_block postdraw -surface_end - - -# Source In -surface_begin 500 0 100 100 -repeat_block predraw -setCompositionMode SourceIn -repeat_block postdraw -surface_end - -translate 0 50 - -# Destination In -surface_begin 0 100 100 100 -repeat_block predraw -setCompositionMode DestinationIn -repeat_block postdraw -surface_end - - -# Source Out -surface_begin 100 100 100 100 -repeat_block predraw -setCompositionMode SourceOut -repeat_block postdraw -surface_end - - -# Destination Out -surface_begin 200 100 100 100 -repeat_block predraw -setCompositionMode DestinationOut -repeat_block postdraw -surface_end - - -# SourceAtop -surface_begin 300 100 100 100 -repeat_block predraw -setCompositionMode SourceAtop -repeat_block postdraw -surface_end - - -# DestinationAtop -surface_begin 400 100 100 100 -repeat_block predraw -setCompositionMode DestinationAtop -repeat_block postdraw -surface_end - - -# Xor -surface_begin 500 100 100 100 -repeat_block predraw -setCompositionMode Xor -repeat_block postdraw -surface_end - -translate 0 50 - -# Plus -surface_begin 0 200 100 100 -repeat_block predraw -setCompositionMode Plus -repeat_block postdraw -surface_end - - -# Multiply -surface_begin 100 200 100 100 -repeat_block predraw -setCompositionMode Multiply -repeat_block postdraw -surface_end - - -# Screen -surface_begin 200 200 100 100 -repeat_block predraw -setCompositionMode Screen -repeat_block postdraw -surface_end - - -# Overlay -surface_begin 300 200 100 100 -repeat_block predraw -setCompositionMode Overlay -repeat_block postdraw -surface_end - - -# Darken -surface_begin 400 200 100 100 -repeat_block predraw -setCompositionMode Darken -repeat_block postdraw -surface_end - - -# Lighten -surface_begin 500 200 100 100 -repeat_block predraw -setCompositionMode Lighten -repeat_block postdraw -surface_end - -translate 0 50 - -# ColorDodge -surface_begin 0 300 100 100 -repeat_block predraw -setCompositionMode ColorDodge -repeat_block postdraw -surface_end - - -# Multiply -surface_begin 100 300 100 100 -repeat_block predraw -setCompositionMode ColorBurn -repeat_block postdraw -surface_end - - -# Screen -surface_begin 200 300 100 100 -repeat_block predraw -setCompositionMode HardLight -repeat_block postdraw -surface_end - - -# Overlay -surface_begin 300 300 100 100 -repeat_block predraw -setCompositionMode SoftLight -repeat_block postdraw -surface_end - - -# Darken -surface_begin 400 300 100 100 -repeat_block predraw -setCompositionMode Difference -repeat_block postdraw -surface_end - - -# Lighten -surface_begin 500 300 100 100 -repeat_block predraw -setCompositionMode Exclusion -repeat_block postdraw -surface_end - -resetMatrix - -drawText 0 50 "SourceOver" -drawText 100 50 "DestinationOver" -drawText 200 50 "Clear" -drawText 300 50 "Source" -drawText 400 50 "Destination" -drawText 500 50 "SourceIn" -drawText 0 200 "DestinationIn" -drawText 100 200 "SourceOut" -drawText 200 200 "DestinationOut" -drawText 300 200 "SourceAtop" -drawText 400 200 "DestinationAtop" -drawText 500 200 "Xor" -drawText 0 350 "Plus" -drawText 100 350 "Multiply" -drawText 200 350 "Screen" -drawText 300 350 "Overlay" -drawText 400 350 "Darken" -drawText 500 350 "Lighten" -drawText 0 500 "ColorDodge" -drawText 100 500 "ColorBurn" -drawText 200 500 "HardLight" -drawText 300 500 "SoftLight" -drawText 400 500 "Difference" -drawText 500 500 "Exclusion" diff --git a/tests/arthur/data/qps/porter_duff2_qps.png b/tests/arthur/data/qps/porter_duff2_qps.png deleted file mode 100644 index b4c893be20..0000000000 Binary files a/tests/arthur/data/qps/porter_duff2_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/porter_duff_qps.png b/tests/arthur/data/qps/porter_duff_qps.png deleted file mode 100644 index c33dade8bd..0000000000 Binary files a/tests/arthur/data/qps/porter_duff_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/primitives.qps b/tests/arthur/data/qps/primitives.qps deleted file mode 100644 index c4cc92cf5d..0000000000 --- a/tests/arthur/data/qps/primitives.qps +++ /dev/null @@ -1,198 +0,0 @@ -setBrush #ff7f7fff -setPen black 1 solidline -translate 20 20 - -begin_block testblock -save -drawRect 0 0 10 10 -drawRect 20 0 20 10 -drawRect 0 20 10 20 -drawRect 20 20 20 20 -translate 50 0 -setPen NoPen -drawRect 0 0 10 10 -drawRect 20 0 20 10 -drawRect 0 20 10 20 -drawRect 20 20 20 20 -restore - -save -translate 0 50 -drawEllipse 0 0 10 10 -drawEllipse 20 0 20 10 -drawEllipse 0 20 10 20 -drawEllipse 20 20 20 20 -translate 50 0 -setPen NoPen -drawEllipse 0 0 10 10 -drawEllipse 20 0 20 10 -drawEllipse 0 20 10 20 -drawEllipse 20 20 20 20 -restore - -save -translate 0 100 -drawPolygon [ 0 0 30 0 30 30 10 30 10 10 40 10 40 40 0 40 ] -save -translate 0 50 -drawPolygon [ 0 0 30 0 30 30 10 30 10 10 40 10 40 40 0 40 ] Winding -translate 0 45 -drawPolyline [ 0 0 50 0 25 25 ] -restore -setPen NoPen -translate 50 0 -drawPolygon [ 0 0 30 0 30 30 10 30 10 10 40 10 40 40 0 40 ] -save -translate 0 50 -drawPolygon [ 0 0 30 0 30 30 10 30 10 10 40 10 40 40 0 40 ] Winding -restore -save -translate -20 100 -drawPie 0 0 50 50 0 1500 -restore -restore -end_block - -setPen black 1 SolidLine FlatCap -translate 200 0 -scale 2 1 -rotate 10 -repeat_block testblock - -resetMatrix -translate 0 250 -setBrush 7f7f7fff -translate 20 20 -repeat_block testblock - -setPen black 1 SolidLine FlatCap -translate 200 0 -scale 2 1 -rotate 10 -repeat_block testblock - -resetMatrix -save -setRenderHint LineAntialiasing -setBrush 7f7fff -translate 20 500 -repeat_block testblock - -translate 200 0 -scale 2 1 -rotate 10 -repeat_block testblock -restore - -setRenderHint LineAntialiasing false -translate 420 20 -begin_block lines -drawLine 0 0 100 0 -drawLine 0 0 100 10 -drawLine 0 0 100 20 -drawLine 0 0 100 30 -drawLine 0 0 100 40 -drawLine 0 0 100 50 -drawLine 0 0 100 60 -drawLine 0 0 100 70 -drawLine 0 0 100 80 -drawLine 0 0 100 90 -drawLine 0 0 100 100 -drawLine 0 0 90 100 -drawLine 0 0 80 100 -drawLine 0 0 70 100 -drawLine 0 0 60 100 -drawLine 0 0 50 100 -drawLine 0 0 40 100 -drawLine 0 0 30 100 -drawLine 0 0 20 100 -drawLine 0 0 10 100 -drawLine 0 0 0 100 -end_block - -setRenderHint LineAntialiasing -translate 0 120 -repeat_block lines - -translate 0 120 -scale 5 2 -repeat_block lines - -resetMatrix -translate 420 500 -begin_block roundedrects -save -drawRoundedRect 0 0 50 30 5 5 -translate 60 0 -drawRoundedRect 0 0 50 30 7.5 7.5 -translate 60 0 -drawRoundedRect 0 0 50 30 10 10 -translate 60 0 -drawRoundedRect 0 0 50 30 12.5 12.5 -translate 60 0 -drawRoundedRect 0 0 50 30 15 15 -restore -save -translate 0 40 -drawRoundedRect 0 0 50 30 20 20 RelativeSize -translate 60 0 -drawRoundedRect 0 0 50 30 40 40 RelativeSize -translate 60 0 -drawRoundedRect 0 0 50 30 60 60 RelativeSize -translate 60 0 -drawRoundedRect 0 0 50 30 80 80 RelativeSize -translate 60 0 -drawRoundedRect 0 0 50 30 100 100 RelativeSize -restore -end_block - -translate 0.5 80.5 -repeat_block roundedrects - -translate -0.5 79.5 -setRenderHint Antialiasing off -repeat_block roundedrects - -resetMatrix -setRenderHint Antialiasing off -setPen black 1 -begin_block drawShapes -translate 550.5 25 -rotate 45 -setBrush nobrush -drawEllipse -10 -10 20 20 -drawLine 10 0 50 0 -drawRect 50 -7 14 14 -resetMatrix -end_block - -setPen black 2 -translate 25 0 -repeat_block drawShapes - -setPen black 3 -translate 50 0 -repeat_block drawShapes - -setPen black 4 -translate 75 0 -repeat_block drawShapes - -resetMatrix -setRenderHint Antialiasing off -setPen nopen -translate 550 100 -setBrush #7f7f7fff -drawRect -0.5 -0.5 21 21 -setBrush red -drawEllipse 0 0 20 20 -setBrush nobrush -setPen black -drawEllipse 0 0 20 20 - -translate 25 0 -setPen nopen -setBrush #7f7f7fff -drawRect 0 0 20 20 -setBrush red -drawEllipse 0 0 20 20 diff --git a/tests/arthur/data/qps/primitives_qps.png b/tests/arthur/data/qps/primitives_qps.png deleted file mode 100644 index 2d8192a121..0000000000 Binary files a/tests/arthur/data/qps/primitives_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/radial_gradients.qps b/tests/arthur/data/qps/radial_gradients.qps deleted file mode 100644 index 5a82f8f3bb..0000000000 --- a/tests/arthur/data/qps/radial_gradients.qps +++ /dev/null @@ -1,96 +0,0 @@ -path_addRect path 400 0 80 80 -path_addEllipse path 440 40 60 60 - -setRenderHint Antialiasing - -setPen black - -begin_block gradients -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setRadial 20 20 50 40 40 -drawRect 0 0 100 100 - -gradient_setSpread ReflectSpread -gradient_setRadial 120 20 50 140 40 -drawEllipse 100 0 100 100 - -gradient_setSpread RepeatSpread -gradient_setRadial 220 20 50 240 40 -drawRoundRect 200 0 100 100 - -gradient_clearStops -gradient_appendStop 0 3f7f7fff -gradient_appendStop 0.5 dfdfffff -gradient_appendStop 1 7f00007f - -gradient_setSpread PadSpread -gradient_setRadial 320 20 50 340 40 -drawPolygon [300 0 390 0 350 99] - -gradient_setSpread ReflectSpread -gradient_setRadial 420 20 50 440 40 -drawPath path - -gradient_setSpread RepeatSpread -gradient_setRadial 520 20 50 540 40 -drawPie 500 0 100 100 720 4320 -end_block - -translate 0 100 -scale 1 2 -repeat_block gradients - -resetMatrix -translate 0 300 -brushTranslate 30 0 -brushScale 0.9 0.9 -brushRotate 20 -repeat_block gradients - -# Some helpful info perhaps? -resetMatrix -setPen black - -drawText 610 50 "No XForm" -drawText 610 200 "scale 1x2" -drawText 610 300 "brush transform" -drawText 10 450 "Pad" -drawText 110 450 "Reflect" -drawText 210 450 "Repeat" -drawText 310 450 "Pad w/alpha" -drawText 410 450 "Reflect w/alpha" -drawText 510 450 "Repeat w/alpha" - -# Radius and focal indicators -setPen 3f000000 -setBrush nobrush - -begin_block ellipse_draw -setClipRect 0 0 100 100 -drawEllipse -30 -30 100 100 -drawEllipse 35 35 11 11 -translate 100 0 -end_block - -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw - -resetMatrix -translate 0 100 -scale 1 2 -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw diff --git a/tests/arthur/data/qps/radial_gradients_extended.qps b/tests/arthur/data/qps/radial_gradients_extended.qps deleted file mode 100644 index d80a149252..0000000000 --- a/tests/arthur/data/qps/radial_gradients_extended.qps +++ /dev/null @@ -1,95 +0,0 @@ -path_addRect path 400 0 80 80 -path_addEllipse path 440 40 60 60 - -setRenderHint Antialiasing - -setPen black - -begin_block gradients -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setRadialExtended 0 0 20 40 40 10 -drawRect 0 0 100 100 - -gradient_setSpread ReflectSpread -gradient_setRadialExtended 120 20 20 140 40 10 -drawEllipse 100 0 100 100 - -gradient_setSpread RepeatSpread -gradient_setRadialExtended 240 20 20 260 40 10 -drawRoundRect 200 0 100 100 - -gradient_clearStops -gradient_appendStop 0 3f7f7fff -gradient_appendStop 0.5 dfdfffff -gradient_appendStop 1 7f00007f - -gradient_setSpread PadSpread -gradient_setRadialExtended 320 20 20 340 40 10 -drawPolygon [300 0 390 0 350 99] - -gradient_setSpread ReflectSpread -gradient_setRadialExtended 420 20 20 440 40 10 -drawPath path - -gradient_setSpread RepeatSpread -gradient_setRadialExtended 520 20 20 540 40 10 -drawPie 500 0 100 100 720 4320 -end_block - -translate 0 100 -scale 1 2 -repeat_block gradients - -resetMatrix -translate 0 300 -brushTranslate 30 0 -brushScale 0.9 0.9 -repeat_block gradients - -# Some helpful info perhaps? -resetMatrix -setPen black - -drawText 610 50 "No XForm" -drawText 610 200 "scale 1x2" -drawText 610 300 "brush transform" -drawText 10 450 "Pad" -drawText 110 450 "Reflect" -drawText 210 450 "Repeat" -drawText 310 450 "Pad w/alpha" -drawText 410 450 "Reflect w/alpha" -drawText 510 450 "Repeat w/alpha" - -# Radius and focal indicators -setPen 3f000000 -setBrush nobrush - -begin_block ellipse_draw -setClipRect 0 0 100 100 -drawEllipse -30 -30 100 100 -drawEllipse 35 35 11 11 -translate 100 0 -end_block - -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw - -resetMatrix -translate 0 100 -scale 1 2 -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw -repeat_block ellipse_draw diff --git a/tests/arthur/data/qps/radial_gradients_extended_qps.png b/tests/arthur/data/qps/radial_gradients_extended_qps.png deleted file mode 100644 index 45a3e6036c..0000000000 Binary files a/tests/arthur/data/qps/radial_gradients_extended_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/radial_gradients_perspectives.qps b/tests/arthur/data/qps/radial_gradients_perspectives.qps deleted file mode 100644 index d446782d20..0000000000 --- a/tests/arthur/data/qps/radial_gradients_perspectives.qps +++ /dev/null @@ -1,60 +0,0 @@ - -setRenderHint Antialiasing - -setPen #00ff00 - -translate 10 10 -# standard draw -begin_block gradient -gradient_clearStops -gradient_appendStop 0 red -gradient_appendStop 0.25 orange -gradient_appendStop 0.5 yellow -gradient_appendStop 0.8 green -gradient_appendStop 1 cyan - -gradient_setSpread PadSpread -gradient_setRadial 110 100 230 230 240 -drawRect 0 0 300 300 -end_block gradient - -# Rotation w/o smooth xform -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0 - repeat_block gradient -restore -restore - -translate 0 320 - -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0 - repeat_block gradient -restore - -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50 - repeat_block gradient -restore -restore - - -resetMatrix -setPen black -translate 125 20 -drawText 0 0 "No transform" -translate 350 0 -drawText 0 0 "Left Tilted" -resetMatrix -translate 125 350 -drawText 0 0 "Bottom Tilted" -translate 350 0 -drawText 0 0 "Right Tilted" -translate 120 0 diff --git a/tests/arthur/data/qps/radial_gradients_perspectives_qps.png b/tests/arthur/data/qps/radial_gradients_perspectives_qps.png deleted file mode 100644 index d8332508f0..0000000000 Binary files a/tests/arthur/data/qps/radial_gradients_perspectives_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/radial_gradients_qps.png b/tests/arthur/data/qps/radial_gradients_qps.png deleted file mode 100644 index 11043e80d3..0000000000 Binary files a/tests/arthur/data/qps/radial_gradients_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/rasterops.qps b/tests/arthur/data/qps/rasterops.qps deleted file mode 100644 index ee3decaf00..0000000000 --- a/tests/arthur/data/qps/rasterops.qps +++ /dev/null @@ -1,84 +0,0 @@ -setPen NoPen - -setBrush black -drawRect 10 10 60 500 - -setCompositionMode SourceOrDestination -translate 20 20 - -begin_block drawShape - setBrush 0xffff0000 - drawEllipse 5 5 30 30 - setBrush 0xff00ff00 - drawRect 0 0 20 20 - setBrush 0xff0000ff - drawRect 20 20 20 20 -end_block - -begin_block loop - setCompositionMode SourceAndDestination - translate 0 50 -repeat_block drawShape - -setCompositionMode SourceXorDestination -translate 0 50 -repeat_block drawShape - -setCompositionMode NotSourceAndNotDestination -translate 0 50 -repeat_block drawShape - -setCompositionMode NotSourceOrNotDestination -translate 0 50 -repeat_block drawShape - -setCompositionMode NotSourceXorDestination -translate 0 50 -repeat_block drawShape - -setCompositionMode NotSource -translate 0 50 -repeat_block drawShape - -setCompositionMode NotSourceAndDestination -translate 0 50 -repeat_block drawShape - -setCompositionMode SourceAndNotDestination -translate 0 50 -repeat_block drawShape -end_block - -resetMatrix -setCompositionMode Source -setBrush white -drawRect 100 10 60 500 -translate 110 20 -repeat_block loop - -resetMatrix -setCompositionMode Source -translate 190 20 -repeat_block loop - -resetMatrix -setPen black -setCompositionMode SourceOver -translate 250 45 -drawText 20 0 "Or ROP" -translate 0 50 -drawText 20 0 "And ROP" -translate 0 50 -drawText 20 0 "Xor ROP" -translate 0 50 -drawText 20 0 "Nor ROP" -translate 0 50 -drawText 20 0 "Nand ROP" -translate 0 50 -drawText 0 0 "NSrcXorDst ROP" -translate 0 50 -drawText 20 0 "NSrc ROP" -translate 0 50 -drawText 0 0 "NSrcAndDst ROP" -translate 0 50 -drawText 0 0 "SrcAndNDst ROP" diff --git a/tests/arthur/data/qps/rasterops_qps.png b/tests/arthur/data/qps/rasterops_qps.png deleted file mode 100644 index 7b93001cd5..0000000000 Binary files a/tests/arthur/data/qps/rasterops_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/sizes.qps b/tests/arthur/data/qps/sizes.qps deleted file mode 100644 index c585e5a01f..0000000000 --- a/tests/arthur/data/qps/sizes.qps +++ /dev/null @@ -1,87 +0,0 @@ -setPen NoPen -setBrush black - -translate 10 10 - -begin_block testblock -drawRect 0 0 10 10 -drawRect 20 0 11 11 -drawRect 40 0 12 12 -drawRect 60 0 13 13 -drawRect 80 0 14 14 -drawRect 100 0 15 15 -drawRect 120 0 16 16 -drawRect 140 0 17 17 -drawRect 160 0 18 18 -drawRect 180 0 19 19 - -drawEllipse 0 20 10 10 -drawEllipse 20 20 11 11 -drawEllipse 40 20 12 12 -drawEllipse 60 20 13 13 -drawEllipse 80 20 14 14 -drawEllipse 100 20 15 15 -drawEllipse 120 20 16 16 -drawEllipse 140 20 17 17 -drawEllipse 160 20 18 18 -drawEllipse 180 20 19 19 - -drawRoundRect 0 40 10 10 -drawRoundRect 20 40 11 11 -drawRoundRect 40 40 12 12 -drawRoundRect 60 40 13 13 -drawRoundRect 80 40 14 14 -drawRoundRect 100 40 15 15 -drawRoundRect 120 40 16 16 -drawRoundRect 140 40 17 17 -drawRoundRect 160 40 18 18 -drawRoundRect 180 40 19 19 - -drawPie 0 60 10 10 0 4320 -drawPie 20 60 11 11 0 4320 -drawPie 40 60 12 12 0 4320 -drawPie 60 60 13 13 0 4320 -drawPie 80 60 14 14 0 4320 -drawPie 100 60 15 15 0 4320 -drawPie 120 60 16 16 0 4320 -drawPie 140 60 17 17 0 4320 -drawPie 160 60 18 18 0 4320 -drawPie 180 60 19 19 0 4320 - -drawArc 0 80 10 10 0 4320 -drawArc 20 80 11 11 0 4320 -drawArc 40 80 12 12 0 4320 -drawArc 60 80 13 13 0 4320 -drawArc 80 80 14 14 0 4320 -drawArc 100 80 15 15 0 4320 -drawArc 120 80 16 16 0 4320 -drawArc 140 80 17 17 0 4320 -drawArc 160 80 18 18 0 4320 -drawArc 180 80 19 19 0 4320 - -drawChord 0 100 10 10 0 4320 -drawChord 20 100 11 11 0 4320 -drawChord 40 100 12 12 0 4320 -drawChord 60 100 13 13 0 4320 -drawChord 80 100 14 14 0 4320 -drawChord 100 100 15 15 0 4320 -drawChord 120 100 16 16 0 4320 -drawChord 140 100 17 17 0 4320 -drawChord 160 100 18 18 0 4320 -drawChord 180 100 19 19 0 4320 - -end_block - -setPen red -translate 0 150 -repeat_block testblock - -setRenderHint LineAntialiasing - -setPen nopen -translate 0 150 -repeat_block testblock - -setPen red -translate 0 150 -repeat_block testblock diff --git a/tests/arthur/data/qps/sizes_qps.png b/tests/arthur/data/qps/sizes_qps.png deleted file mode 100644 index f9dec796a3..0000000000 Binary files a/tests/arthur/data/qps/sizes_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/text.qps b/tests/arthur/data/qps/text.qps deleted file mode 100644 index 2a04bb06f5..0000000000 --- a/tests/arthur/data/qps/text.qps +++ /dev/null @@ -1,122 +0,0 @@ -drawText -5 5 "Text that is drawn outside the bounds..." - -translate 20 20 -begin_block text_drawing -save - setFont "sansserif" 10 normal - drawText 0 20 "sansserif 10pt, normal" - - setFont "sansserif" 12 normal - drawText 0 40 "sansserif 12pt, normal" - - setFont "sansserif" 10 bold - drawText 0 60 "sansserif 12pt, bold" - - setFont "sansserif" 10 bold italic - drawText 0 80 "sansserif 10pt, bold italic" - - - translate 0 100 - setPen #7fff0000 - - setFont "sansserif" 10 normal - drawText 0 20 "alpha sansserif 10pt, normal" - - setFont "sansserif" 12 normal - drawText 0 40 "alpha sansserif 12pt, normal" - - setFont "sansserif" 10 bold - drawText 0 60 "alpha sansserif 12pt, bold" - - setFont "sansserif" 10 bold italic - drawText 0 80 "alpha sansserif 10pt, bold italic" - - - translate 0 100 - setPen black - save - scale 0.9 0.9 - - setFont "sansserif" 10 normal - drawText 0 20 "scaled sansserif 10pt, normal" - - setFont "sansserif" 12 normal - drawText 0 40 "scaled sansserif 12pt, normal" - - setFont "sansserif" 10 bold - drawText 0 60 "scaled sansserif 12pt, bold" - - setFont "sansserif" 10 bold italic - drawText 0 80 "scaled sansserif 10pt, bold italic" - restore - - translate 0 100 - setPen black - save - translate 200 90 - rotate 185 - - setFont "sansserif" 10 normal - drawText 0 20 "scaled sansserif 10pt, normal" - - setFont "sansserif" 12 normal - drawText 0 40 "scaled sansserif 12pt, normal" - - setFont "sansserif" 10 bold - drawText 0 60 "scaled sansserif 12pt, bold" - - setFont "sansserif" 10 bold italic - drawText 0 80 "scaled sansserif 10pt, bold italic" - restore - - translate 0 100 - gradient_appendStop 0 red - gradient_appendStop 0.5 #00ff00 - gradient_appendStop 1 blue - gradient_setLinear 0 0 200 0 - setPen brush - - setFont "sansserif" 10 normal - drawText 0 0 "gradient sansserif 10pt, normal" - - setFont "sansserif" 12 normal - drawText 0 20 "gradient sansserif 12pt, normal" - - setFont "sansserif" 10 bold - drawText 0 40 "gradient sansserif 12pt, bold" - - setFont "sansserif" 10 bold italic - drawText 0 60 "gradient sansserif 10pt, bold italic" -restore -end_block - -translate 250 0 -drawText 25 520 "clipped to rectangle" -save - setPen #3f000000 - setBrush nobrush - drawRect 20 0 100 500 - setClipRect 20 0 100 500 - setPen black - repeat_block text_drawing -restore - -translate 150 0 -drawText 25 520 "clipped to path" -save - path_moveTo clip 20 0 - path_cubicTo clip 0 200 40 400 20 400 - path_lineTo clip 30 500 - path_lineTo clip 30 0 - path_lineTo clip 40 0 - path_lineTo clip 40 500 - path_lineTo clip 120 500 - path_lineTo clip 120 0 - path_lineTo clip 20 0 - setPen #3f000000 - setBrush nobrush - drawPath clip - setClipPath clip - setPen black - repeat_block text_drawing -restore diff --git a/tests/arthur/data/qps/text_perspectives.qps b/tests/arthur/data/qps/text_perspectives.qps deleted file mode 100644 index bfa51c4e38..0000000000 --- a/tests/arthur/data/qps/text_perspectives.qps +++ /dev/null @@ -1,100 +0,0 @@ - -setRenderHint Antialiasing - -setPen black - -translate 10 10 -# standard draw -begin_block text -setBrush gray -drawRect 0 0 300 300 - -setFont "times" 3 -drawText 10 10 "Hello World...." - -setFont "times" 4 -drawText 10 20 "Hello World...." - -setFont "times" 5 -drawText 10 30 "Hello World...." - -setFont "times" 6 -drawText 10 40 "Hello World...." - -setFont "times" 7 -drawText 10 50 "Hello World...." - -setFont "times" 8 -drawText 10 60 "Hello World...." - -setFont "times" 9 -drawText 10 70 "Hello World...." - -setFont "times" 10 -drawText 10 80 "Hello World...." - -setFont "times" 16 -drawText 10 100 "Hello World...." - -setFont "times" 17 -drawText 10 120 "Hello World...." - -setFont "times" 18 -drawText 10 140 "Hello World...." - -setFont "times" 20 -drawText 10 160 "Hello World...." - -setFont "times" 22 -drawText 10 180 "Hello World...." - -setFont "times" 24 -drawText 10 205 "Hello World...." - -setFont "times" 26 -drawText 10 230 "Hello World...." - -setFont "times" 32 -drawText 10 260 "Hello World...." -end_block text - -# Rotation w/o smooth xform -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 50 0 200 300 300 300 0 - repeat_block text -restore -restore - -translate 0 320 - -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 100 300 200 300 300 0 - repeat_block text -restore - -save -translate 350 0 -save - setRenderHint SmoothPixmapTransform on - mapQuadToQuad 0 0 0 300 300 300 300 0 0 0 0 300 300 250 300 50 - repeat_block text -restore -restore - - -resetMatrix -setPen black -translate 125 20 -drawText 0 0 "No transform" -translate 350 0 -drawText 0 0 "Left Tilted" -resetMatrix -translate 125 350 -drawText 0 0 "Bottom Tilted" -translate 350 0 -drawText 0 0 "Right Tilted" -translate 120 0 diff --git a/tests/arthur/data/qps/text_perspectives_qps.png b/tests/arthur/data/qps/text_perspectives_qps.png deleted file mode 100644 index 183ad6ff31..0000000000 Binary files a/tests/arthur/data/qps/text_perspectives_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/text_qps.png b/tests/arthur/data/qps/text_qps.png deleted file mode 100644 index 9a954938cf..0000000000 Binary files a/tests/arthur/data/qps/text_qps.png and /dev/null differ diff --git a/tests/arthur/data/qps/tiled_pixmap.qps b/tests/arthur/data/qps/tiled_pixmap.qps deleted file mode 100644 index 968eae65df..0000000000 --- a/tests/arthur/data/qps/tiled_pixmap.qps +++ /dev/null @@ -1,82 +0,0 @@ - -translate 0 10 -setRenderHint Antialiasing - -pixmap_load dome_argb32 the_pixmap - -begin_block draw_stuff -save - - # Standard draw - drawTiledPixmap the_pixmap 0 0 150 100 0 0 - - # Standard draw with offset - translate 160 0 - drawTiledPixmap the_pixmap 0 0 150 100 25 25 - - # xformed - translate 160 0 - save - translate 10 -10 - rotate 10 - setRenderHint SmoothPixmapTransform false - drawTiledPixmap the_pixmap 0 0 150 100 25 25 - restore - - # xformed with smooth xform - translate 160 0 - save - translate 10 -10 - rotate 10 - setRenderHint SmoothPixmapTransform - drawTiledPixmap the_pixmap 0 0 150 100 25 25 - restore -restore -end_block - - -translate 0 120 -pixmap_load dome_rgb32 the_pixmap -repeat_block draw_stuff - - -translate 0 120 -pixmap_load dome_indexed the_pixmap -repeat_block draw_stuff - - -translate 0 120 -pixmap_load dome_indexed_mask the_pixmap -repeat_block draw_stuff - - -translate 0 120 -pixmap_load dome_mono the_pixmap -repeat_block draw_stuff - - -################################################################################ -# Some helpful text... -# - -resetMatrix -translate 650 80 -drawText 0 0 "32 bit w/alpha" -translate 0 120 -drawText 0 0 "32 bit w/o alpha" -translate 0 120 -drawText 0 0 "8 bit indexed" -translate 0 120 -drawText 0 0 "8 bit indexed w/mask" -translate 0 120 -drawText 0 0 "1 bit" - -resetMatrix -translate 10 630 -drawText 0 0 "normal" -translate 160 0 -drawText 0 0 "offset" -translate 160 0 -drawText 0 0 "xformed" -translate 160 0 -drawText 0 0 "smooth xformed" \ No newline at end of file diff --git a/tests/arthur/data/qps/tiled_pixmap_qps.png b/tests/arthur/data/qps/tiled_pixmap_qps.png deleted file mode 100644 index 42bd5db645..0000000000 Binary files a/tests/arthur/data/qps/tiled_pixmap_qps.png and /dev/null differ diff --git a/tests/arthur/data/random/arcs02.svg b/tests/arthur/data/random/arcs02.svg deleted file mode 100644 index c0bddf9556..0000000000 --- a/tests/arthur/data/random/arcs02.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - Example arcs02 - arc options in paths - Pictures showing the result of setting - large-arc-flag and sweep-flag to the four - possible combinations of 0 and 1. - - - - - - Arc start - Arc end - - - - - - - - - - large-arc-flag=0 - sweep-flag=0 - - - - - large-arc-flag=0 - sweep-flag=1 - - - - - large-arc-flag=1 - sweep-flag=0 - - - - - large-arc-flag=1 - sweep-flag=1 - - - - - - - diff --git a/tests/arthur/data/random/atop.svg b/tests/arthur/data/random/atop.svg deleted file mode 100644 index 3aba158242..0000000000 --- a/tests/arthur/data/random/atop.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/clinton.svg b/tests/arthur/data/random/clinton.svg deleted file mode 100644 index d539754b17..0000000000 --- a/tests/arthur/data/random/clinton.svg +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/cowboy.svg b/tests/arthur/data/random/cowboy.svg deleted file mode 100644 index dc2865c222..0000000000 --- a/tests/arthur/data/random/cowboy.svg +++ /dev/null @@ -1,4110 +0,0 @@ - - - - - - - A Cowboy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/gear_is_rising.svg b/tests/arthur/data/random/gear_is_rising.svg deleted file mode 100644 index f024c3e037..0000000000 --- a/tests/arthur/data/random/gear_is_rising.svg +++ /dev/null @@ -1,702 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/gearflowers.svg b/tests/arthur/data/random/gearflowers.svg deleted file mode 100644 index 038e202d28..0000000000 --- a/tests/arthur/data/random/gearflowers.svg +++ /dev/null @@ -1,8342 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Gearflowers - January 8, 2004 - - - Alexandre Rostovtsev - - - Wallpaper design for the KDE SVG contest. Also, hummingbirds are cool. - - - - gear - flower - hummingbird - - - - - Alexandre Rostovtsev - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/kde-look.svg b/tests/arthur/data/random/kde-look.svg deleted file mode 100644 index f1fe22f303..0000000000 --- a/tests/arthur/data/random/kde-look.svg +++ /dev/null @@ -1,16674 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/linear_grad_transform.svg b/tests/arthur/data/random/linear_grad_transform.svg deleted file mode 100644 index ef04bfcc9b..0000000000 --- a/tests/arthur/data/random/linear_grad_transform.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/longhorn.svg b/tests/arthur/data/random/longhorn.svg deleted file mode 100644 index 8bbf1fa1d3..0000000000 --- a/tests/arthur/data/random/longhorn.svg +++ /dev/null @@ -1,1595 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/multiply.svg b/tests/arthur/data/random/multiply.svg deleted file mode 100644 index fe26bf700a..0000000000 --- a/tests/arthur/data/random/multiply.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Uluru - - - - - - - - - - diff --git a/tests/arthur/data/random/picasso.svg b/tests/arthur/data/random/picasso.svg deleted file mode 100644 index bc4ae44f31..0000000000 --- a/tests/arthur/data/random/picasso.svg +++ /dev/null @@ -1,2842 +0,0 @@ - - - - - Picasso.pdx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Girl Before a Mirror - - -Picasso, 1932, oil on canvas; 64 x 51 1/2 in. -The Museum of Modern Art, New York. - - - diff --git a/tests/arthur/data/random/porterduff.svg b/tests/arthur/data/random/porterduff.svg deleted file mode 100644 index d165473358..0000000000 --- a/tests/arthur/data/random/porterduff.svg +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Opaque - - - - - - - clear - - - - - - - - - - - src - - - - - - - - - - - dst - - - - - - - - - - - src-over - - - - - - - - - - - dst-over - - - - - - - - - - - src-in - - - - - - - - - - - dst-in - - - - - - - - - - - src-out - - - - - - - - - - - dst-out - - - - - - - - - - - src-atop - - - - - - - - - - - dst-atop - - - - - - - - - - - xor - - - - - - - - - Partially Transparent - - - - - - clear - - - - - - - - - - - src - - - - - - - - - - - dst - - - - - - - - - - - src-over - - - - - - - - - - - dst-over - - - - - - - - - - - src-in - - - - - - - - - - - dst-in - - - - - - - - - - - src-out - - - - - - - - - - - dst-out - - - - - - - - - - - src-atop - - - - - - - - - - - dst-atop - - - - - - - - - - - xor - - - - - - - - diff --git a/tests/arthur/data/random/radial_grad_transform.svg b/tests/arthur/data/random/radial_grad_transform.svg deleted file mode 100644 index ebc454b424..0000000000 --- a/tests/arthur/data/random/radial_grad_transform.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/solidcolor.svg b/tests/arthur/data/random/solidcolor.svg deleted file mode 100644 index 04c940092a..0000000000 --- a/tests/arthur/data/random/solidcolor.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - <solidColor> Example - - - - - - - - - - A - - diff --git a/tests/arthur/data/random/spiral.svg b/tests/arthur/data/random/spiral.svg deleted file mode 100644 index 5c5a4e6002..0000000000 --- a/tests/arthur/data/random/spiral.svg +++ /dev/null @@ -1,536 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/tests.svg b/tests/arthur/data/random/tests.svg deleted file mode 100644 index 053802abe8..0000000000 --- a/tests/arthur/data/random/tests.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - -MIN ALT: -MAX ALT: -TIME FROM: -TIME TO: -MEZ - -T - - -H - - -H1 - - -W - - -W1 - - - - - - diff --git a/tests/arthur/data/random/tests2.svg b/tests/arthur/data/random/tests2.svg deleted file mode 100644 index e7942c7e19..0000000000 --- a/tests/arthur/data/random/tests2.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - -U - - - - diff --git a/tests/arthur/data/random/tiger.svg b/tests/arthur/data/random/tiger.svg deleted file mode 100644 index ef798a8df1..0000000000 --- a/tests/arthur/data/random/tiger.svg +++ /dev/null @@ -1,728 +0,0 @@ - - - -A less cute tiger - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/data/random/uluru.png b/tests/arthur/data/random/uluru.png deleted file mode 100644 index dd4696491e..0000000000 Binary files a/tests/arthur/data/random/uluru.png and /dev/null differ diff --git a/tests/arthur/data/random/worldcup.svg b/tests/arthur/data/random/worldcup.svg deleted file mode 100644 index dcb708dcba..0000000000 --- a/tests/arthur/data/random/worldcup.svg +++ /dev/null @@ -1,14668 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CONCACAFConfederation of North, Central American and CaribbeanAssociation Football - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/arthur/datagenerator/datagenerator.cpp b/tests/arthur/datagenerator/datagenerator.cpp deleted file mode 100644 index e2a6ffd5df..0000000000 --- a/tests/arthur/datagenerator/datagenerator.cpp +++ /dev/null @@ -1,481 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "datagenerator.h" - -#include "qengines.h" -#include "xmlgenerator.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define W3C_SVG_BASE "http://www.w3.org/Graphics/SVG/Test/20030813/png/" - -static QString createW3CReference(const QString &refUrl, const QString &filename) -{ - QString base(refUrl); - - QString pngFile = filename; - pngFile.replace(".svg", ".png"); - - base += "full-"; - - base += pngFile; - return base; -} - - -static QString createOutFilename(const QString &baseDir, const QString &filename, - QEngine *engine) -{ - QString outFile = filename; - if (outFile.endsWith(".svgz")) - outFile.replace(".svgz", ".png"); - else - outFile.replace(".svg", ".png"); - - outFile.replace(".qps", ".qps.png"); - - if (!baseDir.isEmpty()) - outFile = QString("%1/%2/%3").arg(baseDir) - .arg(engine->name()).arg(outFile); - else - outFile = QString("%1/%2").arg(engine->name()) - .arg(outFile); - - return outFile; -} - -static void usage(const char *progname) -{ - std::cerr << "Couldn't find 'framework.ini' " - << "file and no suite has been specified."<\n" - << "\t-engine |onscreen|printing\n" - << "\t-suite \n" - << "\t-testcase \n" - << "\t-file \n" - << "\t-size \n" - << "\t-fill \n" - << "\t-output \n" - << std::endl; -} - -DataGenerator::DataGenerator() - : iterations(1) - , size(480, 360) - , fillColor(Qt::white) -{ - settings.load(QString("framework.ini")); - renderer = new QSvgRenderer(); -} - -DataGenerator::~DataGenerator() -{ -} - -void DataGenerator::run(int argc, char **argv) -{ - if (!processArguments(argc, argv)) - return; - - if (!fileName.isEmpty()) { - testGivenFile(); - return; - } - if (!settings.isValid() && suiteName.isEmpty()) { - usage(argv[0]); - return; - } - - prepareDirs(); - if (!settings.isValid()) { //only suite specified - XMLGenerator generator(outputDirName); - testSuite(generator, suiteName, - QString(), QString()); - return; - } - - XMLGenerator generator(outputDirName); - QStringList tests = settings.suites(); - qDebug()<<"tests = "<beginGroup(test); - - QString dirName = settings.settings()->value("dir").toString(); - QString refUrl = settings.settings()->value("reference").toString(); - - QDir dir(dirName); - if (!dir.isAbsolute() && !dir.exists()) - dir = QDir(QString("%1/%2").arg(baseDataDir).arg(dirName)); - - testSuite(generator, test, dir.absolutePath(), refUrl); - settings.settings()->endGroup(); - } - generator.generateOutput(outputDirName); -} - -void DataGenerator::testEngines(XMLGenerator &generator, const QString &file, - const QString &refUrl) -{ - QFileInfo fileInfo(file); - - generator.startTestcase(file); - - if (!refUrl.isEmpty()) { - QString ref = createW3CReference(refUrl, fileInfo.fileName()); - generator.addImage("Reference", ref, XMLData(), Reference); - } - - //bool isQpsScript = file.endsWith(".qps"); - bool isSvgFile = file.endsWith(".svg") || file.endsWith(".svgz"); - - if (isSvgFile) { - QDir oldDir = QDir::current(); - if (!baseDataDir.isEmpty()) { - QDir::setCurrent(baseDataDir); - } - renderer->load(fileInfo.absoluteFilePath()); - if (!baseDataDir.isEmpty()) { - QDir::setCurrent(oldDir.absolutePath()); - } - if (!renderer->isValid()) { - qWarning()<<"Error while processing " < engines = QtEngines::self()->engines(); - testGivenEngines(engines, fileInfo, file, generator, Normal); - - engines = QtEngines::self()->foreignEngines(); - testGivenEngines(engines, fileInfo, file, generator, Foreign); - - generator.endTestcase(); -} - -void DataGenerator::prepareDirs() -{ - QList engines = QtEngines::self()->engines(); - QDir outDirs; - foreach(QEngine *engine, engines) { - if (!wantedEngine(engine->name())) - continue; - - QString dirName = engine->name(); - if (!outputDirName.isEmpty()) - dirName = QString("%1/%2").arg(outputDirName).arg(dirName); - outDirs.mkpath(dirName); - } - - engines = QtEngines::self()->foreignEngines(); - foreach(QEngine *engine, engines) { - if (!wantedEngine(engine->name())) - continue; - - QString dirName = engine->name(); - if (!outputDirName.isEmpty()) - dirName = QString("%1/%2").arg(outputDirName).arg(dirName); - outDirs.mkpath(dirName); - } -} - -bool DataGenerator::processArguments(int argc, char **argv) -{ - QString frameworkFile; - for (int i=1; i < argc; ++i) { - QString opt(argv[i]); - if (opt == "-framework") { - frameworkFile = QString(argv[i+1]); - } else if (opt == "-engine") { - engineName = QString(argv[i+1]); - } else if (opt == "-suite") { - suiteName = QString(argv[i+1]); - } else if (opt == "-testcase") { - testcase = QString(argv[i+1]); - } else if (opt == "-file") { - fileName = QString(argv[i+1]); - } else if (opt == "-output") { - outputDirName = QString(argv[i+1]); - } else if (opt == "-iterations") { - iterations = QString(argv[i+1]).toInt(); - } else if (opt == "-size") { - QStringList args = QString(argv[i+1]).split(",", QString::SkipEmptyParts); - size = QSize(args[0].toInt(), args.size() > 1 ? args[1].toInt() : args[0].toInt()); - } else if (opt == "-fill") { - fillColor = QColor(QString(argv[i+1])); - } else if (opt.startsWith('-')) { - qDebug()<<"Unknown option "< engines = QtEngines::self()->engines(); - bool found = false; - if (engineName == QLatin1String("onscreen")|| - engineName == QLatin1String("printing")) - found = true; - else { - for (int i=0; iname() == engineName); - } - if (!found) { - qDebug("No such engine: '%s'\nAvailable engines are:", qPrintable(engineName)); - for (int i=0; iname())); - return false; - } - } - - if (!fileName.isEmpty()) { - baseDataDir = QFileInfo(fileName).absoluteDir().absolutePath(); - } - - return true; -} - -void DataGenerator::testGivenFile() -{ - prepareDirs(); - - XMLGenerator generator(baseDataDir); - generator.startSuite("Single"); - - QFileInfo fileInfo(fileName); - - bool qpsScript = fileName.endsWith("qps"); - if (!qpsScript) { - QDir oldDir = QDir::current(); - if (!baseDataDir.isEmpty()) { - QDir::setCurrent(baseDataDir); - } - renderer->load(fileInfo.absoluteFilePath()); - - if (!baseDataDir.isEmpty()) { - QDir::setCurrent(oldDir.absolutePath()); - } - - if (!renderer->isValid()) { - qWarning()<<"Error while processing " < engines = QtEngines::self()->engines(); - testGivenEngines(engines, fileInfo, fileInfo.fileName(), generator, - Normal); - generator.endSuite(); - - std::cout<< qPrintable(generator.generateData()); -} - -void DataGenerator::testSuite(XMLGenerator &generator, const QString &test, - const QString &dirName, const QString &refUrl) -{ - generator.startSuite(test); - - QDir dir(dirName); - dir.setFilter(QDir::Files | QDir::NoSymLinks); - //dir.setNameFilter() - - foreach (QFileInfo fileInfo, dir.entryInfoList()) { - if (!testcase.isEmpty() && fileInfo.fileName() != testcase) - continue; - QString suffix = fileInfo.suffix().toLower(); - if (suffix != "qps" && suffix != "svg" && suffix != "svgz") - continue; - qDebug()<<"Testing: "< engines, - const QFileInfo &fileInfo, - const QString &file, - XMLGenerator &generator, - GeneratorFlags eflags) -{ - QString fileName = fileInfo.absoluteFilePath(); - bool qpsScript = fileName.endsWith(".qps"); - QStringList qpsContents; - if (qpsScript) { - QString script = loadFile(fileName); - qpsContents = script.split("\n", QString::SkipEmptyParts); - } - - //foreign one don't generate qpsScripts - if ((eflags & Foreign) && qpsScript) - return; - - foreach (QEngine *engine, engines) { - if (!wantedEngine(engine->name())) - continue; - if (settings.isTestBlacklisted(engine->name(), fileInfo.fileName())) { - XMLData data; - data.details = QString("Test blacklisted"); - data.iterations = 1; - generator.addImage(engine->name(), QString(""), data, eflags); - continue; - } - - QString outFilename = createOutFilename(outputDirName, - fileInfo.fileName(), engine); - engine->prepare(qpsScript ? QSize(800, 800) : size, fillColor); - int elapsed = -1; - int maxElapsed = 0; - int minElapsed = 0; - if ((eflags & Foreign)) { - engine->render(renderer, file); - engine->save(outFilename); - } else { - bool saved = false; - //only measure Qt engines - QTime time; - int currentElapsed = 0; - for (int i = 0; i < iterations; ++i) { - if (qpsScript) { - QDir oldDir = QDir::current(); - if (!baseDataDir.isEmpty()) { - QDir::setCurrent(baseDataDir+"/images"); - } - time.start(); - engine->render(qpsContents, fileName); - currentElapsed = time.elapsed(); - if (!baseDataDir.isEmpty()) { - QDir::setCurrent(oldDir.absolutePath()); - } - } else { - time.start(); - engine->render(renderer, file); - currentElapsed = time.elapsed(); - } - if (currentElapsed > maxElapsed) - maxElapsed = currentElapsed; - if (!minElapsed || - currentElapsed < minElapsed) - minElapsed = currentElapsed; - elapsed += currentElapsed; - if (!saved) { - //qDebug()<<"saving "<name(); - engine->save(outFilename); - engine->cleanup(); - engine->prepare(size, fillColor); - saved = true; - } - } - engine->cleanup(); - } - GeneratorFlags flags = Normal; - if (QtEngines::self()->defaultEngine() == engine) - flags |= Default; - flags |= eflags; - if ((eflags & Foreign)) - flags ^= Normal; - XMLData data; - data.date = QDateTime::currentDateTime(); - data.timeToRender = elapsed; - data.iterations = iterations; - data.maxElapsed = maxElapsed; - data.minElapsed = minElapsed; - generator.addImage(engine->name(), outFilename, - data, flags); - } -} - -bool DataGenerator::wantedEngine(const QString &engine) const -{ - if (!engineName.isEmpty() && - engine != engineName) { - if (engineName == "onscreen") { - if (engine.startsWith("Native") || - engine == QLatin1String("Raster") || - engine == QLatin1String("OpenGL")) - return true; - } else if (engineName == QLatin1String("printing")) { - if (engine == QLatin1String("PS") || - engine == QLatin1String("PDF")) - return true; - } - return false; - } - return true; -} diff --git a/tests/arthur/datagenerator/datagenerator.h b/tests/arthur/datagenerator/datagenerator.h deleted file mode 100644 index b37733c233..0000000000 --- a/tests/arthur/datagenerator/datagenerator.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef DATAGENERATOR_H -#define DATAGENERATOR_H - -#include "xmlgenerator.h" -#include "framework.h" - -#include -#include -#include -#include - -QT_FORWARD_DECLARE_CLASS(QSvgRenderer) -QT_FORWARD_DECLARE_CLASS(QEngine) -QT_FORWARD_DECLARE_CLASS(QFileInfo) - -class DataGenerator -{ -public: - DataGenerator(); - ~DataGenerator(); - - void run(int argc, char **argv); -private: - bool processArguments(int argc, char **argv); - void testEngines(XMLGenerator &generator, const QString &file, - const QString &refUrl); - void testDirectory(const QString &dirname, const QString &refUrl); - void testFile(const QString &file, const QString &refUrl, - QTextStream &out, QTextStream &hout); - void testGivenFile(); - void testSuite(XMLGenerator &generator, const QString &suite, - const QString &dirName, const QString &refUrl); - void prepareDirs(); - - void testGivenEngines(const QList engines, - const QFileInfo &fileInfo, - const QString &file, - XMLGenerator &generator, - GeneratorFlags flags); - void testGivenEngines(const QList engines, - const QFileInfo &fileInfo, - const QString &file, - XMLGenerator &generator, - int iterations, - GeneratorFlags flags); - - bool wantedEngine(const QString &engine) const; -private: - QSvgRenderer *renderer; - Framework settings; - - QString engineName; - QString suiteName; - QString testcase; - QString fileName; - QString outputDirName; - QString baseDataDir; - int iterations; - QSize size; - QColor fillColor; -}; - -#endif diff --git a/tests/arthur/datagenerator/datagenerator.pri b/tests/arthur/datagenerator/datagenerator.pri deleted file mode 100644 index 987573f956..0000000000 --- a/tests/arthur/datagenerator/datagenerator.pri +++ /dev/null @@ -1,2 +0,0 @@ -VPATH += $$PWD -SOURCES += datagenerator.cpp xmlgenerator.cpp diff --git a/tests/arthur/datagenerator/datagenerator.pro b/tests/arthur/datagenerator/datagenerator.pro deleted file mode 100644 index 2c320a3418..0000000000 --- a/tests/arthur/datagenerator/datagenerator.pro +++ /dev/null @@ -1,21 +0,0 @@ -# -*- Mode: makefile -*- -COMMON_FOLDER = $$PWD/../common -include(../arthurtester.pri) -CONFIG += debug console -TEMPLATE = app -TARGET = datagenerator -DEPENDPATH += . -INCLUDEPATH += . -DESTDIR = ../bin - -QT += svg xml core-private gui-private -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl - -# Input -HEADERS += datagenerator.h \ - xmlgenerator.h -SOURCES += main.cpp datagenerator.cpp \ - xmlgenerator.cpp - -DEFINES += QT_USE_USING_NAMESPACE - diff --git a/tests/arthur/datagenerator/main.cpp b/tests/arthur/datagenerator/main.cpp deleted file mode 100644 index 999bb1c7d0..0000000000 --- a/tests/arthur/datagenerator/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include - -#include "datagenerator.h" - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - DataGenerator tester; - - tester.run(argc, argv); - - return 0; -} diff --git a/tests/arthur/datagenerator/xmlgenerator.cpp b/tests/arthur/datagenerator/xmlgenerator.cpp deleted file mode 100644 index 35c990a38c..0000000000 --- a/tests/arthur/datagenerator/xmlgenerator.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "xmlgenerator.h" - -#include "qengines.h" - -#include -#include - -XMLGenerator::XMLGenerator(const QString &baseDir) -{ - QList qengines = QtEngines::self()->engines(); - foreach(QEngine *engine, qengines) { - QString engineDir = engine->name(); - QString fileName = engineDir + "/" + "data.xml"; - - if (!baseDir.isEmpty()) { - engineDir = QString("%1/%2").arg(baseDir).arg(engineDir); - fileName = QString("%1/%2").arg(baseDir).arg(fileName); - } - - if (!QFile::exists(fileName)) - continue; - - - XMLReader handler; - QXmlSimpleReader reader; - reader.setContentHandler(&handler); - reader.setErrorHandler(&handler); - - QFile file(fileName); - if (!file.open(QFile::ReadOnly | QFile::Text)) { - qWarning("Cannot open file '%s', because: %s", - qPrintable(fileName), qPrintable(file.errorString())); - continue; - } - - QXmlInputSource xmlInputSource(&file); - if (reader.parse(xmlInputSource)) { - XMLEngine *engine = handler.xmlEngine(); - checkDirs(engine->generationDate, engineDir); - engines.insert(engine->name, engine); - } - } -} - - -void XMLGenerator::startSuite(const QString &name) -{ - currentSuite = name; -} - - -void XMLGenerator::startTestcase(const QString &testcase) -{ - currentTestcase = testcase; -} - - -void XMLGenerator::addImage(const QString &engineName, const QString &image, - const XMLData &data, GeneratorFlags flags) -{ - XMLEngine *engine; - if (engines.contains(engineName)) - engine = engines[engineName]; - else { - engine = new XMLEngine(engineName, flags & Default); - engine->defaultEngine = (flags & Default); - engine->foreignEngine = (flags & Foreign); - engine->referenceEngine = (flags & Reference); - engine->generationDate = QDateTime::currentDateTime(); - engines.insert(engineName, engine); - } - - XMLSuite *suite; - if (engine->suites.contains(currentSuite)) - suite = engine->suites[currentSuite]; - else { - suite = new XMLSuite(currentSuite); - engine->suites.insert(currentSuite, suite); - } - - XMLFile *file; - if (suite->files.contains(currentTestcase)) - file = suite->files[currentTestcase]; - else { - file = new XMLFile(currentTestcase); - suite->files.insert(currentTestcase, file); - } - - file->output = image; - file->data += data; -} - - -void XMLGenerator::endTestcase() -{ - -} - - -void XMLGenerator::endSuite() -{ - -} - -static void generateDataFile(QTextStream &out, XMLEngine *engine) -{ - QString indent; - out << "name<<"\" default=\""; - if (engine->defaultEngine) { - out<<"true\""; - } else - out<<"false\""; - - out << " foreign=\"" << (engine->foreignEngine?"true":"false") - << "\" reference=\"" << (engine->referenceEngine?"true":"false") - << "\" generationDate=\"" << (engine->generationDate.toString()) - << "\">\n"; - - indent += " "; - foreach(XMLSuite *suite, engine->suites) { - out << indent << "name << "\">\n"; - indent += " "; - - foreach(XMLFile *file, suite->files) { - out << indent << "name<<"\" output=\""<output<<"\">\n"; - indent += " "; - foreach(XMLData data, file->data) { - out << indent - << "\n"; - } - indent.chop(2); - out << indent << "\n"; - } - - indent.chop(2); - out << indent << "\n"; - } - - out << ""; -} - -void XMLGenerator::generateOutput(const QString &baseDir) -{ - QDir dir; - if (!baseDir.isEmpty()) { - dir = QDir(baseDir); - } - foreach(XMLEngine *engine, engines) { - QFile file(QString("%1/%2/data.xml").arg(dir.absolutePath()) - .arg(engine->name)); - - dir.mkpath(QFileInfo(file).absolutePath()); - - if (!file.open(QFile::WriteOnly | QFile::Truncate)) { - fprintf(stderr, "Failed to open output file '%s' for writing\n", - qPrintable(QFileInfo(file).absoluteFilePath())); - return; - } - QTextStream out(&file); - generateDataFile(out, engine); - } -} - -QString XMLGenerator::generateData() const -{ - QString str; - foreach(XMLEngine *engine, engines) { - QTextStream out(&str); - generateDataFile(out, engine); - } - return str; -} - -void XMLGenerator::checkDirs(const QDateTime ¤tDate, const QString &engineDir) -{ - QDateTime yesterday = QDateTime::currentDateTime(); - QDateTime lastWeek = QDateTime::currentDateTime(); - yesterday = yesterday.addDays(-1); - lastWeek = lastWeek.addDays(-7); - - if (currentDate <= yesterday) { - QString newDir = engineDir + ".yesterday"; - if (QFile::exists(engineDir)) { - //### handle last week - QString oldFileName = QString("%1/data.xml").arg(newDir); - XMLReader handler; - QXmlSimpleReader reader; - reader.setContentHandler(&handler); - reader.setErrorHandler(&handler); - QFile file(oldFileName); - if (file.open(QFile::ReadOnly | QFile::Text)) { - QXmlInputSource xmlInputSource(&file); - if (reader.parse(xmlInputSource)) { - XMLEngine *engine = handler.xmlEngine(); - if (engine->generationDate <= lastWeek) { - QString newDir = engineDir + ".lastweek"; - qDebug()<<"Backing last weeks's "<< qPrintable(engine->name); - QStringList args; - args << "-rf"; - args << engineDir; - args << newDir; - QProcess::execute("cp", args); - } - } - } - } - qDebug()<<"Backing yesterday's "<< engineDir; - QStringList args; - args << "-rf"; - args << engineDir; - args << newDir; - QProcess::execute("cp", args); - } -} - - diff --git a/tests/arthur/datagenerator/xmlgenerator.h b/tests/arthur/datagenerator/xmlgenerator.h deleted file mode 100644 index ef0911b60c..0000000000 --- a/tests/arthur/datagenerator/xmlgenerator.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef XMLGENERATOR_H -#define XMLGENERATOR_H - -#include "xmldata.h" - -#include -#include -#include -#include - - -class XMLGenerator -{ -public: - XMLGenerator(const QString &baseDir); - - void startSuite(const QString &name); - void startTestcase(const QString &testcase); - void addImage(const QString &engine, const QString &image, - const XMLData &data, GeneratorFlags flags); - void endTestcase(); - void endSuite(); - - void checkDirs(const QDateTime &dt, const QString &baseDir); - void generateOutput(const QString &baseDir); - QString generateData() const; -private: - QMap engines; - QString currentSuite; - QString currentTestcase; -}; - -#endif diff --git a/tests/arthur/htmlgenerator/htmlgenerator.cpp b/tests/arthur/htmlgenerator/htmlgenerator.cpp deleted file mode 100644 index 48f681c337..0000000000 --- a/tests/arthur/htmlgenerator/htmlgenerator.cpp +++ /dev/null @@ -1,518 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "htmlgenerator.h" - -#include "xmldata.h" - -#include - -#include -#include -#include -#include - -#include - -static void generateIndex(QTextStream &out) -{ - out <<"\ -\n\ - SVG rendering comparison\n\ - \n\ -

QSvg testing framework

\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ -\n"; -} - - -static void usage(const char *progname) -{ - std::cerr << "Couldn't find 'framework.ini' " - << "file and no output has been specified."<" - << " dirname\n" - << std::endl; -} - - -HTMLGenerator::HTMLGenerator() - : settings(0) -{ - if (QFile::exists("framework.ini")) { - settings = new QSettings("framework.ini", QSettings::IniFormat); - } -} - -void HTMLGenerator::generateIndex(const QString &) -{ - -} - -void HTMLGenerator::generatePages() -{ - foreach(HTMLSuite *suite, suites) { - generateSuite(*suite); - } -} - -struct HTMLPage -{ - QString pageName; - QStringList headings; - QList rows; -}; -void HTMLGenerator::generateSuite(const HTMLSuite &suite) -{ - generateReferencePage(suite); - generateHistoryPages(suite); - generateQtComparisonPage(suite); -} - -void HTMLGenerator::generateReferencePage(const HTMLSuite &suite) -{ - - bool generateReference = false; - QStringList generators; - foreach(HTMLRow *row, suite.rows) { - foreach(HTMLImage refs, row->referenceImages) { - generators += refs.generatorName; - foreach(HTMLImage img, row->images) { - if ((img.flags & Default)) { - generators += img.generatorName; - break; - } - } - foreach(HTMLImage img, row->foreignImages) { - generators += img.generatorName; - } - generateReference = true; - break; - } - if (generateReference) - break; - } - - if (!generateReference) - return; - - QFile file(QString("test-%1-reference.html").arg(suite.name)); - if (!file.open(QFile::WriteOnly | QFile::Truncate)) { - return; - } - - QTextStream out(&file); - generateHeader(out, "Reference Page", generators); - - foreach(HTMLRow *row, suite.rows) { - bool referenceRow = false; - QList images; - foreach(HTMLImage refs, row->referenceImages) { - startGenerateRow(out, row->testcase); - referenceRow = true; - images.append(refs); - break; - } - if (referenceRow) { - foreach(HTMLImage img, row->images) { - if ((img.flags & Default)) { - images.append(img); - break; - } - } - images << row->foreignImages; - - generateImages(out, images); - finishGenerateRow(out, row->testcase); - } - } - - generateFooter(out); -} - -void HTMLGenerator::generateHistoryPages(const HTMLSuite &suite) -{ - QStringList lst; - foreach(XMLEngine *engine, engines) { - generateHistoryForEngine(suite, engine->name); - } -} - -void HTMLGenerator::generateHistoryForEngine(const HTMLSuite &suite, const QString &engine) -{ - QFile file(QString("test-%1-%2-history.html").arg(suite.name).arg(engine)); - if (!file.open(QFile::WriteOnly | QFile::Truncate)) { - return; - } - - QTextStream out(&file); - - QStringList generators; - foreach(HTMLRow *row, suite.rows) { - foreach(HTMLImage refs, row->referenceImages) { - generators += refs.generatorName; - generators += "Today"; - generators += "Yesterday"; - generators += "Last Week"; - break; - } - if (!generators.isEmpty()) - break; - } - if (generators.isEmpty()) { - generators += "Today"; - generators += "Yesterday"; - generators += "Last Week"; - } - generateHeader(out, QString("History for %1 engine").arg(engine), generators); - - foreach(HTMLRow *row, suite.rows) { - QList images; - QStringList generators; - foreach(HTMLImage refs, row->referenceImages) { - generators += refs.generatorName; - images.append(refs); - break; - } - - startGenerateRow(out, row->testcase); - foreach(HTMLImage img, row->images) { - if (img.generatorName == engine) { - images << img; - } - } - - generateHistoryImages(out, images); - finishGenerateRow(out, row->testcase); - } - - generateFooter(out); -} - - -void HTMLGenerator::generateQtComparisonPage(const HTMLSuite &suite) -{ - QFile file(QString("test-%1-comparison.html").arg(suite.name)); - if (!file.open(QFile::WriteOnly | QFile::Truncate)) { - return; - } - - QTextStream out(&file); - - QStringList lst; - foreach(XMLEngine *engine, engines) { - if (!engine->foreignEngine && !engine->referenceEngine) - lst += engine->name; - } - - generateHeader(out, QString("Qt Engine Comparison"), lst); - foreach(HTMLRow *row, suite.rows) { - QList images; - - startGenerateRow(out, row->testcase); - foreach(HTMLImage img, row->images) { - images.append(img); - } - generateImages(out, images); - finishGenerateRow(out, row->testcase); - } - - generateFooter(out); -} - - -void HTMLGenerator::generateHeader(QTextStream &out, const QString &name, - const QStringList &generators) -{ - out << "\n" - << ""<<name<<"\n" - << "\n" - << "Click here to go back to main page\n" - << "

Generated: "<

\n" - << "
Testing suiteHistory
1.11.1 history
1.2 testing suite1.2 QSvg history
Random testing suiteRandom tests QSvg history
\n"; - - out << ""; - foreach(QString generator, generators) { - out <<"\n"; - } - out<<"\n"; - -} - -void HTMLGenerator::startGenerateRow(QTextStream &out, const QString &name) -{ - Q_UNUSED(name); - out <<" \n"; -} - -void HTMLGenerator::generateImages(QTextStream &out, - const QList &images) -{ - out <<" \n"; - foreach(HTMLImage image, images) { - out <<" \n"; - } - out <<" \n"; - out <<" \n"; - foreach(HTMLImage image, images) { - out <<" \n"; - } -} - -void HTMLGenerator::generateHistoryImages(QTextStream &out, - const QList &images) -{ - foreach(HTMLImage image, images) { - if ((image.flags & Reference)) { - out <<" \n"; - } else { - QString genName = image.generatorName; - QString file = image.file.replace(image.generatorName, ""); - out <<" \n" - <<" \n" - <<" \n"; - } - } -} - - -void HTMLGenerator::finishGenerateRow(QTextStream &out, const QString &name) -{ - out <<" \n" - <<" \n"; -} - -void HTMLGenerator::generateFooter(QTextStream &out) -{ - out << "
"<
" - << image.generatorName << ": " - << image.details <<" ms
" - <
\n" - << "\n" - << "\n"; -} - -void HTMLGenerator::run(int argc, char **argv) -{ - processArguments(argc, argv); - - QDir dir; - dir.setFilter(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot); - QFileInfoList list = dir.entryInfoList(); - for (int i = 0; i < list.size(); ++i) { - QFileInfo fileInfo = list.at(i); - - QString dataFile = QString("%1/data.xml") - .arg(fileInfo.absoluteFilePath()); - if (QFile::exists(dataFile)) { - XMLReader handler; - QXmlSimpleReader reader; - reader.setContentHandler(&handler); - reader.setErrorHandler(&handler); - - QFile file(dataFile); - if (!file.open(QFile::ReadOnly | QFile::Text)) { - qWarning("Cannot open file '%s', because: %s", - qPrintable(dataFile), qPrintable(file.errorString())); - continue; - } - - QXmlInputSource xmlInputSource(&file); - if (reader.parse(xmlInputSource)) { - XMLEngine *engine = handler.xmlEngine(); - engines.insert(engine->name, engine); - } - } - } - - if (engines.isEmpty()) { - usage(argv[0]); - return; - } - - convertToHtml(); - generatePages(); -} - -void HTMLGenerator::processArguments(int argc, char **argv) -{ - QString frameworkFile; - for (int i=1; i < argc; ++i) { - QString opt(argv[i]); - if (opt == "-framework") { - frameworkFile = QString(argv[++i]); - } else { - outputDirName = opt; - } - } - - if (!frameworkFile.isEmpty() && QFile::exists(frameworkFile)) { - delete settings; - baseDataDir = QFileInfo(frameworkFile).absoluteDir().absolutePath(); - settings = new QSettings(frameworkFile, QSettings::IniFormat); - } - - if (!outputDirName.isEmpty()) { - QDir::setCurrent(outputDirName); - } - htmlOutputDir = QString("html"); - QDir dir; - dir.mkpath(htmlOutputDir); -} - -void HTMLGenerator::convertToHtml() -{ - foreach(XMLEngine *engine, engines) { - foreach(XMLSuite *suite, engine->suites) { - QString refUrl; - QString refPrefix; - if (settings) { - settings->beginGroup(suite->name); - refUrl = settings->value("reference").toString(); - refPrefix = settings->value("referencePrefix").toString(); - if (refUrl.endsWith('/')) - refUrl.chop(1); - settings->endGroup(); - } - - foreach(XMLFile *file, suite->files) { - HTMLImage image; - image.file = file->output; - image.generatorName = engine->name; - - image.details = file->data.last().iterations == 0 - ? QString::number(-1) - : QString::number(file->data.last().timeToRender - / file->data.last().iterations); - image.flags = Normal; - - if (file->data.last().timeToRender == 0) - image.details = file->data.last().details; - - if (engine->defaultEngine) - image.flags |= Default; - if (engine->foreignEngine) { - image.flags ^= Normal; - image.flags |= Foreign; - } - if (engine->referenceEngine) { - image.flags ^= Normal; - image.flags |= Reference; - } - - if (!outputDirName.isEmpty() && image.file.startsWith(outputDirName)) - image.file.remove(0, outputDirName.length() + 1); // + '/' - HTMLSuite *htmlSuite = suites[suite->name]; - if (!htmlSuite) { - htmlSuite = new HTMLSuite; - htmlSuite->name = suite->name; - suites.insert(suite->name, htmlSuite); - } - HTMLRow *htmlRow = htmlSuite->rows[file->name]; - if (!htmlRow) { - htmlRow = new HTMLRow; - htmlRow->testcase = file->name; - htmlSuite->rows.insert(file->name, htmlRow); - } - - if ((image.flags & Foreign)) - htmlRow->foreignImages.append(image); - else if ((image.flags & Reference)) - htmlRow->referenceImages.append(image); - else { - htmlRow->images.append(image); - } - if (!refUrl.isEmpty()) { - QFileInfo fi(file->output); - HTMLImage image; - image.file = QString("%1/%2%3") - .arg(refUrl) - .arg(refPrefix) - .arg(fi.fileName()); - image.generatorName = QString("Reference"); - image.details = QString("Reference"); - image.flags = Reference; - if (htmlRow) { - htmlRow->referenceImages.append(image); - } - } - } - } - } -} - -void HTMLGenerator::createPerformance() -{ -#if 0 - QFile file(QString("test-performance.html")); - if (!file.open(QFile::WriteOnly | QFile::Truncate)) { - return; - } - - QTextStream out(&file); - foreach(XMLEngine *engine, engines) { - QImage img = createHistoryImage(engine); - QImage ; - - } -#endif -} - - diff --git a/tests/arthur/htmlgenerator/htmlgenerator.h b/tests/arthur/htmlgenerator/htmlgenerator.h deleted file mode 100644 index 7ce5ca92a0..0000000000 --- a/tests/arthur/htmlgenerator/htmlgenerator.h +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef HTMLGENERATOR_H -#define HTMLGENERATOR_H - -#include "xmldata.h" - -#include -#include -#include - -QT_FORWARD_DECLARE_CLASS(QStringList) -QT_FORWARD_DECLARE_CLASS(QSettings) - -struct HTMLImage -{ -public: - QString file; - QString generatorName; - GeneratorFlags flags; - QString details; -}; - -struct HTMLRow -{ -public: - QString testcase; - QList referenceImages; - QList foreignImages; - QList images; -}; - -struct HTMLSuite -{ -public: - QString name; - QMap rows; -}; - -class HTMLGenerator -{ -public: - HTMLGenerator(); - - void startSuite(const QString &name); - void startRow(const QString &testcase); - void addImage(const QString &generator, const QString &image, - const QString &details, GeneratorFlags flags); - void endRow(); - void endSuite(); - - void generateIndex(const QString &file); - void generatePages(); - - void run(int argc, char **argv); - -private: - void generateSuite(const HTMLSuite &suite); - - void generateReferencePage(const HTMLSuite &suite); - void generateHistoryPages(const HTMLSuite &suite); - void generateHistoryForEngine(const HTMLSuite &suite, const QString &engine); - void generateQtComparisonPage(const HTMLSuite &suite); - - void generateHeader(QTextStream &out, const QString &name, - const QStringList &generators); - void startGenerateRow(QTextStream &out, const QString &name); - void generateImages(QTextStream &out, - const QList &images); - void generateHistoryImages(QTextStream &out, - const QList &images); - void finishGenerateRow(QTextStream &out, const QString &name); - void generateFooter(QTextStream &out); - - void processArguments(int argc, char **argv); - void convertToHtml(); - void createPerformance(); -private: - QMap suites; - QMap engines; - - QSettings *settings; - QString outputDirName; - QString baseDataDir; - QString htmlOutputDir; -}; - -#endif diff --git a/tests/arthur/htmlgenerator/htmlgenerator.pro b/tests/arthur/htmlgenerator/htmlgenerator.pro deleted file mode 100644 index 4f5d5c8c16..0000000000 --- a/tests/arthur/htmlgenerator/htmlgenerator.pro +++ /dev/null @@ -1,19 +0,0 @@ -# -*- Mode: makefile -*- -COMMON_FOLDER = $$PWD/../common -include(../arthurtester.pri) -TEMPLATE = app -TARGET = htmlgenerator -DEPENDPATH += . -INCLUDEPATH += . -DESTDIR = ../bin - -CONFIG += console - -QT += svg xml core-private gui-private -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl - -# Input -HEADERS += htmlgenerator.h -SOURCES += main.cpp htmlgenerator.cpp - - diff --git a/tests/arthur/htmlgenerator/main.cpp b/tests/arthur/htmlgenerator/main.cpp deleted file mode 100644 index ca787616a4..0000000000 --- a/tests/arthur/htmlgenerator/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include - -#include "htmlgenerator.h" - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - HTMLGenerator generator; - - generator.run(argc, argv); - - return 0; -} diff --git a/tests/arthur/lance/enum.png b/tests/arthur/lance/enum.png deleted file mode 100644 index ae19bd49b0..0000000000 Binary files a/tests/arthur/lance/enum.png and /dev/null differ diff --git a/tests/arthur/lance/icons.qrc b/tests/arthur/lance/icons.qrc deleted file mode 100644 index bf0f12d845..0000000000 --- a/tests/arthur/lance/icons.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - enum.png - tools.png - - diff --git a/tests/arthur/lance/interactivewidget.cpp b/tests/arthur/lance/interactivewidget.cpp deleted file mode 100644 index f7bc67ea0b..0000000000 --- a/tests/arthur/lance/interactivewidget.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "interactivewidget.h" -#include - -InteractiveWidget::InteractiveWidget() -{ - m_onScreenWidget = new OnScreenWidget(""); - m_onScreenWidget->setMinimumSize(320, 240); - - setCentralWidget(m_onScreenWidget); - - ui_textEdit = new QTextEdit(); - ui_textEdit->installEventFilter(this); - - QWidget *panelContent = new QWidget(); - QVBoxLayout *vlayout = new QVBoxLayout(panelContent); - vlayout->setMargin(0); - vlayout->setSpacing(0); - - // create and populate the command toolbox - m_commandsToolBox = new QToolBox(); - QListWidget *currentListWidget = 0; - foreach (PaintCommands::PaintCommandInfos paintCommandInfo, PaintCommands::s_commandInfoTable) { - if (paintCommandInfo.isSectionHeader()) { - currentListWidget = new QListWidget(); - m_commandsToolBox->addItem(currentListWidget, QIcon(":/icons/tools.png"), "commands - "+paintCommandInfo.identifier); - connect(currentListWidget, SIGNAL(itemActivated(QListWidgetItem*)), SLOT(cmdSelected(QListWidgetItem*))); - } else { - (new QListWidgetItem(paintCommandInfo.identifier, currentListWidget))->setToolTip(paintCommandInfo.syntax); - } - } - - // create and populate the enumerations toolbox - m_enumsToolBox = new QToolBox(); - typedef QPair EnumListType; - foreach (EnumListType enumInfos, PaintCommands::s_enumsTable) { - currentListWidget = new QListWidget(); - m_commandsToolBox->addItem(currentListWidget, QIcon(":/icons/enum.png"), "enums - "+enumInfos.first); - connect(currentListWidget, SIGNAL(itemActivated(QListWidgetItem*)), SLOT(enumSelected(QListWidgetItem*))); - foreach (QString enumItem, enumInfos.second) - new QListWidgetItem(enumItem, currentListWidget); - } - - // add other widgets and layout - vlayout->addWidget(m_commandsToolBox); - vlayout->addWidget(m_enumsToolBox); - - QPushButton *run = new QPushButton("&Run"); - QPushButton *load = new QPushButton("&Load"); - QPushButton *save = new QPushButton("&Save"); - run->setFocusPolicy(Qt::NoFocus); - - vlayout->addSpacing(20); - vlayout->addWidget(run); - vlayout->addWidget(load); - vlayout->addWidget(save); - - QDockWidget *panel = new QDockWidget("Commands"); - panel->setWidget(panelContent); - addDockWidget(Qt::LeftDockWidgetArea, panel); - - QDockWidget *editor = new QDockWidget("Editor"); - editor->setWidget(ui_textEdit); - addDockWidget(Qt::RightDockWidgetArea, editor); - - // connect gui signals - connect(run, SIGNAL(clicked()), SLOT(run())); - connect(load, SIGNAL(clicked()), SLOT(load())); - connect(save, SIGNAL(clicked()), SLOT(save())); -} - -/***************************************************************************************************/ -void InteractiveWidget::run() -{ - m_onScreenWidget->m_commands.clear(); - QString script = ui_textEdit->toPlainText(); - QStringList lines = script.split("\n"); - for (int i = 0; i < lines.size(); ++i) - m_onScreenWidget->m_commands.append(lines.at(i)); - m_onScreenWidget->repaint(); -} - -/***************************************************************************************************/ -void InteractiveWidget::cmdSelected(QListWidgetItem *item) -{ - if (ui_textEdit->textCursor().atBlockStart()) { - ui_textEdit->insertPlainText(PaintCommands::findCommandById(item->text())->sample + "\n"); - } else { - ui_textEdit->moveCursor(QTextCursor::EndOfLine); - ui_textEdit->insertPlainText("\n" + PaintCommands::findCommandById(item->text())->sample); - } - ui_textEdit->setFocus(); -} - -/***************************************************************************************************/ -void InteractiveWidget::enumSelected(QListWidgetItem *item) -{ - ui_textEdit->insertPlainText(item->text()); - ui_textEdit->setFocus(); -} - -/***************************************************************************************************/ -void InteractiveWidget::load() -{ - QString fname = QFileDialog::getOpenFileName( - this, - QString("Load QPaintEngine Script"), - QFileInfo(m_filename).absoluteFilePath(), - QString("QPaintEngine Script (*.qps);;All files (*.*)")); - - load(fname); -} - -/***************************************************************************************************/ -void InteractiveWidget::load(const QString &fname) -{ - if (!fname.isEmpty()) { - m_filename = fname; - ui_textEdit->clear(); - QFile file(fname); - file.open(QIODevice::ReadOnly | QIODevice::Text); - QTextStream textFile(&file); - QString script = textFile.readAll(); - ui_textEdit->setPlainText(script); - m_onScreenWidget->m_filename = fname; - } -} - -/***************************************************************************************************/ -void InteractiveWidget::save() -{ - QString script = ui_textEdit->toPlainText(); - if (!script.endsWith("\n")) - script += QString("\n"); - QString fname = QFileDialog::getSaveFileName(this, - QString("Save QPaintEngine Script"), - QFileInfo(m_filename).absoluteFilePath(), - QString("QPaintEngine Script (*.qps);;All files (*.*)")); - if (!fname.isEmpty()) { - m_filename = fname; - QFile file(fname); - file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); - QTextStream textFile(&file); - textFile << script; - m_onScreenWidget->m_filename = fname; - } -} - -/***************************************************************************************************/ -bool InteractiveWidget::eventFilter(QObject *o, QEvent *e) -{ - if (qobject_cast(o) && e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(e); - if (ke->key() == Qt::Key_Tab) { - m_commandsToolBox->currentWidget()->setFocus(); - return true; - } else if (ke->key() == Qt::Key_Return && ke->modifiers() == Qt::ControlModifier) { - run(); - return true; - } - } - return false; -} diff --git a/tests/arthur/lance/interactivewidget.h b/tests/arthur/lance/interactivewidget.h deleted file mode 100644 index f5e91c87dc..0000000000 --- a/tests/arthur/lance/interactivewidget.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef INTERACTIVEWIDGET_H -#define INTERACTIVEWIDGET_H - -#include "widgets.h" -#include "paintcommands.h" - -#include - -#include - -QT_FORWARD_DECLARE_CLASS(QToolBox) - -class InteractiveWidget : public QMainWindow -{ - Q_OBJECT -public: - InteractiveWidget(); - -public slots: - void run(); - void load(); - void load(const QString &fname); - void save(); - -protected: - bool eventFilter(QObject *o, QEvent *e); - -protected slots: - void cmdSelected(QListWidgetItem *item); - void enumSelected(QListWidgetItem *item); - -private: - QToolBox *m_commandsToolBox; - QToolBox *m_enumsToolBox; - OnScreenWidget *m_onScreenWidget; - QTextEdit *ui_textEdit; - QString m_filename; -}; - -#endif diff --git a/tests/arthur/lance/lance.pro b/tests/arthur/lance/lance.pro deleted file mode 100644 index 8f3407cfc9..0000000000 --- a/tests/arthur/lance/lance.pro +++ /dev/null @@ -1,22 +0,0 @@ -COMMON_FOLDER = $$PWD/../common -include(../arthurtester.pri) -CONFIG+=console moc -TEMPLATE = app -INCLUDEPATH += . - -# Input -HEADERS += widgets.h interactivewidget.h -SOURCES += interactivewidget.cpp main.cpp -RESOURCES += icons.qrc - -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl - -symbian*: { - testData.files = $$QT_BUILD_TREE/tests/arthur/data/qps - testData.path = . - DEPLOYMENT += testData -} - -QT += xml svg core-private gui-private - - diff --git a/tests/arthur/lance/main.cpp b/tests/arthur/lance/main.cpp deleted file mode 100644 index f63ac7a367..0000000000 --- a/tests/arthur/lance/main.cpp +++ /dev/null @@ -1,670 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "interactivewidget.h" -#include "widgets.h" -#include "paintcommands.h" - -#include -#include -#include -#include - -#include - -#ifdef USE_CUSTOM_DEVICE -#include "customdevice.h" -#endif - -#ifndef QT_NO_OPENGL -#include -#include -#endif - -// #define DO_QWS_DEBUGGING - -#ifdef DO_QWS_DEBUGGING -extern bool qt_show_painter_debug_output = false; -#endif - -//#define CONSOLE_APPLICATION - -static const struct { - const char *name; - QImage::Format format; -} imageFormats[] = { - { "mono", QImage::Format_Mono }, - { "monolsb", QImage::Format_MonoLSB }, - { "indexed8", QImage::Format_Indexed8 }, - { "rgb32", QImage::Format_RGB32 }, - { "argb32", QImage::Format_ARGB32 }, - { "argb32_premultiplied", QImage::Format_ARGB32_Premultiplied }, - { "rgb16", QImage::Format_RGB16 }, - { "argb8565_premultiplied", QImage::Format_ARGB8565_Premultiplied }, - { "rgb666", QImage::Format_RGB666 }, - { "argb6666_premultiplied", QImage::Format_ARGB6666_Premultiplied }, - { "rgb555", QImage::Format_RGB555 }, - { "argb8555_premultiplied", QImage::Format_ARGB8555_Premultiplied }, - { "rgb888", QImage::Format_RGB888 }, - { "rgb444", QImage::Format_RGB444 }, - { "argb4444_premultiplied", QImage::Format_ARGB4444_Premultiplied } -}; - -static void printHelp() -{ - printf("\nUsage:\n\n" - " paintcmd [options] files\n" - "\n" - " Options:\n" - " -widget Paints the files to a widget on screen\n" - " -pixmap Paints the files to a pixmap\n" - " -bitmap Paints the files to a bitmap\n" - " -image Paints the files to an image\n" - " -imageformat Set the format of the image when painting to an image\n" - " -imagemono Paints the files to a monochrome image\n" - " -imagewidget same as image, but with interacion...\n" -#ifndef QT_NO_OPENGL - " -opengl Paints the files to an OpenGL on screen\n" -#endif -#ifdef USE_CUSTOM_DEVICE - " -customdevice Paints the files to the custom paint device\n" - " -customwidget Paints the files to a custom widget on screen\n" -#endif - " -pdf Paints to a pdf\n" - " -ps Paints to a ps\n" - " -picture Prints into a picture, then shows the result in a label\n" - " -printer Prints the commands to a file called output.ps|pdf\n" - " -highres Prints in highres mode\n" - " -printdialog Opens a print dialog, then prints to the selected printer\n" - " -grab Paints the files to an image called filename_qps.png\n" - " -i Interactive mode.\n" - " -v Verbose.\n" - " -bg-white No checkers background\n" - " -commands Displays all available commands\n"); -} - -static void displayCommands() -{ - printf("Drawing operations:\n" - " drawArc x y width height angle sweep\n" - " drawChord x y width height angle sweep\n" - " drawEllipse x y width height\n" - " drawLine x1 y1 x2 y2\n" - " drawPath pathname\n" - " drawPie x y width height angle sweep\n" - " drawPixmap pixmapfile x y width height sx sy sw sh\n" - " drawPolygon [ x1 y1 x2 y2 ... ] winding|oddeven\n" - " drawPolyline [ x1 y1 x2 y2 ... ]\n" - " drawRect x y width height\n" - " drawRoundRect x y width height xfactor yfactor\n" - " drawText x y \"text\"\n" - " drawTiledPixmap pixmapfile x y width height sx sy\n" - "\n" - "Path commands:\n" - " path_addEllipse pathname x y width height\n" - " path_addPolygon pathname [ x1 y1 x2 y2 ... ] winding?\n" - " path_addRect pathname x y width height\n" - " path_addText pathname x y \"text\" Uses current font\n" - " path_arcTo pathname x y width hegiht\n" - " path_closeSubpath pathname\n" - " path_createOutline pathname newoutlinename Uses current pen\n" - " path_cubicTo pathname c1x c1y c2x c2y endx endy\n" - " path_lineTo pathname x y\n" - " path_moveTo pathname x y\n" - " path_setFillRule pathname winding?\n" - "\n" - "Painter configuration:\n" - " resetMatrix\n" - " restore\n" - " save\n" - " rotate degrees\n" - " translate dx dy\n" - " scale sx sy\n" - " mapQuadToQuad x0 y0 x1 y1 x2 y2 x3 y3 x4 y4 x5 y5 x6 y6 x7 y7" - " setMatrix m11 m12 m13 m21 m22 m23 m31 m32 m33" - " setBackground color pattern?\n" - " setBackgroundMode TransparentMode|OpaqueMode\n" - " setBrush pixmapfile\n" - " setBrush nobrush\n" - " setBrush color pattern\n" - " setBrush x1 y1 color1 x2 y2 color2 gradient brush\n" - " setBrushOrigin x y\n" - " setFont \"fontname\" pointsize bold? italic?\n" - " setPen style color\n" - " setPen color width style capstyle joinstyle\n" - " setRenderHint LineAntialiasing\n" - " gradient_clearStops\n" - " gradient_appendStop pos color" - " gradient_setSpread [PadSpread|ReflectSpread|RepeatSpread]\n" - " gradient_setLinear x1 y1 x2 y2\n" - " gradient_setRadial center_x center_y radius focal_x focal_y\n" - " gradient_setConical center_x center_y angle\n" - "\n" - "Clipping commands:\n" - " region_addRect regionname x y width height\n" - " region_getClipRegion regionname\n" - " setClipRect x y width height\n" - " setClipRegion regionname\n" - " setClipping true|false\n" - " setClipPath pathname\n" - "\n" - "Various commands:\n" - " surface_begin x y width height\n" - " surface_end\n" - " pixmap_load filename name_in_script\n" - " image_load filename name_in_script\n"); -} -static InteractiveWidget *interactive_widget = 0; - -static void runInteractive() -{ - interactive_widget = new InteractiveWidget; - interactive_widget->show(); -} - -static QLabel* createLabel() -{ - QLabel *label = new QLabel; - QPalette palette = label->palette(); - palette.setBrush(QPalette::Window, QBrush(Qt::white)); - label->setPalette(palette); - return label; -} - -int main(int argc, char **argv) -{ -#ifdef CONSOLE_APPLICATION - QApplication app(argc, argv, QApplication::Tty); -#else - QApplication app(argc, argv); -#endif -#ifdef DO_QWS_DEBUGGING - qt_show_painter_debug_output = false; -#endif - - DeviceType type = WidgetType; - bool checkers_background = true; - - QImage::Format imageFormat = QImage::Format_ARGB32_Premultiplied; - - QLocale::setDefault(QLocale::c()); - - QStringList files; - - bool interactive = false; - bool printdlg = false; - bool highres = false; - bool show_cmp = false; - int width = 800, height = 800; - bool verboseMode = false; - -#ifndef QT_NO_OPENGL - QGLFormat f = QGLFormat::defaultFormat(); - f.setSampleBuffers(true); - f.setStencil(true); - f.setAlpha(true); - f.setAlphaBufferSize(8); - QGLFormat::setDefaultFormat(f); -#endif - - char *arg; - for (int i=1; i= 0) { - QFileInfo info(input); - QDir dir = info.dir(); - QFileInfoList infos = dir.entryInfoList(QStringList(info.fileName())); - for (int ii=0; iiload(files.at(0)); - } else if (files.isEmpty()) { - printHelp(); - return 0; - } else { - for (int j=0; jsetWindowTitle("VERIFY: " + pmFile); - label->setPixmap(pixmap); - label->show(); - } - } - - switch (type) { - - case WidgetType: - { - OnScreenWidget *qWidget = - new OnScreenWidget(files.at(j)); - qWidget->setVerboseMode(verboseMode); - qWidget->setType(type); - qWidget->setCheckersBackground(checkers_background); - qWidget->m_commands = content; - qWidget->resize(width, height); - qWidget->show(); - activeWidget = qWidget; - break; - } - - case ImageWidgetType: - { - OnScreenWidget *qWidget = new OnScreenWidget(files.at(j)); - qWidget->setVerboseMode(verboseMode); - qWidget->setType(type); - qWidget->setCheckersBackground(checkers_background); - qWidget->m_commands = content; - qWidget->resize(width, height); - qWidget->show(); - activeWidget = qWidget; - break; - - } -#ifndef QT_NO_OPENGL - case OpenGLPBufferType: - { - QGLPixelBuffer pbuffer(QSize(width, height)); - QPainter pt(&pbuffer); - pcmd.setPainter(&pt); - pcmd.setFilePath(fileinfo.absolutePath()); - pcmd.runCommands(); - pt.end(); - - QImage image = pbuffer.toImage(); - - QLabel *label = createLabel(); - label->setPixmap(QPixmap::fromImage(image)); - label->resize(label->sizeHint()); - label->show(); - activeWidget = label; - break; - } - case OpenGLType: - { - OnScreenWidget *qGLWidget = new OnScreenWidget(files.at(j)); - qGLWidget->setVerboseMode(verboseMode); - qGLWidget->setType(type); - qGLWidget->setCheckersBackground(checkers_background); - qGLWidget->m_commands = content; - qGLWidget->resize(width, height); - qGLWidget->show(); - activeWidget = qGLWidget; - break; - } -#else - case OpenGLType: - printf("OpenGL type not supported in this Qt build\n"); - break; -#endif -#ifdef USE_CUSTOM_DEVICE - case CustomDeviceType: - { - CustomPaintDevice custom(width, height); - QPainter pt; - pt.begin(&custom); - pcmd.setPainter(&pt); - pcmd.setFilePath(fileinfo.absolutePath()); - pcmd.runCommands(); - pt.end(); - QImage *img = custom.image(); - if (img) { - QLabel *label = createLabel(); - label->setPixmap(QPixmap::fromImage(*img)); - label->resize(label->sizeHint()); - label->show(); - activeWidget = label; - img->save("custom_output_pixmap.png", "PNG"); - } else { - custom.save("custom_output_pixmap.png", "PNG"); - } - break; - } - case CustomWidgetType: - { - OnScreenWidget *cWidget = new OnScreenWidget; - cWidget->setVerboseMode(verboseMode); - cWidget->setType(type); - cWidget->setCheckersBackground(checkers_background); - cWidget->m_filename = files.at(j); - cWidget->setWindowTitle(fileinfo.filePath()); - cWidget->m_commands = content; - cWidget->resize(width, height); - cWidget->show(); - activeWidget = cWidget; - break; - } -#endif - case PixmapType: - { - QPixmap pixmap(width, height); - pixmap.fill(Qt::white); - QPainter pt(&pixmap); - pcmd.setPainter(&pt); - pcmd.setFilePath(fileinfo.absolutePath()); - pcmd.runCommands(); - pt.end(); - pixmap.save("output_pixmap.png", "PNG"); - break; - } - - case BitmapType: - { - QBitmap bitmap(width, height); - QPainter pt(&bitmap); - pcmd.setPainter(&pt); - pcmd.setFilePath(fileinfo.absolutePath()); - pcmd.runCommands(); - pt.end(); - bitmap.save("output_bitmap.png", "PNG"); - - QLabel *label = createLabel(); - label->setPixmap(bitmap); - label->resize(label->sizeHint()); - label->show(); - activeWidget = label; - break; - } - - case ImageMonoType: - case ImageType: - { - qDebug() << "Creating image"; - QImage image(width, height, type == ImageMonoType - ? QImage::Format_MonoLSB - : imageFormat); - image.fill(0); - QPainter pt(&image); - pcmd.setPainter(&pt); - pcmd.setFilePath(fileinfo.absolutePath()); - pcmd.runCommands(); - pt.end(); - image.convertToFormat(QImage::Format_ARGB32).save("output_image.png", "PNG"); -#ifndef CONSOLE_APPLICATION - QLabel *label = createLabel(); - label->setPixmap(QPixmap::fromImage(image)); - label->resize(label->sizeHint()); - label->show(); - activeWidget = label; -#endif - break; - } - - case PictureType: - { - QPicture pic; - QPainter pt(&pic); - pcmd.setPainter(&pt); - pcmd.setFilePath(fileinfo.absolutePath()); - pcmd.runCommands(); - pt.end(); - - QImage image(width, height, QImage::Format_ARGB32_Premultiplied); - image.fill(0); - pt.begin(&image); - pt.drawPicture(0, 0, pic); - pt.end(); - QLabel *label = createLabel(); - label->setWindowTitle(fileinfo.absolutePath()); - label->setPixmap(QPixmap::fromImage(image)); - label->resize(label->sizeHint()); - label->show(); - activeWidget = label; - break; - } - - case PrinterType: - { -#ifndef QT_NO_PRINTER - PaintCommands pcmd(QStringList(), 800, 800); - pcmd.setVerboseMode(verboseMode); - pcmd.setType(type); - pcmd.setCheckersBackground(checkers_background); - pcmd.setContents(content); - QString file = QString(files.at(j)).replace(".", "_") + ".ps"; - - QPrinter p(highres ? QPrinter::HighResolution : QPrinter::ScreenResolution); - if (printdlg) { - QPrintDialog printDialog(&p, 0); - if (printDialog.exec() != QDialog::Accepted) - break; - } else { - p.setOutputFileName(file); - } - - QPainter pt(&p); - pcmd.setPainter(&pt); - pcmd.setFilePath(fileinfo.absolutePath()); - pcmd.runCommands(); - pt.end(); - - if (!printdlg) { - printf("wrote file: %s\n", qPrintable(file)); - } - - Q_ASSERT(!p.paintingActive()); -#endif - break; - } - case PsType: - case PdfType: - { -#ifndef QT_NO_PRINTER - PaintCommands pcmd(QStringList(), 800, 800); - pcmd.setVerboseMode(verboseMode); - pcmd.setType(type); - pcmd.setCheckersBackground(checkers_background); - pcmd.setContents(content); - bool ps = type == PsType; - QPrinter p(highres ? QPrinter::HighResolution : QPrinter::ScreenResolution); - QFileInfo input(files.at(j)); - QString file = QString("%1_%2.%3") - .arg(input.baseName()) - .arg(input.suffix()) - .arg(ps ? "ps" : "pdf"); - p.setOutputFormat(ps ? QPrinter::PdfFormat : QPrinter::PostScriptFormat); - p.setOutputFileName(file); - p.setPageSize(QPrinter::A4); - QPainter pt(&p); - pcmd.setPainter(&pt); - pcmd.setFilePath(fileinfo.absolutePath()); - pcmd.runCommands(); - pt.end(); - - printf("write file: %s\n", qPrintable(file)); -#endif - break; - } - case GrabType: - { - QImage image(width, height, QImage::Format_ARGB32_Premultiplied); - image.fill(QColor(Qt::white).rgb()); - QPainter pt(&image); - pcmd.setPainter(&pt); - pcmd.setFilePath(fileinfo.absolutePath()); - pcmd.runCommands(); - pt.end(); - QImage image1(width, height, QImage::Format_RGB32); - image1.fill(QColor(Qt::white).rgb()); - QPainter pt1(&image1); - pt1.drawImage(QPointF(0, 0), image); - pt1.end(); - - QString filename = QString(files.at(j)).replace(".qps", "_qps") + ".png"; - image1.save(filename, "PNG"); - printf("%s grabbed to %s\n", qPrintable(files.at(j)), qPrintable(filename)); - break; - } - default: - break; - } - } - } -#ifndef CONSOLE_APPLICATION - if (activeWidget || interactive) { - QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); - app.exec(); - } - delete activeWidget; -#endif - delete interactive_widget; - return 0; -} - diff --git a/tests/arthur/lance/tools.png b/tests/arthur/lance/tools.png deleted file mode 100644 index 822e1e576e..0000000000 Binary files a/tests/arthur/lance/tools.png and /dev/null differ diff --git a/tests/arthur/lance/widgets.h b/tests/arthur/lance/widgets.h deleted file mode 100644 index 033067d846..0000000000 --- a/tests/arthur/lance/widgets.h +++ /dev/null @@ -1,354 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef WIDGETS_H -#define WIDGETS_H - -#include "paintcommands.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include - -#include - -const int CP_RADIUS = 10; - -class StupidWorkaround : public QObject -{ - Q_OBJECT -public: - StupidWorkaround(QWidget *widget, int *value) - : QObject(widget), w(widget), mode(value) - { - } - -public slots: - void setViewMode(int m) { - *mode = m; - w->update(); - } - -private: - QWidget *w; - int *mode; -}; - -template -class OnScreenWidget : public T -{ -public: - - enum ViewMode { - RenderView, - BaselineView, - DifferenceView - }; - - OnScreenWidget(const QString &file, QWidget *parent = 0) - : T(parent), - m_filename(file), - m_view_mode(RenderView) - { - QSettings settings("Trolltech", "lance"); - for (int i=0; i<10; ++i) { - QPointF suggestion(100 + i * 40, 100 + 100 * qSin(i * 3.1415 / 10.0)); - m_controlPoints << settings.value("cp" + QString::number(i), suggestion).toPointF(); - } - - m_currentPoint = -1; - m_showControlPoints = false; - m_deviceType = WidgetType; - m_checkersBackground = true; - m_verboseMode = false; - - m_baseline_name = QString(m_filename).replace(".qps", "_qps") + ".png"; - if (QFileInfo(m_baseline_name).exists()) { - m_baseline = QPixmap(m_baseline_name); - } - - if (m_baseline.isNull()) { - T::setWindowTitle("Rendering: '" + file + "'. No baseline available"); - } else { - T::setWindowTitle("Rendering: '" + file + "'. Shortcuts: 1=render, 2=baseline, 3=difference"); - - StupidWorkaround *workaround = new StupidWorkaround(this, &m_view_mode); - - QSignalMapper *mapper = new QSignalMapper(this); - T::connect(mapper, SIGNAL(mapped(int)), workaround, SLOT(setViewMode(int))); - T::connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setWindowTitle(QString))); - - QAction *renderViewAction = new QAction("Render View", this); - renderViewAction->setShortcut(Qt::Key_1); - T::connect(renderViewAction, SIGNAL(triggered()), mapper, SLOT(map())); - mapper->setMapping(renderViewAction, RenderView); - mapper->setMapping(renderViewAction, "Render View: " + file); - T::addAction(renderViewAction); - - QAction *baselineAction = new QAction("Baseline", this); - baselineAction->setShortcut(Qt::Key_2); - T::connect(baselineAction, SIGNAL(triggered()), mapper, SLOT(map())); - mapper->setMapping(baselineAction, BaselineView); - mapper->setMapping(baselineAction, "Baseline View: " + file); - T::addAction(baselineAction); - - QAction *differenceAction = new QAction("Differenfe View", this); - differenceAction->setShortcut(Qt::Key_3); - T::connect(differenceAction, SIGNAL(triggered()), mapper, SLOT(map())); - mapper->setMapping(differenceAction, DifferenceView); - mapper->setMapping(differenceAction, "Difference View" + file); - T::addAction(differenceAction); - - } - - } - - ~OnScreenWidget() - { - QSettings settings("Trolltech", "lance"); - for (int i=0; i<10; ++i) { - settings.setValue("cp" + QString::number(i), m_controlPoints.at(i)); - } - settings.sync(); - } - - void setVerboseMode(bool v) { m_verboseMode = v; } - void setCheckersBackground(bool b) { m_checkersBackground = b; } - void setType(DeviceType t) { m_deviceType = t; } - - void resizeEvent(QResizeEvent *e) { - m_image = QImage(); - T::resizeEvent(e); - } - - void paintEvent(QPaintEvent *) { - switch (m_view_mode) { - case RenderView: paintRenderView(); break; - case BaselineView: paintBaselineView(); break; - case DifferenceView: paintDifferenceView(); break; - } - } - - void paintRenderView() - { - QPainter pt; - QPaintDevice *dev = this; - if (m_deviceType == ImageWidgetType) { - if (m_image.size() != T::size()) - m_image = QImage(T::size(), QImage::Format_ARGB32_Premultiplied); - m_image.fill(0); - dev = &m_image; - } - - pt.begin(dev); - - PaintCommands paintCommands(m_commands, 800, 800); - paintCommands.setVerboseMode(m_verboseMode); - paintCommands.setCheckersBackground(m_checkersBackground); - paintCommands.setType(m_deviceType); - paintCommands.setPainter(&pt); - paintCommands.setControlPoints(m_controlPoints); - paintCommands.setFilePath(QFileInfo(m_filename).absolutePath()); -#ifdef DO_QWS_DEBUGGING - qt_show_painter_debug_output = true; -#endif - pt.save(); - paintCommands.runCommands(); - pt.restore(); -#ifdef DO_QWS_DEBUGGING - qt_show_painter_debug_output = false; -#endif - - pt.end(); - - if (m_deviceType == ImageWidgetType) { - QPainter(this).drawImage(0, 0, m_image); - } - - if (m_currentPoint >= 0 || m_showControlPoints) { - pt.begin(this); - pt.setRenderHint(QPainter::Antialiasing); - pt.setFont(this->font()); - pt.resetMatrix(); - pt.setPen(QColor(127, 127, 127, 191)); - pt.setBrush(QColor(191, 191, 255, 63)); - for (int i=0; iwindowSurface()) - m_render_view = T::window()->windowSurface()->grabWidget(this); - else - m_render_view = QPixmap::grabWidget(this); - - m_render_view.save("renderView.png"); - } - } - - void paintBaselineView() { - QPainter p(this); - - if (m_baseline.isNull()) { - p.drawText(T::rect(), Qt::AlignCenter, - "No baseline found\n" - "file '" + m_baseline_name + "' does not exist..."); - return; - } - - p.drawPixmap(0, 0, m_baseline); - - p.setPen(QColor::fromRgb(0, 0, 0, 0.1)); - p.setFont(QFont("Arial", 128)); - p.rotate(45); - p.drawText(100, 0, "BASELINE"); - } - - QPixmap generateDifference() - { - QImage img(T::size(), QImage::Format_RGB32); - img.fill(0); - - QPainter p(&img); - p.drawPixmap(0, 0, m_render_view); - - p.setCompositionMode(QPainter::RasterOp_SourceXorDestination); - p.drawPixmap(0, 0, m_baseline); - - p.end(); - - return QPixmap::fromImage(img); - } - - void paintDifferenceView() { - QPainter p(this); - if (m_baseline.isNull()) { - p.drawText(T::rect(), Qt::AlignCenter, - "No baseline found\n" - "file '" + m_baseline_name + "' does not exist..."); - return; - } - - p.fillRect(T::rect(), Qt::black); - p.drawPixmap(0, 0, generateDifference()); - } - - - void mouseMoveEvent(QMouseEvent *e) - { - if (m_currentPoint == -1) - return; - if (T::rect().contains(e->pos())) - m_controlPoints[m_currentPoint] = e->pos(); - T::update(); - } - - void mousePressEvent(QMouseEvent *e) - { - if (e->button() == Qt::RightButton) { - m_showControlPoints = true; - } - - if (e->button() == Qt::LeftButton) { - for (int i=0; ipos()).length() < CP_RADIUS) { - m_currentPoint = i; - break; - } - } - } - T::update(); - } - - void mouseReleaseEvent(QMouseEvent *e) - { - if (e->button() == Qt::LeftButton) - m_currentPoint = -1; - if (e->button() == Qt::RightButton) - m_showControlPoints = false; - T::update(); - } - - QSize sizeHint() const { return QSize(800, 800); } - - QVector m_controlPoints; - int m_currentPoint; - bool m_showControlPoints; - - QStringList m_commands; - QString m_filename; - QString m_baseline_name; - - bool m_verboseMode; - bool m_checkersBackground; - DeviceType m_deviceType; - - int m_view_mode; - - QImage m_image; - - QPixmap m_baseline; - QPixmap m_render_view; -}; - -#endif diff --git a/tests/arthur/performancediff/main.cpp b/tests/arthur/performancediff/main.cpp deleted file mode 100644 index d16596703b..0000000000 --- a/tests/arthur/performancediff/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include - -#include "performancediff.h" - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - PerformanceDiff generator; - - generator.run(argc, argv); - - return 0; -} diff --git a/tests/arthur/performancediff/performancediff.cpp b/tests/arthur/performancediff/performancediff.cpp deleted file mode 100644 index 3580f2aefa..0000000000 --- a/tests/arthur/performancediff/performancediff.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "performancediff.h" - -#include "xmldata.h" - -#include - -#include -#include -#include -#include - -#include -#include - - -static const int MIN_TEST_VAL = 20; -static const int TEST_EPSILON = 5; //ms - -static void usage(const char *progname) -{ - std::cerr << "Couldn't find 'framework.ini' " - << "file and no output has been specified."< &engines) -{ - QDir dir(dirName); - dir.setFilter(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot); - QFileInfoList list = dir.entryInfoList(); - for (int i = 0; i < list.size(); ++i) { - QFileInfo fileInfo = list.at(i); - QString dataFile = QString("%1/data.xml") - .arg(fileInfo.absoluteFilePath()); - if (QFile::exists(dataFile)) { - XMLReader handler; - QXmlSimpleReader reader; - reader.setContentHandler(&handler); - reader.setErrorHandler(&handler); - - QFile file(dataFile); - if (!file.open(QFile::ReadOnly | QFile::Text)) { - qWarning("Cannot open file '%s', because: %s", - qPrintable(dataFile), qPrintable(file.errorString())); - continue; - } - - QXmlInputSource xmlInputSource(&file); - if (reader.parse(xmlInputSource)) { - XMLEngine *engine = handler.xmlEngine(); - engines.insert(engine->name, engine); - } - } - } - -} -void PerformanceDiff::run(int argc, char **argv) -{ - processArguments(argc, argv); - - loadEngines(inputDirName, inputEngines); - loadEngines(diffDirName, diffEngines); - - if (inputEngines.isEmpty() || diffEngines.isEmpty()) { - usage(argv[0]); - return; - } - - generateDiff(); - //generateOutput(); -} - -void PerformanceDiff::processArguments(int argc, char **argv) -{ - if (argc != 3) - return; - inputDirName = QString(argv[1]); - diffDirName = QString(argv[2]); -} - -void PerformanceDiff::generateDiff() -{ - qreal totalIn = 0; - qreal totalDiff = 0; - - std::cout<name]; - if (!inEngine) - continue; - foreach(XMLSuite *diffSuite, diffEngine->suites) { - XMLSuite *inSuite = inEngine->suites[diffSuite->name]; - if (!inSuite) - continue; - - foreach(XMLFile *diffFile, diffSuite->files) { - XMLFile *inFile = inSuite->files[diffFile->name]; - if (!inFile) - continue; - - qreal inAvg = 0; - qreal diffAvg = 0; - qreal inMin = 0; - qreal inMax = 0; - foreach(XMLData data, inFile->data) { - inAvg = (double(data.timeToRender)/data.iterations); - if (!inMin) - inMin = data.minElapsed; - else if (data.minElapsed < inMin) - inMin = data.minElapsed; - if (!inMax) - inMax = data.maxElapsed; - else if (inMax < data.maxElapsed) - inMax = data.maxElapsed; - } - //skipping really small tests - if (inAvg < MIN_TEST_VAL) { - continue; - } - - totalIn += inAvg; - foreach(XMLData data, diffFile->data) { - diffAvg = (double(data.timeToRender)/data.iterations); - } - totalDiff += diffAvg; - - QFileInfo fi(diffFile->name); - std::cout.width(80); - std::cout.setf(std::ios::fixed, std::ios::floatfield); - std::cout.setf(std::ios::showpoint); - std::cout << std::resetiosflags(std::ios::right); - std::cout << std::resetiosflags(std::ios::left); - std::cout< TEST_EPSILON)) { - std::cout<<" + ("< inMax && - (qAbs(diffAvg - inMax) > TEST_EPSILON)) { - std::cout<<" - ("< -#include - -QT_FORWARD_DECLARE_CLASS(QStringList) -QT_FORWARD_DECLARE_CLASS(QSettings) - -class PerformanceDiff -{ -public: - PerformanceDiff(); - - //void generateOutput(); - - void run(int argc, char **argv); - -private: - void processArguments(int argc, char **argv); - void generateDiff(); -private: - QMap inputEngines; - QMap diffEngines; - - QSettings *settings; - QString inputDirName; - QString diffDirName; -}; - -#endif diff --git a/tests/arthur/performancediff/performancediff.pro b/tests/arthur/performancediff/performancediff.pro deleted file mode 100644 index 8c1fb98047..0000000000 --- a/tests/arthur/performancediff/performancediff.pro +++ /dev/null @@ -1,19 +0,0 @@ -# -*- Mode: makefile -*- -COMMON_FOLDER = $$PWD/../common -include(../arthurtester.pri) -TEMPLATE = app -TARGET = performancediff -DEPENDPATH += . -INCLUDEPATH += . -DESTDIR = ../bin - -CONFIG += console - -QT += xml svg core-private gui-private -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl - -# Input -HEADERS += performancediff.h -SOURCES += main.cpp performancediff.cpp - - diff --git a/tests/arthur/shower/main.cpp b/tests/arthur/shower/main.cpp deleted file mode 100644 index e501dd8e13..0000000000 --- a/tests/arthur/shower/main.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include - -#include "shower.h" -#include "qengines.h" - -static void usage() -{ - qDebug()<<"shower <-engine engineName> file"; -} - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - QString engine = "Raster"; - QString file; - for (int i = 1; i < argc; ++i) { - QString opt = argv[i]; - if (opt == "-engine") { - ++i; - engine = QString(argv[i]); - } else if (opt.startsWith('-')) { - qDebug()<<"Unsupported option "<engines()) { - if (qengine->name() == engine) { - engineExists = true; - } - engineNames.append(qengine->name()); - } - - if (file.isEmpty() || engine.isEmpty()) { - usage(); - return 1; - } - - if (!engineExists) { - qDebug()<<"Engine "< -#include -#include -#include -#include -#include -#include -#include -#include - -static QString loadFile(const QString &name) -{ - QFile file(name); - if (!file.open(QFile::ReadOnly)) { - qDebug("Can't open file '%s'", qPrintable(name)); - return QString(); - } - QTextStream str(&file); - return str.readAll(); -} - -Shower::Shower(const QString &file, - const QString &engineName) - : QWidget(0) -{ - foreach(QEngine *qengine, QtEngines::self()->engines()) { - if (qengine->name() == engineName) { - engine = qengine; - break; - } - } - - QFileInfo fi(file); - baseDataDir = fi.absolutePath(); - if (file.endsWith("svg")) { - renderer = new QSvgRenderer(this); - renderer->load(file); - } else { - qps = QFileInfo(file); - QString script = loadFile(qps.absoluteFilePath()); - qpsScript = script.split("\n", QString::SkipEmptyParts); - renderer = 0; - if (qpsScript.isEmpty()) { - printf("failed to read file: '%s'\n", qPrintable(qps.fileName())); - return; - } - } -} - - -QSize Shower::sizeHint() const -{ - return QSize(600, 600); -} - - -void Shower::paintEvent(QPaintEvent *) -{ - if (buffer.size() != size()) { - buffer = QImage(size(), QImage::Format_ARGB32_Premultiplied); - QPainter p(&buffer); - p.setViewport(0, 0, width(), height()); - p.eraseRect(0, 0, width(), height()); - engine->prepare(size()); - if (renderer) { - engine->render(renderer, QString("sample")); - } else { - engine->render(qpsScript, qps.absoluteFilePath()); - } - if (!engine->drawOnPainter(&p)) { - QString tempFileName = QString("%1sample.png").arg(QDir::tempPath()); - engine->save(tempFileName); - QImage img(tempFileName); - engine->cleanup(); - QFile::remove(tempFileName); - p.drawImage(0, 0, img); - } - } - QPainter pt(this); - pt.drawImage(0, 0, buffer); -} diff --git a/tests/arthur/shower/shower.h b/tests/arthur/shower/shower.h deleted file mode 100644 index 1ad190eb39..0000000000 --- a/tests/arthur/shower/shower.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef SHOWER_H -#define SHOWER_H - -#include -#include -#include -#include -#include - -QT_FORWARD_DECLARE_CLASS(QSvgRenderer) -QT_FORWARD_DECLARE_CLASS(QPaintEvent) -QT_FORWARD_DECLARE_CLASS(QEngine) - -class Shower : public QWidget -{ - Q_OBJECT -public: - Shower(const QString &file, - const QString &engine); - - QSize sizeHint() const; -protected: - void paintEvent(QPaintEvent *e); -private: - QEngine *engine; - QSvgRenderer *renderer; - QImage buffer; - QStringList qpsScript; - QFileInfo qps; - QString baseDataDir; -}; - -#endif diff --git a/tests/arthur/shower/shower.pro b/tests/arthur/shower/shower.pro deleted file mode 100644 index f4f8d47809..0000000000 --- a/tests/arthur/shower/shower.pro +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Mode: makefile -*- -COMMON_FOLDER = $$PWD/../common -include(../arthurtester.pri) -TEMPLATE = app -TARGET = shower -DEPENDPATH += . -INCLUDEPATH += . -DESTDIR = ../bin - -QT += xml svg core-private gui-private -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl - -# Input -HEADERS += shower.h -SOURCES += main.cpp shower.cpp - - diff --git a/tests/auto/baselineexample/baselineexample.pro b/tests/auto/baselineexample/baselineexample.pro index 13f03b8f36..3d3d42e8cc 100644 --- a/tests/auto/baselineexample/baselineexample.pro +++ b/tests/auto/baselineexample/baselineexample.pro @@ -15,4 +15,4 @@ TEMPLATE = app SOURCES += tst_baselineexample.cpp DEFINES += SRCDIR=\\\"$$PWD/\\\" -include($$PWD/../../arthur/common/qbaselinetest.pri) +include($$PWD/../../baselineserver/shared/qbaselinetest.pri) diff --git a/tests/auto/lancelot/images.qrc b/tests/auto/lancelot/images.qrc new file mode 100644 index 0000000000..060b52c85a --- /dev/null +++ b/tests/auto/lancelot/images.qrc @@ -0,0 +1,34 @@ + + + + images/alpha.png + images/border.png + images/borderimage.png + images/dome_argb32.png + images/dome_indexed.png + images/dome_mono_palette.png + images/dome_rgb32.png + images/face.png + images/gam045.png + images/gam100.png + images/image.png + images/masked.png + images/sign.png + images/struct-image-01.jpg + images/bitmap.png + images/dome_indexed_mask.png + images/dome_mono_128.png + images/dome_mono.png + images/dot.png + images/gam030.png + images/gam056.png + images/gam200.png + images/mask_100.png + images/mask.png + images/solid.png + images/struct-image-01.png + images/zebra.png + images/alpha2x2.png + images/solid2x2.png + + diff --git a/tests/auto/lancelot/images/alpha.png b/tests/auto/lancelot/images/alpha.png new file mode 100644 index 0000000000..e465b2586d Binary files /dev/null and b/tests/auto/lancelot/images/alpha.png differ diff --git a/tests/auto/lancelot/images/alpha2x2.png b/tests/auto/lancelot/images/alpha2x2.png new file mode 100644 index 0000000000..67ecc04286 Binary files /dev/null and b/tests/auto/lancelot/images/alpha2x2.png differ diff --git a/tests/auto/lancelot/images/bitmap.png b/tests/auto/lancelot/images/bitmap.png new file mode 100644 index 0000000000..d21f8f51bb Binary files /dev/null and b/tests/auto/lancelot/images/bitmap.png differ diff --git a/tests/auto/lancelot/images/border.png b/tests/auto/lancelot/images/border.png new file mode 100644 index 0000000000..a3d2fed0a3 Binary files /dev/null and b/tests/auto/lancelot/images/border.png differ diff --git a/tests/auto/lancelot/images/borderimage.png b/tests/auto/lancelot/images/borderimage.png new file mode 100644 index 0000000000..f7f6b66227 Binary files /dev/null and b/tests/auto/lancelot/images/borderimage.png differ diff --git a/tests/auto/lancelot/images/dome_argb32.png b/tests/auto/lancelot/images/dome_argb32.png new file mode 100644 index 0000000000..e3ccba0c13 Binary files /dev/null and b/tests/auto/lancelot/images/dome_argb32.png differ diff --git a/tests/auto/lancelot/images/dome_indexed.png b/tests/auto/lancelot/images/dome_indexed.png new file mode 100644 index 0000000000..beefcd514e Binary files /dev/null and b/tests/auto/lancelot/images/dome_indexed.png differ diff --git a/tests/auto/lancelot/images/dome_indexed_mask.png b/tests/auto/lancelot/images/dome_indexed_mask.png new file mode 100644 index 0000000000..a62f29f40e Binary files /dev/null and b/tests/auto/lancelot/images/dome_indexed_mask.png differ diff --git a/tests/auto/lancelot/images/dome_mono.png b/tests/auto/lancelot/images/dome_mono.png new file mode 100644 index 0000000000..950c2a7494 Binary files /dev/null and b/tests/auto/lancelot/images/dome_mono.png differ diff --git a/tests/auto/lancelot/images/dome_mono_128.png b/tests/auto/lancelot/images/dome_mono_128.png new file mode 100644 index 0000000000..77e48aaab7 Binary files /dev/null and b/tests/auto/lancelot/images/dome_mono_128.png differ diff --git a/tests/auto/lancelot/images/dome_mono_palette.png b/tests/auto/lancelot/images/dome_mono_palette.png new file mode 100644 index 0000000000..dca3f59245 Binary files /dev/null and b/tests/auto/lancelot/images/dome_mono_palette.png differ diff --git a/tests/auto/lancelot/images/dome_rgb32.png b/tests/auto/lancelot/images/dome_rgb32.png new file mode 100644 index 0000000000..27bc02a545 Binary files /dev/null and b/tests/auto/lancelot/images/dome_rgb32.png differ diff --git a/tests/auto/lancelot/images/dot.png b/tests/auto/lancelot/images/dot.png new file mode 100644 index 0000000000..17a7b6a0ba Binary files /dev/null and b/tests/auto/lancelot/images/dot.png differ diff --git a/tests/auto/lancelot/images/face.png b/tests/auto/lancelot/images/face.png new file mode 100644 index 0000000000..4f6172d83b Binary files /dev/null and b/tests/auto/lancelot/images/face.png differ diff --git a/tests/auto/lancelot/images/gam030.png b/tests/auto/lancelot/images/gam030.png new file mode 100644 index 0000000000..904c9721bd Binary files /dev/null and b/tests/auto/lancelot/images/gam030.png differ diff --git a/tests/auto/lancelot/images/gam045.png b/tests/auto/lancelot/images/gam045.png new file mode 100644 index 0000000000..b649a8a54f Binary files /dev/null and b/tests/auto/lancelot/images/gam045.png differ diff --git a/tests/auto/lancelot/images/gam056.png b/tests/auto/lancelot/images/gam056.png new file mode 100644 index 0000000000..e5f959dc96 Binary files /dev/null and b/tests/auto/lancelot/images/gam056.png differ diff --git a/tests/auto/lancelot/images/gam100.png b/tests/auto/lancelot/images/gam100.png new file mode 100644 index 0000000000..6c7ba5f1ed Binary files /dev/null and b/tests/auto/lancelot/images/gam100.png differ diff --git a/tests/auto/lancelot/images/gam200.png b/tests/auto/lancelot/images/gam200.png new file mode 100644 index 0000000000..daa20fcbc4 Binary files /dev/null and b/tests/auto/lancelot/images/gam200.png differ diff --git a/tests/auto/lancelot/images/image.png b/tests/auto/lancelot/images/image.png new file mode 100644 index 0000000000..85d486a790 Binary files /dev/null and b/tests/auto/lancelot/images/image.png differ diff --git a/tests/auto/lancelot/images/mask.png b/tests/auto/lancelot/images/mask.png new file mode 100644 index 0000000000..c3f3b1b6ca Binary files /dev/null and b/tests/auto/lancelot/images/mask.png differ diff --git a/tests/auto/lancelot/images/mask_100.png b/tests/auto/lancelot/images/mask_100.png new file mode 100644 index 0000000000..fc950dc7ed Binary files /dev/null and b/tests/auto/lancelot/images/mask_100.png differ diff --git a/tests/auto/lancelot/images/masked.png b/tests/auto/lancelot/images/masked.png new file mode 100644 index 0000000000..6debec534d Binary files /dev/null and b/tests/auto/lancelot/images/masked.png differ diff --git a/tests/auto/lancelot/images/sign.png b/tests/auto/lancelot/images/sign.png new file mode 100644 index 0000000000..6aac7e150a Binary files /dev/null and b/tests/auto/lancelot/images/sign.png differ diff --git a/tests/auto/lancelot/images/solid.png b/tests/auto/lancelot/images/solid.png new file mode 100644 index 0000000000..371e9c1aee Binary files /dev/null and b/tests/auto/lancelot/images/solid.png differ diff --git a/tests/auto/lancelot/images/solid2x2.png b/tests/auto/lancelot/images/solid2x2.png new file mode 100644 index 0000000000..ad67cd3e12 Binary files /dev/null and b/tests/auto/lancelot/images/solid2x2.png differ diff --git a/tests/auto/lancelot/images/struct-image-01.jpg b/tests/auto/lancelot/images/struct-image-01.jpg new file mode 100644 index 0000000000..a74e07223b Binary files /dev/null and b/tests/auto/lancelot/images/struct-image-01.jpg differ diff --git a/tests/auto/lancelot/images/struct-image-01.png b/tests/auto/lancelot/images/struct-image-01.png new file mode 100644 index 0000000000..4ed08406dc Binary files /dev/null and b/tests/auto/lancelot/images/struct-image-01.png differ diff --git a/tests/auto/lancelot/images/zebra.png b/tests/auto/lancelot/images/zebra.png new file mode 100644 index 0000000000..ef35f20785 Binary files /dev/null and b/tests/auto/lancelot/images/zebra.png differ diff --git a/tests/auto/lancelot/lancelot.pro b/tests/auto/lancelot/lancelot.pro index c4eaaac6ab..67fff1b411 100644 --- a/tests/auto/lancelot/lancelot.pro +++ b/tests/auto/lancelot/lancelot.pro @@ -3,11 +3,11 @@ QT += xml contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl SOURCES += tst_lancelot.cpp \ - $$PWD/../../arthur/common/paintcommands.cpp -HEADERS += $$PWD/../../arthur/common/paintcommands.h -RESOURCES += $$PWD/../../arthur/common/images.qrc + paintcommands.cpp +HEADERS += paintcommands.h +RESOURCES += images.qrc -include($$PWD/../../arthur/common/qbaselinetest.pri) +include($$PWD/../../baselineserver/shared/qbaselinetest.pri) !symbian:!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\" linux-g++-maemo:DEFINES += USE_RUNTIME_DIR diff --git a/tests/auto/lancelot/paintcommands.cpp b/tests/auto/lancelot/paintcommands.cpp new file mode 100644 index 0000000000..8735baa3f0 --- /dev/null +++ b/tests/auto/lancelot/paintcommands.cpp @@ -0,0 +1,2586 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "paintcommands.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef QT_NO_OPENGL +#include +#endif + +/********************************************************************************* +** everything to populate static tables +**********************************************************************************/ +const char *PaintCommands::brushStyleTable[] = { + "NoBrush", + "SolidPattern", + "Dense1Pattern", + "Dense2Pattern", + "Dense3Pattern", + "Dense4Pattern", + "Dense5Pattern", + "Dense6Pattern", + "Dense7Pattern", + "HorPattern", + "VerPattern", + "CrossPattern", + "BDiagPattern", + "FDiagPattern", + "DiagCrossPattern", + "LinearGradientPattern" +}; + +const char *PaintCommands::penStyleTable[] = { + "NoPen", + "SolidLine", + "DashLine", + "DotLine", + "DashDotLine", + "DashDotDotLine" +}; + +const char *PaintCommands::fontWeightTable[] = { + "Light", + "Normal", + "DemiBold", + "Bold", + "Black" +}; + +const char *PaintCommands::fontHintingTable[] = { + "Default", + "None", + "Vertical", + "Full" +}; + +const char *PaintCommands::clipOperationTable[] = { + "NoClip", + "ReplaceClip", + "IntersectClip", + "UniteClip" +}; + +const char *PaintCommands::spreadMethodTable[] = { + "PadSpread", + "ReflectSpread", + "RepeatSpread" +}; + +const char *PaintCommands::coordinateMethodTable[] = { + "LogicalMode", + "StretchToDeviceMode", + "ObjectBoundingMode" +}; + +const char *PaintCommands::sizeModeTable[] = { + "AbsoluteSize", + "RelativeSize" +}; + +const char *PaintCommands::compositionModeTable[] = { + "SourceOver", + "DestinationOver", + "Clear", + "Source", + "Destination", + "SourceIn", + "DestinationIn", + "SourceOut", + "DestinationOut", + "SourceAtop", + "DestinationAtop", + "Xor", + "Plus", + "Multiply", + "Screen", + "Overlay", + "Darken", + "Lighten", + "ColorDodge", + "ColorBurn", + "HardLight", + "SoftLight", + "Difference", + "Exclusion", + "SourceOrDestination", + "SourceAndDestination", + "SourceXorDestination", + "NotSourceAndNotDestination", + "NotSourceOrNotDestination", + "NotSourceXorDestination", + "NotSource", + "NotSourceAndDestination", + "SourceAndNotDestination" +}; + +const char *PaintCommands::imageFormatTable[] = { + "Invalid", + "Mono", + "MonoLSB", + "Indexed8", + "RGB32", + "ARGB32", + "ARGB32_Premultiplied", + "Format_RGB16", + "Format_ARGB8565_Premultiplied", + "Format_RGB666", + "Format_ARGB6666_Premultiplied", + "Format_RGB555", + "Format_ARGB8555_Premultiplied", + "Format_RGB888", + "Format_RGB444", + "Format_ARGB4444_Premultiplied" +}; + +int PaintCommands::translateEnum(const char *table[], const QString &pattern, int limit) +{ + QByteArray p = pattern.toLatin1().toLower(); + for (int i=0; i PaintCommands::s_commandInfoTable = QList(); +QList > PaintCommands::s_enumsTable = QList >(); +QMultiHash PaintCommands::s_commandHash; + +#define DECL_PAINTCOMMAND(identifier, method, regexp, syntax, sample) \ + s_commandInfoTable << PaintCommandInfos(QLatin1String(identifier), &PaintCommands::method, QRegExp(regexp), \ + QLatin1String(syntax), QLatin1String(sample) ); + +#define DECL_PAINTCOMMANDSECTION(title) \ + s_commandInfoTable << PaintCommandInfos(QLatin1String(title)); + +#define ADD_ENUMLIST(listCaption, cStrArray) { \ + QStringList list; \ + for (int i=0; i", + "import \"myfile.qrc\""); + DECL_PAINTCOMMAND("begin_block", command_begin_block, + "^begin_block\\s+(\\w*)$", + "begin_block ", + "begin_block blockName"); + DECL_PAINTCOMMAND("end_block", command_end_block, + "^end_block$", + "end_block", + "end_block"); + DECL_PAINTCOMMAND("repeat_block", command_repeat_block, + "^repeat_block\\s+(\\w*)$", + "repeat_block ", + "repeat_block blockName"); + DECL_PAINTCOMMAND("textlayout_draw", command_textlayout_draw, + "^textlayout_draw\\s+\"(.*)\"\\s+([0-9.]*)$", + "textlayout_draw ", + "textlayout_draw \"your text\" 1.0"); + DECL_PAINTCOMMAND("abort", command_abort, + "^abort$", + "abort", + "abort"); + DECL_PAINTCOMMAND("noop", command_noop, + "^$", + "-", + "\n"); + + DECL_PAINTCOMMANDSECTION("setters"); + DECL_PAINTCOMMAND("setBackgroundMode", command_setBgMode, + "^(setBackgroundMode|setBgMode)\\s+(\\w*)$", + "setBackgroundMode ", + "setBackgroundMode TransparentMode"); + DECL_PAINTCOMMAND("setBackground", command_setBackground, + "^setBackground\\s+#?(\\w*)\\s*(\\w*)?$", + "setBackground [brush style enum]", + "setBackground black SolidPattern"); + DECL_PAINTCOMMAND("setOpacity", command_setOpacity, + "^setOpacity\\s+(-?\\d*\\.?\\d*)$", + "setOpacity \n - opacity is in [0,1]", + "setOpacity 1.0"); + DECL_PAINTCOMMAND("path_setFillRule", command_path_setFillRule, + "^path_setFillRule\\s+(\\w*)\\s+(\\w*)$", + "path_setFillRule [Winding|OddEven]", + "path_setFillRule pathName Winding"); + DECL_PAINTCOMMAND("setBrush", command_setBrush, + "^setBrush\\s+(#?[\\w.:\\/]*)\\s*(\\w*)?$", + "setBrush \nsetBrush noBrush\nsetBrush ", + "setBrush white SolidPattern"); + DECL_PAINTCOMMAND("setBrushOrigin", command_setBrushOrigin, + "^setBrushOrigin\\s*(-?\\w*)\\s+(-?\\w*)$", + "setBrushOrigin ", + "setBrushOrigin 0 0"); + DECL_PAINTCOMMAND("brushTranslate", command_brushTranslate, + "^brushTranslate\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "brushTranslate ", + "brushTranslate 0.0 0.0"); + DECL_PAINTCOMMAND("brushScale", command_brushScale, + "^brushScale\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "brushScale ", + "brushScale 0.0 0.0"); + DECL_PAINTCOMMAND("brushRotate", command_brushRotate, + "^brushRotate\\s+(-?[\\w.]*)$", + "brushRotate \n - angle in degrees", + "brushRotate 0.0"); + DECL_PAINTCOMMAND("brushShear", command_brushShear, + "^brushShear\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "brushShear ", + "brushShear 0.0 0.0"); + DECL_PAINTCOMMAND("setCompositionMode", command_setCompositionMode, + "^setCompositionMode\\s+([\\w_0-9]*)$", + "setCompositionMode ", + "setCompositionMode SourceOver"); + DECL_PAINTCOMMAND("setFont", command_setFont, + "^setFont\\s+\"([\\w\\s]*)\"\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)$", + "setFont [size] [font weight|font weight enum] [italic] [hinting enum]\n - font weight is an integer between 0 and 99", + "setFont \"times\" 12"); + DECL_PAINTCOMMAND("setPen", command_setPen, + "^setPen\\s+#?(\\w*)$", + "setPen \nsetPen \nsetPen brush", + "setPen black"); + DECL_PAINTCOMMAND("setPen", command_setPen2, + "^setPen\\s+(#?\\w*)\\s+([\\w.]+)\\s*(\\w*)\\s*(\\w*)\\s*(\\w*)$", + "setPen brush| [width] [pen style enum] [FlatCap|SquareCap|RoundCap] [MiterJoin|BevelJoin|RoundJoin]", + "setPen black 1 FlatCap MiterJoin"); + DECL_PAINTCOMMAND("pen_setDashOffset", command_pen_setDashOffset, + "^pen_setDashOffset\\s+(-?[\\w.]+)$", + "pen_setDashOffset \n", + "pen_setDashOffset 1.0"); + DECL_PAINTCOMMAND("pen_setDashPattern", command_pen_setDashPattern, + "^pen_setDashPattern\\s+\\[([\\w\\s.]*)\\]$", + "pen_setDashPattern <[ ... ]>", + "pen_setDashPattern [ 2 1 4 1 3 3 ]"); + DECL_PAINTCOMMAND("pen_setCosmetic", command_pen_setCosmetic, + "^pen_setCosmetic\\s+(\\w*)$", + "pen_setCosmetic ", + "pen_setCosmetic true"); + DECL_PAINTCOMMAND("setRenderHint", command_setRenderHint, + "^setRenderHint\\s+([\\w_0-9]*)\\s*(\\w*)$", + "setRenderHint ", + "setRenderHint Antialiasing true"); + DECL_PAINTCOMMAND("clearRenderHint", command_clearRenderHint, + "^clearRenderHint$", + "clearRenderHint", + "clearRenderHint"); + + DECL_PAINTCOMMANDSECTION("gradients"); + DECL_PAINTCOMMAND("gradient_appendStop", command_gradient_appendStop, + "^gradient_appendStop\\s+([\\w.]*)\\s+#?(\\w*)$", + "gradient_appendStop ", + "gradient_appendStop 1.0 red"); + DECL_PAINTCOMMAND("gradient_clearStops", command_gradient_clearStops, + "^gradient_clearStops$", + "gradient_clearStops", + "gradient_clearStops"); + DECL_PAINTCOMMAND("gradient_setConical", command_gradient_setConical, + "^gradient_setConical\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$", + "gradient_setConical \n - angle in degrees", + "gradient_setConical 5.0 5.0 45.0"); + DECL_PAINTCOMMAND("gradient_setLinear", command_gradient_setLinear, + "^gradient_setLinear\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$", + "gradient_setLinear ", + "gradient_setLinear 1.0 1.0 2.0 2.0"); + DECL_PAINTCOMMAND("gradient_setRadial", command_gradient_setRadial, + "^gradient_setRadial\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)$", + "gradient_setRadial \n - C is the center\n - rad is the radius\n - F is the focal point", + "gradient_setRadial 1.0 1.0 45.0 2.0 2.0"); + DECL_PAINTCOMMAND("gradient_setRadialExtended", command_gradient_setRadialExtended, + "^gradient_setRadialExtended\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)\\s?([\\w.]*)$", + "gradient_setRadialExtended \n - C is the center\n - rad is the center radius\n - F is the focal point\n - frad is the focal radius", + "gradient_setRadialExtended 1.0 1.0 45.0 2.0 2.0 45.0"); + DECL_PAINTCOMMAND("gradient_setLinearPen", command_gradient_setLinearPen, + "^gradient_setLinearPen\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)\\s+([\\w.]*)$", + "gradient_setLinearPen ", + "gradient_setLinearPen 1.0 1.0 2.0 2.0"); + DECL_PAINTCOMMAND("gradient_setSpread", command_gradient_setSpread, + "^gradient_setSpread\\s+(\\w*)$", + "gradient_setSpread ", + "gradient_setSpread PadSpread"); + DECL_PAINTCOMMAND("gradient_setCoordinateMode", command_gradient_setCoordinateMode, + "^gradient_setCoordinateMode\\s+(\\w*)$", + "gradient_setCoordinateMode ", + "gradient_setCoordinateMode ObjectBoundingMode"); + DECL_PAINTCOMMANDSECTION("drawing ops"); + DECL_PAINTCOMMAND("drawPoint", command_drawPoint, + "^drawPoint\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "drawPoint ", + "drawPoint 10.0 10.0"); + DECL_PAINTCOMMAND("drawLine", command_drawLine, + "^drawLine\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "drawLine ", + "drawLine 10.0 10.0 20.0 20.0"); + DECL_PAINTCOMMAND("drawRect", command_drawRect, + "^drawRect\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "drawRect ", + "drawRect 10.0 10.0 20.0 20.0"); + DECL_PAINTCOMMAND("drawRoundRect", command_drawRoundRect, + "^drawRoundRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)?\\s*(-?\\w*)?$", + "drawRoundRect [rx] [ry]", + "drawRoundRect 10 10 20 20 3 3"); + DECL_PAINTCOMMAND("drawRoundedRect", command_drawRoundedRect, + "^drawRoundedRect\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s*(\\w*)?$", + "drawRoundedRect [SizeMode enum]", + "drawRoundedRect 10 10 20 20 4 4 AbsoluteSize"); + DECL_PAINTCOMMAND("drawArc", command_drawArc, + "^drawArc\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", + "drawArc \n - angles are expressed in 1/16th of degree", + "drawArc 10 10 20 20 0 5760"); + DECL_PAINTCOMMAND("drawChord", command_drawChord, + "^drawChord\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", + "drawChord \n - angles are expressed in 1/16th of degree", + "drawChord 10 10 20 20 0 5760"); + DECL_PAINTCOMMAND("drawEllipse", command_drawEllipse, + "^drawEllipse\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "drawEllipse ", + "drawEllipse 10.0 10.0 20.0 20.0"); + DECL_PAINTCOMMAND("drawPath", command_drawPath, + "^drawPath\\s+(\\w*)$", + "drawPath ", + "drawPath mypath"); + DECL_PAINTCOMMAND("drawPie", command_drawPie, + "^drawPie\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", + "drawPie \n - angles are expressed in 1/16th of degree", + "drawPie 10 10 20 20 0 5760"); + DECL_PAINTCOMMAND("drawPixmap", command_drawPixmap, + "^drawPixmap\\s+([\\w.:\\-/]*)" + "\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?" // target rect + "\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?$", // source rect + "drawPixmap " + "\n- where t means target and s means source" + "\n- a width or height of -1 means maximum space", + "drawPixmap :/images/face.png 0 0 -1 -1 0 0 -1 -1"); + DECL_PAINTCOMMAND("drawImage", command_drawImage, + "^drawImage\\s+([\\w.:\\/]*)" + "\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?" // target rect + "\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?\\s*(-?[\\w.]*)?$", // source rect + "drawImage " + "\n- where t means target and s means source" + "\n- a width or height of -1 means maximum space", + "drawImage :/images/face.png 0 0 -1 -1 0 0 -1 -1"); + DECL_PAINTCOMMAND("drawPolygon", command_drawPolygon, + "^drawPolygon\\s+\\[([\\w\\s-.]*)\\]\\s*(\\w*)$", + "drawPolygon <[ ... ]> ", + "drawPolygon [ 1 4 6 8 5 3 ] Winding"); + DECL_PAINTCOMMAND("drawConvexPolygon", command_drawConvexPolygon, + "^drawConvexPolygon\\s+\\[([\\w\\s-.]*)\\]$", + "drawConvexPolygon <[ ... ]>", + "drawConvexPolygon [ 1 4 6 8 5 3 ]"); + DECL_PAINTCOMMAND("drawPolyline", command_drawPolyline, + "^drawPolyline\\s+\\[([\\w\\s]*)\\]$", + "drawPolyline <[ ... ]>", + "drawPolyline [ 1 4 6 8 5 3 ]"); + DECL_PAINTCOMMAND("drawText", command_drawText, + "^drawText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$", + "drawText ", + "drawText 10 10 \"my text\""); + DECL_PAINTCOMMAND("drawStaticText", command_drawStaticText, + "^drawStaticText\\s+(-?\\w*)\\s+(-?\\w*)\\s+\"(.*)\"$", + "drawStaticText ", + "drawStaticText 10 10 \"my text\""); + DECL_PAINTCOMMAND("drawTiledPixmap", command_drawTiledPixmap, + "^drawTiledPixmap\\s+([\\w.:\\/]*)" + "\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w*)\\s*(-?\\w*)" + "\\s*(-?\\w*)\\s*(-?\\w*)$", + "drawTiledPixmap " + "\n - where t means tile" + "\n - and s is an offset in the tile", + "drawTiledPixmap :/images/alpha.png "); + + DECL_PAINTCOMMANDSECTION("painterPaths"); + DECL_PAINTCOMMAND("path_moveTo", command_path_moveTo, + "^path_moveTo\\s+([.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", + "path_moveTo ", + "path_moveTo mypath 1.0 1.0"); + DECL_PAINTCOMMAND("path_lineTo", command_path_lineTo, + "^path_lineTo\\s+([.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", + "path_lineTo ", + "path_lineTo mypath 1.0 1.0"); + DECL_PAINTCOMMAND("path_addEllipse", command_path_addEllipse, + "^path_addEllipse\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", + "path_addEllipse ", + "path_addEllipse mypath 10.0 10.0 20.0 20.0"); + DECL_PAINTCOMMAND("path_addPolygon", command_path_addPolygon, + "^path_addPolygon\\s+(\\w*)\\s+\\[([\\w\\s]*)\\]\\s*(\\w*)$", + "path_addPolygon <[ ... ]>", + "path_addPolygon mypath [ 1 4 6 8 5 3 ]"); + DECL_PAINTCOMMAND("path_addRect", command_path_addRect, + "^path_addRect\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", + "path_addRect ", + "path_addRect mypath 10.0 10.0 20.0 20.0"); + DECL_PAINTCOMMAND("path_addText", command_path_addText, + "^path_addText\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+\"(.*)\"$", + "path_addText ", + "path_addText mypath 10.0 20.0 \"some text\""); + DECL_PAINTCOMMAND("path_arcTo", command_path_arcTo, + "^path_arcTo\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", + "path_arcTo \n - angles are expressed in degrees", + "path_arcTo mypath 0.0 0.0 10.0 10.0 0.0 360.0"); + DECL_PAINTCOMMAND("path_cubicTo", command_path_cubicTo, + "^path_cubicTo\\s+(\\w*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", + "path_cubicTo ", + "path_cubicTo mypath 0.0 0.0 10.0 10.0 20.0 20.0"); + DECL_PAINTCOMMAND("path_closeSubpath", command_path_closeSubpath, + "^path_closeSubpath\\s+(\\w*)$", + "path_closeSubpath ", + "path_closeSubpath mypath"); + DECL_PAINTCOMMAND("path_createOutline", command_path_createOutline, + "^path_createOutline\\s+(\\w*)\\s+(\\w*)$", + "path_createOutline ", + "path_createOutline mypath myoutline"); + DECL_PAINTCOMMAND("path_debugPrint", command_path_debugPrint, + "^path_debugPrint\\s+(\\w*)$", + "path_debugPrint ", + "path_debugPrint mypath"); + + DECL_PAINTCOMMANDSECTION("regions"); + DECL_PAINTCOMMAND("region_addRect", command_region_addRect, + "^region_addRect\\s+(\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", + "region_addRect ", + "region_addRect myregion 0.0 0.0 10.0 10.0"); + DECL_PAINTCOMMAND("region_addEllipse", command_region_addEllipse, + "^region_addEllipse\\s+(\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$", + "region_addEllipse ", + "region_addEllipse myregion 0.0 0.0 10.0 10.0"); + + DECL_PAINTCOMMANDSECTION("clipping"); + DECL_PAINTCOMMAND("region_getClipRegion", command_region_getClipRegion, + "^region_getClipRegion\\s+(\\w*)$", + "region_getClipRegion ", + "region_getClipRegion myregion"); + DECL_PAINTCOMMAND("setClipRegion", command_setClipRegion, + "^setClipRegion\\s+(\\w*)\\s*(\\w*)$", + "setClipRegion ", + "setClipRegion myregion ReplaceClip"); + DECL_PAINTCOMMAND("path_getClipPath", command_path_getClipPath, + "^path_getClipPath\\s+([\\w0-9]*)$", + "path_getClipPath ", + "path_getClipPath mypath"); + DECL_PAINTCOMMAND("setClipPath", command_setClipPath, + "^setClipPath\\s+(\\w*)\\s*(\\w*)$", + "setClipPath ", + "setClipPath mypath ReplaceClip"); + DECL_PAINTCOMMAND("setClipRect", command_setClipRect, + "^setClipRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(\\w*)$", + "setClipRect ", + "setClipRect 0.0 0.0 10.0 10.0 ReplaceClip"); + DECL_PAINTCOMMAND("setClipping", command_setClipping, + "^setClipping\\s+(\\w*)$", + "setClipping ", + "setClipping true"); + + DECL_PAINTCOMMANDSECTION("surface"); + DECL_PAINTCOMMAND("surface_begin", command_surface_begin, + "^surface_begin\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "surface_begin ", + "surface_begin 0.0 0.0 10.0 10.0"); + DECL_PAINTCOMMAND("surface_end", command_surface_end, + "^surface_end$", + "surface_end", + "surface_end"); + + DECL_PAINTCOMMANDSECTION("painter states"); + DECL_PAINTCOMMAND("restore", command_restore, + "^restore$", + "restore", + "restore"); + DECL_PAINTCOMMAND("save", command_save, + "^save$", + "save", + "save"); + + DECL_PAINTCOMMANDSECTION("pixmaps'n'images"); + DECL_PAINTCOMMAND("pixmap_load", command_pixmap_load, + "^pixmap_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$", + "pixmap_load ", + "pixmap_load :/images/face.png myPixmap"); + DECL_PAINTCOMMAND("pixmap_setMask", command_pixmap_setMask, + "^pixmap_setMask\\s+([\\w.:\\/]*)\\s+([\\w.:\\/]*)$", + "pixmap_setMask ", + "pixmap_setMask myPixmap :/images/bitmap.png"); + DECL_PAINTCOMMAND("bitmap_load", command_bitmap_load, + "^bitmap_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$", + "bitmap_load \n - note that the image is stored as a pixmap", + "bitmap_load :/images/bitmap.png myBitmap"); + DECL_PAINTCOMMAND("image_convertToFormat", command_image_convertToFormat, + "^image_convertToFormat\\s+([\\w.:\\/]*)\\s+([\\w.:\\/]+)\\s+([\\w0-9_]*)$", + "image_convertToFormat ", + "image_convertToFormat myImage myNewImage Indexed8"); + DECL_PAINTCOMMAND("image_load", command_image_load, + "^image_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$", + "image_load ", + "image_load :/images/face.png myImage"); + DECL_PAINTCOMMAND("image_setColor", command_image_setColor, + "^image_setColor\\s+([\\w.:\\/]*)\\s+([0-9]*)\\s+#([0-9]*)$", + "image_setColor ", + "image_setColor myImage 0 black"); + DECL_PAINTCOMMAND("image_setColorCount", command_image_setColorCount, + "^image_setColorCount\\s+([\\w.:\\/]*)\\s+([0-9]*)$", + "image_setColorCount ", + "image_setColorCount myImage 128"); + + DECL_PAINTCOMMANDSECTION("transformations"); + DECL_PAINTCOMMAND("resetMatrix", command_resetMatrix, + "^resetMatrix$", + "resetMatrix", + "resetMatrix"); + DECL_PAINTCOMMAND("setMatrix", command_setMatrix, + "^setMatrix\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", + "setMatrix ", + "setMatrix 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0"); + DECL_PAINTCOMMAND("translate", command_translate, + "^translate\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "translate ", + "translate 10.0 10.0"); + DECL_PAINTCOMMAND("rotate", command_rotate, + "^rotate\\s+(-?[\\w.]*)$", + "rotate \n - with angle in degrees", + "rotate 30.0"); + DECL_PAINTCOMMAND("rotate_x", command_rotate_x, + "^rotate_x\\s+(-?[\\w.]*)$", + "rotate_x \n - with angle in degrees", + "rotate_x 30.0"); + DECL_PAINTCOMMAND("rotate_y", command_rotate_y, + "^rotate_y\\s+(-?[\\w.]*)$", + "rotate_y \n - with angle in degrees", + "rotate_y 30.0"); + DECL_PAINTCOMMAND("scale", command_scale, + "^scale\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$", + "scale ", + "scale 2.0 1.0"); + DECL_PAINTCOMMAND("mapQuadToQuad", command_mapQuadToQuad, + "^mapQuadToQuad\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)$", + "mapQuadToQuad " + "\n - where vertices 1 to 4 defines the source quad and 5 to 8 the destination quad", + "mapQuadToQuad 0.0 0.0 1.0 1.0 0.0 0.0 -1.0 -1.0"); + + // populate the command lookup hash + for (int i=0; i T PaintCommands::image_load(const QString &filepath) +{ + T t(filepath); + + if (t.isNull()) + t = T(":images/" + filepath); + + if (t.isNull()) + t = T("images/" + filepath); + + if (t.isNull()) { + QFileInfo fi(filepath); + QDir dir = fi.absoluteDir(); + dir.cdUp(); + dir.cd("images"); + QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(fi.fileName()); + t = T(fileName); + if (t.isNull() && !fileName.endsWith(".png")) { + fileName.append(".png"); + t = T(fileName); + } + } + + return t; +} + +/********************************************************************************* +** setters +**********************************************************************************/ +void PaintCommands::insertAt(int commandIndex, const QStringList &newCommands) +{ + int index = 0; + int left = newCommands.size(); + while (left--) + m_commands.insert(++commandIndex, newCommands.at(index++)); +} + +/********************************************************************************* +** run +**********************************************************************************/ +void PaintCommands::runCommand(const QString &scriptLine) +{ + if (scriptLine.isEmpty()) { + command_noop(QRegExp()); + return; + } + if (scriptLine.startsWith('#')) { + command_comment(QRegExp()); + return; + } + QString firstWord = scriptLine.section(QRegExp("\\s"), 0, 0); + QList indices = s_commandHash.values(firstWord); + foreach(int idx, indices) { + const PaintCommandInfos &command = s_commandInfoTable.at(idx); + if (command.regExp.indexIn(scriptLine) >= 0) { + (this->*(command.paintMethod))(command.regExp); + return; + } + } + qWarning("ERROR: unknown command or argument syntax error in \"%s\"", qPrintable(scriptLine)); +} + +void PaintCommands::runCommands() +{ + staticInit(); + int width = m_painter->window().width(); + int height = m_painter->window().height(); + + if (width <= 0) + width = 800; + if (height <= 0) + height = 800; + + // paint background + if (m_checkers_background) { + QPixmap pm(20, 20); + pm.fill(Qt::white); + QPainter pt(&pm); + pt.fillRect(0, 0, 10, 10, QColor::fromRgba(0xffdfdfdf)); + pt.fillRect(10, 10, 10, 10, QColor::fromRgba(0xffdfdfdf)); + pt.end(); + m_painter->drawTiledPixmap(0, 0, width, height, pm); + } else { + m_painter->fillRect(0, 0, width, height, Qt::white); + } + + // run each command + m_abort = false; + for (int i=0; idevice()->devType() == Qt::Widget) + return m_painter->window().width(); + else + return 800; + } + if (str.toLower() == "height") { + if (m_painter->device()->devType() == Qt::Widget) + return m_painter->window().height(); + else + return 800; + } + if (re.indexIn(str) >= 0) { + int index = re.cap(1).toInt(); + bool is_it_x = re.cap(2) == "x"; + if (index < 0 || index >= m_controlPoints.size()) { + qWarning("ERROR: control point index=%d is out of bounds", index); + return 0; + } + return is_it_x ? m_controlPoints.at(index).x() : m_controlPoints.at(index).y(); + } + return str.toDouble(); +} + +QColor PaintCommands::convertToColor(const QString &str) +{ + static QRegExp alphaColor("#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})"); + static QRegExp opaqueColor("#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})"); + + Q_ASSERT(alphaColor.isValid()); + Q_ASSERT(opaqueColor.isValid()); + + if (alphaColor.indexIn(str) >= 0) { + return QColor(alphaColor.cap(2).toInt(0, 16), + alphaColor.cap(3).toInt(0, 16), + alphaColor.cap(4).toInt(0, 16), + alphaColor.cap(1).toInt(0, 16)); + } else if (opaqueColor.indexIn(str) >= 0) { + return QColor(opaqueColor.cap(1).toInt(0, 16), + opaqueColor.cap(2).toInt(0, 16), + opaqueColor.cap(3).toInt(0, 16)); + } + return QColor(str); +} + +/********************************************************************************* +** command implementations +**********************************************************************************/ +void PaintCommands::command_comment(QRegExp) +{ + if (m_verboseMode) + printf(" -(lance) comment: %s\n", qPrintable(m_currentCommand)); +} + +/***************************************************************************************************/ +void PaintCommands::command_import(QRegExp re) +{ + QString importFile(re.cap(1)); + QFileInfo fi(m_filepath); + QDir dir = fi.absoluteDir(); + QFile *file = new QFile(dir.absolutePath() + QDir::separator() + importFile); + + if (importFile.isEmpty() || !file->exists()) { + dir.cdUp(); + dir.cd("data"); + dir.cd("qps"); + delete file; + file = new QFile(dir.absolutePath() + QDir::separator() + importFile); + } + + if (importFile.isEmpty() || !file->exists()) { + dir.cdUp(); + dir.cd("images"); + delete file; + file = new QFile(dir.absolutePath() + QDir::separator() + importFile); + } + + if (importFile.isEmpty() || !file->exists()) { + printf(" - importing non-existing file at line %d (%s)\n", m_currentCommandIndex, + qPrintable(file->fileName())); + delete file; + return; + } + + if (!file->open(QIODevice::ReadOnly)) { + printf(" - failed to read file: '%s'\n", qPrintable(file->fileName())); + delete file; + return; + } + if (m_verboseMode) + printf(" -(lance) importing file at line %d (%s)\n", m_currentCommandIndex, + qPrintable(fi.fileName())); + + QFileInfo fileinfo(*file); + m_commands[m_currentCommandIndex] = QString("# import file (%1) start").arg(fileinfo.fileName()); + QTextStream textFile(file); + QString rawContent = textFile.readAll(); + QStringList importedData = rawContent.split('\n', QString::SkipEmptyParts); + importedData.append(QString("# import file (%1) end ---").arg(fileinfo.fileName())); + insertAt(m_currentCommandIndex, importedData); + + if (m_verboseMode) { + printf(" -(lance) Command buffer now looks like:\n"); + for (int i = 0; i < m_commands.count(); ++i) + printf(" ---> {%s}\n", qPrintable(m_commands.at(i))); + } + delete file; +} + +/***************************************************************************************************/ +void PaintCommands::command_begin_block(QRegExp re) +{ + const QString &blockName = re.cap(1); + if (m_verboseMode) + printf(" -(lance) begin_block (%s)\n", qPrintable(blockName)); + + m_commands[m_currentCommandIndex] = QString("# begin block (%1)").arg(blockName); + QStringList newBlock; + int i = m_currentCommandIndex + 1; + for (; i < m_commands.count(); ++i) { + const QString &nextCmd = m_commands.at(i); + if (nextCmd.startsWith("end_block")) { + m_commands[i] = QString("# end block (%1)").arg(blockName); + break; + } + newBlock += nextCmd; + } + + if (m_verboseMode) + for (int j = 0; j < newBlock.count(); ++j) + printf(" %d: %s\n", j, qPrintable(newBlock.at(j))); + + if (i >= m_commands.count()) + printf(" - Warning! Block doesn't have an 'end_block' marker!\n"); + + m_blockMap.insert(blockName, newBlock); +} + +/***************************************************************************************************/ +void PaintCommands::command_end_block(QRegExp) +{ + printf(" - end_block should be consumed by begin_block command.\n"); + printf(" You will never see this if your block markers are in sync\n"); + printf(" (noop)\n"); +} + +/***************************************************************************************************/ +void PaintCommands::command_repeat_block(QRegExp re) +{ + QString blockName = re.cap(1); + if (m_verboseMode) + printf(" -(lance) repeating block (%s)\n", qPrintable(blockName)); + + QStringList block = m_blockMap.value(blockName); + if (block.isEmpty()) { + printf(" - repeated block (%s) is empty!\n", qPrintable(blockName)); + return; + } + + m_commands[m_currentCommandIndex] = QString("# repeated block (%1)").arg(blockName); + insertAt(m_currentCommandIndex, block); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawLine(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double x1 = convertToDouble(caps.at(1)); + double y1 = convertToDouble(caps.at(2)); + double x2 = convertToDouble(caps.at(3)); + double y2 = convertToDouble(caps.at(4)); + + if (m_verboseMode) + printf(" -(lance) drawLine((%.2f, %.2f), (%.2f, %.2f))\n", x1, y1, x2, y2); + + m_painter->drawLine(QLineF(x1, y1, x2, y2)); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawPath(QRegExp re) +{ + if (m_verboseMode) + printf(" -(lance) drawPath(name=%s)\n", qPrintable(re.cap(1))); + + QPainterPath &path = m_pathMap[re.cap(1)]; + m_painter->drawPath(path); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawPixmap(QRegExp re) +{ + QPixmap pm; + pm = m_pixmapMap[re.cap(1)]; // try cache first + if (pm.isNull()) + pm = image_load(re.cap(1)); + if (pm.isNull()) { + QFileInfo fi(m_filepath); + QDir dir = fi.absoluteDir(); + dir.cdUp(); + dir.cd("images"); + QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(re.cap(1)); + pm = QPixmap(fileName); + if (pm.isNull() && !fileName.endsWith(".png")) { + fileName.append(".png"); + pm = QPixmap(fileName); + } + } + if (pm.isNull()) { + fprintf(stderr, "ERROR(drawPixmap): failed to load pixmap: '%s'\n", + qPrintable(re.cap(1))); + return; + } + + qreal tx = convertToFloat(re.cap(2)); + qreal ty = convertToFloat(re.cap(3)); + qreal tw = convertToFloat(re.cap(4)); + qreal th = convertToFloat(re.cap(5)); + + qreal sx = convertToFloat(re.cap(6)); + qreal sy = convertToFloat(re.cap(7)); + qreal sw = convertToFloat(re.cap(8)); + qreal sh = convertToFloat(re.cap(9)); + + if (tw == 0) tw = -1; + if (th == 0) th = -1; + if (sw == 0) sw = -1; + if (sh == 0) sh = -1; + + if (m_verboseMode) + printf(" -(lance) drawPixmap('%s' dim=(%d, %d), depth=%d, (%f, %f, %f, %f), (%f, %f, %f, %f)\n", + qPrintable(re.cap(1)), pm.width(), pm.height(), pm.depth(), + tx, ty, tw, th, sx, sy, sw, sh); + + m_painter->drawPixmap(QRectF(tx, ty, tw, th), pm, QRectF(sx, sy, sw, sh)); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawImage(QRegExp re) +{ + QImage im; + im = m_imageMap[re.cap(1)]; // try cache first + if (im.isNull()) + im = image_load(re.cap(1)); + + if (im.isNull()) { + QFileInfo fi(m_filepath); + QDir dir = fi.absoluteDir(); + dir.cdUp(); + dir.cd("images"); + QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(re.cap(1)); + im = QImage(fileName); + if (im.isNull() && !fileName.endsWith(".png")) { + fileName.append(".png"); + im = QImage(fileName); + } + } + if (im.isNull()) { + fprintf(stderr, "ERROR(drawImage): failed to load image: '%s'\n", qPrintable(re.cap(1))); + return; + } + + qreal tx = convertToFloat(re.cap(2)); + qreal ty = convertToFloat(re.cap(3)); + qreal tw = convertToFloat(re.cap(4)); + qreal th = convertToFloat(re.cap(5)); + + qreal sx = convertToFloat(re.cap(6)); + qreal sy = convertToFloat(re.cap(7)); + qreal sw = convertToFloat(re.cap(8)); + qreal sh = convertToFloat(re.cap(9)); + + if (tw == 0) tw = -1; + if (th == 0) th = -1; + if (sw == 0) sw = -1; + if (sh == 0) sh = -1; + + if (m_verboseMode) + printf(" -(lance) drawImage('%s' dim=(%d, %d), (%f, %f, %f, %f), (%f, %f, %f, %f)\n", + qPrintable(re.cap(1)), im.width(), im.height(), tx, ty, tw, th, sx, sy, sw, sh); + + m_painter->drawImage(QRectF(tx, ty, tw, th), im, QRectF(sx, sy, sw, sh), Qt::OrderedDither | Qt::OrderedAlphaDither); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawTiledPixmap(QRegExp re) +{ + QPixmap pm; + pm = m_pixmapMap[re.cap(1)]; // try cache first + if (pm.isNull()) + pm = image_load(re.cap(1)); + if (pm.isNull()) { + QFileInfo fi(m_filepath); + QDir dir = fi.absoluteDir(); + dir.cdUp(); + dir.cd("images"); + QString fileName = QString("%1/%2").arg(dir.absolutePath()).arg(re.cap(1)); + pm = QPixmap(fileName); + if (pm.isNull() && !fileName.endsWith(".png")) { + fileName.append(".png"); + pm = QPixmap(fileName); + } + } + if (pm.isNull()) { + fprintf(stderr, "ERROR(drawTiledPixmap): failed to load pixmap: '%s'\n", + qPrintable(re.cap(1))); + return; + } + + int tx = convertToInt(re.cap(2)); + int ty = convertToInt(re.cap(3)); + int tw = convertToInt(re.cap(4)); + int th = convertToInt(re.cap(5)); + + int sx = convertToInt(re.cap(6)); + int sy = convertToInt(re.cap(7)); + + if (tw == 0) tw = -1; + if (th == 0) th = -1; + + if (m_verboseMode) + printf(" -(lance) drawTiledPixmap('%s' dim=(%d, %d), (%d, %d, %d, %d), (%d, %d)\n", + qPrintable(re.cap(1)), pm.width(), pm.height(), tx, ty, tw, th, sx, sy); + + m_painter->drawTiledPixmap(tx, ty, tw, th, pm, sx, sy); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawPoint(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + float x = convertToFloat(caps.at(1)); + float y = convertToFloat(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) drawPoint(%.2f, %.2f)\n", x, y); + + m_painter->drawPoint(QPointF(x, y)); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawPolygon(QRegExp re) +{ + static QRegExp separators("\\s"); + QStringList caps = re.capturedTexts(); + QString cap = caps.at(1); + QStringList numbers = cap.split(separators, QString::SkipEmptyParts); + + QPolygonF array; + for (int i=0; i + 1drawPolygon(array, caps.at(2).toLower() == "winding" ? Qt::WindingFill : Qt::OddEvenFill); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawPolyline(QRegExp re) +{ + static QRegExp separators("\\s"); + QStringList numbers = re.cap(1).split(separators, QString::SkipEmptyParts); + + QPolygonF array; + for (int i=0; i + 1drawPolyline(array.toPolygon()); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawRect(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + float x = convertToFloat(caps.at(1)); + float y = convertToFloat(caps.at(2)); + float w = convertToFloat(caps.at(3)); + float h = convertToFloat(caps.at(4)); + + if (m_verboseMode) + printf(" -(lance) drawRect(%.2f, %.2f, %.2f, %.2f)\n", x, y, w, h); + + m_painter->drawRect(QRectF(x, y, w, h)); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawRoundedRect(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + float x = convertToFloat(caps.at(1)); + float y = convertToFloat(caps.at(2)); + float w = convertToFloat(caps.at(3)); + float h = convertToFloat(caps.at(4)); + float xr = convertToFloat(caps.at(5)); + float yr = convertToFloat(caps.at(6)); + + int mode = translateEnum(sizeModeTable, caps.at(7), sizeof(sizeModeTable)/sizeof(char *)); + if (mode < 0) + mode = Qt::AbsoluteSize; + + if (m_verboseMode) + printf(" -(lance) drawRoundRect(%f, %f, %f, %f, %f, %f, %s)\n", x, y, w, h, xr, yr, mode ? "RelativeSize" : "AbsoluteSize"); + + m_painter->drawRoundedRect(QRectF(x, y, w, h), xr, yr, Qt::SizeMode(mode)); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawRoundRect(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + int x = convertToInt(caps.at(1)); + int y = convertToInt(caps.at(2)); + int w = convertToInt(caps.at(3)); + int h = convertToInt(caps.at(4)); + int xs = caps.at(5).isEmpty() ? 50 : convertToInt(caps.at(5)); + int ys = caps.at(6).isEmpty() ? 50 : convertToInt(caps.at(6)); + + if (m_verboseMode) + printf(" -(lance) drawRoundRect(%d, %d, %d, %d, [%d, %d])\n", x, y, w, h, xs, ys); + + m_painter->drawRoundRect(x, y, w, h, xs, ys); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawEllipse(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + float x = convertToFloat(caps.at(1)); + float y = convertToFloat(caps.at(2)); + float w = convertToFloat(caps.at(3)); + float h = convertToFloat(caps.at(4)); + + if (m_verboseMode) + printf(" -(lance) drawEllipse(%.2f, %.2f, %.2f, %.2f)\n", x, y, w, h); + + m_painter->drawEllipse(QRectF(x, y, w, h)); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawPie(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + int x = convertToInt(caps.at(1)); + int y = convertToInt(caps.at(2)); + int w = convertToInt(caps.at(3)); + int h = convertToInt(caps.at(4)); + int angle = convertToInt(caps.at(5)); + int sweep = convertToInt(caps.at(6)); + + if (m_verboseMode) + printf(" -(lance) drawPie(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep); + + m_painter->drawPie(x, y, w, h, angle, sweep); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawChord(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + int x = convertToInt(caps.at(1)); + int y = convertToInt(caps.at(2)); + int w = convertToInt(caps.at(3)); + int h = convertToInt(caps.at(4)); + int angle = convertToInt(caps.at(5)); + int sweep = convertToInt(caps.at(6)); + + if (m_verboseMode) + printf(" -(lance) drawChord(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep); + + m_painter->drawChord(x, y, w, h, angle, sweep); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawArc(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + int x = convertToInt(caps.at(1)); + int y = convertToInt(caps.at(2)); + int w = convertToInt(caps.at(3)); + int h = convertToInt(caps.at(4)); + int angle = convertToInt(caps.at(5)); + int sweep = convertToInt(caps.at(6)); + + if (m_verboseMode) + printf(" -(lance) drawArc(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep); + + m_painter->drawArc(x, y, w, h, angle, sweep); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawText(QRegExp re) +{ + if (!m_shouldDrawText) + return; + QStringList caps = re.capturedTexts(); + int x = convertToInt(caps.at(1)); + int y = convertToInt(caps.at(2)); + QString txt = caps.at(3); + + if (m_verboseMode) + printf(" -(lance) drawText(%d, %d, %s)\n", x, y, qPrintable(txt)); + + m_painter->drawText(x, y, txt); +} + +void PaintCommands::command_drawStaticText(QRegExp re) +{ + if (!m_shouldDrawText) + return; + QStringList caps = re.capturedTexts(); + int x = convertToInt(caps.at(1)); + int y = convertToInt(caps.at(2)); + QString txt = caps.at(3); + + if (m_verboseMode) + printf(" -(lance) drawStaticText(%d, %d, %s)\n", x, y, qPrintable(txt)); + + m_painter->drawStaticText(x, y, QStaticText(txt)); +} + +/***************************************************************************************************/ +void PaintCommands::command_noop(QRegExp) +{ + if (m_verboseMode) + printf(" -(lance) noop: %s\n", qPrintable(m_currentCommand)); + + if (!m_currentCommand.trimmed().isEmpty()) { + fprintf(stderr, "unknown command: '%s'\n", qPrintable(m_currentCommand.trimmed())); + } +} + +/***************************************************************************************************/ +void PaintCommands::command_path_addText(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + double x = convertToDouble(caps.at(2)); + double y = convertToDouble(caps.at(3)); + QString text = caps.at(4); + + if (m_verboseMode) + printf(" -(lance) path_addText(%s, %.2f, %.2f, text=%s\n", qPrintable(name), x, y, qPrintable(text)); + + m_pathMap[name].addText(x, y, m_painter->font(), text); +} + +/***************************************************************************************************/ +void PaintCommands::command_path_addEllipse(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + double x = convertToDouble(caps.at(2)); + double y = convertToDouble(caps.at(3)); + double w = convertToDouble(caps.at(4)); + double h = convertToDouble(caps.at(5)); + + if (m_verboseMode) + printf(" -(lance) path_addEllipse(%s, %.2f, %.2f, %.2f, %.2f)\n", qPrintable(name), x, y, w, h); + + m_pathMap[name].addEllipse(x, y, w, h); +} + +/***************************************************************************************************/ +void PaintCommands::command_path_addRect(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + double x = convertToDouble(caps.at(2)); + double y = convertToDouble(caps.at(3)); + double w = convertToDouble(caps.at(4)); + double h = convertToDouble(caps.at(5)); + + if (m_verboseMode) + printf(" -(lance) path_addRect(%s, %.2f, %.2f, %.2f, %.2f)\n", qPrintable(name), x, y, w, h); + + m_pathMap[name].addRect(x, y, w, h); +} + +/***************************************************************************************************/ +void PaintCommands::command_path_addPolygon(QRegExp re) +{ + static QRegExp separators("\\s"); + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + QString cap = caps.at(2); + QStringList numbers = cap.split(separators, QString::SkipEmptyParts); + + QPolygonF array; + for (int i=0; i + 1pen(); + + if (m_verboseMode) + printf(" -(lance) path_createOutline(%s, name=%s, width=%d)\n", + qPrintable(name), qPrintable(newName), pen.width()); + + if (!m_pathMap.contains(name)) { + fprintf(stderr, "createOutline(), unknown path: %s\n", qPrintable(name)); + return; + } + QPainterPathStroker stroker; + stroker.setWidth(pen.widthF()); + stroker.setDashPattern(pen.style()); + stroker.setCapStyle(pen.capStyle()); + stroker.setJoinStyle(pen.joinStyle()); + m_pathMap[newName] = stroker.createStroke(m_pathMap[name]); +} + +/***************************************************************************************************/ +void PaintCommands::command_path_cubicTo(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + double x1 = convertToDouble(caps.at(2)); + double y1 = convertToDouble(caps.at(3)); + double x2 = convertToDouble(caps.at(4)); + double y2 = convertToDouble(caps.at(5)); + double x3 = convertToDouble(caps.at(6)); + double y3 = convertToDouble(caps.at(7)); + + if (m_verboseMode) + printf(" -(lance) path_cubicTo(%s, (%.2f, %.2f), (%.2f, %.2f), (%.2f, %.2f))\n", qPrintable(name), x1, y1, x2, y2, x3, y3); + + m_pathMap[name].cubicTo(x1, y1, x2, y2, x3, y3); +} + +/***************************************************************************************************/ +void PaintCommands::command_path_moveTo(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + double x1 = convertToDouble(caps.at(2)); + double y1 = convertToDouble(caps.at(3)); + + if (m_verboseMode) + printf(" -(lance) path_moveTo(%s, (%.2f, %.2f))\n", qPrintable(name), x1, y1); + + m_pathMap[name].moveTo(x1, y1); +} + +/***************************************************************************************************/ +void PaintCommands::command_path_lineTo(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + double x1 = convertToDouble(caps.at(2)); + double y1 = convertToDouble(caps.at(3)); + + if (m_verboseMode) + printf(" -(lance) path_lineTo(%s, (%.2f, %.2f))\n", qPrintable(name), x1, y1); + + m_pathMap[name].lineTo(x1, y1); +} + +/***************************************************************************************************/ +void PaintCommands::command_path_setFillRule(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + bool winding = caps.at(2).toLower() == "winding"; + + if (m_verboseMode) + printf(" -(lance) path_setFillRule(name=%s, winding=%d)\n", qPrintable(name), winding); + + m_pathMap[name].setFillRule(winding ? Qt::WindingFill : Qt::OddEvenFill); +} + +/***************************************************************************************************/ +void PaintCommands::command_path_closeSubpath(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + + if (m_verboseMode) + printf(" -(lance) path_closeSubpath(name=%s)\n", qPrintable(name)); + + m_pathMap[name].closeSubpath(); +} + +/***************************************************************************************************/ +void PaintCommands::command_path_getClipPath(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + + if (m_verboseMode) + printf(" -(lance) path_closeSubpath(name=%s)\n", qPrintable(name)); + + m_pathMap[name] = m_painter->clipPath(); +} + +/***************************************************************************************************/ +static void qt_debug_path(const QPainterPath &path, const QString &name) +{ + const char *names[] = { + "MoveTo ", + "LineTo ", + "CurveTo ", + "CurveToData" + }; + + printf("\nQPainterPath (%s): elementCount=%d\n", qPrintable(name), path.elementCount()); + for (int i=0; i= 0 && e.type <= QPainterPath::CurveToDataElement); + printf(" - %3d:: %s, (%.2f, %.2f)\n", i, names[e.type], e.x, e.y); + } +} + +/***************************************************************************************************/ +void PaintCommands::command_path_debugPrint(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + qt_debug_path(m_pathMap[name], name); +} + +/***************************************************************************************************/ +void PaintCommands::command_region_addRect(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + int x = convertToInt(caps.at(2)); + int y = convertToInt(caps.at(3)); + int w = convertToInt(caps.at(4)); + int h = convertToInt(caps.at(5)); + + if (m_verboseMode) + printf(" -(lance) region_addRect(%s, %d, %d, %d, %d)\n", qPrintable(name), x, y, w, h); + + m_regionMap[name] += QRect(x, y, w, h); +} + +/***************************************************************************************************/ +void PaintCommands::command_region_addEllipse(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + int x = convertToInt(caps.at(2)); + int y = convertToInt(caps.at(3)); + int w = convertToInt(caps.at(4)); + int h = convertToInt(caps.at(5)); + + if (m_verboseMode) + printf(" -(lance) region_addEllipse(%s, %d, %d, %d, %d)\n", qPrintable(name), x, y, w, h); + + m_regionMap[name] += QRegion(x, y, w, h, QRegion::Ellipse); +} + +/***************************************************************************************************/ +void PaintCommands::command_region_getClipRegion(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString name = caps.at(1); + QRegion region = m_painter->clipRegion(); + + if (m_verboseMode) + printf(" -(lance) region_getClipRegion(name=%s), bounds=[%d, %d, %d, %d]\n", qPrintable(name), + region.boundingRect().x(), + region.boundingRect().y(), + region.boundingRect().width(), + region.boundingRect().height()); + + m_regionMap[name] = region; +} + +/***************************************************************************************************/ +void PaintCommands::command_resetMatrix(QRegExp) +{ + if (m_verboseMode) + printf(" -(lance) resetMatrix()\n"); + + m_painter->resetTransform(); +} + +/***************************************************************************************************/ +void PaintCommands::command_restore(QRegExp) +{ + if (m_verboseMode) + printf(" -(lance) restore()\n"); + + m_painter->restore(); +} + +/***************************************************************************************************/ +void PaintCommands::command_rotate(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double angle = convertToDouble(caps.at(1)); + + if (m_verboseMode) + printf(" -(lance) rotate(%.2f)\n", angle); + + m_painter->rotate(angle); +} + +/***************************************************************************************************/ +void PaintCommands::command_rotate_x(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double angle = convertToDouble(caps.at(1)); + + if (m_verboseMode) + printf(" -(lance) rotate_x(%.2f)\n", angle); + + QTransform transform; + transform.rotate(angle, Qt::XAxis); + m_painter->setTransform(transform, true); +} + +/***************************************************************************************************/ +void PaintCommands::command_rotate_y(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double angle = convertToDouble(caps.at(1)); + + if (m_verboseMode) + printf(" -(lance) rotate_y(%.2f)\n", angle); + + QTransform transform; + transform.rotate(angle, Qt::YAxis); + m_painter->setTransform(transform, true); +} + +/***************************************************************************************************/ +void PaintCommands::command_save(QRegExp) +{ + if (m_verboseMode) + printf(" -(lance) save()\n"); + + m_painter->save(); +} + +/***************************************************************************************************/ +void PaintCommands::command_mapQuadToQuad(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double x1 = convertToDouble(caps.at(1)); + double y1 = convertToDouble(caps.at(2)); + double x2 = convertToDouble(caps.at(3)); + double y2 = convertToDouble(caps.at(4)); + double x3 = convertToDouble(caps.at(5)); + double y3 = convertToDouble(caps.at(6)); + double x4 = convertToDouble(caps.at(7)); + double y4 = convertToDouble(caps.at(8)); + QPolygonF poly1(4); + poly1[0] = QPointF(x1, y1); + poly1[1] = QPointF(x2, y2); + poly1[2] = QPointF(x3, y3); + poly1[3] = QPointF(x4, y4); + + double x5 = convertToDouble(caps.at(9)); + double y5 = convertToDouble(caps.at(10)); + double x6 = convertToDouble(caps.at(11)); + double y6 = convertToDouble(caps.at(12)); + double x7 = convertToDouble(caps.at(13)); + double y7 = convertToDouble(caps.at(14)); + double x8 = convertToDouble(caps.at(15)); + double y8 = convertToDouble(caps.at(16)); + QPolygonF poly2(4); + poly2[0] = QPointF(x5, y5); + poly2[1] = QPointF(x6, y6); + poly2[2] = QPointF(x7, y7); + poly2[3] = QPointF(x8, y8); + + if (m_verboseMode) + printf(" -(lance) mapQuadToQuad(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f ->\n\t" + ",%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", + x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6, x7, y7, x8, y8); + + QTransform trans; + + if (!QTransform::quadToQuad(poly1, poly2, trans)) { + qWarning("Couldn't perform quad to quad transformation!"); + } + + m_painter->setTransform(trans, true); +} + +/***************************************************************************************************/ +void PaintCommands::command_setMatrix(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double m11 = convertToDouble(caps.at(1)); + double m12 = convertToDouble(caps.at(2)); + double m13 = convertToDouble(caps.at(3)); + double m21 = convertToDouble(caps.at(4)); + double m22 = convertToDouble(caps.at(5)); + double m23 = convertToDouble(caps.at(6)); + double m31 = convertToDouble(caps.at(7)); + double m32 = convertToDouble(caps.at(8)); + double m33 = convertToDouble(caps.at(9)); + + if (m_verboseMode) + printf(" -(lance) setMatrix(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", + m11, m12, m13, m21, m22, m23, m31, m32, m33); + + QTransform trans; + trans.setMatrix(m11, m12, m13, + m21, m22, m23, + m31, m32, m33); + + m_painter->setTransform(trans, true); +} + +/***************************************************************************************************/ +void PaintCommands::command_scale(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double sx = convertToDouble(caps.at(1)); + double sy = convertToDouble(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) scale(%.2f, %.2f)\n", sx, sy); + + + m_painter->scale(sx, sy); +} + +/***************************************************************************************************/ +void PaintCommands::command_setBackground(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QColor color = convertToColor(caps.at(1)); + QString pattern = caps.at(2); + + int style = translateEnum(brushStyleTable, pattern, Qt::LinearGradientPattern); + if (style < 0) + style = Qt::SolidPattern; + + if (m_verboseMode) + printf(" -(lance) setBackground(%s, %s)\n", qPrintable(color.name()), qPrintable(pattern)); + + m_painter->setBackground(QBrush(color, Qt::BrushStyle(style))); +} + +/***************************************************************************************************/ +void PaintCommands::command_setOpacity(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double opacity = convertToDouble(caps.at(1)); + + if (m_verboseMode) + printf(" -(lance) setOpacity(%lf)\n", opacity); + + m_painter->setOpacity(opacity); +} + +/***************************************************************************************************/ +void PaintCommands::command_setBgMode(QRegExp re) +{ + QString cap = re.cap(2); + Qt::BGMode mode = Qt::TransparentMode; + if (cap.toLower() == QLatin1String("opaquemode") || cap.toLower() == QLatin1String("opaque")) + mode = Qt::OpaqueMode; + + if (m_verboseMode) + printf(" -(lance) setBackgroundMode(%s)\n", mode == Qt::OpaqueMode ? "OpaqueMode" : "TransparentMode"); + + m_painter->setBackgroundMode(mode); +} + +/***************************************************************************************************/ +void PaintCommands::command_setBrush(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + + QPixmap pm = image_load(caps.at(1)); + if (!pm.isNull()) { // Assume pixmap + if (m_verboseMode) + printf(" -(lance) setBrush(pixmap=%s, width=%d, height=%d)\n", + qPrintable(caps.at(1)), pm.width(), pm.height()); + + m_painter->setBrush(QBrush(pm)); + } else if (caps.at(1).toLower() == "nobrush") { + m_painter->setBrush(Qt::NoBrush); + if (m_verboseMode) + printf(" -(lance) setBrush(Qt::NoBrush)\n"); + } else { + QColor color = convertToColor(caps.at(1)); + QString pattern = caps.at(2); + + int style = translateEnum(brushStyleTable, pattern, Qt::LinearGradientPattern); + if (style < 0) + style = Qt::SolidPattern; + + if (m_verboseMode) + printf(" -(lance) setBrush(%s, %s (%d))\n", qPrintable(color.name()), qPrintable(pattern), style); + + m_painter->setBrush(QBrush(color, Qt::BrushStyle(style))); + } +} + +/***************************************************************************************************/ +void PaintCommands::command_setBrushOrigin(QRegExp re) +{ + int x = convertToInt(re.cap(1)); + int y = convertToInt(re.cap(2)); + + if (m_verboseMode) + printf(" -(lance) setBrushOrigin(%d, %d)\n", x, y); + + m_painter->setBrushOrigin(x, y); +} + +/***************************************************************************************************/ +void PaintCommands::command_brushTranslate(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double dx = convertToDouble(caps.at(1)); + double dy = convertToDouble(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) brushTranslate(%f, %f)\n", dx, dy); + + QBrush new_brush = m_painter->brush(); + QTransform brush_matrix = new_brush.transform(); + brush_matrix.translate(dx, dy); + new_brush.setTransform(brush_matrix); + m_painter->setBrush(new_brush); +} + +/***************************************************************************************************/ +void PaintCommands::command_brushScale(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double sx = convertToDouble(caps.at(1)); + double sy = convertToDouble(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) brushScale(%f, %f)\n", sx, sy); + + QBrush new_brush = m_painter->brush(); + QTransform brush_matrix = new_brush.transform(); + brush_matrix.scale(sx, sy); + new_brush.setTransform(brush_matrix); + m_painter->setBrush(new_brush); +} + +/***************************************************************************************************/ +void PaintCommands::command_brushRotate(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double rot = convertToDouble(caps.at(1)); + + if (m_verboseMode) + printf(" -(lance) brushScale(%f)\n", rot); + + QBrush new_brush = m_painter->brush(); + QTransform brush_matrix = new_brush.transform(); + brush_matrix.rotate(rot); + new_brush.setTransform(brush_matrix); + m_painter->setBrush(new_brush); +} + +/***************************************************************************************************/ +void PaintCommands::command_brushShear(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double sx = convertToDouble(caps.at(1)); + double sy = convertToDouble(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) brushShear(%f, %f)\n", sx, sy); + + QBrush new_brush = m_painter->brush(); + QTransform brush_matrix = new_brush.transform(); + brush_matrix.shear(sx, sy); + new_brush.setTransform(brush_matrix); + m_painter->setBrush(new_brush); +} + +/***************************************************************************************************/ +void PaintCommands::command_setClipping(QRegExp re) +{ + bool clipping = re.cap(1).toLower() == "true"; + + if (m_verboseMode) + printf(" -(lance) setClipping(%d)\n", clipping); + + m_painter->setClipping(clipping); +} + +/***************************************************************************************************/ +void PaintCommands::command_setClipRect(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + int x = convertToInt(caps.at(1)); + int y = convertToInt(caps.at(2)); + int w = convertToInt(caps.at(3)); + int h = convertToInt(caps.at(4)); + + int combine = translateEnum(clipOperationTable, caps.at(5), Qt::IntersectClip + 1); + if (combine == -1) + combine = Qt::ReplaceClip; + + if (m_verboseMode) + printf(" -(lance) setClipRect(%d, %d, %d, %d), %s\n", x, y, w, h, clipOperationTable[combine]); + + m_painter->setClipRect(x, y, w, h, Qt::ClipOperation(combine)); +} + +/***************************************************************************************************/ +void PaintCommands::command_setClipPath(QRegExp re) +{ + int combine = translateEnum(clipOperationTable, re.cap(2), Qt::IntersectClip + 1); + if (combine == -1) + combine = Qt::ReplaceClip; + + if (m_verboseMode) + printf(" -(lance) setClipPath(name=%s), %s\n", qPrintable(re.cap(1)), clipOperationTable[combine]); + + if (!m_pathMap.contains(re.cap(1))) + fprintf(stderr, " - setClipPath, no such path"); + m_painter->setClipPath(m_pathMap[re.cap(1)], Qt::ClipOperation(combine)); +} + +/***************************************************************************************************/ +void PaintCommands::command_setClipRegion(QRegExp re) +{ + int combine = translateEnum(clipOperationTable, re.cap(2), Qt::IntersectClip + 1); + if (combine == -1) + combine = Qt::ReplaceClip; + QRegion r = m_regionMap[re.cap(1)]; + + if (m_verboseMode) + printf(" -(lance) setClipRegion(name=%s), bounds=[%d, %d, %d, %d], %s\n", + qPrintable(re.cap(1)), + r.boundingRect().x(), + r.boundingRect().y(), + r.boundingRect().width(), + r.boundingRect().height(), + clipOperationTable[combine]); + + m_painter->setClipRegion(m_regionMap[re.cap(1)], Qt::ClipOperation(combine)); +} + +/***************************************************************************************************/ +void PaintCommands::command_setFont(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QString family = caps.at(1); + int size = convertToInt(caps.at(2)); + + int weight = translateEnum(fontWeightTable, re.cap(3).toLower(), 5); + if (weight != -1) { + switch (weight) { + case 0: weight = QFont::Light; break; + case 1: weight = QFont::Normal; break; + case 2: weight = QFont::DemiBold; break; + case 3: weight = QFont::Bold; break; + case 4: weight = QFont::Black; break; + } + } else { + weight = convertToInt(re.cap(3)); + } + + bool italic = caps.at(4).toLower() == "true" || caps.at(4).toLower() == "italic"; + + QFont font(family, size, weight, italic); + +#if QT_VERSION >= 0x040800 + int hinting = translateEnum(fontHintingTable, caps.at(5), 4); + if (hinting == -1) + hinting = 0; + else + font.setHintingPreference(QFont::HintingPreference(hinting)); +#else + int hinting = 1; +#endif + if (m_verboseMode) + printf(" -(lance) setFont(family=%s, size=%d, weight=%d, italic=%d hinting=%s\n", + qPrintable(family), size, weight, italic, fontHintingTable[hinting]); + + m_painter->setFont(font); +} + +/***************************************************************************************************/ +void PaintCommands::command_setPen(QRegExp re) +{ + QString cap = re.cap(1); + int style = translateEnum(penStyleTable, cap, Qt::DashDotDotLine + 1); + if (style >= 0) { + if (m_verboseMode) + printf(" -(lance) setPen(%s)\n", qPrintable(cap)); + + m_painter->setPen(Qt::PenStyle(style)); + } else if (cap.toLower() == "brush") { + QPen pen(m_painter->brush(), 0); + if (m_verboseMode) { + printf(" -(lance) setPen(brush), style=%d, color=%08x\n", + pen.brush().style(), pen.color().rgba()); + } + m_painter->setPen(pen); + } else { + QColor color = convertToColor(cap); + if (m_verboseMode) + printf(" -(lance) setPen(%s)\n", qPrintable(color.name())); + + m_painter->setPen(color); + } +} + +/***************************************************************************************************/ +void PaintCommands::command_setPen2(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + + QBrush brush; + + if (caps.at(1).toLower() == "brush") + brush = m_painter->brush(); + else + brush = convertToColor(caps.at(1)); + + double width = convertToDouble(caps.at(2)); + int penStyle = translateEnum(penStyleTable, caps.at(3), Qt::DashDotDotLine + 1); + if (penStyle < 0) + penStyle = Qt::SolidLine; + + Qt::PenCapStyle capStyle = Qt::SquareCap; + if (caps.at(4).toLower() == "flatcap") capStyle = Qt::FlatCap; + else if (caps.at(4).toLower() == "squarecap") capStyle = Qt::SquareCap; + else if (caps.at(4).toLower() == "roundcap") capStyle = Qt::RoundCap; + else if (!caps.at(4).isEmpty()) + fprintf(stderr, "ERROR: setPen, unknown capStyle: %s\n", qPrintable(caps.at(4))); + + Qt::PenJoinStyle joinStyle = Qt::BevelJoin; + if (caps.at(5).toLower() == "miterjoin") joinStyle = Qt::MiterJoin; + else if (caps.at(5).toLower() == "beveljoin") joinStyle = Qt::BevelJoin; + else if (caps.at(5).toLower() == "roundjoin") joinStyle = Qt::RoundJoin; + else if (!caps.at(5).isEmpty()) + fprintf(stderr, "ERROR: setPen, unknown joinStyle: %s\n", qPrintable(caps.at(5))); + + if (m_verboseMode) + printf(" -(lance) setPen(%s, width=%f, style=%d, cap=%d, join=%d)\n", + qPrintable(brush.color().name()), width, penStyle, capStyle, joinStyle); + + m_painter->setPen(QPen(brush, width, Qt::PenStyle(penStyle), capStyle, joinStyle)); +} + +/***************************************************************************************************/ +void PaintCommands::command_setRenderHint(QRegExp re) +{ + QString hintString = re.cap(1).toLower(); + bool on = re.cap(2).isEmpty() || re.cap(2).toLower() == "true"; + if (hintString.contains("antialiasing")) { + if (m_verboseMode) + printf(" -(lance) setRenderHint Antialiasing\n"); + + m_painter->setRenderHint(QPainter::Antialiasing, on); + } else if (hintString.contains("smoothpixmaptransform")) { + if (m_verboseMode) + printf(" -(lance) setRenderHint SmoothPixmapTransform\n"); + m_painter->setRenderHint(QPainter::SmoothPixmapTransform, on); + } else { + fprintf(stderr, "ERROR(setRenderHint): unknown hint '%s'\n", qPrintable(hintString)); + } +} + +/***************************************************************************************************/ +void PaintCommands::command_clearRenderHint(QRegExp /*re*/) +{ + m_painter->setRenderHint(QPainter::Antialiasing, false); + m_painter->setRenderHint(QPainter::SmoothPixmapTransform, false); + if (m_verboseMode) + printf(" -(lance) clearRenderHint\n"); +} + +/***************************************************************************************************/ +void PaintCommands::command_setCompositionMode(QRegExp re) +{ + QString modeString = re.cap(1).toLower(); + int mode = translateEnum(compositionModeTable, modeString, 33); + + if (mode < 0 || mode > QPainter::RasterOp_SourceAndNotDestination) { + fprintf(stderr, "ERROR: invalid mode: %s\n", qPrintable(modeString)); + return; + } + + if (m_verboseMode) + printf(" -(lance) setCompositionMode: %d: %s\n", mode, qPrintable(modeString)); + + m_painter->setCompositionMode(QPainter::CompositionMode(mode)); +} + +/***************************************************************************************************/ +void PaintCommands::command_translate(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double dx = convertToDouble(caps.at(1)); + double dy = convertToDouble(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) translate(%f, %f)\n", dx, dy); + + m_painter->translate(dx, dy); +} + +/***************************************************************************************************/ +void PaintCommands::command_pixmap_load(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + + QString fileName = caps.at(1); + QString name = caps.at(2); + + if (name.isEmpty()) + name = fileName; + + QImage im = image_load(fileName); + QPixmap px = QPixmap::fromImage(im, Qt::OrderedDither | Qt::OrderedAlphaDither); + + if (m_verboseMode) + printf(" -(lance) pixmap_load(%s as %s), size=[%d, %d], depth=%d\n", + qPrintable(fileName), qPrintable(name), + px.width(), px.height(), px.depth()); + + m_pixmapMap[name] = px; +} + +/***************************************************************************************************/ +void PaintCommands::command_bitmap_load(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + + QString fileName = caps.at(1); + QString name = caps.at(2); + + if (name.isEmpty()) + name = fileName; + + QBitmap bm = image_load(fileName); + + if (m_verboseMode) + printf(" -(lance) bitmap_load(%s as %s), size=[%d, %d], depth=%d\n", + qPrintable(fileName), qPrintable(name), + bm.width(), bm.height(), bm.depth()); + + m_pixmapMap[name] = bm; +} + +/***************************************************************************************************/ +void PaintCommands::command_pixmap_setMask(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + QBitmap mask = image_load(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) pixmap_setMask(%s, %s)\n", qPrintable(caps.at(1)), qPrintable(caps.at(2))); + + if (!m_pixmapMap[caps.at(1)].isNull()) + m_pixmapMap[caps.at(1)].setMask(mask); +} + +/***************************************************************************************************/ +void PaintCommands::command_image_load(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + + QString fileName = caps.at(1); + QString name = caps.at(2); + + if (name.isEmpty()) + name = fileName; + + QImage image = image_load(fileName); + + if (m_verboseMode) + printf(" -(lance) image_load(%s as %s), size=[%d, %d], format=%d\n", + qPrintable(fileName), qPrintable(name), + image.width(), image.height(), image.format()); + + m_imageMap[name] = image; +} + +/***************************************************************************************************/ +void PaintCommands::command_image_setColorCount(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + + QString name = caps.at(1); + int count = convertToInt(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) image_setColorCount(%s), %d -> %d\n", + qPrintable(name), m_imageMap[name].colorCount(), count); + + m_imageMap[name].setColorCount(count); +} + +/***************************************************************************************************/ +void PaintCommands::command_image_setColor(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + + QString name = caps.at(1); + int index = convertToInt(caps.at(2)); + QColor color = convertToColor(caps.at(3)); + + if (m_verboseMode) + printf(" -(lance) image_setColor(%s), %d = %08x\n", qPrintable(name), index, color.rgba()); + + m_imageMap[name].setColor(index, color.rgba()); +} + +/***************************************************************************************************/ +void PaintCommands::command_abort(QRegExp) +{ + m_abort = true; +} + +/***************************************************************************************************/ +void PaintCommands::command_gradient_clearStops(QRegExp) +{ + if (m_verboseMode) + printf(" -(lance) gradient_clearStops\n"); + m_gradientStops.clear(); +} + +/***************************************************************************************************/ +void PaintCommands::command_gradient_appendStop(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double pos = convertToDouble(caps.at(1)); + QColor color = convertToColor(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) gradient_appendStop(%.2f, %x)\n", pos, color.rgba()); + + m_gradientStops << QGradientStop(pos, color); +} + +/***************************************************************************************************/ +void PaintCommands::command_gradient_setLinear(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double x1 = convertToDouble(caps.at(1)); + double y1 = convertToDouble(caps.at(2)); + double x2 = convertToDouble(caps.at(3)); + double y2 = convertToDouble(caps.at(4)); + + if (m_verboseMode) + printf(" -(lance) gradient_setLinear (%.2f, %.2f), (%.2f, %.2f), spread=%d\n", + x1, y1, x2, y2, m_gradientSpread); + + QLinearGradient lg(QPointF(x1, y1), QPointF(x2, y2)); + lg.setStops(m_gradientStops); + lg.setSpread(m_gradientSpread); + lg.setCoordinateMode(m_gradientCoordinate); + QBrush brush(lg); + QTransform brush_matrix = m_painter->brush().transform(); + brush.setTransform(brush_matrix); + m_painter->setBrush(brush); +} + +/***************************************************************************************************/ +void PaintCommands::command_gradient_setLinearPen(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double x1 = convertToDouble(caps.at(1)); + double y1 = convertToDouble(caps.at(2)); + double x2 = convertToDouble(caps.at(3)); + double y2 = convertToDouble(caps.at(4)); + + if (m_verboseMode) + printf(" -(lance) gradient_setLinear (%.2f, %.2f), (%.2f, %.2f), spread=%d\n", + x1, y1, x2, y2, m_gradientSpread); + + QLinearGradient lg(QPointF(x1, y1), QPointF(x2, y2)); + lg.setStops(m_gradientStops); + lg.setSpread(m_gradientSpread); + lg.setCoordinateMode(m_gradientCoordinate); + QPen pen = m_painter->pen(); + pen.setBrush(lg); + m_painter->setPen(pen); +} + +/***************************************************************************************************/ +void PaintCommands::command_gradient_setRadial(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double cx = convertToDouble(caps.at(1)); + double cy = convertToDouble(caps.at(2)); + double rad = convertToDouble(caps.at(3)); + double fx = convertToDouble(caps.at(4)); + double fy = convertToDouble(caps.at(5)); + + if (m_verboseMode) + printf(" -(lance) gradient_setRadial center=(%.2f, %.2f), radius=%.2f, focal=(%.2f, %.2f), " + "spread=%d\n", + cx, cy, rad, fx, fy, m_gradientSpread); + + QRadialGradient rg(QPointF(cx, cy), rad, QPointF(fx, fy)); + rg.setStops(m_gradientStops); + rg.setSpread(m_gradientSpread); + rg.setCoordinateMode(m_gradientCoordinate); + QBrush brush(rg); + QTransform brush_matrix = m_painter->brush().transform(); + brush.setTransform(brush_matrix); + m_painter->setBrush(brush); +} + +/***************************************************************************************************/ +void PaintCommands::command_gradient_setRadialExtended(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double cx = convertToDouble(caps.at(1)); + double cy = convertToDouble(caps.at(2)); + double rad = convertToDouble(caps.at(3)); + double fx = convertToDouble(caps.at(4)); + double fy = convertToDouble(caps.at(5)); + double frad = convertToDouble(caps.at(6)); + + if (m_verboseMode) + printf(" -(lance) gradient_setRadialExtended center=(%.2f, %.2f), radius=%.2f, focal=(%.2f, %.2f), " + "focal radius=%.2f, spread=%d\n", + cx, cy, rad, fx, fy, frad, m_gradientSpread); + + QRadialGradient rg(QPointF(cx, cy), rad, QPointF(fx, fy), frad); + rg.setStops(m_gradientStops); + rg.setSpread(m_gradientSpread); + rg.setCoordinateMode(m_gradientCoordinate); + QBrush brush(rg); + QTransform brush_matrix = m_painter->brush().transform(); + brush.setTransform(brush_matrix); + m_painter->setBrush(brush); +} + +/***************************************************************************************************/ +void PaintCommands::command_gradient_setConical(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double cx = convertToDouble(caps.at(1)); + double cy = convertToDouble(caps.at(2)); + double angle = convertToDouble(caps.at(3)); + + if (m_verboseMode) { + printf(" -(lance) gradient_setConical center=(%.2f, %.2f), angle=%.2f\n, spread=%d", + cx, cy, angle, m_gradientSpread); + } + + QConicalGradient cg(QPointF(cx, cy), angle); + cg.setStops(m_gradientStops); + cg.setSpread(m_gradientSpread); + cg.setCoordinateMode(m_gradientCoordinate); + QBrush brush(cg); + QTransform brush_matrix = m_painter->brush().transform(); + brush.setTransform(brush_matrix); + m_painter->setBrush(brush); +} + +/***************************************************************************************************/ +void PaintCommands::command_gradient_setSpread(QRegExp re) +{ + int spreadMethod = translateEnum(spreadMethodTable, re.cap(1), 3); + + if (m_verboseMode) + printf(" -(lance) gradient_setSpread %d=[%s]\n", spreadMethod, spreadMethodTable[spreadMethod]); + + m_gradientSpread = QGradient::Spread(spreadMethod); +} + +void PaintCommands::command_gradient_setCoordinateMode(QRegExp re) +{ + int coord = translateEnum(coordinateMethodTable, re.cap(1), 3); + + if (m_verboseMode) + printf(" -(lance) gradient_setCoordinateMode %d=[%s]\n", coord, + coordinateMethodTable[coord]); + + m_gradientCoordinate = QGradient::CoordinateMode(coord); +} + +/***************************************************************************************************/ +void PaintCommands::command_surface_begin(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double x = convertToDouble(caps.at(1)); + double y = convertToDouble(caps.at(2)); + double w = convertToDouble(caps.at(3)); + double h = convertToDouble(caps.at(4)); + + if (m_surface_painter) { + fprintf(stderr, "ERROR: surface already active"); + return; + } + + if (m_verboseMode) + printf(" -(lance) surface_begin, pos=[%.2f, %.2f], size=[%.2f, %.2f]\n", x, y, w, h); + + m_surface_painter = m_painter; + + if (m_type == OpenGLType || m_type == OpenGLPBufferType) { +#ifndef QT_NO_OPENGL + m_surface_pbuffer = new QGLPixelBuffer(qRound(w), qRound(h)); + m_painter = new QPainter(m_surface_pbuffer); + m_painter->fillRect(QRect(0, 0, qRound(w), qRound(h)), Qt::transparent); +#endif +#ifdef Q_WS_X11 + } else if (m_type == WidgetType) { + m_surface_pixmap = QPixmap(qRound(w), qRound(h)); + m_surface_pixmap.fill(Qt::transparent); + m_painter = new QPainter(&m_surface_pixmap); +#endif + } else { + m_surface_image = QImage(qRound(w), qRound(h), QImage::Format_ARGB32_Premultiplied); + m_surface_image.fill(0); + m_painter = new QPainter(&m_surface_image); + } + m_surface_rect = QRectF(x, y, w, h); +} + +/***************************************************************************************************/ +void PaintCommands::command_surface_end(QRegExp) +{ + if (!m_surface_painter) { + fprintf(stderr, "ERROR: surface not active"); + return; + } + + if (m_verboseMode) + printf(" -(lance) surface_end, pos=[%.2f, %.2f], size=[%.2f, %.2f]\n", + m_surface_rect.x(), + m_surface_rect.y(), + m_surface_rect.width(), + m_surface_rect.height()); + m_painter->end(); + + delete m_painter; + m_painter = m_surface_painter; + m_surface_painter = 0; + + if (m_type == OpenGLType || m_type == OpenGLPBufferType) { +#ifndef QT_NO_OPENGL + QImage image = m_surface_pbuffer->toImage(); + QImage new_image(image.bits(), image.width(), + image.height(), QImage::Format_ARGB32_Premultiplied); + QPaintDevice *pdev = m_painter->device(); + if (pdev->devType() == QInternal::Widget) { + QWidget *w = static_cast(pdev); + static_cast(w)->makeCurrent(); + } else if (pdev->devType() == QInternal::Pbuffer) { + static_cast(pdev)->makeCurrent(); + } + + m_painter->drawImage(m_surface_rect, new_image); + + delete m_surface_pbuffer; + m_surface_pbuffer = 0; +#endif +#ifdef Q_WS_X11 + } else if (m_type == WidgetType) { + m_painter->drawPixmap(m_surface_rect.topLeft(), m_surface_pixmap); + m_surface_pixmap = QPixmap(); +#endif + } else { + m_painter->drawImage(m_surface_rect, m_surface_image); + m_surface_image = QImage(); + } + m_surface_rect = QRectF(); +} + +/***************************************************************************************************/ +void PaintCommands::command_image_convertToFormat(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + + QString srcName = caps.at(1); + QString destName = caps.at(2); + + if (!m_imageMap.contains(srcName)) { + fprintf(stderr, "ERROR(convertToFormat): no such image '%s'\n", qPrintable(srcName)); + return; + } + + int format = translateEnum(imageFormatTable, caps.at(3), QImage::NImageFormats); + if (format < 0 || format >= QImage::NImageFormats) { + fprintf(stderr, "ERROR(convertToFormat): invalid format %d = '%s'\n", + format, qPrintable(caps.at(3))); + return; + } + + QImage src = m_imageMap[srcName]; + QImage dest = src.convertToFormat(QImage::Format(format), + Qt::OrderedAlphaDither | Qt::OrderedDither); + + if (m_verboseMode) { + printf(" -(lance) convertToFormat %s:%d -> %s:%d\n", + qPrintable(srcName), src.format(), + qPrintable(destName), dest.format()); + } + + m_imageMap[destName] = dest; +} + +/***************************************************************************************************/ +void PaintCommands::command_textlayout_draw(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + + QString text = caps.at(1); + double width = convertToDouble(caps.at(2)); + + if (m_verboseMode) + printf(" -(lance) textlayout_draw text='%s', width=%f\n", + qPrintable(text), width); + + QFont copy = m_painter->font(); + copy.setPointSize(10); + + QTextLayout layout(text, copy, m_painter->device()); + layout.beginLayout(); + + double y_offset = 0; + + while (true) { + QTextLine line = layout.createLine(); + if (!line.isValid()) + break; + line.setLineWidth(width); + line.setPosition(QPointF(0, y_offset)); + + y_offset += line.height(); + } + + layout.draw(m_painter, QPointF(0, 0)); +} + +/***************************************************************************************************/ +void PaintCommands::command_pen_setDashOffset(QRegExp re) +{ + QStringList caps = re.capturedTexts(); + double offset = convertToDouble(caps.at(1)); + + if (m_verboseMode) + printf(" -(lance) setDashOffset(%lf)\n", offset); + + QPen p = m_painter->pen(); + p.setDashOffset(offset); + m_painter->setPen(p); +} + +/***************************************************************************************************/ +void PaintCommands::command_pen_setDashPattern(QRegExp re) +{ + static QRegExp separators("\\s"); + QStringList caps = re.capturedTexts(); + QString cap = caps.at(1); + QStringList numbers = cap.split(separators, QString::SkipEmptyParts); + + QVector pattern; + for (int i=0; ipen(); + p.setDashPattern(pattern); + m_painter->setPen(p); +} + +/***************************************************************************************************/ +void PaintCommands::command_pen_setCosmetic(QRegExp re) +{ + QString hm = re.capturedTexts().at(1); + bool on = hm == "true" || hm == "yes" || hm == "on"; + + if (m_verboseMode) { + printf(" -(lance) pen_setCosmetic(%s)\n", on ? "true" : "false"); + } + + QPen p = m_painter->pen(); + p.setCosmetic(on); + + m_painter->setPen(p); +} + +/***************************************************************************************************/ +void PaintCommands::command_drawConvexPolygon(QRegExp re) +{ + static QRegExp separators("\\s"); + QStringList caps = re.capturedTexts(); + QString cap = caps.at(1); + QStringList numbers = cap.split(separators, QString::SkipEmptyParts); + + QPolygonF array; + for (int i=0; i + 1drawConvexPolygon(array); +} diff --git a/tests/auto/lancelot/paintcommands.h b/tests/auto/lancelot/paintcommands.h new file mode 100644 index 0000000000..925a867f2f --- /dev/null +++ b/tests/auto/lancelot/paintcommands.h @@ -0,0 +1,334 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef PAINTCOMMANDS_H +#define PAINTCOMMANDS_H + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_FORWARD_DECLARE_CLASS(QPainter) +QT_FORWARD_DECLARE_CLASS(QRegExp) +#ifndef QT_NO_OPENGL +QT_FORWARD_DECLARE_CLASS(QGLPixelBuffer) +#endif + +enum DeviceType { + WidgetType, + BitmapType, + PixmapType, + ImageType, + ImageMonoType, + OpenGLType, + OpenGLPBufferType, + PictureType, + PrinterType, + PdfType, + PsType, + GrabType, + CustomDeviceType, + CustomWidgetType, + ImageWidgetType +}; + +/************************************************************************/ +class PaintCommands +{ +public: + // construction / initialization + PaintCommands(const QStringList &cmds, int w, int h) + : m_painter(0) + , m_surface_painter(0) + , m_commands(cmds) + , m_gradientSpread(QGradient::PadSpread) + , m_gradientCoordinate(QGradient::LogicalMode) + , m_width(w) + , m_height(h) + , m_verboseMode(false) + , m_type(WidgetType) + , m_checkers_background(true) + , m_shouldDrawText(true) + { staticInit(); } + +public: + void setCheckersBackground(bool b) { staticInit(); m_checkers_background = b; } + void setContents(const QStringList &cmds) { + staticInit(); + m_blockMap.clear(); + m_pathMap.clear(); + m_pixmapMap.clear(); + m_imageMap.clear(); + m_regionMap.clear(); + m_gradientStops.clear(); + m_controlPoints.clear(); + m_gradientSpread = QGradient::PadSpread; + m_gradientCoordinate = QGradient::LogicalMode; + m_commands = cmds; + + + } + void setPainter(QPainter *pt) { staticInit(); m_painter = pt; } + void setType(DeviceType t) { staticInit(); m_type = t; } + void setFilePath(const QString &path) { staticInit(); m_filepath = path; } + void setControlPoints(const QVector &points) { staticInit(); m_controlPoints = points; } + void setVerboseMode(bool v) { staticInit(); m_verboseMode = v; } + void insertAt(int commandIndex, const QStringList &newCommands); + void setShouldDrawText(bool drawText) { m_shouldDrawText = drawText; } + + // run + void runCommands(); + +private: + // run + void runCommand(const QString &scriptLine); + + // conversion methods + int convertToInt(const QString &str); + double convertToDouble(const QString &str); + float convertToFloat(const QString &str); + QColor convertToColor(const QString &str); + + // commands: comments + void command_comment(QRegExp re); + + // commands: importer + void command_import(QRegExp re); + + // commands: blocks + void command_begin_block(QRegExp re); + void command_end_block(QRegExp re); + void command_repeat_block(QRegExp re); + + // commands: misc + void command_textlayout_draw(QRegExp re); + void command_abort(QRegExp re); + + // commands: noops + void command_noop(QRegExp re); + + // commands: setters + void command_setBgMode(QRegExp re); + void command_setBackground(QRegExp re); + void command_setOpacity(QRegExp re); + void command_path_setFillRule(QRegExp re); + void command_setBrush(QRegExp re); + void command_setBrushOrigin(QRegExp re); + void command_brushTranslate(QRegExp re); + void command_brushRotate(QRegExp re); + void command_brushScale(QRegExp re); + void command_brushShear(QRegExp re); + void command_setClipPath(QRegExp re); + void command_setClipRect(QRegExp re); + void command_setClipRectangle(QRegExp re); + void command_setClipRegion(QRegExp re); + void command_setClipping(QRegExp re); + void command_setCompositionMode(QRegExp re); + void command_setFont(QRegExp re); + void command_setPen(QRegExp re); + void command_setPen2(QRegExp re); + void command_pen_setDashOffset(QRegExp re); + void command_pen_setDashPattern(QRegExp re); + void command_pen_setCosmetic(QRegExp re); + void command_setRenderHint(QRegExp re); + void command_clearRenderHint(QRegExp re); + void command_gradient_appendStop(QRegExp re); + void command_gradient_clearStops(QRegExp re); + void command_gradient_setConical(QRegExp re); + void command_gradient_setLinear(QRegExp re); + void command_gradient_setRadial(QRegExp re); + void command_gradient_setRadialExtended(QRegExp re); + void command_gradient_setLinearPen(QRegExp re); + void command_gradient_setSpread(QRegExp re); + void command_gradient_setCoordinateMode(QRegExp re); + + // commands: drawing ops + void command_drawArc(QRegExp re); + void command_drawChord(QRegExp re); + void command_drawConvexPolygon(QRegExp re); + void command_drawEllipse(QRegExp re); + void command_drawImage(QRegExp re); + void command_drawLine(QRegExp re); + void command_drawPath(QRegExp re); + void command_drawPie(QRegExp re); + void command_drawPixmap(QRegExp re); + void command_drawPoint(QRegExp re); + void command_drawPolygon(QRegExp re); + void command_drawPolyline(QRegExp re); + void command_drawRect(QRegExp re); + void command_drawRoundedRect(QRegExp re); + void command_drawRoundRect(QRegExp re); + void command_drawText(QRegExp re); + void command_drawStaticText(QRegExp re); + void command_drawTiledPixmap(QRegExp re); + void command_path_addEllipse(QRegExp re); + void command_path_addPolygon(QRegExp re); + void command_path_addRect(QRegExp re); + void command_path_addText(QRegExp re); + void command_path_arcTo(QRegExp re); + void command_path_closeSubpath(QRegExp re); + void command_path_createOutline(QRegExp re); + void command_path_cubicTo(QRegExp re); + void command_path_debugPrint(QRegExp re); + void command_path_lineTo(QRegExp re); + void command_path_moveTo(QRegExp re); + void command_region_addEllipse(QRegExp re); + void command_region_addRect(QRegExp re); + + // getters + void command_region_getClipRegion(QRegExp re); + void command_path_getClipPath(QRegExp re); + + // commands: surface begin/end + void command_surface_begin(QRegExp re); + void command_surface_end(QRegExp re); + + // commands: save/restore painter state + void command_restore(QRegExp re); + void command_save(QRegExp re); + + // commands: pixmap/image + void command_pixmap_load(QRegExp re); + void command_pixmap_setMask(QRegExp re); + void command_bitmap_load(QRegExp re); + void command_image_convertToFormat(QRegExp re); + void command_image_load(QRegExp re); + void command_image_setColor(QRegExp re); + void command_image_setColorCount(QRegExp re); + + // commands: transformation + void command_resetMatrix(QRegExp re); + void command_translate(QRegExp re); + void command_rotate(QRegExp re); + void command_rotate_x(QRegExp re); + void command_rotate_y(QRegExp re); + void command_scale(QRegExp re); + void command_mapQuadToQuad(QRegExp re); + void command_setMatrix(QRegExp re); + + // attributes + QPainter *m_painter; + QPainter *m_surface_painter; + QImage m_surface_image; + QPixmap m_surface_pixmap; +#ifndef QT_NO_OPENGL + QGLPixelBuffer *m_surface_pbuffer; +#endif + QRectF m_surface_rect; + QStringList m_commands; + QString m_currentCommand; + int m_currentCommandIndex; + QString m_filepath; + QMap m_blockMap; + QMap m_pathMap; + QMap m_pixmapMap; + QMap m_imageMap; + QMap m_regionMap; + QGradientStops m_gradientStops; + QGradient::Spread m_gradientSpread; + QGradient::CoordinateMode m_gradientCoordinate; + bool m_abort; + int m_width; + int m_height; + + bool m_verboseMode; + DeviceType m_type; + bool m_checkers_background; + bool m_shouldDrawText; + + QVector m_controlPoints; + + // painter functionalities string tables + static const char *brushStyleTable[]; + static const char *penStyleTable[]; + static const char *fontWeightTable[]; + static const char *fontHintingTable[]; + static const char *clipOperationTable[]; + static const char *spreadMethodTable[]; + static const char *coordinateMethodTable[]; + static const char *compositionModeTable[]; + static const char *imageFormatTable[]; + static const char *sizeModeTable[]; + static int translateEnum(const char *table[], const QString &pattern, int limit); + + // utility + template T image_load(const QString &filepath); + + // commands dictionary management + static void staticInit(); + +public: + struct PaintCommandInfos + { + PaintCommandInfos(QString id, void (PaintCommands::*p)(QRegExp), QRegExp r, QString sy, QString sa) + : identifier(id) + , regExp(r) + , syntax(sy) + , sample(sa) + , paintMethod(p) + {} + PaintCommandInfos(QString title) + : identifier(title), paintMethod(0) {} + bool isSectionHeader() const { return paintMethod == 0; } + QString identifier; + QRegExp regExp; + QString syntax; + QString sample; + void (PaintCommands::*paintMethod)(QRegExp); + }; + + static PaintCommandInfos *findCommandById(const QString &identifier) { + for (int i=0; i s_commandInfoTable; + static QList > s_enumsTable; + static QMultiHash s_commandHash; +}; + +#endif // PAINTCOMMANDS_H diff --git a/tests/baselineserver/.gitignore b/tests/baselineserver/.gitignore new file mode 100644 index 0000000000..cc513e0df2 --- /dev/null +++ b/tests/baselineserver/.gitignore @@ -0,0 +1,2 @@ +storage +bin/baselineserver diff --git a/tests/baselineserver/bin/runserver b/tests/baselineserver/bin/runserver new file mode 100755 index 0000000000..48c5c1d086 --- /dev/null +++ b/tests/baselineserver/bin/runserver @@ -0,0 +1,13 @@ +#!/bin/bash + +logfile=baselineserver.log + +while true; do + echo >> $logfile + echo -n "***RESTARTING*** " >> $logfile + date >> $logfile + + ./baselineserver 2>&1 | tee -a $logfile + + sleep 2 +done diff --git a/tests/baselineserver/shared/baselineprotocol.cpp b/tests/baselineserver/shared/baselineprotocol.cpp new file mode 100644 index 0000000000..0fe3aa22a9 --- /dev/null +++ b/tests/baselineserver/shared/baselineprotocol.cpp @@ -0,0 +1,527 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "baselineprotocol.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const QString PI_TestCase(QLS("TestCase")); +const QString PI_HostName(QLS("HostName")); +const QString PI_HostAddress(QLS("HostAddress")); +const QString PI_OSName(QLS("OSName")); +const QString PI_OSVersion(QLS("OSVersion")); +const QString PI_QtVersion(QLS("QtVersion")); +const QString PI_BuildKey(QLS("BuildKey")); +const QString PI_GitCommit(QLS("GitCommit")); +const QString PI_QMakeSpec(QLS("QMakeSpec")); +const QString PI_PulseGitBranch(QLS("PulseGitBranch")); +const QString PI_PulseTestrBranch(QLS("PulseTestrBranch")); + +#ifndef QMAKESPEC +#define QMAKESPEC "Unknown" +#endif + +#if defined(Q_OS_WIN) +#include +#endif +#if defined(Q_OS_UNIX) +#include +#endif +void BaselineProtocol::sysSleep(int ms) +{ +#if defined(Q_OS_WIN) + Sleep(DWORD(ms)); +#else + struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; + nanosleep(&ts, NULL); +#endif +} + +PlatformInfo::PlatformInfo() + : QMap(), replaceDefault(false) +{ +} + +PlatformInfo PlatformInfo::localHostInfo() +{ + PlatformInfo pi; + pi.insert(PI_HostName, QHostInfo::localHostName()); + pi.insert(PI_QtVersion, QLS(qVersion())); + pi.insert(PI_QMakeSpec, QString(QLS(QMAKESPEC)).remove(QRegExp(QLS("^.*mkspecs/")))); + pi.insert(PI_BuildKey, QLibraryInfo::buildKey()); +#if defined(Q_OS_LINUX) + pi.insert(PI_OSName, QLS("Linux")); + QProcess uname; + uname.start(QLS("uname"), QStringList() << QLS("-r")); + if (uname.waitForFinished(3000)) + pi.insert(PI_OSVersion, QString::fromLocal8Bit(uname.readAllStandardOutput().constData()).simplified()); +#elif defined(Q_OS_WINCE) + pi.insert(PI_OSName, QLS("WinCE")); + pi.insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion())); +#elif defined(Q_OS_WIN) + pi.insert(PI_OSName, QLS("Windows")); + pi.insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion())); +#elif defined(Q_OS_MAC) + pi.insert(PI_OSName, QLS("MacOS")); + pi.insert(PI_OSVersion, QString::number(qMacVersion())); +#elif defined(Q_OS_SYMBIAN) + pi.insert(PI_OSName, QLS("Symbian")); + pi.insert(PI_OSVersion, QString::number(QSysInfo::symbianVersion()); +#else + pi.insert(PI_OSName, QLS("Other")); +#endif + + QProcess git; + QString cmd; + QStringList args; +#if defined(Q_OS_WIN) + cmd = QLS("cmd.exe"); + args << QLS("/c") << QLS("git"); +#else + cmd = QLS("git"); +#endif + args << QLS("log") << QLS("--max-count=1") << QLS("--pretty=%H [%an] [%ad] %s"); + git.start(cmd, args); + git.waitForFinished(3000); + if (!git.exitCode()) + pi.insert(PI_GitCommit, QString::fromLocal8Bit(git.readAllStandardOutput().constData()).simplified()); + else + pi.insert(PI_GitCommit, QLS("Unknown")); + + QByteArray gb = qgetenv("PULSE_GIT_BRANCH"); + if (!gb.isEmpty()) + pi.insert(PI_PulseGitBranch, QString::fromLatin1(gb)); + QByteArray tb = qgetenv("PULSE_TESTR_BRANCH"); + if (!tb.isEmpty()) + pi.insert(PI_PulseTestrBranch, QString::fromLatin1(tb)); + + return pi; +} + + +PlatformInfo::PlatformInfo(const PlatformInfo &other) + : QMap(other) +{ + sigKeys = other.sigKeys; + replaceDefault = other.replaceDefault; +} + + +PlatformInfo &PlatformInfo::operator=(const PlatformInfo &other) +{ + QMap::operator=(other); + sigKeys = other.sigKeys; + replaceDefault = other.replaceDefault; + return *this; +} + + +void PlatformInfo::addSignificantKeys(const QStringList &keys, bool replaceDefaultKeys) +{ + sigKeys = keys; + replaceDefault = replaceDefaultKeys; +} + + +QStringList PlatformInfo::addedKeys() const +{ + return sigKeys; +} + + +bool PlatformInfo::addedKeysReplaceDefault() const +{ + return replaceDefault; +} + + +QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi) +{ + stream << static_cast&>(pi); + stream << pi.sigKeys << pi.replaceDefault; + return stream; +} + + +QDataStream & operator>> (QDataStream &stream, PlatformInfo &pi) +{ + stream >> static_cast&>(pi); + stream >> pi.sigKeys >> pi.replaceDefault; + return stream; +} + + +ImageItem &ImageItem::operator=(const ImageItem &other) +{ + testFunction = other.testFunction; + itemName = other.itemName; + itemChecksum = other.itemChecksum; + status = other.status; + image = other.image; + imageChecksums = other.imageChecksums; + return *this; +} + +// Defined in lookup3.c: +void hashword2 ( +const quint32 *k, /* the key, an array of quint32 values */ +size_t length, /* the length of the key, in quint32s */ +quint32 *pc, /* IN: seed OUT: primary hash value */ +quint32 *pb); /* IN: more seed OUT: secondary hash value */ + +quint64 ImageItem::computeChecksum(const QImage &image) +{ + QImage img(image); + const int bpl = img.bytesPerLine(); + const int padBytes = bpl - (img.width() * img.depth() / 8); + if (padBytes) { + uchar *p = img.bits() + bpl - padBytes; + const int h = img.height(); + for (int y = 0; y < h; ++y) { + qMemSet(p, 0, padBytes); + p += bpl; + } + } + + quint32 h1 = 0xfeedbacc; + quint32 h2 = 0x21604894; + hashword2((const quint32 *)img.constBits(), img.byteCount()/4, &h1, &h2); + return (quint64(h1) << 32) | h2; +} + +#if 0 +QString ImageItem::engineAsString() const +{ + switch (engine) { + case Raster: + return QLS("Raster"); + break; + case OpenGL: + return QLS("OpenGL"); + break; + default: + break; + } + return QLS("Unknown"); +} + +QString ImageItem::formatAsString() const +{ + static const int numFormats = 16; + static const char *formatNames[numFormats] = { + "Invalid", + "Mono", + "MonoLSB", + "Indexed8", + "RGB32", + "ARGB32", + "ARGB32-Premult", + "RGB16", + "ARGB8565-Premult", + "RGB666", + "ARGB6666-Premult", + "RGB555", + "ARGB8555-Premult", + "RGB888", + "RGB444", + "ARGB4444-Premult" + }; + if (renderFormat < 0 || renderFormat >= numFormats) + return QLS("UnknownFormat"); + return QLS(formatNames[renderFormat]); +} +#endif + +void ImageItem::writeImageToStream(QDataStream &out) const +{ + if (image.isNull() || image.format() == QImage::Format_Invalid) { + out << quint8(0); + return; + } + out << quint8('Q') << quint8(image.format()); + out << quint8(QSysInfo::ByteOrder) << quint8(0); // pad to multiple of 4 bytes + out << quint32(image.width()) << quint32(image.height()) << quint32(image.bytesPerLine()); + out << qCompress((const uchar *)image.constBits(), image.byteCount()); + //# can be followed by colormap for formats that use it +} + +void ImageItem::readImageFromStream(QDataStream &in) +{ + quint8 hdr, fmt, endian, pad; + quint32 width, height, bpl; + QByteArray data; + + in >> hdr; + if (hdr != 'Q') { + image = QImage(); + return; + } + in >> fmt >> endian >> pad; + if (!fmt || fmt >= QImage::NImageFormats) { + image = QImage(); + return; + } + if (endian != QSysInfo::ByteOrder) { + qWarning("ImageItem cannot read streamed image with different endianness"); + image = QImage(); + return; + } + in >> width >> height >> bpl; + in >> data; + data = qUncompress(data); + QImage res((const uchar *)data.constData(), width, height, bpl, QImage::Format(fmt)); + image = res.copy(); //# yuck, seems there is currently no way to avoid data copy +} + +QDataStream & operator<< (QDataStream &stream, const ImageItem &ii) +{ + stream << ii.testFunction << ii.itemName << ii.itemChecksum << quint8(ii.status) << ii.imageChecksums << ii.misc; + ii.writeImageToStream(stream); + return stream; +} + +QDataStream & operator>> (QDataStream &stream, ImageItem &ii) +{ + quint8 encStatus; + stream >> ii.testFunction >> ii.itemName >> ii.itemChecksum >> encStatus >> ii.imageChecksums >> ii.misc; + ii.status = ImageItem::ItemStatus(encStatus); + ii.readImageFromStream(stream); + return stream; +} + +BaselineProtocol::BaselineProtocol() +{ +} + +BaselineProtocol::~BaselineProtocol() +{ + socket.close(); + if (socket.state() != QTcpSocket::UnconnectedState) + socket.waitForDisconnected(Timeout); +} + + +bool BaselineProtocol::connect(const QString &testCase, bool *dryrun) +{ + errMsg.clear(); + QByteArray serverName(qgetenv("QT_LANCELOT_SERVER")); + if (serverName.isNull()) + serverName = "lancelot.test.qt.nokia.com"; + + socket.connectToHost(serverName, ServerPort); + if (!socket.waitForConnected(Timeout)) { + sysSleep(Timeout); // Wait a bit and try again, the server might just be restarting + if (!socket.waitForConnected(Timeout)) { + errMsg += QLS("TCP connectToHost failed. Host:") + serverName + QLS(" port:") + QString::number(ServerPort); + return false; + } + } + + PlatformInfo pi = PlatformInfo::localHostInfo(); + pi.insert(PI_TestCase, testCase); + QByteArray block; + QDataStream ds(&block, QIODevice::ReadWrite); + ds << pi; + if (!sendBlock(AcceptPlatformInfo, block)) { + errMsg += QLS("Failed to send data to server."); + return false; + } + + Command cmd = UnknownError; + if (!receiveBlock(&cmd, &block)) { + errMsg.prepend(QLS("Failed to get response from server. ")); + return false; + } + + if (cmd == Abort) { + errMsg += QLS("Server rejected connection. Reason: ") + QString::fromLatin1(block); + return false; + } + + if (dryrun) + *dryrun = (cmd == DoDryRun); + + if (cmd != Ack && cmd != DoDryRun) { + errMsg += QLS("Unexpected response from server."); + return false; + } + + return true; +} + + +bool BaselineProtocol::acceptConnection(PlatformInfo *pi) +{ + errMsg.clear(); + + QByteArray block; + Command cmd = AcceptPlatformInfo; + if (!receiveBlock(&cmd, &block) || cmd != AcceptPlatformInfo) + return false; + + if (pi) { + QDataStream ds(block); + ds >> *pi; + pi->insert(PI_HostAddress, socket.peerAddress().toString()); + } + + return true; +} + + +bool BaselineProtocol::requestBaselineChecksums(const QString &testFunction, ImageItemList *itemList) +{ + errMsg.clear(); + if (!itemList) + return false; + + for(ImageItemList::iterator it = itemList->begin(); it != itemList->end(); it++) + it->testFunction = testFunction; + + QByteArray block; + QDataStream ds(&block, QIODevice::WriteOnly); + ds << *itemList; + if (!sendBlock(RequestBaselineChecksums, block)) + return false; + + Command cmd; + QByteArray rcvBlock; + if (!receiveBlock(&cmd, &rcvBlock) || cmd != BaselineProtocol::Ack) + return false; + QDataStream rds(&rcvBlock, QIODevice::ReadOnly); + rds >> *itemList; + return true; +} + + +bool BaselineProtocol::submitNewBaseline(const ImageItem &item, QByteArray *serverMsg) +{ + Command cmd; + return (sendItem(AcceptNewBaseline, item) && receiveBlock(&cmd, serverMsg) && cmd == Ack); +} + + +bool BaselineProtocol::submitMismatch(const ImageItem &item, QByteArray *serverMsg) +{ + Command cmd; + return (sendItem(AcceptMismatch, item) && receiveBlock(&cmd, serverMsg) && cmd == Ack); +} + + +bool BaselineProtocol::sendItem(Command cmd, const ImageItem &item) +{ + errMsg.clear(); + QBuffer buf; + buf.open(QIODevice::WriteOnly); + QDataStream ds(&buf); + ds << item; + if (!sendBlock(cmd, buf.data())) { + errMsg.prepend(QLS("Failed to submit image to server. ")); + return false; + } + return true; +} + + +bool BaselineProtocol::sendBlock(Command cmd, const QByteArray &block) +{ + QDataStream s(&socket); + // TBD: set qds version as a constant + s << quint16(ProtocolVersion) << quint16(cmd); + s.writeBytes(block.constData(), block.size()); + return true; +} + + +bool BaselineProtocol::receiveBlock(Command *cmd, QByteArray *block) +{ + while (socket.bytesAvailable() < int(2*sizeof(quint16) + sizeof(quint32))) { + if (!socket.waitForReadyRead(Timeout)) + return false; + } + QDataStream ds(&socket); + quint16 rcvProtocolVersion, rcvCmd; + ds >> rcvProtocolVersion >> rcvCmd; + if (rcvProtocolVersion != ProtocolVersion) { + errMsg = QLS("Baseline protocol version mismatch, received:") + QString::number(rcvProtocolVersion) + + QLS(" expected:") + QString::number(ProtocolVersion); + return false; + } + if (cmd) + *cmd = Command(rcvCmd); + + QByteArray uMsg; + quint32 remaining; + ds >> remaining; + uMsg.resize(remaining); + int got = 0; + char* uMsgBuf = uMsg.data(); + do { + got = ds.readRawData(uMsgBuf, remaining); + remaining -= got; + uMsgBuf += got; + } while (remaining && got >= 0 && socket.waitForReadyRead(Timeout)); + + if (got < 0) + return false; + + if (block) + *block = uMsg; + + return true; +} + + +QString BaselineProtocol::errorMessage() +{ + QString ret = errMsg; + if (socket.error() >= 0) + ret += QLS(" Socket state: ") + socket.errorString(); + return ret; +} + diff --git a/tests/baselineserver/shared/baselineprotocol.h b/tests/baselineserver/shared/baselineprotocol.h new file mode 100644 index 0000000000..2d09e683d4 --- /dev/null +++ b/tests/baselineserver/shared/baselineprotocol.h @@ -0,0 +1,193 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef BASELINEPROTOCOL_H +#define BASELINEPROTOCOL_H + +#include +#include +#include +#include +#include +#include +#include + +#define QLS QLatin1String +#define QLC QLatin1Char + +#define FileFormat "png" + +extern const QString PI_TestCase; +extern const QString PI_HostName; +extern const QString PI_HostAddress; +extern const QString PI_OSName; +extern const QString PI_OSVersion; +extern const QString PI_QtVersion; +extern const QString PI_BuildKey; +extern const QString PI_GitCommit; +extern const QString PI_QMakeSpec; +extern const QString PI_PulseGitBranch; +extern const QString PI_PulseTestrBranch; + +class PlatformInfo : public QMap +{ +public: + PlatformInfo(); + PlatformInfo(const PlatformInfo &other); + ~PlatformInfo() + {} + PlatformInfo &operator=(const PlatformInfo &other); + + static PlatformInfo localHostInfo(); + + void addSignificantKeys(const QStringList& keys, bool replaceDefaultKeys=false); + QStringList addedKeys() const; + bool addedKeysReplaceDefault() const; + +private: + QStringList sigKeys; + bool replaceDefault; + friend QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi); + friend QDataStream & operator>> (QDataStream &stream, PlatformInfo& pi); +}; +QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pi); +QDataStream & operator>> (QDataStream &stream, PlatformInfo& pi); + + +struct ImageItem +{ +public: + ImageItem() + : status(Ok), itemChecksum(0) + {} + ImageItem(const ImageItem &other) + { *this = other; } + ~ImageItem() + {} + ImageItem &operator=(const ImageItem &other); + + static quint64 computeChecksum(const QImage& image); + + enum ItemStatus { + Ok = 0, + BaselineNotFound = 1, + IgnoreItem = 2, + Mismatch = 3 + }; + + QString testFunction; + QString itemName; + ItemStatus status; + QImage image; + QList imageChecksums; + quint16 itemChecksum; + QByteArray misc; + + void writeImageToStream(QDataStream &stream) const; + void readImageFromStream(QDataStream &stream); +}; +QDataStream & operator<< (QDataStream &stream, const ImageItem &ii); +QDataStream & operator>> (QDataStream &stream, ImageItem& ii); + +Q_DECLARE_METATYPE(ImageItem); + +typedef QVector ImageItemList; + + +class BaselineProtocol +{ +public: + BaselineProtocol(); + ~BaselineProtocol(); + + static BaselineProtocol *instance(QObject *parent = 0); + + // **************************************************** + // Important constants here + // **************************************************** + enum Constant { + ProtocolVersion = 5, + ServerPort = 54129, + Timeout = 15000 + }; + + enum Command { + UnknownError = 0, + // Queries + AcceptPlatformInfo = 1, + RequestBaselineChecksums = 2, + AcceptNewBaseline = 4, + AcceptMismatch = 5, + // Responses + Ack = 128, + Abort = 129, + DoDryRun = 130 + }; + + // For client: + + // For advanced client: + bool connect(const QString &testCase, bool *dryrun = 0); + bool requestBaselineChecksums(const QString &testFunction, ImageItemList *itemList); + bool submitNewBaseline(const ImageItem &item, QByteArray *serverMsg); + bool submitMismatch(const ImageItem &item, QByteArray *serverMsg); + + // For server: + bool acceptConnection(PlatformInfo *pi); + + QString errorMessage(); + +private: + bool sendItem(Command cmd, const ImageItem &item); + + bool sendBlock(Command cmd, const QByteArray &block); + bool receiveBlock(Command *cmd, QByteArray *block); + void sysSleep(int ms); + + QString errMsg; + QTcpSocket socket; + + friend class BaselineThread; + friend class BaselineHandler; +}; + + +#endif // BASELINEPROTOCOL_H diff --git a/tests/baselineserver/shared/baselineprotocol.pri b/tests/baselineserver/shared/baselineprotocol.pri new file mode 100644 index 0000000000..62e38a6ab5 --- /dev/null +++ b/tests/baselineserver/shared/baselineprotocol.pri @@ -0,0 +1,11 @@ +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD + +QT *= network + +SOURCES += \ + $$PWD/baselineprotocol.cpp \ + $$PWD/lookup3.cpp + +HEADERS += \ + $$PWD/baselineprotocol.h diff --git a/tests/baselineserver/shared/lookup3.cpp b/tests/baselineserver/shared/lookup3.cpp new file mode 100644 index 0000000000..1ad2d371c4 --- /dev/null +++ b/tests/baselineserver/shared/lookup3.cpp @@ -0,0 +1,786 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +/* +These functions are based on: + +------------------------------------------------------------------------------- +lookup3.c, by Bob Jenkins, May 2006, Public Domain. + +These are functions for producing 32-bit hashes for hash table lookup. +hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() +are externally useful functions. Routines to test the hash are included +if SELF_TEST is defined. You can use this free for any purpose. It's in +the public domain. It has no warranty. + +You probably want to use hashlittle(). hashlittle() and hashbig() +hash byte arrays. hashlittle() is is faster than hashbig() on +little-endian machines. Intel and AMD are little-endian machines. +On second thought, you probably want hashlittle2(), which is identical to +hashlittle() except it returns two 32-bit hashes for the price of one. +You could implement hashbig2() if you wanted but I haven't bothered here. + +If you want to find a hash of, say, exactly 7 integers, do + a = i1; b = i2; c = i3; + mix(a,b,c); + a += i4; b += i5; c += i6; + mix(a,b,c); + a += i7; + final(a,b,c); +then use c as the hash value. If you have a variable length array of +4-byte integers to hash, use hashword(). If you have a byte array (like +a character string), use hashlittle(). If you have several byte arrays, or +a mix of things, see the comments above hashlittle(). + +Why is this so big? I read 12 bytes at a time into 3 4-byte integers, +then mix those integers. This is fast (you can do a lot more thorough +mixing with 12*3 instructions on 3 integers than you can with 3 instructions +on 1 byte), but shoehorning those bytes into integers efficiently is messy. +------------------------------------------------------------------------------- +*/ + +#include + +#if Q_BYTE_ORDER == Q_BIG_ENDIAN +# define HASH_LITTLE_ENDIAN 0 +# define HASH_BIG_ENDIAN 1 +#else +# define HASH_LITTLE_ENDIAN 1 +# define HASH_BIG_ENDIAN 0 +#endif + +#define hashsize(n) ((quint32)1<<(n)) +#define hashmask(n) (hashsize(n)-1) +#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) + +/* +------------------------------------------------------------------------------- +mix -- mix 3 32-bit values reversibly. + +This is reversible, so any information in (a,b,c) before mix() is +still in (a,b,c) after mix(). + +If four pairs of (a,b,c) inputs are run through mix(), or through +mix() in reverse, there are at least 32 bits of the output that +are sometimes the same for one pair and different for another pair. +This was tested for: +* pairs that differed by one bit, by two bits, in any combination + of top bits of (a,b,c), or in any combination of bottom bits of + (a,b,c). +* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed + the output delta to a Gray code (a^(a>>1)) so a string of 1's (as + is commonly produced by subtraction) look like a single 1-bit + difference. +* the base values were pseudorandom, all zero but one bit set, or + all zero plus a counter that starts at zero. + +Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that +satisfy this are + 4 6 8 16 19 4 + 9 15 3 18 27 15 + 14 9 3 7 17 3 +Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing +for "differ" defined as + with a one-bit base and a two-bit delta. I +used http://burtleburtle.net/bob/hash/avalanche.html to choose +the operations, constants, and arrangements of the variables. + +This does not achieve avalanche. There are input bits of (a,b,c) +that fail to affect some output bits of (a,b,c), especially of a. The +most thoroughly mixed value is c, but it doesn't really even achieve +avalanche in c. + +This allows some parallelism. Read-after-writes are good at doubling +the number of bits affected, so the goal of mixing pulls in the opposite +direction as the goal of parallelism. I did what I could. Rotates +seem to cost as much as shifts on every machine I could lay my hands +on, and rotates are much kinder to the top and bottom bits, so I used +rotates. +------------------------------------------------------------------------------- +*/ +#define mix(a,b,c) \ +{ \ + a -= c; a ^= rot(c, 4); c += b; \ + b -= a; b ^= rot(a, 6); a += c; \ + c -= b; c ^= rot(b, 8); b += a; \ + a -= c; a ^= rot(c,16); c += b; \ + b -= a; b ^= rot(a,19); a += c; \ + c -= b; c ^= rot(b, 4); b += a; \ +} + +/* +------------------------------------------------------------------------------- +final -- final mixing of 3 32-bit values (a,b,c) into c + +Pairs of (a,b,c) values differing in only a few bits will usually +produce values of c that look totally different. This was tested for +* pairs that differed by one bit, by two bits, in any combination + of top bits of (a,b,c), or in any combination of bottom bits of + (a,b,c). +* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed + the output delta to a Gray code (a^(a>>1)) so a string of 1's (as + is commonly produced by subtraction) look like a single 1-bit + difference. +* the base values were pseudorandom, all zero but one bit set, or + all zero plus a counter that starts at zero. + +These constants passed: + 14 11 25 16 4 14 24 + 12 14 25 16 4 14 24 +and these came close: + 4 8 15 26 3 22 24 + 10 8 15 26 3 22 24 + 11 8 15 26 3 22 24 +------------------------------------------------------------------------------- +*/ +#define final(a,b,c) \ +{ \ + c ^= b; c -= rot(b,14); \ + a ^= c; a -= rot(c,11); \ + b ^= a; b -= rot(a,25); \ + c ^= b; c -= rot(b,16); \ + a ^= c; a -= rot(c,4); \ + b ^= a; b -= rot(a,14); \ + c ^= b; c -= rot(b,24); \ +} + +/* +-------------------------------------------------------------------- + This works on all machines. To be useful, it requires + -- that the key be an array of quint32's, and + -- that the length be the number of quint32's in the key + + The function hashword() is identical to hashlittle() on little-endian + machines, and identical to hashbig() on big-endian machines, + except that the length has to be measured in quint32s rather than in + bytes. hashlittle() is more complicated than hashword() only because + hashlittle() has to dance around fitting the key bytes into registers. +-------------------------------------------------------------------- +*/ +quint32 hashword( +const quint32 *k, /* the key, an array of quint32 values */ +size_t length, /* the length of the key, in quint32s */ +quint32 initval) /* the previous hash, or an arbitrary value */ +{ + quint32 a,b,c; + + /* Set up the internal state */ + a = b = c = 0xdeadbeef + (((quint32)length)<<2) + initval; + + /*------------------------------------------------- handle most of the key */ + while (length > 3) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 3; + k += 3; + } + + /*------------------------------------------- handle the last 3 quint32's */ + switch(length) /* all the case statements fall through */ + { + case 3 : c+=k[2]; + case 2 : b+=k[1]; + case 1 : a+=k[0]; + final(a,b,c); + case 0: /* case 0: nothing left to add */ + break; + } + /*------------------------------------------------------ report the result */ + return c; +} + + +/* +-------------------------------------------------------------------- +hashword2() -- same as hashword(), but take two seeds and return two +32-bit values. pc and pb must both be nonnull, and *pc and *pb must +both be initialized with seeds. If you pass in (*pb)==0, the output +(*pc) will be the same as the return value from hashword(). +-------------------------------------------------------------------- +*/ +void hashword2 ( +const quint32 *k, /* the key, an array of quint32 values */ +size_t length, /* the length of the key, in quint32s */ +quint32 *pc, /* IN: seed OUT: primary hash value */ +quint32 *pb) /* IN: more seed OUT: secondary hash value */ +{ + quint32 a,b,c; + + /* Set up the internal state */ + a = b = c = 0xdeadbeef + ((quint32)(length<<2)) + *pc; + c += *pb; + + /*------------------------------------------------- handle most of the key */ + while (length > 3) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 3; + k += 3; + } + + /*------------------------------------------- handle the last 3 quint32's */ + switch(length) /* all the case statements fall through */ + { + case 3 : c+=k[2]; + case 2 : b+=k[1]; + case 1 : a+=k[0]; + final(a,b,c); + case 0: /* case 0: nothing left to add */ + break; + } + /*------------------------------------------------------ report the result */ + *pc=c; *pb=b; +} + + +/* +------------------------------------------------------------------------------- +hashlittle() -- hash a variable-length key into a 32-bit value + k : the key (the unaligned variable-length array of bytes) + length : the length of the key, counting by bytes + initval : can be any 4-byte value +Returns a 32-bit value. Every bit of the key affects every bit of +the return value. Two keys differing by one or two bits will have +totally different hash values. + +The best hash table sizes are powers of 2. There is no need to do +mod a prime (mod is sooo slow!). If you need less than 32 bits, +use a bitmask. For example, if you need only 10 bits, do + h = (h & hashmask(10)); +In which case, the hash table should have hashsize(10) elements. + +If you are hashing n strings (quint8 **)k, do it like this: + for (i=0, h=0; i 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* + * "k[2]&0xffffff" actually reads beyond the end of the string, but + * then masks off the part it's not allowed to read. Because the + * string is aligned, the masked-off tail is in the same word as the + * rest of the string. Every machine with memory protection I've seen + * does it on word boundaries, so is OK with this. But VALGRIND will + * still catch it and complain. The masking trick does make the hash + * noticably faster for short strings (like English words). + */ +#ifndef VALGRIND + + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; + case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; + case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=k[1]&0xffffff; a+=k[0]; break; + case 6 : b+=k[1]&0xffff; a+=k[0]; break; + case 5 : b+=k[1]&0xff; a+=k[0]; break; + case 4 : a+=k[0]; break; + case 3 : a+=k[0]&0xffffff; break; + case 2 : a+=k[0]&0xffff; break; + case 1 : a+=k[0]&0xff; break; + case 0 : return c; /* zero length strings require no mixing */ + } + +#else /* make valgrind happy */ + + const quint8 *k8 = (const quint8 *)k; + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=((quint32)k8[10])<<16; /* fall through */ + case 10: c+=((quint32)k8[9])<<8; /* fall through */ + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=((quint32)k8[6])<<16; /* fall through */ + case 6 : b+=((quint32)k8[5])<<8; /* fall through */ + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]; break; + case 3 : a+=((quint32)k8[2])<<16; /* fall through */ + case 2 : a+=((quint32)k8[1])<<8; /* fall through */ + case 1 : a+=k8[0]; break; + case 0 : return c; + } + +#endif /* !valgrind */ + + } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { + const quint16 *k = (const quint16 *)key; /* read 16-bit chunks */ + const quint8 *k8; + + /*--------------- all but last block: aligned reads and different mixing */ + while (length > 12) + { + a += k[0] + (((quint32)k[1])<<16); + b += k[2] + (((quint32)k[3])<<16); + c += k[4] + (((quint32)k[5])<<16); + mix(a,b,c); + length -= 12; + k += 6; + } + + /*----------------------------- handle the last (probably partial) block */ + k8 = (const quint8 *)k; + switch(length) + { + case 12: c+=k[4]+(((quint32)k[5])<<16); + b+=k[2]+(((quint32)k[3])<<16); + a+=k[0]+(((quint32)k[1])<<16); + break; + case 11: c+=((quint32)k8[10])<<16; /* fall through */ + case 10: c+=k[4]; + b+=k[2]+(((quint32)k[3])<<16); + a+=k[0]+(((quint32)k[1])<<16); + break; + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[2]+(((quint32)k[3])<<16); + a+=k[0]+(((quint32)k[1])<<16); + break; + case 7 : b+=((quint32)k8[6])<<16; /* fall through */ + case 6 : b+=k[2]; + a+=k[0]+(((quint32)k[1])<<16); + break; + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]+(((quint32)k[1])<<16); + break; + case 3 : a+=((quint32)k8[2])<<16; /* fall through */ + case 2 : a+=k[0]; + break; + case 1 : a+=k8[0]; + break; + case 0 : return c; /* zero length requires no mixing */ + } + + } else { /* need to read the key one byte at a time */ + const quint8 *k = (const quint8 *)key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + a += ((quint32)k[1])<<8; + a += ((quint32)k[2])<<16; + a += ((quint32)k[3])<<24; + b += k[4]; + b += ((quint32)k[5])<<8; + b += ((quint32)k[6])<<16; + b += ((quint32)k[7])<<24; + c += k[8]; + c += ((quint32)k[9])<<8; + c += ((quint32)k[10])<<16; + c += ((quint32)k[11])<<24; + mix(a,b,c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch(length) /* all the case statements fall through */ + { + case 12: c+=((quint32)k[11])<<24; + case 11: c+=((quint32)k[10])<<16; + case 10: c+=((quint32)k[9])<<8; + case 9 : c+=k[8]; + case 8 : b+=((quint32)k[7])<<24; + case 7 : b+=((quint32)k[6])<<16; + case 6 : b+=((quint32)k[5])<<8; + case 5 : b+=k[4]; + case 4 : a+=((quint32)k[3])<<24; + case 3 : a+=((quint32)k[2])<<16; + case 2 : a+=((quint32)k[1])<<8; + case 1 : a+=k[0]; + break; + case 0 : return c; + } + } + + final(a,b,c); + return c; +} + + +/* + * hashlittle2: return 2 32-bit hash values + * + * This is identical to hashlittle(), except it returns two 32-bit hash + * values instead of just one. This is good enough for hash table + * lookup with 2^^64 buckets, or if you want a second hash if you're not + * happy with the first, or if you want a probably-unique 64-bit ID for + * the key. *pc is better mixed than *pb, so use *pc first. If you want + * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)". + */ +void hashlittle2( + const void *key, /* the key to hash */ + size_t length, /* length of the key */ + quint32 *pc, /* IN: primary initval, OUT: primary hash */ + quint32 *pb) /* IN: secondary initval, OUT: secondary hash */ +{ + quint32 a,b,c; /* internal state */ + union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */ + + /* Set up the internal state */ + a = b = c = 0xdeadbeef + ((quint32)length) + *pc; + c += *pb; + + u.ptr = key; + if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { + const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */ + + /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* + * "k[2]&0xffffff" actually reads beyond the end of the string, but + * then masks off the part it's not allowed to read. Because the + * string is aligned, the masked-off tail is in the same word as the + * rest of the string. Every machine with memory protection I've seen + * does it on word boundaries, so is OK with this. But VALGRIND will + * still catch it and complain. The masking trick does make the hash + * noticably faster for short strings (like English words). + */ +#ifndef VALGRIND + + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; + case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; + case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=k[1]&0xffffff; a+=k[0]; break; + case 6 : b+=k[1]&0xffff; a+=k[0]; break; + case 5 : b+=k[1]&0xff; a+=k[0]; break; + case 4 : a+=k[0]; break; + case 3 : a+=k[0]&0xffffff; break; + case 2 : a+=k[0]&0xffff; break; + case 1 : a+=k[0]&0xff; break; + case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + } + +#else /* make valgrind happy */ + + const quint8 *k8 = (const quint8 *)k; + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=((quint32)k8[10])<<16; /* fall through */ + case 10: c+=((quint32)k8[9])<<8; /* fall through */ + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=((quint32)k8[6])<<16; /* fall through */ + case 6 : b+=((quint32)k8[5])<<8; /* fall through */ + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]; break; + case 3 : a+=((quint32)k8[2])<<16; /* fall through */ + case 2 : a+=((quint32)k8[1])<<8; /* fall through */ + case 1 : a+=k8[0]; break; + case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + } + +#endif /* !valgrind */ + + } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { + const quint16 *k = (const quint16 *)key; /* read 16-bit chunks */ + const quint8 *k8; + + /*--------------- all but last block: aligned reads and different mixing */ + while (length > 12) + { + a += k[0] + (((quint32)k[1])<<16); + b += k[2] + (((quint32)k[3])<<16); + c += k[4] + (((quint32)k[5])<<16); + mix(a,b,c); + length -= 12; + k += 6; + } + + /*----------------------------- handle the last (probably partial) block */ + k8 = (const quint8 *)k; + switch(length) + { + case 12: c+=k[4]+(((quint32)k[5])<<16); + b+=k[2]+(((quint32)k[3])<<16); + a+=k[0]+(((quint32)k[1])<<16); + break; + case 11: c+=((quint32)k8[10])<<16; /* fall through */ + case 10: c+=k[4]; + b+=k[2]+(((quint32)k[3])<<16); + a+=k[0]+(((quint32)k[1])<<16); + break; + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[2]+(((quint32)k[3])<<16); + a+=k[0]+(((quint32)k[1])<<16); + break; + case 7 : b+=((quint32)k8[6])<<16; /* fall through */ + case 6 : b+=k[2]; + a+=k[0]+(((quint32)k[1])<<16); + break; + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]+(((quint32)k[1])<<16); + break; + case 3 : a+=((quint32)k8[2])<<16; /* fall through */ + case 2 : a+=k[0]; + break; + case 1 : a+=k8[0]; + break; + case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + } + + } else { /* need to read the key one byte at a time */ + const quint8 *k = (const quint8 *)key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + a += ((quint32)k[1])<<8; + a += ((quint32)k[2])<<16; + a += ((quint32)k[3])<<24; + b += k[4]; + b += ((quint32)k[5])<<8; + b += ((quint32)k[6])<<16; + b += ((quint32)k[7])<<24; + c += k[8]; + c += ((quint32)k[9])<<8; + c += ((quint32)k[10])<<16; + c += ((quint32)k[11])<<24; + mix(a,b,c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch(length) /* all the case statements fall through */ + { + case 12: c+=((quint32)k[11])<<24; + case 11: c+=((quint32)k[10])<<16; + case 10: c+=((quint32)k[9])<<8; + case 9 : c+=k[8]; + case 8 : b+=((quint32)k[7])<<24; + case 7 : b+=((quint32)k[6])<<16; + case 6 : b+=((quint32)k[5])<<8; + case 5 : b+=k[4]; + case 4 : a+=((quint32)k[3])<<24; + case 3 : a+=((quint32)k[2])<<16; + case 2 : a+=((quint32)k[1])<<8; + case 1 : a+=k[0]; + break; + case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + } + } + + final(a,b,c); + *pc=c; *pb=b; +} + + + +/* + * hashbig(): + * This is the same as hashword() on big-endian machines. It is different + * from hashlittle() on all machines. hashbig() takes advantage of + * big-endian byte ordering. + */ +quint32 hashbig( const void *key, size_t length, quint32 initval) +{ + quint32 a,b,c; + union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */ + + /* Set up the internal state */ + a = b = c = 0xdeadbeef + ((quint32)length) + initval; + + u.ptr = key; + if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) { + const quint32 *k = (const quint32 *)key; /* read 32-bit chunks */ + + /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* + * "k[2]<<8" actually reads beyond the end of the string, but + * then shifts out the part it's not allowed to read. Because the + * string is aligned, the illegal read is in the same word as the + * rest of the string. Every machine with memory protection I've seen + * does it on word boundaries, so is OK with this. But VALGRIND will + * still catch it and complain. The masking trick does make the hash + * noticably faster for short strings (like English words). + */ +#ifndef VALGRIND + + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=k[2]&0xffffff00; b+=k[1]; a+=k[0]; break; + case 10: c+=k[2]&0xffff0000; b+=k[1]; a+=k[0]; break; + case 9 : c+=k[2]&0xff000000; b+=k[1]; a+=k[0]; break; + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=k[1]&0xffffff00; a+=k[0]; break; + case 6 : b+=k[1]&0xffff0000; a+=k[0]; break; + case 5 : b+=k[1]&0xff000000; a+=k[0]; break; + case 4 : a+=k[0]; break; + case 3 : a+=k[0]&0xffffff00; break; + case 2 : a+=k[0]&0xffff0000; break; + case 1 : a+=k[0]&0xff000000; break; + case 0 : return c; /* zero length strings require no mixing */ + } + +#else /* make valgrind happy */ + + const quint8 *k8 = (const quint8 *)k; + switch(length) /* all the case statements fall through */ + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=((quint32)k8[10])<<8; /* fall through */ + case 10: c+=((quint32)k8[9])<<16; /* fall through */ + case 9 : c+=((quint32)k8[8])<<24; /* fall through */ + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=((quint32)k8[6])<<8; /* fall through */ + case 6 : b+=((quint32)k8[5])<<16; /* fall through */ + case 5 : b+=((quint32)k8[4])<<24; /* fall through */ + case 4 : a+=k[0]; break; + case 3 : a+=((quint32)k8[2])<<8; /* fall through */ + case 2 : a+=((quint32)k8[1])<<16; /* fall through */ + case 1 : a+=((quint32)k8[0])<<24; break; + case 0 : return c; + } + +#endif /* !VALGRIND */ + + } else { /* need to read the key one byte at a time */ + const quint8 *k = (const quint8 *)key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += ((quint32)k[0])<<24; + a += ((quint32)k[1])<<16; + a += ((quint32)k[2])<<8; + a += ((quint32)k[3]); + b += ((quint32)k[4])<<24; + b += ((quint32)k[5])<<16; + b += ((quint32)k[6])<<8; + b += ((quint32)k[7]); + c += ((quint32)k[8])<<24; + c += ((quint32)k[9])<<16; + c += ((quint32)k[10])<<8; + c += ((quint32)k[11]); + mix(a,b,c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch(length) /* all the case statements fall through */ + { + case 12: c+=k[11]; + case 11: c+=((quint32)k[10])<<8; + case 10: c+=((quint32)k[9])<<16; + case 9 : c+=((quint32)k[8])<<24; + case 8 : b+=k[7]; + case 7 : b+=((quint32)k[6])<<8; + case 6 : b+=((quint32)k[5])<<16; + case 5 : b+=((quint32)k[4])<<24; + case 4 : a+=k[3]; + case 3 : a+=((quint32)k[2])<<8; + case 2 : a+=((quint32)k[1])<<16; + case 1 : a+=((quint32)k[0])<<24; + break; + case 0 : return c; + } + } + + final(a,b,c); + return c; +} diff --git a/tests/baselineserver/shared/qbaselinetest.cpp b/tests/baselineserver/shared/qbaselinetest.cpp new file mode 100644 index 0000000000..de3150e080 --- /dev/null +++ b/tests/baselineserver/shared/qbaselinetest.cpp @@ -0,0 +1,193 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qbaselinetest.h" +#include "baselineprotocol.h" + +namespace QBaselineTest { + +BaselineProtocol proto; +bool connected = false; +bool triedConnecting = false; + +QByteArray curFunction; +ImageItemList itemList; +bool gotBaselines; + + +bool connect(QByteArray *msg, bool *error) +{ + if (!triedConnecting) { + triedConnecting = true; + if (!proto.connect(QTest::testObject()->metaObject()->className())) { + *msg += "Failed to connect to baseline server: " + proto.errorMessage().toLatin1(); + *error = true; + return false; + } + connected = true; + } + if (!connected) { + *msg = "Not connected to baseline server."; + *error = true; + return false; + } + return true; +} + + +bool compareItem(const ImageItem &baseline, const QImage &img, QByteArray *msg, bool *error) +{ + ImageItem item = baseline; + item.image = img; + item.imageChecksums.clear(); + item.imageChecksums.prepend(ImageItem::computeChecksum(img)); + QByteArray srvMsg; + switch (baseline.status) { + case ImageItem::Ok: + break; + case ImageItem::IgnoreItem : + qDebug() << msg->constData() << "Ignored, blacklisted on server."; + return true; + break; + case ImageItem::BaselineNotFound: + if (proto.submitNewBaseline(item, &srvMsg)) + qDebug() << msg->constData() << "Baseline not found on server. New baseline uploaded."; + else + qDebug() << msg->constData() << "Baseline not found on server. Uploading of new baseline failed:" << srvMsg; + return true; + break; + default: + qWarning() << "Unexpected reply from baseline server."; + return true; + break; + } + *error = false; + // The actual comparison of the given image with the baseline: + if (baseline.imageChecksums.contains(item.imageChecksums.at(0))) + return true; + proto.submitMismatch(item, &srvMsg); + *msg += "Mismatch. See report:\n " + srvMsg; + return false; +} + +bool checkImage(const QImage &img, const char *name, quint16 checksum, QByteArray *msg, bool *error) +{ + if (!connected && !connect(msg, error)) + return true; + + QByteArray itemName; + bool hasName = qstrlen(name); + const char *tag = QTest::currentDataTag(); + if (qstrlen(tag)) { + itemName = tag; + if (hasName) + itemName.append('_').append(name); + } else { + itemName = hasName ? name : "default_name"; + } + + *msg = "Baseline check of image '" + itemName + "': "; + + + ImageItem item; + item.itemName = QString::fromLatin1(itemName); + item.itemChecksum = checksum; + item.testFunction = QString::fromLatin1(QTest::currentTestFunction()); + ImageItemList list; + list.append(item); + if (!proto.requestBaselineChecksums(QLatin1String(QTest::currentTestFunction()), &list) || list.isEmpty()) { + *msg = "Communication with baseline server failed: " + proto.errorMessage().toLatin1(); + *error = true; + return true; + } + + return compareItem(list.at(0), img, msg, error); +} + + +QTestData &newRow(const char *dataTag, quint16 checksum) +{ + if (QTest::currentTestFunction() != curFunction) { + curFunction = QTest::currentTestFunction(); + itemList.clear(); + gotBaselines = false; + } + ImageItem item; + item.itemName = QString::fromLatin1(dataTag); + item.itemChecksum = checksum; + item.testFunction = QString::fromLatin1(QTest::currentTestFunction()); + itemList.append(item); + + return QTest::newRow(dataTag); +} + + +bool testImage(const QImage& img, QByteArray *msg, bool *error) +{ + if (!connected && !connect(msg, error)) + return true; + + if (QTest::currentTestFunction() != curFunction || itemList.isEmpty()) { + qWarning() << "Usage error: QBASELINE_TEST used without corresponding QBaselineTest::newRow()"; + return true; + } + + if (!gotBaselines) { + if (!proto.requestBaselineChecksums(QString::fromLatin1(QTest::currentTestFunction()), &itemList) || itemList.isEmpty()) { + *msg = "Communication with baseline server failed: " + proto.errorMessage().toLatin1(); + *error = true; + return true; + } + gotBaselines = true; + } + + QString curTag = QString::fromLatin1(QTest::currentDataTag()); + ImageItemList::const_iterator it = itemList.constBegin(); + while (it != itemList.constEnd() && it->itemName != curTag) + ++it; + if (it == itemList.constEnd()) { + qWarning() << "Usage error: QBASELINE_TEST used without corresponding QBaselineTest::newRow() for row" << curTag; + return true; + } + return compareItem(*it, img, msg, error); +} + +} diff --git a/tests/baselineserver/shared/qbaselinetest.h b/tests/baselineserver/shared/qbaselinetest.h new file mode 100644 index 0000000000..e76c32562f --- /dev/null +++ b/tests/baselineserver/shared/qbaselinetest.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef BASELINETEST_H +#define BASELINETEST_H + +#include + +namespace QBaselineTest { +bool checkImage(const QImage& img, const char *name, quint16 checksum, QByteArray *msg, bool *error); +bool testImage(const QImage& img, QByteArray *msg, bool *error); +QTestData &newRow(const char *dataTag, quint16 checksum = 0); +} + +#define QBASELINE_CHECK_SUM(image, name, checksum)\ +do {\ + QByteArray _msg;\ + bool _err = false;\ + if (!QBaselineTest::checkImage((image), (name), (checksum), &_msg, &_err)) {\ + QFAIL(_msg.constData());\ + } else if (_err) {\ + QSKIP(_msg.constData(), SkipSingle);\ + }\ +} while (0) + +#define QBASELINE_CHECK(image, name) QBASELINE_CHECK_SUM(image, name, 0) + +#define QBASELINE_TEST(image)\ +do {\ + QByteArray _msg;\ + bool _err = false;\ + if (!QBaselineTest::testImage((image), &_msg, &_err)) {\ + QFAIL(_msg.constData());\ + } else if (_err) {\ + QSKIP(_msg.constData(), SkipSingle);\ + }\ +} while (0) + +#endif // BASELINETEST_H diff --git a/tests/baselineserver/shared/qbaselinetest.pri b/tests/baselineserver/shared/qbaselinetest.pri new file mode 100644 index 0000000000..5420c6ed1c --- /dev/null +++ b/tests/baselineserver/shared/qbaselinetest.pri @@ -0,0 +1,13 @@ +QT *= testlib + +SOURCES += \ + $$PWD/qbaselinetest.cpp + +HEADERS += \ + $$PWD/qbaselinetest.h + +win32|symbian*:MKSPEC=$$replace(QMAKESPEC, \\\\, /) +else:MKSPEC=$$QMAKESPEC +DEFINES += QMAKESPEC=\\\"$$MKSPEC\\\" + +include($$PWD/baselineprotocol.pri) diff --git a/tests/baselineserver/src/baselineserver.cpp b/tests/baselineserver/src/baselineserver.cpp new file mode 100644 index 0000000000..6ff0a0c72d --- /dev/null +++ b/tests/baselineserver/src/baselineserver.cpp @@ -0,0 +1,576 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#define QT_USE_FAST_CONCATENATION +#define QT_USE_FAST_OPERATOR_PLUS + +#include "baselineserver.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// extra fields, for use in image metadata storage +const QString PI_ImageChecksum(QLS("ImageChecksum")); +const QString PI_RunId(QLS("RunId")); +const QString PI_CreationDate(QLS("CreationDate")); + +QString BaselineServer::storage; +QString BaselineServer::url; +QString BaselineServer::settingsFile; + +BaselineServer::BaselineServer(QObject *parent) + : QTcpServer(parent), lastRunIdIdx(0) +{ + QFileInfo me(QCoreApplication::applicationFilePath()); + meLastMod = me.lastModified(); + heartbeatTimer = new QTimer(this); + connect(heartbeatTimer, SIGNAL(timeout()), this, SLOT(heartbeat())); + heartbeatTimer->start(HEARTBEAT*1000); +} + +QString BaselineServer::storagePath() +{ + if (storage.isEmpty()) { + storage = QLS(qgetenv("QT_LANCELOT_DIR")); + if (storage.isEmpty()) + storage = QLS("/var/www"); + } + return storage; +} + +QString BaselineServer::baseUrl() +{ + if (url.isEmpty()) { + url = QLS("http://") + + QHostInfo::localHostName().toLatin1() + '.' + + QHostInfo::localDomainName().toLatin1() + '/'; + } + return url; +} + +QString BaselineServer::settingsFilePath() +{ + if (settingsFile.isEmpty()) { + QString exeName = QCoreApplication::applicationFilePath().section(QLC('/'), -1); + settingsFile = storagePath() + QLC('/') + exeName + QLS(".ini"); + } + return settingsFile; +} + +void BaselineServer::incomingConnection(int socketDescriptor) +{ + QString runId = QDateTime::currentDateTime().toString(QLS("MMMdd-hhmmss")); + if (runId == lastRunId) { + runId += QLC('-') + QString::number(++lastRunIdIdx); + } else { + lastRunId = runId; + lastRunIdIdx = 0; + } + qDebug() << "Server: New connection! RunId:" << runId; + BaselineThread *thread = new BaselineThread(runId, socketDescriptor, this); + connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); + thread->start(); +} + +void BaselineServer::heartbeat() +{ + // The idea is to exit to be restarted when modified, as soon as not actually serving + QFileInfo me(QCoreApplication::applicationFilePath()); + if (me.lastModified() == meLastMod) + return; + if (!me.exists() || !me.isExecutable()) + return; + + //# (could close() here to avoid accepting new connections, to avoid livelock) + //# also, could check for a timeout to force exit, to avoid hung threads blocking + bool isServing = false; + foreach(BaselineThread *thread, findChildren()) { + if (thread->isRunning()) { + isServing = true; + break; + } + } + + if (!isServing) + QCoreApplication::exit(); +} + +BaselineThread::BaselineThread(const QString &runId, int socketDescriptor, QObject *parent) + : QThread(parent), runId(runId), socketDescriptor(socketDescriptor) +{ +} + +void BaselineThread::run() +{ + BaselineHandler handler(runId, socketDescriptor); + exec(); +} + + +BaselineHandler::BaselineHandler(const QString &runId, int socketDescriptor) + : QObject(), runId(runId), connectionEstablished(false) +{ + settings = new QSettings(BaselineServer::settingsFilePath(), QSettings::IniFormat, this); + + if (socketDescriptor == -1) + return; + + connect(&proto.socket, SIGNAL(readyRead()), this, SLOT(receiveRequest())); + connect(&proto.socket, SIGNAL(disconnected()), this, SLOT(receiveDisconnect())); + proto.socket.setSocketDescriptor(socketDescriptor); +} + +const char *BaselineHandler::logtime() +{ + return 0; + //return QTime::currentTime().toString(QLS("mm:ss.zzz")); +} + +bool BaselineHandler::establishConnection() +{ + if (!proto.acceptConnection(&plat)) { + qWarning() << runId << logtime() << "Accepting new connection from" << proto.socket.peerAddress().toString() << "failed." << proto.errorMessage(); + proto.sendBlock(BaselineProtocol::Abort, proto.errorMessage().toLatin1()); // In case the client can hear us, tell it what's wrong. + proto.socket.disconnectFromHost(); + return false; + } + QString logMsg; + foreach (QString key, plat.keys()) { + if (key != PI_HostName && key != PI_HostAddress) + logMsg += key + QLS(": '") + plat.value(key) + QLS("', "); + } + qDebug() << runId << logtime() << "Connection established with" << plat.value(PI_HostName) + << "[" << qPrintable(plat.value(PI_HostAddress)) << "]" << logMsg; + + settings->beginGroup("ClientFilters"); + if (!settings->childKeys().isEmpty() && !plat.value(PI_PulseGitBranch).isEmpty()) { // i.e. not adhoc client + // Abort if client does not match the filters + foreach (QString filterKey, settings->childKeys()) { + QString filter = settings->value(filterKey).toString(); + QString platVal = plat.value(filterKey); + if (filter.isEmpty() || platVal.isEmpty()) + continue; // tbd: add a syntax for specifying a "value-must-be-present" filter + if (!platVal.contains(filter)) { + qDebug() << runId << logtime() << "Did not pass client filter on" << filterKey << "; disconnecting."; + proto.sendBlock(BaselineProtocol::Abort, QByteArray("Configured to not do testing for this client or repo, ref. ") + BaselineServer::settingsFilePath().toLatin1()); + proto.socket.disconnectFromHost(); + return false; + } + } + } + settings->endGroup(); + + proto.sendBlock(BaselineProtocol::Ack, QByteArray()); + + report.init(this, runId, plat); + return true; +} + +void BaselineHandler::receiveRequest() +{ + if (!connectionEstablished) { + connectionEstablished = establishConnection(); + return; + } + + QByteArray block; + BaselineProtocol::Command cmd; + if (!proto.receiveBlock(&cmd, &block)) { + qWarning() << runId << logtime() << "Command reception failed. "<< proto.errorMessage(); + QThread::currentThread()->exit(1); + return; + } + + switch(cmd) { + case BaselineProtocol::RequestBaselineChecksums: + provideBaselineChecksums(block); + break; + case BaselineProtocol::AcceptNewBaseline: + storeImage(block, true); + break; + case BaselineProtocol::AcceptMismatch: + storeImage(block, false); + break; + default: + qWarning() << runId << logtime() << "Unknown command received. " << proto.errorMessage(); + proto.sendBlock(BaselineProtocol::UnknownError, QByteArray()); + } +} + + +void BaselineHandler::provideBaselineChecksums(const QByteArray &itemListBlock) +{ + ImageItemList itemList; + QDataStream ds(itemListBlock); + ds >> itemList; + qDebug() << runId << logtime() << "Received request for checksums for" << itemList.count() + << "items in test function" << itemList.at(0).testFunction; + + for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) { + i->imageChecksums.clear(); + i->status = ImageItem::BaselineNotFound; + QString prefix = pathForItem(*i, true); + PlatformInfo itemData = fetchItemMetadata(prefix); + if (itemData.contains(PI_ImageChecksum)) { + bool ok = false; + quint64 checksum = itemData.value(PI_ImageChecksum).toULongLong(&ok, 16); + if (ok) { + i->imageChecksums.prepend(checksum); + i->status = ImageItem::Ok; + } + } + } + + // Find and mark blacklisted items + QString context = pathForItem(itemList.at(0), true, false).section(QLC('/'), 0, -2); + if (itemList.count() > 0) { + QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST")); + if (file.open(QIODevice::ReadOnly)) { + QTextStream in(&file); + do { + QString itemName = in.readLine(); + if (!itemName.isNull()) { + for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) { + if (i->itemName == itemName) + i->status = ImageItem::IgnoreItem; + } + } + } while (!in.atEnd()); + } + } + + QByteArray block; + QDataStream ods(&block, QIODevice::WriteOnly); + ods << itemList; + proto.sendBlock(BaselineProtocol::Ack, block); + report.addItems(itemList); +} + + +void BaselineHandler::storeImage(const QByteArray &itemBlock, bool isBaseline) +{ + QDataStream ds(itemBlock); + ImageItem item; + ds >> item; + + QString prefix = pathForItem(item, isBaseline); + qDebug() << runId << logtime() << "Received" << (isBaseline ? "baseline" : "mismatched") << "image for:" << item.itemName << "Storing in" << prefix; + + QString msg; + if (isBaseline) + msg = QLS("New baseline image stored: ") + pathForItem(item, true, true) + QLS(FileFormat); + else + msg = BaselineServer::baseUrl() + report.filePath(); + proto.sendBlock(BaselineProtocol::Ack, msg.toLatin1()); + + QString dir = prefix.section(QLC('/'), 0, -2); + QDir cwd; + if (!cwd.exists(dir)) + cwd.mkpath(dir); + item.image.save(prefix + QLS(FileFormat), FileFormat); + + PlatformInfo itemData = plat; + itemData.insert(PI_ImageChecksum, QString::number(item.imageChecksums.at(0), 16)); //# Only the first is stored. TBD: get rid of list + itemData.insert(PI_RunId, runId); + itemData.insert(PI_CreationDate, QDateTime::currentDateTime().toString()); + storeItemMetadata(itemData, prefix); + + if (!isBaseline) + report.addMismatch(item); +} + + +void BaselineHandler::storeItemMetadata(const PlatformInfo &metadata, const QString &path) +{ + QFile file(path + QLS(MetadataFileExt)); + if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + qWarning() << runId << logtime() << "ERROR: could not write to file" << file.fileName(); + return; + } + QTextStream out(&file); + PlatformInfo::const_iterator it = metadata.constBegin(); + while (it != metadata.constEnd()) { + out << it.key() << ": " << it.value() << endl; + ++it; + } + file.close(); +} + + +PlatformInfo BaselineHandler::fetchItemMetadata(const QString &path) +{ + PlatformInfo res; + QFile file(path + QLS(MetadataFileExt)); + if (!file.open(QIODevice::ReadOnly)) + return res; + QTextStream in(&file); + do { + QString line = in.readLine(); + int idx = line.indexOf(QLS(": ")); + if (idx > 0) + res.insert(line.left(idx), line.mid(idx+2)); + } while (!in.atEnd()); + return res; +} + + +void BaselineHandler::receiveDisconnect() +{ + qDebug() << runId << logtime() << "Client disconnected."; + report.end(); + QThread::currentThread()->exit(0); +} + + +void BaselineHandler::mapPlatformInfo() const +{ + mapped = plat; + + // Map hostname + QString host = plat.value(PI_HostName).section(QLC('.'), 0, 0); // Filter away domain, if any + if (host.isEmpty() || host == QLS("localhost")) { + host = plat.value(PI_HostAddress); + } else { + if (!plat.value(PI_PulseGitBranch).isEmpty()) { + // i.e. pulse run, so remove index postfix typical of vm hostnames + host.remove(QRegExp(QLS("\\d+$"))); + if (host.endsWith(QLC('-'))) + host.chop(1); + } + } + if (host.isEmpty()) + host = QLS("unknownhost"); + mapped.insert(PI_HostName, host); + + // Map qmakespec + QString mkspec = plat.value(PI_QMakeSpec); + mapped.insert(PI_QMakeSpec, mkspec.replace(QLC('/'), QLC('_'))); + + // Map Qt version + QString ver = plat.value(PI_QtVersion); + mapped.insert(PI_QtVersion, ver.prepend(QLS("Qt-"))); +} + +QString BaselineHandler::pathForItem(const ImageItem &item, bool isBaseline, bool absolute) const +{ + if (mapped.isEmpty()) + mapPlatformInfo(); + + QString itemName = item.itemName.simplified(); + itemName.replace(QLC(' '), QLC('_')); + itemName.replace(QLC('.'), QLC('_')); + itemName.append(QLC('_')); + itemName.append(QString::number(item.itemChecksum, 16).rightJustified(4, QLC('0'))); + + QStringList path; + if (absolute) + path += BaselineServer::storagePath(); + path += mapped.value(PI_TestCase); + path += QLS(isBaseline ? "baselines" : "mismatches"); + path += item.testFunction; + path += mapped.value(PI_QtVersion); + path += mapped.value(PI_QMakeSpec); + path += mapped.value(PI_HostName); + if (!isBaseline) + path += runId; + path += itemName + QLC('.'); + + return path.join(QLS("/")); +} + + +QString BaselineHandler::view(const QString &baseline, const QString &rendered, const QString &compared) +{ + QFile f(":/templates/view.html"); + f.open(QIODevice::ReadOnly); + return QString::fromLatin1(f.readAll()).arg('/'+baseline, '/'+rendered, '/'+compared); +} + + +QString BaselineHandler::clearAllBaselines(const QString &context) +{ + int tot = 0; + int failed = 0; + QDirIterator it(BaselineServer::storagePath() + QLC('/') + context, + QStringList() << QLS("*.") + QLS(FileFormat) << QLS("*.") + QLS(MetadataFileExt)); + while (it.hasNext()) { + tot++; + if (!QFile::remove(it.next())) + failed++; + } + return QString(QLS("%1 of %2 baselines cleared from context ")).arg((tot-failed)/2).arg(tot/2) + context; +} + +QString BaselineHandler::updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile) +{ + int tot = 0; + int failed = 0; + QString storagePrefix = BaselineServer::storagePath() + QLC('/'); + // If itemId is set, update just that one, otherwise, update all: + QString filter = itemFile.isEmpty() ? QLS("*_????.") : itemFile; + QDirIterator it(storagePrefix + mismatchContext, QStringList() << filter + QLS(FileFormat) << filter + QLS(MetadataFileExt)); + while (it.hasNext()) { + tot++; + it.next(); + QString oldFile = storagePrefix + context + QLC('/') + it.fileName(); + QFile::remove(oldFile); // Remove existing baseline file + if (!QFile::copy(it.filePath(), oldFile)) // and replace it with the mismatch + failed++; + } + return QString(QLS("%1 of %2 baselines updated in context %3 from context %4")).arg((tot-failed)/2).arg(tot/2).arg(context, mismatchContext); +} + +QString BaselineHandler::blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist) +{ + QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST")); + QStringList blackList; + if (file.open(QIODevice::ReadWrite)) { + while (!file.atEnd()) + blackList.append(file.readLine().trimmed()); + + if (removeFromBlacklist) + blackList.removeAll(itemId); + else if (!blackList.contains(itemId)) + blackList.append(itemId); + + file.resize(0); + foreach (QString id, blackList) + file.write(id.toLatin1() + '\n'); + file.close(); + return QLS(removeFromBlacklist ? "Whitelisted " : "Blacklisted ") + itemId + QLS(" in context ") + context; + } else { + return QLS("Unable to update blacklisted tests, failed to open ") + file.fileName(); + } +} + + +void BaselineHandler::testPathMapping() +{ + qDebug() << "Storage prefix:" << BaselineServer::storagePath(); + + QStringList hosts; + hosts << QLS("bq-ubuntu910-x86-01") + << QLS("bq-ubuntu910-x86-15") + << QLS("osl-mac-master-5.test.qt.nokia.com") + << QLS("osl-mac-master-6.test.qt.nokia.com") + << QLS("sv-xp-vs-010") + << QLS("sv-xp-vs-011") + << QLS("sv-solaris-sparc-008") + << QLS("macbuilder-02.test.troll.no") + << QLS("bqvm1164") + << QLS("chimera") + << QLS("localhost") + << QLS(""); + + ImageItem item; + item.testFunction = QLS("testPathMapping"); + item.itemName = QLS("arcs.qps"); + item.imageChecksums << 0x0123456789abcdefULL; + item.itemChecksum = 0x0123; + + plat.insert(PI_QtVersion, QLS("5.0.0")); + plat.insert(PI_BuildKey, QLS("(nobuildkey)")); + plat.insert(PI_QMakeSpec, QLS("linux-g++")); + plat.insert(PI_PulseGitBranch, QLS("somebranch")); + foreach(const QString& host, hosts) { + mapped.clear(); + plat.insert(PI_HostName, host); + qDebug() << "Baseline from" << host << "->" << pathForItem(item, true); + qDebug() << "Mismatch from" << host << "->" << pathForItem(item, false); + } +} + + +QString BaselineHandler::computeMismatchScore(const QImage &baseline, const QImage &rendered) +{ + if (baseline.size() != rendered.size() || baseline.format() != rendered.format()) + return QLS("[No score, incomparable images.]"); + if (baseline.depth() != 32) + return QLS("[Score computation not implemented for format.]"); + + int w = baseline.width(); + int h = baseline.height(); + + uint ncd = 0; // number of differing color pixels + uint nad = 0; // number of differing alpha pixels + uint scd = 0; // sum of color pixel difference + uint sad = 0; // sum of alpha pixel difference + + for (int y=0; y +#include +#include +#include +#include +#include +#include +#include + +#include "baselineprotocol.h" +#include "report.h" + +// #seconds between update checks +#define HEARTBEAT 10 +#define MetadataFileExt "metadata" + +class BaselineServer : public QTcpServer +{ + Q_OBJECT + +public: + BaselineServer(QObject *parent = 0); + + static QString storagePath(); + static QString baseUrl(); + static QString settingsFilePath(); + +protected: + void incomingConnection(int socketDescriptor); + +private slots: + void heartbeat(); + +private: + QTimer *heartbeatTimer; + QDateTime meLastMod; + QString lastRunId; + int lastRunIdIdx; + static QString storage; + static QString url; + static QString settingsFile; +}; + + + +class BaselineThread : public QThread +{ + Q_OBJECT + +public: + BaselineThread(const QString &runId, int socketDescriptor, QObject *parent); + void run(); + +private: + QString runId; + int socketDescriptor; +}; + + +class BaselineHandler : public QObject +{ + Q_OBJECT + +public: + BaselineHandler(const QString &runId, int socketDescriptor = -1); + void testPathMapping(); + QString pathForItem(const ImageItem &item, bool isBaseline = true, bool absolute = true) const; + + // CGI callbacks: + static QString view(const QString &baseline, const QString &rendered, const QString &compared); + static QString clearAllBaselines(const QString &context); + static QString updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile); + static QString blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist = false); + +private slots: + void receiveRequest(); + void receiveDisconnect(); + +private: + bool establishConnection(); + void provideBaselineChecksums(const QByteArray &itemListBlock); + void storeImage(const QByteArray &itemBlock, bool isBaseline); + void storeItemMetadata(const PlatformInfo &metadata, const QString &path); + PlatformInfo fetchItemMetadata(const QString &path); + void mapPlatformInfo() const; + const char *logtime(); + QString computeMismatchScore(const QImage& baseline, const QImage& rendered); + + BaselineProtocol proto; + PlatformInfo plat; + mutable PlatformInfo mapped; + QString runId; + bool connectionEstablished; + Report report; + QSettings *settings; +}; + +#endif // BASELINESERVER_H diff --git a/tests/baselineserver/src/baselineserver.pro b/tests/baselineserver/src/baselineserver.pro new file mode 100644 index 0000000000..b59d59d1ed --- /dev/null +++ b/tests/baselineserver/src/baselineserver.pro @@ -0,0 +1,30 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2010-08-11T11:51:09 +# +#------------------------------------------------- + +QT += core network + +# gui needed for QImage +# QT -= gui + +TARGET = baselineserver +DESTDIR = ../bin +CONFIG += console +CONFIG -= app_bundle + +TEMPLATE = app + +include(../shared/baselineprotocol.pri) + +SOURCES += main.cpp \ + baselineserver.cpp \ + report.cpp + +HEADERS += \ + baselineserver.h \ + report.h + +RESOURCES += \ + baselineserver.qrc diff --git a/tests/baselineserver/src/baselineserver.qrc b/tests/baselineserver/src/baselineserver.qrc new file mode 100644 index 0000000000..b5cd6afadb --- /dev/null +++ b/tests/baselineserver/src/baselineserver.qrc @@ -0,0 +1,5 @@ + + + templates/view.html + + diff --git a/tests/baselineserver/src/main.cpp b/tests/baselineserver/src/main.cpp new file mode 100644 index 0000000000..8e5fa4e669 --- /dev/null +++ b/tests/baselineserver/src/main.cpp @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include "baselineserver.h" + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + + QString queryString(qgetenv("QUERY_STRING")); + if (!queryString.isEmpty()) { + // run as CGI script + Report::handleCGIQuery(queryString); + return 0; + } + + if (a.arguments().contains(QLatin1String("-testmapping"))) { + BaselineHandler h(QLS("SomeRunId")); + h.testPathMapping(); + return 0; + } + + BaselineServer server; + if (!server.listen(QHostAddress::Any, BaselineProtocol::ServerPort)) { + qWarning("Failed to listen!"); + return 1; + } + + qDebug() << "\n*****" << argv[0] << "started, ready to serve on port" << BaselineProtocol::ServerPort + << "with baseline protocol version" << BaselineProtocol::ProtocolVersion << "*****\n"; + return a.exec(); +} diff --git a/tests/baselineserver/src/report.cpp b/tests/baselineserver/src/report.cpp new file mode 100644 index 0000000000..7c2d6ac6df --- /dev/null +++ b/tests/baselineserver/src/report.cpp @@ -0,0 +1,311 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "report.h" +#include "baselineprotocol.h" +#include "baselineserver.h" +#include +#include +#include + +Report::Report() + : written(false), numItems(0), numMismatches(0) +{ +} + +Report::~Report() +{ + end(); +} + +QString Report::filePath() +{ + return path; +} + +void Report::init(const BaselineHandler *h, const QString &r, const PlatformInfo &p) +{ + handler = h; + runId = r; + plat = p; + rootDir = BaselineServer::storagePath() + QLC('/'); + reportDir = plat.value(PI_TestCase) + QLC('/') + (plat.value(PI_PulseGitBranch).isEmpty() ? QLS("reports/adhoc/") : QLS("reports/pulse/")); + QString dir = rootDir + reportDir; + QDir cwd; + if (!cwd.exists(dir)) + cwd.mkpath(dir); + path = reportDir + QLS("Report_") + runId + QLS(".html"); +} + +void Report::addItems(const ImageItemList &items) +{ + if (items.isEmpty()) + return; + numItems += items.size(); + QString func = items.at(0).testFunction; + if (!testFunctions.contains(func)) + testFunctions.append(func); + itemLists[func] += items; +} + +void Report::addMismatch(const ImageItem &item) +{ + if (!testFunctions.contains(item.testFunction)) { + qWarning() << "Report::addMismatch: unknown testfunction" << item.testFunction; + return; + } + bool found = false; + ImageItemList &list = itemLists[item.testFunction]; + for (ImageItemList::iterator it = list.begin(); it != list.end(); ++it) { + if (it->itemName == item.itemName && it->itemChecksum == item.itemChecksum) { + it->status = ImageItem::Mismatch; + found = true; + break; + } + } + if (found) + numMismatches++; + else + qWarning() << "Report::addMismatch: unknown item" << item.itemName << "in testfunction" << item.testFunction; +} + +void Report::end() +{ + if (written || !numMismatches) + return; + write(); + written = true; +} + + +void Report::write() +{ + QFile file(rootDir + path); + if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + qWarning() << "Failed to open report file" << file.fileName(); + return; + } + out.setDevice(&file); + + writeHeader(); + foreach(const QString &func, testFunctions) { + writeFunctionResults(itemLists.value(func)); + } + writeFooter(); + file.close(); +} + + +void Report::writeHeader() +{ + QString title = plat.value(PI_TestCase) + QLS(" Qt Baseline Test Report"); + out << "" << title << "\n" + << "

" << title << "

\n" + << "

Note: This is a static page, generated at " << QDateTime::currentDateTime().toString() + << " for the test run with id " << runId << "

\n" + << "

Summary: " << numMismatches << " of " << numItems << " items reported mismatching

\n\n"; + out << "

Platform Info:

\n" + << "\n"; + foreach (QString key, plat.keys()) + out << "\n"; + out << "
" << key << "" << plat.value(key) << "
\n\n"; +} + + +void Report::writeFunctionResults(const ImageItemList &list) +{ + QString testFunction = list.at(0).testFunction; + QString pageUrl = BaselineServer::baseUrl() + path; + QString ctx = handler->pathForItem(list.at(0), true, false).section(QLC('/'), 0, -2); + QString misCtx = handler->pathForItem(list.at(0), false, false).section(QLC('/'), 0, -2); + + + out << "\n

 

Test function: " << testFunction << "

\n"; + out << "

Clear all baselines for this testfunction (They will be recreated by the next run)

\n"; + out << "

Let these mismatching images be the new baselines for this testfunction

\n\n"; + + out << "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n\n"; + + foreach (const ImageItem &item, list) { + out << "\n"; + out << "\n"; + QString prefix = handler->pathForItem(item, true, false); + QString baseline = prefix + QLS(FileFormat); + QString metadata = prefix + QLS(MetadataFileExt); + if (item.status == ImageItem::Mismatch) { + QString rendered = handler->pathForItem(item, false, false) + QLS(FileFormat); + QString itemFile = prefix.section(QLC('/'), -1); + writeItem(baseline, rendered, item, itemFile, ctx, misCtx, metadata); + } + else { + out << "\n" + << "\n" + << "\n"; + } + out << "\n\n"; + } + + out << "
ItemBaselineRenderedComparison (diffs are RED)Info/Action
" << item.itemName << "image infon/a"; + switch (item.status) { + case ImageItem::BaselineNotFound: + out << "Baseline not found/regenerated"; + break; + case ImageItem::IgnoreItem: + out << "Blacklisted " + << "Whitelist this item"; + break; + case ImageItem::Ok: + out << "No mismatch reported"; + break; + default: + out << "?"; + break; + } + out << "
\n"; +} + +void Report::writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, + const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata) +{ + QString compared = generateCompared(baseline, rendered); + QString pageUrl = BaselineServer::baseUrl() + path; + + QStringList images = QStringList() << baseline << rendered << compared; + foreach (const QString& img, images) + out << "\n"; + + out << "\n" + << "

Mismatch reported

\n" + << "

Baseline Info\n" + << "

Let this be the new baseline

\n" + << "

Blacklist this item

\n" + << "

Inspect

\n" + << "\n"; +} + +void Report::writeFooter() +{ + out << "\n\n"; +} + + +QString Report::generateCompared(const QString &baseline, const QString &rendered, bool fuzzy) +{ + QString res = rendered; + QFileInfo fi(res); + res.chop(fi.suffix().length() + 1); + res += QLS(fuzzy ? "_fuzzycompared.png" : "_compared.png"); + QStringList args; + if (fuzzy) + args << QLS("-fuzz") << QLS("5%"); + args << rootDir+baseline << rootDir+rendered << rootDir+res; + QProcess::execute(QLS("compare"), args); + return res; +} + + +QString Report::generateThumbnail(const QString &image) +{ + QString res = image; + QFileInfo imgFI(rootDir+image); + res.chop(imgFI.suffix().length() + 1); + res += QLS("_thumbnail.jpg"); + QFileInfo resFI(rootDir+res); + if (resFI.exists() && resFI.lastModified() > imgFI.lastModified()) + return res; + QStringList args; + args << rootDir+image << QLS("-resize") << QLS("240x240>") << QLS("-quality") << QLS("50") << rootDir+res; + QProcess::execute(QLS("convert"), args); + return res; +} + + +void Report::handleCGIQuery(const QString &query) +{ + QUrl cgiUrl(QLS("http://dummy/cgi-bin/dummy.cgi?") + query); + QTextStream s(stdout); + s << "Content-Type: text/html\r\n\r\n" + << ""; + + QString command(cgiUrl.queryItemValue("cmd")); + + if (command == QLS("view")) { + s << BaselineHandler::view(cgiUrl.queryItemValue(QLS("baseline")), + cgiUrl.queryItemValue(QLS("rendered")), + cgiUrl.queryItemValue(QLS("compared"))); + } + else if (command == QLS("updateSingleBaseline")) { + s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")), + cgiUrl.queryItemValue(QLS("mismatchContext")), + cgiUrl.queryItemValue(QLS("itemFile"))); + } else if (command == QLS("updateAllBaselines")) { + s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")), + cgiUrl.queryItemValue(QLS("mismatchContext")), + QString()); + } else if (command == QLS("clearAllBaselines")) { + s << BaselineHandler::clearAllBaselines(cgiUrl.queryItemValue(QLS("context"))); + } else if (command == QLS("blacklist")) { + // blacklist a test + s << BaselineHandler::blacklistTest(cgiUrl.queryItemValue(QLS("context")), + cgiUrl.queryItemValue(QLS("itemId"))); + } else if (command == QLS("whitelist")) { + // whitelist a test + s << BaselineHandler::blacklistTest(cgiUrl.queryItemValue(QLS("context")), + cgiUrl.queryItemValue(QLS("itemId")), true); + } else { + s << "Unknown query:
" << query << "
"; + } + s << "

Back to report"; + s << ""; +} diff --git a/tests/baselineserver/src/report.h b/tests/baselineserver/src/report.h new file mode 100644 index 0000000000..d21102d32f --- /dev/null +++ b/tests/baselineserver/src/report.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef REPORT_H +#define REPORT_H + +#include "baselineprotocol.h" +#include +#include +#include +#include + +class BaselineHandler; + +class Report +{ +public: + Report(); + ~Report(); + + void init(const BaselineHandler *h, const QString &r, const PlatformInfo &p); + void addItems(const ImageItemList& items); + void addMismatch(const ImageItem& item); + void end(); + + QString filePath(); + + static void handleCGIQuery(const QString &query); + +private: + void write(); + void writeFunctionResults(const ImageItemList &list); + void writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, + const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata); + void writeHeader(); + void writeFooter(); + QString generateCompared(const QString &baseline, const QString &rendered, bool fuzzy = false); + QString generateThumbnail(const QString &image); + + const BaselineHandler *handler; + QString runId; + PlatformInfo plat; + QString rootDir; + QString reportDir; + QString path; + QStringList testFunctions; + QMap itemLists; + bool written; + int numItems; + int numMismatches; + QTextStream out; +}; + +#endif // REPORT_H diff --git a/tests/baselineserver/src/templates/view.html b/tests/baselineserver/src/templates/view.html new file mode 100644 index 0000000000..c048f4781c --- /dev/null +++ b/tests/baselineserver/src/templates/view.html @@ -0,0 +1,79 @@ +

Lancelot Viewer

+ +

+Zoom: +1x +2x +4x +

+ +

+ + + + + + + + + + + + +
Baseline%1
Rendered%2
Differences

+ + +

+ +

+ + diff --git a/tests/manual/lance/README b/tests/manual/lance/README new file mode 100644 index 0000000000..6e89b29b08 --- /dev/null +++ b/tests/manual/lance/README @@ -0,0 +1,6 @@ +The "lance" tool can be used to edit and run QPainter script (.qps) +files. They are used in the "lancelot" qpainter regression autotest. +A collection of scripts can be found in the directory +tests/auto/lancelot/scripts + +See lance -help for options. diff --git a/tests/manual/lance/enum.png b/tests/manual/lance/enum.png new file mode 100644 index 0000000000..ae19bd49b0 Binary files /dev/null and b/tests/manual/lance/enum.png differ diff --git a/tests/manual/lance/icons.qrc b/tests/manual/lance/icons.qrc new file mode 100644 index 0000000000..bf0f12d845 --- /dev/null +++ b/tests/manual/lance/icons.qrc @@ -0,0 +1,6 @@ + + + enum.png + tools.png + + diff --git a/tests/manual/lance/interactivewidget.cpp b/tests/manual/lance/interactivewidget.cpp new file mode 100644 index 0000000000..f7bc67ea0b --- /dev/null +++ b/tests/manual/lance/interactivewidget.cpp @@ -0,0 +1,202 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "interactivewidget.h" +#include + +InteractiveWidget::InteractiveWidget() +{ + m_onScreenWidget = new OnScreenWidget(""); + m_onScreenWidget->setMinimumSize(320, 240); + + setCentralWidget(m_onScreenWidget); + + ui_textEdit = new QTextEdit(); + ui_textEdit->installEventFilter(this); + + QWidget *panelContent = new QWidget(); + QVBoxLayout *vlayout = new QVBoxLayout(panelContent); + vlayout->setMargin(0); + vlayout->setSpacing(0); + + // create and populate the command toolbox + m_commandsToolBox = new QToolBox(); + QListWidget *currentListWidget = 0; + foreach (PaintCommands::PaintCommandInfos paintCommandInfo, PaintCommands::s_commandInfoTable) { + if (paintCommandInfo.isSectionHeader()) { + currentListWidget = new QListWidget(); + m_commandsToolBox->addItem(currentListWidget, QIcon(":/icons/tools.png"), "commands - "+paintCommandInfo.identifier); + connect(currentListWidget, SIGNAL(itemActivated(QListWidgetItem*)), SLOT(cmdSelected(QListWidgetItem*))); + } else { + (new QListWidgetItem(paintCommandInfo.identifier, currentListWidget))->setToolTip(paintCommandInfo.syntax); + } + } + + // create and populate the enumerations toolbox + m_enumsToolBox = new QToolBox(); + typedef QPair EnumListType; + foreach (EnumListType enumInfos, PaintCommands::s_enumsTable) { + currentListWidget = new QListWidget(); + m_commandsToolBox->addItem(currentListWidget, QIcon(":/icons/enum.png"), "enums - "+enumInfos.first); + connect(currentListWidget, SIGNAL(itemActivated(QListWidgetItem*)), SLOT(enumSelected(QListWidgetItem*))); + foreach (QString enumItem, enumInfos.second) + new QListWidgetItem(enumItem, currentListWidget); + } + + // add other widgets and layout + vlayout->addWidget(m_commandsToolBox); + vlayout->addWidget(m_enumsToolBox); + + QPushButton *run = new QPushButton("&Run"); + QPushButton *load = new QPushButton("&Load"); + QPushButton *save = new QPushButton("&Save"); + run->setFocusPolicy(Qt::NoFocus); + + vlayout->addSpacing(20); + vlayout->addWidget(run); + vlayout->addWidget(load); + vlayout->addWidget(save); + + QDockWidget *panel = new QDockWidget("Commands"); + panel->setWidget(panelContent); + addDockWidget(Qt::LeftDockWidgetArea, panel); + + QDockWidget *editor = new QDockWidget("Editor"); + editor->setWidget(ui_textEdit); + addDockWidget(Qt::RightDockWidgetArea, editor); + + // connect gui signals + connect(run, SIGNAL(clicked()), SLOT(run())); + connect(load, SIGNAL(clicked()), SLOT(load())); + connect(save, SIGNAL(clicked()), SLOT(save())); +} + +/***************************************************************************************************/ +void InteractiveWidget::run() +{ + m_onScreenWidget->m_commands.clear(); + QString script = ui_textEdit->toPlainText(); + QStringList lines = script.split("\n"); + for (int i = 0; i < lines.size(); ++i) + m_onScreenWidget->m_commands.append(lines.at(i)); + m_onScreenWidget->repaint(); +} + +/***************************************************************************************************/ +void InteractiveWidget::cmdSelected(QListWidgetItem *item) +{ + if (ui_textEdit->textCursor().atBlockStart()) { + ui_textEdit->insertPlainText(PaintCommands::findCommandById(item->text())->sample + "\n"); + } else { + ui_textEdit->moveCursor(QTextCursor::EndOfLine); + ui_textEdit->insertPlainText("\n" + PaintCommands::findCommandById(item->text())->sample); + } + ui_textEdit->setFocus(); +} + +/***************************************************************************************************/ +void InteractiveWidget::enumSelected(QListWidgetItem *item) +{ + ui_textEdit->insertPlainText(item->text()); + ui_textEdit->setFocus(); +} + +/***************************************************************************************************/ +void InteractiveWidget::load() +{ + QString fname = QFileDialog::getOpenFileName( + this, + QString("Load QPaintEngine Script"), + QFileInfo(m_filename).absoluteFilePath(), + QString("QPaintEngine Script (*.qps);;All files (*.*)")); + + load(fname); +} + +/***************************************************************************************************/ +void InteractiveWidget::load(const QString &fname) +{ + if (!fname.isEmpty()) { + m_filename = fname; + ui_textEdit->clear(); + QFile file(fname); + file.open(QIODevice::ReadOnly | QIODevice::Text); + QTextStream textFile(&file); + QString script = textFile.readAll(); + ui_textEdit->setPlainText(script); + m_onScreenWidget->m_filename = fname; + } +} + +/***************************************************************************************************/ +void InteractiveWidget::save() +{ + QString script = ui_textEdit->toPlainText(); + if (!script.endsWith("\n")) + script += QString("\n"); + QString fname = QFileDialog::getSaveFileName(this, + QString("Save QPaintEngine Script"), + QFileInfo(m_filename).absoluteFilePath(), + QString("QPaintEngine Script (*.qps);;All files (*.*)")); + if (!fname.isEmpty()) { + m_filename = fname; + QFile file(fname); + file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); + QTextStream textFile(&file); + textFile << script; + m_onScreenWidget->m_filename = fname; + } +} + +/***************************************************************************************************/ +bool InteractiveWidget::eventFilter(QObject *o, QEvent *e) +{ + if (qobject_cast(o) && e->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(e); + if (ke->key() == Qt::Key_Tab) { + m_commandsToolBox->currentWidget()->setFocus(); + return true; + } else if (ke->key() == Qt::Key_Return && ke->modifiers() == Qt::ControlModifier) { + run(); + return true; + } + } + return false; +} diff --git a/tests/manual/lance/interactivewidget.h b/tests/manual/lance/interactivewidget.h new file mode 100644 index 0000000000..f5e91c87dc --- /dev/null +++ b/tests/manual/lance/interactivewidget.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef INTERACTIVEWIDGET_H +#define INTERACTIVEWIDGET_H + +#include "widgets.h" +#include "paintcommands.h" + +#include + +#include + +QT_FORWARD_DECLARE_CLASS(QToolBox) + +class InteractiveWidget : public QMainWindow +{ + Q_OBJECT +public: + InteractiveWidget(); + +public slots: + void run(); + void load(); + void load(const QString &fname); + void save(); + +protected: + bool eventFilter(QObject *o, QEvent *e); + +protected slots: + void cmdSelected(QListWidgetItem *item); + void enumSelected(QListWidgetItem *item); + +private: + QToolBox *m_commandsToolBox; + QToolBox *m_enumsToolBox; + OnScreenWidget *m_onScreenWidget; + QTextEdit *ui_textEdit; + QString m_filename; +}; + +#endif diff --git a/tests/manual/lance/lance.pro b/tests/manual/lance/lance.pro new file mode 100644 index 0000000000..a3fa27f77f --- /dev/null +++ b/tests/manual/lance/lance.pro @@ -0,0 +1,26 @@ +LANCELOT_DIR = $$PWD/../../auto/lancelot +CONFIG+=console moc +TEMPLATE = app +INCLUDEPATH += . $$LANCELOT_DIR +QT += core-private gui-private + +# Input +HEADERS += widgets.h \ + interactivewidget.h \ + $$LANCELOT_DIR/paintcommands.h +SOURCES += interactivewidget.cpp \ + main.cpp \ + $$LANCELOT_DIR/paintcommands.cpp +RESOURCES += icons.qrc \ + $$LANCELOT_DIR/images.qrc + +contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl + +symbian*: { + testData.files = $$QT_BUILD_TREE/tests/auto/lancelot/scripts + testData.path = . + DEPLOYMENT += testData +} + + + diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp new file mode 100644 index 0000000000..f63ac7a367 --- /dev/null +++ b/tests/manual/lance/main.cpp @@ -0,0 +1,670 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "interactivewidget.h" +#include "widgets.h" +#include "paintcommands.h" + +#include +#include +#include +#include + +#include + +#ifdef USE_CUSTOM_DEVICE +#include "customdevice.h" +#endif + +#ifndef QT_NO_OPENGL +#include +#include +#endif + +// #define DO_QWS_DEBUGGING + +#ifdef DO_QWS_DEBUGGING +extern bool qt_show_painter_debug_output = false; +#endif + +//#define CONSOLE_APPLICATION + +static const struct { + const char *name; + QImage::Format format; +} imageFormats[] = { + { "mono", QImage::Format_Mono }, + { "monolsb", QImage::Format_MonoLSB }, + { "indexed8", QImage::Format_Indexed8 }, + { "rgb32", QImage::Format_RGB32 }, + { "argb32", QImage::Format_ARGB32 }, + { "argb32_premultiplied", QImage::Format_ARGB32_Premultiplied }, + { "rgb16", QImage::Format_RGB16 }, + { "argb8565_premultiplied", QImage::Format_ARGB8565_Premultiplied }, + { "rgb666", QImage::Format_RGB666 }, + { "argb6666_premultiplied", QImage::Format_ARGB6666_Premultiplied }, + { "rgb555", QImage::Format_RGB555 }, + { "argb8555_premultiplied", QImage::Format_ARGB8555_Premultiplied }, + { "rgb888", QImage::Format_RGB888 }, + { "rgb444", QImage::Format_RGB444 }, + { "argb4444_premultiplied", QImage::Format_ARGB4444_Premultiplied } +}; + +static void printHelp() +{ + printf("\nUsage:\n\n" + " paintcmd [options] files\n" + "\n" + " Options:\n" + " -widget Paints the files to a widget on screen\n" + " -pixmap Paints the files to a pixmap\n" + " -bitmap Paints the files to a bitmap\n" + " -image Paints the files to an image\n" + " -imageformat Set the format of the image when painting to an image\n" + " -imagemono Paints the files to a monochrome image\n" + " -imagewidget same as image, but with interacion...\n" +#ifndef QT_NO_OPENGL + " -opengl Paints the files to an OpenGL on screen\n" +#endif +#ifdef USE_CUSTOM_DEVICE + " -customdevice Paints the files to the custom paint device\n" + " -customwidget Paints the files to a custom widget on screen\n" +#endif + " -pdf Paints to a pdf\n" + " -ps Paints to a ps\n" + " -picture Prints into a picture, then shows the result in a label\n" + " -printer Prints the commands to a file called output.ps|pdf\n" + " -highres Prints in highres mode\n" + " -printdialog Opens a print dialog, then prints to the selected printer\n" + " -grab Paints the files to an image called filename_qps.png\n" + " -i Interactive mode.\n" + " -v Verbose.\n" + " -bg-white No checkers background\n" + " -commands Displays all available commands\n"); +} + +static void displayCommands() +{ + printf("Drawing operations:\n" + " drawArc x y width height angle sweep\n" + " drawChord x y width height angle sweep\n" + " drawEllipse x y width height\n" + " drawLine x1 y1 x2 y2\n" + " drawPath pathname\n" + " drawPie x y width height angle sweep\n" + " drawPixmap pixmapfile x y width height sx sy sw sh\n" + " drawPolygon [ x1 y1 x2 y2 ... ] winding|oddeven\n" + " drawPolyline [ x1 y1 x2 y2 ... ]\n" + " drawRect x y width height\n" + " drawRoundRect x y width height xfactor yfactor\n" + " drawText x y \"text\"\n" + " drawTiledPixmap pixmapfile x y width height sx sy\n" + "\n" + "Path commands:\n" + " path_addEllipse pathname x y width height\n" + " path_addPolygon pathname [ x1 y1 x2 y2 ... ] winding?\n" + " path_addRect pathname x y width height\n" + " path_addText pathname x y \"text\" Uses current font\n" + " path_arcTo pathname x y width hegiht\n" + " path_closeSubpath pathname\n" + " path_createOutline pathname newoutlinename Uses current pen\n" + " path_cubicTo pathname c1x c1y c2x c2y endx endy\n" + " path_lineTo pathname x y\n" + " path_moveTo pathname x y\n" + " path_setFillRule pathname winding?\n" + "\n" + "Painter configuration:\n" + " resetMatrix\n" + " restore\n" + " save\n" + " rotate degrees\n" + " translate dx dy\n" + " scale sx sy\n" + " mapQuadToQuad x0 y0 x1 y1 x2 y2 x3 y3 x4 y4 x5 y5 x6 y6 x7 y7" + " setMatrix m11 m12 m13 m21 m22 m23 m31 m32 m33" + " setBackground color pattern?\n" + " setBackgroundMode TransparentMode|OpaqueMode\n" + " setBrush pixmapfile\n" + " setBrush nobrush\n" + " setBrush color pattern\n" + " setBrush x1 y1 color1 x2 y2 color2 gradient brush\n" + " setBrushOrigin x y\n" + " setFont \"fontname\" pointsize bold? italic?\n" + " setPen style color\n" + " setPen color width style capstyle joinstyle\n" + " setRenderHint LineAntialiasing\n" + " gradient_clearStops\n" + " gradient_appendStop pos color" + " gradient_setSpread [PadSpread|ReflectSpread|RepeatSpread]\n" + " gradient_setLinear x1 y1 x2 y2\n" + " gradient_setRadial center_x center_y radius focal_x focal_y\n" + " gradient_setConical center_x center_y angle\n" + "\n" + "Clipping commands:\n" + " region_addRect regionname x y width height\n" + " region_getClipRegion regionname\n" + " setClipRect x y width height\n" + " setClipRegion regionname\n" + " setClipping true|false\n" + " setClipPath pathname\n" + "\n" + "Various commands:\n" + " surface_begin x y width height\n" + " surface_end\n" + " pixmap_load filename name_in_script\n" + " image_load filename name_in_script\n"); +} +static InteractiveWidget *interactive_widget = 0; + +static void runInteractive() +{ + interactive_widget = new InteractiveWidget; + interactive_widget->show(); +} + +static QLabel* createLabel() +{ + QLabel *label = new QLabel; + QPalette palette = label->palette(); + palette.setBrush(QPalette::Window, QBrush(Qt::white)); + label->setPalette(palette); + return label; +} + +int main(int argc, char **argv) +{ +#ifdef CONSOLE_APPLICATION + QApplication app(argc, argv, QApplication::Tty); +#else + QApplication app(argc, argv); +#endif +#ifdef DO_QWS_DEBUGGING + qt_show_painter_debug_output = false; +#endif + + DeviceType type = WidgetType; + bool checkers_background = true; + + QImage::Format imageFormat = QImage::Format_ARGB32_Premultiplied; + + QLocale::setDefault(QLocale::c()); + + QStringList files; + + bool interactive = false; + bool printdlg = false; + bool highres = false; + bool show_cmp = false; + int width = 800, height = 800; + bool verboseMode = false; + +#ifndef QT_NO_OPENGL + QGLFormat f = QGLFormat::defaultFormat(); + f.setSampleBuffers(true); + f.setStencil(true); + f.setAlpha(true); + f.setAlphaBufferSize(8); + QGLFormat::setDefaultFormat(f); +#endif + + char *arg; + for (int i=1; i= 0) { + QFileInfo info(input); + QDir dir = info.dir(); + QFileInfoList infos = dir.entryInfoList(QStringList(info.fileName())); + for (int ii=0; iiload(files.at(0)); + } else if (files.isEmpty()) { + printHelp(); + return 0; + } else { + for (int j=0; jsetWindowTitle("VERIFY: " + pmFile); + label->setPixmap(pixmap); + label->show(); + } + } + + switch (type) { + + case WidgetType: + { + OnScreenWidget *qWidget = + new OnScreenWidget(files.at(j)); + qWidget->setVerboseMode(verboseMode); + qWidget->setType(type); + qWidget->setCheckersBackground(checkers_background); + qWidget->m_commands = content; + qWidget->resize(width, height); + qWidget->show(); + activeWidget = qWidget; + break; + } + + case ImageWidgetType: + { + OnScreenWidget *qWidget = new OnScreenWidget(files.at(j)); + qWidget->setVerboseMode(verboseMode); + qWidget->setType(type); + qWidget->setCheckersBackground(checkers_background); + qWidget->m_commands = content; + qWidget->resize(width, height); + qWidget->show(); + activeWidget = qWidget; + break; + + } +#ifndef QT_NO_OPENGL + case OpenGLPBufferType: + { + QGLPixelBuffer pbuffer(QSize(width, height)); + QPainter pt(&pbuffer); + pcmd.setPainter(&pt); + pcmd.setFilePath(fileinfo.absolutePath()); + pcmd.runCommands(); + pt.end(); + + QImage image = pbuffer.toImage(); + + QLabel *label = createLabel(); + label->setPixmap(QPixmap::fromImage(image)); + label->resize(label->sizeHint()); + label->show(); + activeWidget = label; + break; + } + case OpenGLType: + { + OnScreenWidget *qGLWidget = new OnScreenWidget(files.at(j)); + qGLWidget->setVerboseMode(verboseMode); + qGLWidget->setType(type); + qGLWidget->setCheckersBackground(checkers_background); + qGLWidget->m_commands = content; + qGLWidget->resize(width, height); + qGLWidget->show(); + activeWidget = qGLWidget; + break; + } +#else + case OpenGLType: + printf("OpenGL type not supported in this Qt build\n"); + break; +#endif +#ifdef USE_CUSTOM_DEVICE + case CustomDeviceType: + { + CustomPaintDevice custom(width, height); + QPainter pt; + pt.begin(&custom); + pcmd.setPainter(&pt); + pcmd.setFilePath(fileinfo.absolutePath()); + pcmd.runCommands(); + pt.end(); + QImage *img = custom.image(); + if (img) { + QLabel *label = createLabel(); + label->setPixmap(QPixmap::fromImage(*img)); + label->resize(label->sizeHint()); + label->show(); + activeWidget = label; + img->save("custom_output_pixmap.png", "PNG"); + } else { + custom.save("custom_output_pixmap.png", "PNG"); + } + break; + } + case CustomWidgetType: + { + OnScreenWidget *cWidget = new OnScreenWidget; + cWidget->setVerboseMode(verboseMode); + cWidget->setType(type); + cWidget->setCheckersBackground(checkers_background); + cWidget->m_filename = files.at(j); + cWidget->setWindowTitle(fileinfo.filePath()); + cWidget->m_commands = content; + cWidget->resize(width, height); + cWidget->show(); + activeWidget = cWidget; + break; + } +#endif + case PixmapType: + { + QPixmap pixmap(width, height); + pixmap.fill(Qt::white); + QPainter pt(&pixmap); + pcmd.setPainter(&pt); + pcmd.setFilePath(fileinfo.absolutePath()); + pcmd.runCommands(); + pt.end(); + pixmap.save("output_pixmap.png", "PNG"); + break; + } + + case BitmapType: + { + QBitmap bitmap(width, height); + QPainter pt(&bitmap); + pcmd.setPainter(&pt); + pcmd.setFilePath(fileinfo.absolutePath()); + pcmd.runCommands(); + pt.end(); + bitmap.save("output_bitmap.png", "PNG"); + + QLabel *label = createLabel(); + label->setPixmap(bitmap); + label->resize(label->sizeHint()); + label->show(); + activeWidget = label; + break; + } + + case ImageMonoType: + case ImageType: + { + qDebug() << "Creating image"; + QImage image(width, height, type == ImageMonoType + ? QImage::Format_MonoLSB + : imageFormat); + image.fill(0); + QPainter pt(&image); + pcmd.setPainter(&pt); + pcmd.setFilePath(fileinfo.absolutePath()); + pcmd.runCommands(); + pt.end(); + image.convertToFormat(QImage::Format_ARGB32).save("output_image.png", "PNG"); +#ifndef CONSOLE_APPLICATION + QLabel *label = createLabel(); + label->setPixmap(QPixmap::fromImage(image)); + label->resize(label->sizeHint()); + label->show(); + activeWidget = label; +#endif + break; + } + + case PictureType: + { + QPicture pic; + QPainter pt(&pic); + pcmd.setPainter(&pt); + pcmd.setFilePath(fileinfo.absolutePath()); + pcmd.runCommands(); + pt.end(); + + QImage image(width, height, QImage::Format_ARGB32_Premultiplied); + image.fill(0); + pt.begin(&image); + pt.drawPicture(0, 0, pic); + pt.end(); + QLabel *label = createLabel(); + label->setWindowTitle(fileinfo.absolutePath()); + label->setPixmap(QPixmap::fromImage(image)); + label->resize(label->sizeHint()); + label->show(); + activeWidget = label; + break; + } + + case PrinterType: + { +#ifndef QT_NO_PRINTER + PaintCommands pcmd(QStringList(), 800, 800); + pcmd.setVerboseMode(verboseMode); + pcmd.setType(type); + pcmd.setCheckersBackground(checkers_background); + pcmd.setContents(content); + QString file = QString(files.at(j)).replace(".", "_") + ".ps"; + + QPrinter p(highres ? QPrinter::HighResolution : QPrinter::ScreenResolution); + if (printdlg) { + QPrintDialog printDialog(&p, 0); + if (printDialog.exec() != QDialog::Accepted) + break; + } else { + p.setOutputFileName(file); + } + + QPainter pt(&p); + pcmd.setPainter(&pt); + pcmd.setFilePath(fileinfo.absolutePath()); + pcmd.runCommands(); + pt.end(); + + if (!printdlg) { + printf("wrote file: %s\n", qPrintable(file)); + } + + Q_ASSERT(!p.paintingActive()); +#endif + break; + } + case PsType: + case PdfType: + { +#ifndef QT_NO_PRINTER + PaintCommands pcmd(QStringList(), 800, 800); + pcmd.setVerboseMode(verboseMode); + pcmd.setType(type); + pcmd.setCheckersBackground(checkers_background); + pcmd.setContents(content); + bool ps = type == PsType; + QPrinter p(highres ? QPrinter::HighResolution : QPrinter::ScreenResolution); + QFileInfo input(files.at(j)); + QString file = QString("%1_%2.%3") + .arg(input.baseName()) + .arg(input.suffix()) + .arg(ps ? "ps" : "pdf"); + p.setOutputFormat(ps ? QPrinter::PdfFormat : QPrinter::PostScriptFormat); + p.setOutputFileName(file); + p.setPageSize(QPrinter::A4); + QPainter pt(&p); + pcmd.setPainter(&pt); + pcmd.setFilePath(fileinfo.absolutePath()); + pcmd.runCommands(); + pt.end(); + + printf("write file: %s\n", qPrintable(file)); +#endif + break; + } + case GrabType: + { + QImage image(width, height, QImage::Format_ARGB32_Premultiplied); + image.fill(QColor(Qt::white).rgb()); + QPainter pt(&image); + pcmd.setPainter(&pt); + pcmd.setFilePath(fileinfo.absolutePath()); + pcmd.runCommands(); + pt.end(); + QImage image1(width, height, QImage::Format_RGB32); + image1.fill(QColor(Qt::white).rgb()); + QPainter pt1(&image1); + pt1.drawImage(QPointF(0, 0), image); + pt1.end(); + + QString filename = QString(files.at(j)).replace(".qps", "_qps") + ".png"; + image1.save(filename, "PNG"); + printf("%s grabbed to %s\n", qPrintable(files.at(j)), qPrintable(filename)); + break; + } + default: + break; + } + } + } +#ifndef CONSOLE_APPLICATION + if (activeWidget || interactive) { + QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); + app.exec(); + } + delete activeWidget; +#endif + delete interactive_widget; + return 0; +} + diff --git a/tests/manual/lance/tools.png b/tests/manual/lance/tools.png new file mode 100644 index 0000000000..822e1e576e Binary files /dev/null and b/tests/manual/lance/tools.png differ diff --git a/tests/manual/lance/widgets.h b/tests/manual/lance/widgets.h new file mode 100644 index 0000000000..033067d846 --- /dev/null +++ b/tests/manual/lance/widgets.h @@ -0,0 +1,354 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef WIDGETS_H +#define WIDGETS_H + +#include "paintcommands.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + +#include + +const int CP_RADIUS = 10; + +class StupidWorkaround : public QObject +{ + Q_OBJECT +public: + StupidWorkaround(QWidget *widget, int *value) + : QObject(widget), w(widget), mode(value) + { + } + +public slots: + void setViewMode(int m) { + *mode = m; + w->update(); + } + +private: + QWidget *w; + int *mode; +}; + +template +class OnScreenWidget : public T +{ +public: + + enum ViewMode { + RenderView, + BaselineView, + DifferenceView + }; + + OnScreenWidget(const QString &file, QWidget *parent = 0) + : T(parent), + m_filename(file), + m_view_mode(RenderView) + { + QSettings settings("Trolltech", "lance"); + for (int i=0; i<10; ++i) { + QPointF suggestion(100 + i * 40, 100 + 100 * qSin(i * 3.1415 / 10.0)); + m_controlPoints << settings.value("cp" + QString::number(i), suggestion).toPointF(); + } + + m_currentPoint = -1; + m_showControlPoints = false; + m_deviceType = WidgetType; + m_checkersBackground = true; + m_verboseMode = false; + + m_baseline_name = QString(m_filename).replace(".qps", "_qps") + ".png"; + if (QFileInfo(m_baseline_name).exists()) { + m_baseline = QPixmap(m_baseline_name); + } + + if (m_baseline.isNull()) { + T::setWindowTitle("Rendering: '" + file + "'. No baseline available"); + } else { + T::setWindowTitle("Rendering: '" + file + "'. Shortcuts: 1=render, 2=baseline, 3=difference"); + + StupidWorkaround *workaround = new StupidWorkaround(this, &m_view_mode); + + QSignalMapper *mapper = new QSignalMapper(this); + T::connect(mapper, SIGNAL(mapped(int)), workaround, SLOT(setViewMode(int))); + T::connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setWindowTitle(QString))); + + QAction *renderViewAction = new QAction("Render View", this); + renderViewAction->setShortcut(Qt::Key_1); + T::connect(renderViewAction, SIGNAL(triggered()), mapper, SLOT(map())); + mapper->setMapping(renderViewAction, RenderView); + mapper->setMapping(renderViewAction, "Render View: " + file); + T::addAction(renderViewAction); + + QAction *baselineAction = new QAction("Baseline", this); + baselineAction->setShortcut(Qt::Key_2); + T::connect(baselineAction, SIGNAL(triggered()), mapper, SLOT(map())); + mapper->setMapping(baselineAction, BaselineView); + mapper->setMapping(baselineAction, "Baseline View: " + file); + T::addAction(baselineAction); + + QAction *differenceAction = new QAction("Differenfe View", this); + differenceAction->setShortcut(Qt::Key_3); + T::connect(differenceAction, SIGNAL(triggered()), mapper, SLOT(map())); + mapper->setMapping(differenceAction, DifferenceView); + mapper->setMapping(differenceAction, "Difference View" + file); + T::addAction(differenceAction); + + } + + } + + ~OnScreenWidget() + { + QSettings settings("Trolltech", "lance"); + for (int i=0; i<10; ++i) { + settings.setValue("cp" + QString::number(i), m_controlPoints.at(i)); + } + settings.sync(); + } + + void setVerboseMode(bool v) { m_verboseMode = v; } + void setCheckersBackground(bool b) { m_checkersBackground = b; } + void setType(DeviceType t) { m_deviceType = t; } + + void resizeEvent(QResizeEvent *e) { + m_image = QImage(); + T::resizeEvent(e); + } + + void paintEvent(QPaintEvent *) { + switch (m_view_mode) { + case RenderView: paintRenderView(); break; + case BaselineView: paintBaselineView(); break; + case DifferenceView: paintDifferenceView(); break; + } + } + + void paintRenderView() + { + QPainter pt; + QPaintDevice *dev = this; + if (m_deviceType == ImageWidgetType) { + if (m_image.size() != T::size()) + m_image = QImage(T::size(), QImage::Format_ARGB32_Premultiplied); + m_image.fill(0); + dev = &m_image; + } + + pt.begin(dev); + + PaintCommands paintCommands(m_commands, 800, 800); + paintCommands.setVerboseMode(m_verboseMode); + paintCommands.setCheckersBackground(m_checkersBackground); + paintCommands.setType(m_deviceType); + paintCommands.setPainter(&pt); + paintCommands.setControlPoints(m_controlPoints); + paintCommands.setFilePath(QFileInfo(m_filename).absolutePath()); +#ifdef DO_QWS_DEBUGGING + qt_show_painter_debug_output = true; +#endif + pt.save(); + paintCommands.runCommands(); + pt.restore(); +#ifdef DO_QWS_DEBUGGING + qt_show_painter_debug_output = false; +#endif + + pt.end(); + + if (m_deviceType == ImageWidgetType) { + QPainter(this).drawImage(0, 0, m_image); + } + + if (m_currentPoint >= 0 || m_showControlPoints) { + pt.begin(this); + pt.setRenderHint(QPainter::Antialiasing); + pt.setFont(this->font()); + pt.resetMatrix(); + pt.setPen(QColor(127, 127, 127, 191)); + pt.setBrush(QColor(191, 191, 255, 63)); + for (int i=0; iwindowSurface()) + m_render_view = T::window()->windowSurface()->grabWidget(this); + else + m_render_view = QPixmap::grabWidget(this); + + m_render_view.save("renderView.png"); + } + } + + void paintBaselineView() { + QPainter p(this); + + if (m_baseline.isNull()) { + p.drawText(T::rect(), Qt::AlignCenter, + "No baseline found\n" + "file '" + m_baseline_name + "' does not exist..."); + return; + } + + p.drawPixmap(0, 0, m_baseline); + + p.setPen(QColor::fromRgb(0, 0, 0, 0.1)); + p.setFont(QFont("Arial", 128)); + p.rotate(45); + p.drawText(100, 0, "BASELINE"); + } + + QPixmap generateDifference() + { + QImage img(T::size(), QImage::Format_RGB32); + img.fill(0); + + QPainter p(&img); + p.drawPixmap(0, 0, m_render_view); + + p.setCompositionMode(QPainter::RasterOp_SourceXorDestination); + p.drawPixmap(0, 0, m_baseline); + + p.end(); + + return QPixmap::fromImage(img); + } + + void paintDifferenceView() { + QPainter p(this); + if (m_baseline.isNull()) { + p.drawText(T::rect(), Qt::AlignCenter, + "No baseline found\n" + "file '" + m_baseline_name + "' does not exist..."); + return; + } + + p.fillRect(T::rect(), Qt::black); + p.drawPixmap(0, 0, generateDifference()); + } + + + void mouseMoveEvent(QMouseEvent *e) + { + if (m_currentPoint == -1) + return; + if (T::rect().contains(e->pos())) + m_controlPoints[m_currentPoint] = e->pos(); + T::update(); + } + + void mousePressEvent(QMouseEvent *e) + { + if (e->button() == Qt::RightButton) { + m_showControlPoints = true; + } + + if (e->button() == Qt::LeftButton) { + for (int i=0; ipos()).length() < CP_RADIUS) { + m_currentPoint = i; + break; + } + } + } + T::update(); + } + + void mouseReleaseEvent(QMouseEvent *e) + { + if (e->button() == Qt::LeftButton) + m_currentPoint = -1; + if (e->button() == Qt::RightButton) + m_showControlPoints = false; + T::update(); + } + + QSize sizeHint() const { return QSize(800, 800); } + + QVector m_controlPoints; + int m_currentPoint; + bool m_showControlPoints; + + QStringList m_commands; + QString m_filename; + QString m_baseline_name; + + bool m_verboseMode; + bool m_checkersBackground; + DeviceType m_deviceType; + + int m_view_mode; + + QImage m_image; + + QPixmap m_baseline; + QPixmap m_render_view; +}; + +#endif -- cgit v1.2.3