summaryrefslogtreecommitdiff
path: root/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix assert with wrong number of argument to animateTransformAllan Sandfeld Jensen2022-08-311-0/+18
| | | | | | Pick-to: 6.4 6.2 5.15 Change-Id: I8e864ab4213d65866b0004f115f4e7c7bf7173d5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-131-27/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Ie5a75414af5fda27f5b5f527f3543b088b674677 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix tst_qicon_svg, tst_qsvgplugin, tst_qsvgrenderer runtime failuresTatiana Borisova2022-01-131-4/+4
| | | | | | | | | - add resources to binary for INTEGRITY (IGY is static build only) Task-number: QTBUG-99123 Pick-to: 6.2 6.3 Change-Id: If33215406210bb84be3b526bdae9d88ff04170f0 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix boundsOnElement() for text nodes having transformationsEirik Aavitsland2021-11-191-0/+6
| | | | | | | | | | Text layout calculations are done with a local scaling, and that was mixed up with the node transformation when computing the bounds. Fixes: QTBUG-98139 Pick-to: 6.2 Change-Id: Id3ab0500cfba4578989b5766677a53340e8cecde Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix parsing of arc elements in pathsEirik Aavitsland2021-07-141-0/+14
| | | | | | | | | | | The arc element takes some flag parameters, which could be mixed up with the float parameters since svg does not require delimiting characters here. Hence legal svg would be misread.. Fixes: QTBUG-92184 Pick-to: 6.2 6.1 5.15 Change-Id: I5885c50d47e2e06ab0f02afefb7a5585c5c713ff Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix compiler warning about unused functionVolker Hilsheimer2020-11-241-7/+10
| | | | | | | | | | Instead of providing an overload of diffIsSmallEnough for double and float each where one is always unused, make it a template. Pick-to: 6.0 Change-Id: I0b9ed29df844256ec77e990564201c5fe55bb59f Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add support for 'image-rendering' attributeAles Erjavec2020-11-031-0/+48
| | | | | | | | | | | Write and parse the 'image-rendering' attibute. The value is mapped to QPainter::SmoothPixmapTransform render hint. [ChangeLog] Add support for 'image-rendering' attribute Task-number: QTBUG-4145 Change-Id: I5268eac73b234cd195adade502ab9945a89f3ff6 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix check against division by zeroRobert Loehning2020-08-181-0/+8
| | | | | | | | | | The squared values must not be zero. Since both are qreal, this can happen even when neither of them is zero itself. Fixes: oss-fuzz-24738 Pick-to: 5.12 5.15 Change-Id: I61b2bc891e7e3831d4b6ee68b467db28c4f877d4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Test rendering length which is fuzzy nullRobert Loehning2020-08-171-0/+12
| | | | | | Pick-to: 5.15 Change-Id: I1a21f70cc5ca2319d041c5db8900e69adcb9850d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Avoid endless recursion when inflating gzipRobert Loehning2020-07-291-2/+1
| | | | | | | Fixes: oss-fuzz-24146 Pick-to: 5.12 5.15 Change-Id: I52a974e6a0694fb4afb50d932b2e99917c3034b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't divide by zeroVolker Hilsheimer2020-07-171-0/+8
| | | | | | | | Fixes: oss-fuzz-23731 Pick-to: 5.15 5.12 Change-Id: Ib21a32a30f7a204d263e6710f17567d91c6aae79 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of QMatrixJarek Kobus2020-02-061-2/+2
| | | | | | Task-number: QTBUG-81628 Change-Id: I31f5ffeff1e20f2c77a67325e58a0522d25cb1b7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* | 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>
* 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>
* 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>
* Fix typosJarek Kobus2018-02-131-3/+3
| | | | | Change-Id: I14e42b9f55f80e7f2098ba9fcb3c9c47a81446ab Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* 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>
* Updated license headersJani Heikkinen2016-01-251-17/+12
| | | | | | | | | | | | From Qt 5.7 -> tools & applications are licensed under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: Ia9ba3f9e0c35ea5ae4b1b310f310f44aaf95a7f6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: Ie7d37928ebd680c6f1b20045de11abcd5595c73f Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-10-141-0/+9
|\ | | | | | | Change-Id: Ideff1b627a310a85d728d74ed25b83e7de5352fe
| * fix crash on malformed SVG5.3Joerg Bornemann2014-10-061-0/+9
| | | | | | | | | | | | | | | | | | | | In a gradient that references itself via xlink:href we encountered an infinite recursion, and eventually a stack overflow. Now we print a warning and ignore the invalid link. Task-number: QTBUG-35387 Change-Id: Id72800eaa267d015a471df284245861ed8bc94cd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Update license headers and add new license filesv5.4.0-alpha1Antti Kokko2014-08-251-19/+11
|/ | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I847adeea20fd98e5c9a18b8c44a15de84283f216 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: Icf9d15a0f1f38ab60f0dd8fc2bc6ac936dd7dc62 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-241-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie28eae89f2ad032f174ff840cc6a44d8dd511eed Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I5f2eda9477944e22ec5f6dd07dcb53feaa9fc03b Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: Ia89ccb618e630103d60a6e2703e3fbedae0616a6 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | | Change-Id: I2dda86020c6d4b3edf8461733b14a95b9e519afc Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-061-3/+0
| | | | | | | | | | These comments were mostly empty. Appropriate naming of tests and appropriate placement of tests within the directory tree provide more reliable indicators of what is being tested. Change-Id: I2f0142a7d1744f9b785c49c50d729723d544ff34 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qtsvg Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Fix compile warning in tests.Friedemann Kleint2011-05-201-2/+2
|
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+1374
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12