aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickcanvasitem
Commit message (Collapse)AuthorAgeFilesLines
* Canvas test: make sure canvas is readyFrederik Gladhorn2016-07-043-1/+5
| | | | | | | | | | | | before: Totals: 80 passed, 653 failed, 0 skipped, 0 blacklisted, 35852ms after: Totals: 729 passed, 4 failed, 0 skipped, 0 blacklisted, 29599ms The last four failures are due to high dpi issues. Change-Id: Ie937091558395572dc281ee5a5b90848ea9d2081 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix assertion in qt_create_image_data()Peter Varga2016-04-192-0/+23
| | | | | | | Fix rounding of width and height parameters. Change-Id: Ib7655dafe382684340c32e2d2dc8adb445af65b0 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced 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: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix OTHER_FILES in qquickcanvasitem.proUlf Hermann2015-09-151-3/+26
| | | | | | | It's very handy for IDEs if it matches the actual files. Change-Id: Ib19b5ddc322260a9b24f3cf2f618e06a943cfa9d Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-09-061-0/+18
|\ | | | | | | Change-Id: Id27c36e55fcc68cc1140b0d9bec00b8ae6b52ed0
| * Fix hue clamping in Context2DLaszlo Agocs2015-08-241-0/+18
| | | | | | | | | | | | | | | | It goes from 0..359, not 0..255. Task-number: QTBUG-47894 Change-Id: I0612a9d5e4999afae7703b5c49741b94fb0da07f Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-031-1/+0
|/ | | | | Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Canvas: add a testcase for QSGSimpleTextureNode crash.Mitch Curtis2015-08-121-0/+22
| | | | | | Task-number: QTBUG-47714 Change-Id: I8ecf2673ebc5de3d0fe1dec8a67bee81f5d4fb8f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-242-1/+88
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf LICENSE.GPLv2 examples/qml/networkaccessmanagerfactory/view.qml src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4stringobject.cpp Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
| * Ensure that Canvas has the correct size with complex bindings.Mitch Curtis2015-01-281-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a Canvas is a child of an item with certain width and height values (as described in the bug report), it won't paint correctly. For example, the order of events might occur like so: 1. Canvas width set to 1 2. Canvas height set to 1 3. Canvas width set to 32, which causes the height to also be set to 32 Every size change causes QQuickCanvasItem::geometryChanged() to be called, but the third event above causes it to be called recursively, such that the most nested call results in the size being 32x32, but then the execution returns to the first call and 32x1 is used instead, overwriting the correct size. We fix this by setting the new canvas size to width() and height(), ignoring the recursion and instead using the latest size of the item. Change-Id: Iebbcbfaa3217319b32b97f6b68f7a8af197a0e89 Task-number: QTBUG-42878 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Canvas: don't crash when getContext("2d") is called on destruction.Mitch Curtis2015-01-262-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'd assume that a Window existed when that's not always the case. For example: import QtQuick 2.4 import QtQuick.Window 2.2 Window { Loader { sourceComponent: Canvas { Component.onDestruction: getContext("2d") } Component.onCompleted: active = false } } Change-Id: I5f30876e21ced5658adfa3bac494fd4196e0a7e3 Task-number: QTBUG-42222 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-121-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: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* qttest: make findChild available only for QtTest 1.1Fawzi Mohamed2014-12-054-4/+4
| | | | | Change-Id: I4ceb1a969bd4296b82f899088b02b5e8cf100bcd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix clip state tracking in Context2DMatt Fischer2014-09-221-1/+1
| | | | | | | | | | | | | | | | | | A recent change (f45fe58ad2aa741c90b756643da75f1a6bc2fdf6) introduced the concept of clipping being disabled for a context, so that it can start with no clip path set. However, this state is not properly tracked, so an attempt to restore a context state which has no clip path does not work properly. This change adds this information to the Clip command, so that it can be properly restored. This patch also re-enables a test case which was supposed to check this behavior, but had been disabled. Task-number: QTBUG-40312 Change-Id: I3fd5626ecfcc1298a81931828cbb590290098a92 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Make Canvas test case independent of chosen font.Ulf Hermann2014-09-161-1/+6
| | | | | | | | | 0/0 is not always a red pixel after rendering "Hello" in red. The chosen font has an influence on that. Looking for some red pixel in row 0 is pretty safe. Change-Id: I669548c3c9d8cd25d720998fd9ba31c1f480e4e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Wait longer for image to be loaded in canvas item testUlf Hermann2014-09-161-1/+1
| | | | | | | 200ms can be too short if the system is busy Change-Id: I4f9c6bcbec93d511b5b5e9d531450f3ffd22cb0c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* tst_qquickcanvasitem: Setting as insignificant.Simo Fält2014-08-291-0/+1
| | | | | | Task-number: QTBUG-41043 Change-Id: Ib438ddc890e9a1ede16731b950b195d4341b8fd0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Ignore extra arguments passed to Context2D functions.Mitch Curtis2014-08-141-0/+343
| | | | | | | | | | | This is in line with what Chrome, Firefox and IE do. This is also how most JavaScript functions in Qt behave by default (for example, TableView::resizeColumnsToContents()). Task-number: QTBUG-40703 Change-Id: I087221e305dcb5fd6709ad4a99a5163d641faac6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Run autotests for Canvas.renderTarget == FramebufferObject also.Gunnar Sletta2014-08-021-2/+2
| | | | | Change-Id: Id1729966b3b2b75a3bd4ad387b3d7914266fb3a5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Canvas: do not emit paint when resized but hiddenJ-P Nurmi2014-03-162-13/+20
| | | | | | | | | | | | | | | It turns out to be a bad idea (as in, breaks the enterprise controls) to block paint() altogether when hidden. The original bug report QTBUG-31830 only complained about paint() being emitted upon resize while _hidden_, so this change solves exactly that. User is still free to call requestPaint() even when hidden, and Canvas now doesn't recklessly ignore the request. Task-number: QTBUG-31830 Change-Id: Icd82188f65406b3ef6ae3b19b5984944576886ff Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Canvas: do not emit paint signal when invisibleJ-P Nurmi2014-02-282-3/+14
| | | | | | | Task-number: QTBUG-31830 Change-Id: I23c6fc822547120f14c2d9a09f01a8f985745e2a Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Revert "Fix item polishing"J-P Nurmi2014-02-282-14/+3
| | | | | | | | | | | | | | | | | | This caused items like positioners and itemviews to not relayout or update as appropriate when items were hidden, and therefore caused problems all over in eg. controls. This reverts commits - 43f983350a548b1b663ea07a0e87e4cc58834214 - 01e609e9fa0ca1317e0f4eff4802a79584450357 - 439f31f128e70ecae16544ee7041695c60e0b2d6 Task-number: QTBUG-36954 Task-number: QTBUG-36934 Task-number: QTBUG-31830 Change-Id: If04cdce51206568c360a45e24efc0bd04764750b Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* Fix canvas tests after commit 439f31f128e70ecae16544ee7041695c60e0b2d6Simon Hausmann2014-02-041-5/+1
| | | | | | | | | | | We must make sure that the canvas is created somewhere in the item hierarchy of a scene-graph initialized (thus visible) window. A Window { visible: true } type of item is not sufficient, but we can simply use our testcase as parent/associated item, because that one is equipped with a when: windowShown condition. Change-Id: I67a65208fae1a6fd953493eaa2898a324a6cc917 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Dont call updatePolish if an item is not visibleFabian Bumberger2014-01-082-4/+20
| | | | | | | | | [ChangeLog][QtQuick][QQuickItem] "updatePolish" is not called for invisible items any more. Task-number: QTBUG-31830 Change-Id: Idad6107afaf0c6e6c96d9404ac286695c21883c7 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Support multiple quoted font families in Context2D font property.Mitch Curtis2013-08-051-28/+49
| | | | | | | | | | | | | | | | Currently, it's not possible to specify more than one font family in Context2D's font property. Also, any family with spaces in its name will fail to be read, and quoting the name will also fail. This patch makes it possible to specify several font families as per the CSS shorthand font property spec, as well as quoting of font families with spaces in their names. Task-number: QTBUG-32727 Change-Id: I2bc1f1d2b7f5f8f0519e73f4001b4a8242bb039c Reviewed-by: Karim Pinter <karim.pinter@digia.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* Correctly parse Context2D font as per CSS shorthand font propertyMitch Curtis2013-06-241-2/+77
| | | | | | | Task-number: QTBUG-31721 Change-Id: I6a6ba99ed29392fa7ed67f6a3dba567947f9c46b Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Set default font size to 10px as per spec, not 10pt.Mitch Curtis2013-06-141-0/+2
| | | | | | | | | | | | See: http://www.w3.org/TR/2dcontext/#dom-context-2d-font Also removes duplicated assignments that are done as part of the default constructor. Task-number: QTBUG-31716 Change-Id: I5bd131c14a5defd422d858f02974c215de7adae9 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Allow floating point pixel sizes for Context2D, don't set if invalid.Mitch Curtis2013-06-141-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, setting a floating point pixel size for context2d's font will result in the following error: QFont::setPixelSize: Pixel size <= 0 (0) This is because qt_font_from_string() uses toInt() to convert the number to an int, which fails because of the decimal fraction. The font size is then set regardless (to 0), which does not comply with the standard: "[...] If the new value is syntactically incorrect (including using property-independent style sheet syntax like 'inherit' or 'initial'), then it must be ignored, without assigning a new font value. [CSS]" [1] This patch makes qt_font_from_string() call toFloat() on the string and then casts the value to an int. I could not find any evidence that floating point pixel sizes are disallowed, and QFont only deals with integer sizes anyway. If the conversion to float fails, the font size is not set (it defaults to 10px, according to [2]). [1] http://www.w3.org/TR/2dcontext/#dom-context-2d-font [2] http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-context2d.html#font-prop Change-Id: I6204eaa9fb6048bb9c4452403c3a4cf2913a03a1 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* support url type qml property as a source for Context2D::drawImage()Tasuku Suzuki2013-06-101-0/+11
| | | | | Change-Id: I66445dafd64f6c47fe1098fadd83bf3af301e58d Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Change Canvas to use Image and antialiasing by default.Gunnar Sletta2013-02-261-1/+2
| | | | | Change-Id: I3033cba7c2f9e1dd9886e8f92ece1a2f43f60c01 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fixed Canvas ImageData pixel values not being settable to 0.Samuel Rødal2013-02-071-0/+8
| | | | | | | | | | | | Someone probably figured "since the data is all initialized to 0 to begin with, we can skip 0 values". However, it's possible to temporarily set a value to other than 0 and then back to 0, a fully valid use case that we need to support. Task-number: QTBUG-29065 Change-Id: Ia9f0803743d696ca8b9cca89c666ccba80a3abd0 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* remove some unnecessary CONFIG additionsOswald Buddenhagen2012-12-161-1/+1
| | | | | | | | qt is already added by spec_pre.prf, warn_on by default_pre.prf and dll by qt_module.prf. Change-Id: I449e49275622bac39b7d76af8855c417ddce21e9 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-25/+25
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* doc: fix some typos in .qml filesSergio Ahumada2012-09-071-1/+1
| | | | | Change-Id: Ice5d60b06ec9ab81fbd98fd1679c8834f3018938 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Use the new antialiasing property for canvas paintingCharles Yin2012-08-281-1/+0
| | | | | Change-Id: I76f21d055696978f2f6936006eea038dd73cce6c Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Refactor context2d thread logicCharles Yin2012-07-313-14/+14
| | | | | | | | | | 1. Use QQuickContext2DRenderThread for Threaded rendering 2. Make FBO target works with all render strategies 3. Remove some unnessary locks, call texture methods by invoking meta calls 4. Run existing tests with all render targets and strategies (except Cooperative) Change-Id: I0db5c91d848b86bcc1536c30d7a5804b66a817f1 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Fix unstable test_paint test caseCharles Yin2012-06-052-3/+5
| | | | | | Change-Id: I11c79b3f014d82b113429bd17b2d5473fdcebf1d Task-number: QTBUG-25859 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix canvas item drawImage bug with FBO render targetCharles Yin2012-06-051-1/+13
| | | | | | | | | | If canvas' render target is FramebufferObject, only the first drawImage() call was successful, it could be fixed by adding beginNativePainting() and endNativePainting(), but this could be unexpected behavior with OpenGL paint engine. task-number: QTBUG-23595 Change-Id: Iff70fc88f6d39655dd283fa5dde3365887910460 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add unit tests for SVG pathCharles Yin2012-05-231-0/+57
| | | | | Change-Id: I4358416ccf973940fbd54633254274ba0a18e777 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Use the default timeout for tryCompareCharles Yin2012-05-232-12/+12
| | | | | | | | Even with this fix, the test still fails in CI, so mark this test as insignificant until we figure out the real reason. Change-Id: Idd07820c63b0c9627c86ed87f97b5ade6a552f7e Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Refactor canvas item unit testsCharles Yin2012-05-0421-4931/+5122
| | | | | Change-Id: I99ba84889ce360d2def27834f15af43c2bdf29bc Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix context2d transform issuesCharles Yin2012-03-305-129/+129
| | | | | | | | | After calling transform related methods, the current path should be transformed with the same method but in reversal mode. So that during painting, the painter will apply the CTM to this path again, otherwise path will be transformed twice. Change-Id: I7e12bdff82dabb408f47152ba07b608872d4093f Task-number: QTBUG-24988 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Change smooth to be true by defaultGunnar Sletta2012-03-224-0/+4
| | | | | Change-Id: Ia74a5c76058a2822e61dfa2f7316ea0612ebc15c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove unneeded dependencies to QtWidgets and QtOpenGLLars Knoll2012-03-121-1/+1
| | | | | Change-Id: I43bb54524f5786a838073df8812107dda7b0d56e Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Changed quick tests to work from install directoryKurt Korbatits2012-03-071-3/+1
| | | | | | | | | - Changed tests to use TESTDATA - added check for cross_compile option to skip when sources not available Change-Id: I1f382794ff982bbc07fc20438a4e4a8c8b8d565f Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Change the default renderTarget and renderStrategyCharles Yin2012-03-0716-17/+19
| | | | | | | | | | As we always use OpenGL and scenegraph render thread now, the best default render target should be FBO and the best render strategy should be cooperative mode (use the render thread). Task-number:QTBUG-23956 Change-Id: I64b070dec566e359d27c84680fef1c691d6ce411 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Continue refactor of Canvas rendering.Justin McPherson2012-03-061-1/+1
| | | | | | | | - Remove sync() - not necessary - Queue buffer before flush Change-Id: If7dea8e56a612d241c67a82eae265febc45059a8 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>