summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add API to enable opt-in aspect ratio feature in QSvgRendererEirik Aavitsland2020-01-281-2/+1
| | | | | | | | | [ChangeLog][QSvgRenderer] Introduced aspect ratio mode property, so that rendering may be set to preserve the view box aspect ratio. Task-number: QTBUG-81259 Change-Id: I9802788cdaf2c30974c1ffc34ad5b67cdc74ed57 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-281-0/+3
|\ | | | | | | Change-Id: I987599c388f414928aabf6a193a8250c27f4f60d
| * Revert the keep-aspectratio feature for 5.14.1v5.14.15.14.1Eirik Aavitsland2020-01-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was introduced as non-optional behavior for 5.14.0, but caused many regressions. This patch reverts that, and instead prepares for introducing it as an opt-in feature in Qt 5.15. [ChangeLog][QSVGRenderer] In Qt 5.14.0, rendering would keep aspect ratio implied by the viewbox, independently of the specified target area. This caused many regressions with existing code, so is reverted now in 5.14.1. The feature will instead be available as an opt-in in Qt 5.15. Task-number: QTBUG-81259 Change-Id: I3efa2db864eb80ee00e8a067e56d9912bab36442 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Don't use deprecated QMatrix class anymoreJarek Kobus2020-01-171-5/+5
| | | | | | | | | | | | Task-number: QTBUG-46653 Change-Id: I9944b62141d7054e3935000a819bebc5fd54df6c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-071-0/+31
|\ \ | |/ | | | | Change-Id: If6bf34ca3216ab9e0866d8c4eea7c4e92a7f3f4d
| * Fix yet another viewbox scaling issue, for render to boundsEirik Aavitsland2020-01-031-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recent introduction of keepAspectRation scaling led to wrong output (outside bounds) in the case of an explicitly specified target bounds rect, i.e. QSVGRenderer::render(QPainter *p, QRectF bounds). Fix by reverting to old code path in this case, i.e. allow the user to override the keepAspectRatio behavior by explicitly specifying target bounds. As a driveby, also fix the keepAspectRatio code path in case of a target rect having non-zero x/y coordinates. Now the fix above means that this will never happen in the code as it stands, but it may come in handy later. [ChangeLog][QSVGRenderer] From Qt 5.14.0, normal rendering will keep aspect ratio implied by the viewbox. The render() methods taking an explicit target bounds QRectF parameter can now be used to override that behavior. They will scale the output to the bounds while ignoring aspect ratio, as was the default rendering prior to 5.14.0. Fixes: QTBUG-80888 Change-Id: I399b05ca50d290b8e4b01bdc47b5b6f74c890c9a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | Fuzzing: Allow linking to other fuzzing enginesRobert Loehning2020-01-031-1/+6
|/ | | | | | | | | | oss-fuzz sets the environment variable LIB_FUZZING_ENGINE to link with AFL or libFuzzer. If this variable is not set, libFuzzer will be used as before, only that the right qmake variable will be used for doing so. Change-Id: I024e1cb460d6777b50947c6622bcefc652c1338d Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Add binary compatibility file for qtsvg 5.14 branchMilla Pohjanheimo2019-12-161-0/+19826
| | | | | | | BC file built against 5.14.0 added. Change-Id: Ib26e7a17413883495ada0fa12c4ad2fd9e066359 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Re-fix scaling when rendering a specific element by idAlessandro Portale2019-11-141-0/+36
| | | | | | | | | | | | | | | | | | | | | This is a modification of 14fa4591eb34a35cf3d485fd901e3f1e2caa7770 That patch corrected the handling of the view box when rendering an entire SVG document. However, contrary to intention stated in the comment of that patch, it turns out that the new viewbox handling code path can be taken also for the case of rendering only a single element by id. Instead, we want to keep the original behavior where the element's origin bounds are transformed to fit into the user requested target bounds, allowing non-proportional scaling. Since the render-single-element case is easily and uniqely identifiable by the sourceRect parameter being non-null, just add an explicit check for that to the code path branching. Done-with: Eirik Aavitsland <eirik.aavitsland@qt.io> Fixes: QTBUG-79933 Change-Id: I64a35bbb193db22c33670b48ea165a91df8e719e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fuzzing: Don't copy input data to QByteArrayRobert Loehning2019-11-121-1/+1
| | | | | Change-Id: Ifb28491916bd30725bc460f7561a62b1933527c7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix rendering of SVG with translating viewBoxEirik Aavitsland2019-11-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is a modification of14fa4591eb34a35cf3d485fd901e3f1e2caa7770. That change correctly implemented support for scaling and centering viewBox. However, the viewBox scaling and x-min/y-min translation was applied in the wrong order, so SVGs with a non-zero x-min/y-min viewBox would be rendered with an offset. The autotest reflected this error, and is also fixed here. (In user space, the black rectangle's upper left corner (0,0) is in the center of the viewBox and so should end up in the center of the produced image, independently of the scaling. All other tested SVG renderers place it there.) This change fixes all the reported regression cases from the above commit, while not re-breaking the original cases fixed by that commit. Fixes: QTBUG-79333 Fixes: QTBUG-78200 Task-number: QTBUG-70256 Change-Id: I0d3394e3caf6ec7edf16a10992c2fbfdac7398e5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-131-0/+19772
|\ | | | | | | Change-Id: I0ac8513a9a0bc6fc0ff03ad27e0f9ca5af1a2fcc
| * Binary compatibility file against Qt5.13.0 for QtSvgMilla Pohjanheimo2019-08-121-0/+19772
| | | | | | | | | | | | | | BC file added Change-Id: I1d0d1950c35244b7968a5217c27ba38f498034d4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-295-20/+22
|\ \ | |/ | | | | Change-Id: I3e08aa8666c4e74b70606a91bc2bc5653fac4003
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-275-20/+22
| |\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: If39eda43ff21d841aaa24ffed8b5793ff1239cce
| | * Android: Skip QSVGRenderer testEskil Abrahamsen Blomfeldt2019-06-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests require access to local file system and are not written to be portable to remote devices. Since there is no real platform-dependency in this, testing them on other platforms is sufficient, so we will just skip it on Android rather than spend time on it. Task-number: QTBUG-73624 Change-Id: Ic11b69d2eb73e0cd264b153c9870dd7923e1336d Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| | * Android: Fix QSVGPlugin testEskil Abrahamsen Blomfeldt2019-06-252-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | Assets have to be included in the resources in order to be accessible when testing on a remote device. Task-number: QTBUG-73625 Change-Id: I80332b6492bffc01c0157918b9e6abbc2b87a43b Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| | * Make QSvgGenerator test pass on AndroidEskil Abrahamsen Blomfeldt2019-05-142-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Platforms like Android require assets to be bundled with the app. We include the reference SVGs as resources to work around this. Task-number: QTBUG-73623 Change-Id: Id9cc7a7d575da5adbe73a3392419fd74a1ec1bbd Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | | Fix rendering of SVGs with viewBoxesSimon Hausmann2019-05-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presence of the viewBox attribute in the svg tag implies the presence of the preserveAspectRatio attribute as well. It defaults to scaling the view box to the view port while preserving the aspect ratio and the box is also centered. This patch does not implement the full preserveAspectRatio attribute, but it does implement the default of aspect ratio preservation and centering, as that is what caused the rendering error in the linked task. This causes some tests in the SVG Tiny 1.2 test suite to differ. This is visible using the rendertestsuite helper program (see other change). In particular it corrects the rendering of struct-svg-203-t.svg to correctly center the text and avoid scaling it. For animate-elem-38-t.svg the rendering improved by making the entire text visible, as in the reference. The same applies to media-video-216-t.svg. In both rendering the scaling changes slightly. Done-With: Rainer Keller <rainer.keller@qt.io> Fixes: QTBUG-70256 Change-Id: I9142c511890765993ee3e316f0383550919fdcd4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Add little helper program for finding visual regressionsSimon Hausmann2019-05-244-0/+176
| | | | | | | | | | | | | | | Change-Id: I0b6c7a7d82d64011fb9b1e2aea5ff0552c719f54 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-041-0/+10
|\ \ \ | |/ / | | | | | | Change-Id: I962bd9762be35f5905367a96a19038eb9b3c7637
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-271-0/+10
| |\ \ | | |/ | | | | | | Change-Id: I4a7a5ad6cd164f0d440217566bd647ecde4fddfb
| | * Fix stack overflow on indirect self-referralAllan Sandfeld Jensen2019-04-241-0/+10
| | | | | | | | | | | | | | | Change-Id: If2b13c3dc4a09ce6d18aff97855179172f92878b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Add libfuzzer test for QSvgRenderer::render()Robert Loehning2019-04-302-0/+45
|/ / | | | | | | | | | | Task-number: QTBUG-74104 Change-Id: I4ce6a9e4ddc51c904af4a9bf4fb14e52fd8a23c8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-201-0/+39
|\ \ | |/ | | | | Change-Id: Id1bdcd52b3c4553e882de825c769bd7643745dce
| * Fix crash for recursive gradient referencesEirik Aavitsland2019-04-021-0/+39
| | | | | | | | | | | | | | | | | | A reference loop with at least three elements would lead to endless recursion. Fixes: QTBUG-74189 Change-Id: Ie3c1b32da0e98e9218dc387dd3210666018a92e1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta1Qt Forward Merge Bot2019-03-091-10/+29
|\ \ | |/ | | | | Change-Id: I53ec3fb5c2aa7aa953628d2ef56fead24ce0160f
| * Fix IRI parsing, and use after freeAllan Sandfeld Jensen2019-03-041-10/+29
| | | | | | | | | | | | | | | | | | | | Make the parsing of IRI references tighter, and avoid freeing styles when inserting a duplicate id. Fixes: QTBUG-74104 Change-Id: I3a12fcf09ce1c55c135a4209817413ed8af75dec Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Fix deprecation warningsv5.13.0-alpha1Friedemann Kleint2019-02-051-6/+6
|/ | | | | | | | | | | | | | | | | Fix: qsvgiconengine.cpp: In member function ‘virtual QPixmap QSvgIconEngine::pixmap(const QSize&, QIcon::Mode, QIcon::State)’: qsvgiconengine.cpp:200:38: warning: ‘static bool QPixmapCache::find(const QString&, QPixmap&)’ is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations] tst_qsvgrenderer.cpp:479:54: warning: ‘const QMatrix& QPainter::worldMatrix() const’ is deprecated: Use worldTransform() instead [-Wdeprecated-declarations] ... glwidget.cpp: In member function ‘void GLWidget::draw()’: glwidget.cpp:231:41: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] glwidget.cpp:232:41: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] fluidlauncher.cpp:71:65: warning: ‘const QRect QDesktopWidget::screenGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations] Change-Id: Iae20d950c3118d05f91202c8020dbd81fa73b48f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Merge remote-tracking branch 'origin/5.12.1' into 5.12Qt Forward Merge Bot2019-02-011-0/+19402
|\ | | | | | | Change-Id: I4b40124deaa859a56442bfd17568f8053368af82
| * Add binary compatibility file for QtSvg for Qt 5.12Milla Pohjanheimo2018-12-181-0/+19402
| | | | | | | | | | | | | | Binary compatibility file added. Change-Id: I6661a0f32ce0c76d8a9d9b8ef6adcd4d89235ea7 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Allow <style> without type attributeChih-Hsuan Yen2019-01-291-0/+22
|/ | | | | | | | | | | | | | According to https://www.w3.org/TR/SVG/styling.html#StyleElement, `type` can be omitted. > If the attribute is not specified, then the style sheet language is assumed to be CSS. Original-Author: Christoph Feck Fixes: QTBUG-58326 Fixes: QTBUG-69378 Change-Id: Ic3d0e8db99da8c81e5a01c0dda33fb38428e38d5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Consider relative path in image tagsLars Schmertmann2018-11-304-0/+66
| | | | | | Task-number: QTBUG-16198 Change-Id: I26bf48cbac39af0fae490ed21579e8de326cd1a3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix parsing of forward referrals in use elementsEirik Aavitsland2018-08-201-5/+40
| | | | | | | | | | SVG <use> elements may refer to a node that is defined later in the file. The parser would then fail to resolve the link. Implement delayed link resolution in the parser to handle such cases. Task-number: QTBUG-69694 Change-Id: I94ffb3511dbd0fac822bb56991415b2d99ccf90e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix crash when parsing malformed url referenceEirik Aavitsland2018-07-301-0/+26
| | | | | | | The parsing did not check for end of input. Change-Id: I56a478877d242146395977b767511425d2b8ced1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove dead test - compilerwarningsLiang Qi2018-06-221-39/+0
| | | | | | | A follow-up of 9d078c8f147ea875e862360b0d7480201fbbcff7 in qtqa repo. Change-Id: Iefdd437266d3c8df0d8814d13ec660aa9cba463a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Add binary compatibility file for 5.11 for QtSvgMilla Pohjanheimo2018-06-051-0/+19337
| | | | | | | Binary compatibility file for bic test added. Change-Id: I78878fa96a9c8bc6960076d4350fa03802911a9b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Interpret width or height specified in percent as relative to viewportFrederik Christiani2018-04-303-0/+18
| | | | | | | | | | | When width or height is specified in percent, it is supposed to be relative to the viewport. https://www.w3.org/TR/SVG/coords.html#Units Task-number: QTBUG-2279 Change-Id: Ia1597b88d4e1c705a6755db788a18cf790d5ee97 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix typosJarek Kobus2018-02-131-3/+3
| | | | | Change-Id: I14e42b9f55f80e7f2098ba9fcb3c9c47a81446ab Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* svgiconengine: Fix isNull() for deserialized iconsPalo Kisa2018-01-101-0/+10
| | | | | | | | | | | | | | | In 4a9470e55ce08752501868c60762268fdf2c44af there was introduced specific isNull() implementation for QSvgIconEngine. But the existing check was not sufficient for the scenarios where the QIcon is constructed by deserialization from QDataStream (from previously serialized valid svg QIcon). We also need to check the svgBuffers as the previously serialized svgFiles are silently ignored by QSvgIconEngine::read(). Change-Id: Id64ce233baead053c8b5ca61f1d416e46a8c6088 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Add binary compatibility file for QtSvg for 5.10Milla Pohjanheimo2017-12-141-0/+19337
| | | | | | | File to test binary compatibility for QtSvg for 5.10 added Change-Id: I5333ee7c5ab7bc13e131d7b9db7f13c8c652fe78 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-rc3v5.10.0-rc2v5.10.0-rc1v5.10.05.10.0Liang Qi2017-11-151-1/+14
|\ | | | | | | Change-Id: I2c5f1f592e2141b93fa274124a96f2a63b83acdb
| * Fix crash on recursive self-referral in <use> elementEirik Aavitsland2017-11-151-1/+14
| | | | | | | | | | | | | | | | | | | | Referring to an ancestor in a <use> element would lead to endless recursion. Add checks to avoid recursion, and also emit a warning while parsing. Task-number: QTBUG-64425 Change-Id: I9ee1b9bfef13796cc3f387ff8579c6b13bc4ae9a Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devv5.10.0-beta3v5.10.0-beta2v5.10.0-beta1v5.10.0-alpha1Liang Qi2017-08-151-0/+19016
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I1ebd40264cf1afaf5bcbf8b2f272e153f51a5625
| * Update binary compatibility files for Qt5.9.0 for QtSvgMilla Pohjanheimo2017-06-301-0/+19016
| | | | | | | | | | | | | | Binary compatibility files updated for Qt 5.9.0. Change-Id: Id7bdd7620ea8081616aea223e5bc423e454de305 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-213-2/+19040
|\ \ | |/ | | | | Change-Id: I855627bf0387be820d97bbc0226fed07fd1db64a
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-101-0/+18996
| |\ | | | | | | | | | Change-Id: I9244a68bf4709fa136c52132a66d70d7c0b8897b
| | * Binary compatibility file for qtsvg (5.8.0)Milla Pohjanheimo2017-02-031-0/+18996
| | | | | | | | | | | | | | | | | | | | | Added binary compatibility file for qtsvg Change-Id: I851696a36852988910fc2ea5e2284b4e4bfac0f8 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
| * | Fix radial gradient brushes in svg generatorEirik Aavitsland2017-02-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code would generate radial gradiants named with an "xml:id" attribute, in contrast to linear gradients which is named by an "id" attribute. Those two forms should be equivalent according to the spec, but in practice most browsers and viewers only accept the latter. Change-Id: I798387bdbd3a6ea831af8ce103683141b567e940 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * | Add support for pattern brushes to svg generatorEirik Aavitsland2017-02-141-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pattern brushes was not implemented in the svg generator. Shapes drawn with such brushes would not be included in the svg file. [ChangeLog][][QSvgGenerator] Add support for pattern brushes Task-number: QTBUG-58148 Change-Id: Ib275661c596631fea64cb250c9743a529cd7b834 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>