aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickborderimage.cpp
Commit message (Collapse)AuthorAgeFilesLines
* BorderImage support for @2x assetsAndy Nichols2015-05-061-32/+39
| | | | | | | | | | | | | | | | Despite being a subclass of QQuickImageBase, BorderImage components did not support using @2x assets like Image components. The 9 patch image logic now accounts for device pixel ratio when needed. Manual tests added for stretch, repeat and round tiling modes. [ChangeLog][BorderImage] Add support for @2x HiDPI border images. This means, no more need to multiply the border sizes by the device pixel ratio. Change-Id: I79958739929964c816ba5dacedd9eaf93a60a183 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@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>
* Revert "Fix pixel bleed in BorderImage"Eskil Abrahamsen Blomfeldt2014-11-101-362/+62
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit a9238292145e05d36be7c35bdd50829c6400a3de. It also reverts follow-up commits: 87755d0437413cfb875c50e3dfa53030601567c9 c2c710e5a8d66fa696276aa69c2e3b00436eefe5 cc8a76ce8ea76afe912902067e95ca2abf9e482f The new implementation is much too slow because it will cause each section of the border image to be uploaded to the atlas, and it will not be shared between different border images nor between different sizes of the border. The performance regression is so significant that it's not worth it for the original bug fix. We leave the tests around, so some of those might regress due to this. Change-Id: I3f56f4564255ebb77e6487881a6a11b19ad0234e Task-number: QTBUG-42288 Task-number: QTBUG-35838 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* BorderImage: Fix white area when size changes after first paintEskil Abrahamsen Blomfeldt2014-10-311-1/+7
| | | | | | | | | | | | | When e.g. growing the size of the border image in an animation, we would not get updates of the paint nodes when the size was so small that the bounded target rect and source rect did not change (when the size was smaller than the sum of the borders). Since this can happen, we also need to detect when the size changes and update the node for this case. Task-number: QTBUG-42022 Change-Id: I0849d740f363e66a3a4fd6de23fc9d7399ab0779 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix build when using -WerrorSérgio Martins2014-09-301-1/+1
| | | | | | | | | "'borderBottom' may be used uninitialized in this function [-Werror=maybe-uninitialized]" Observed when compiling for android. Change-Id: Ifcb26e28440f08528a192ea2fe88d6343e33710b Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Fix crash when borders exceed item width/height in border imageEskil Abrahamsen Blomfeldt2014-09-161-87/+124
| | | | | | | | | | | | | | | | | While we protected against the the borders exceeding the size of the source image when deciding whether to create a given patch, we did not protect against the case where the target rectangle is smaller than the borders. To fix this, we simply move the calculation of the target rectangle up to before we create the nodes, and check for isEmpty() before creating the nodes. In addition, we did not properly handle changing the borders dynamically. The subtree has to be rebuilt if the borders change so that the source or target rectangles change. Change-Id: Ia6a0df616ebbd0a32924de0b63fd48043027930a Task-number: QTBUG-41338 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix pixel bleed in BorderImageEskil Abrahamsen Blomfeldt2014-09-101-62/+319
| | | | | | | | | | | | | | | | | | | | Keeping all patches of the border image in the same texture with different sample points can cause parts of the border to bleed over to the center patch. To rectify this, we create a separate texture for each of the nine patches we need, and separate image nodes. To avoid applying antialiasing on the interior edges of the border image, we introduce new antialiasing flags which can be used to specify precisely which edges of the image should be antialiased. [ChangeLog][BorderImage] Fixed possible pixel bleed between border patches and center patch in BorderImage. Change-Id: Icc292b3969217320eecca99e79675316c42eab08 Task-number: QTBUG-35838 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* 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>
* Doc: correct link/compilation errors in Qt DeclarativeNico Vertriest2014-07-021-1/+1
| | | | | | | Task-number: QTBUG-34749 Change-Id: I507d54b0568d77c6099a0bd99f5c369b8667032a Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Avoid Nearest mipmap filtering for BorderImage.Gunnar Sletta2014-02-161-0/+1
| | | | | | | | | | QSGOpaqueTextureMaterial has Nearest as the default mipmap filtering, which BorderImage inherited. That default value is not ideal, but I would prefer to not change behavior, so request None from borderimage instead. Change-Id: I9857f1434ae9f067c3b0e460ea552d3e854b9d64 Reviewed-by: aavit <eirik.aavitsland@digia.com>
* QtQuick docs: add missing \qmlpropertygroup commandsJ-P Nurmi2013-12-201-0/+1
| | | | | | | "warning: No QML property group command found; using..." Change-Id: Iafbdbc09cbd76bf81a5baf3a5a4fab843778b5cb Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-1/+1
| | | | | | | | | | | | | | | | | | | See the task for the full reasoning behind this patch. The threaded renderloop has been refactored to have one window per thread. This is mostly a simplification of the current code path where for loops over multiple windows are turned into if (window). The QSGContext has been split into two classes, QSGRenderContext for which there is one per OpenGLContext. The rest of the patch is name changes and a couple of cleanups in the hopes of simplifying this change. Task-number: QTBUG-33993 Change-Id: I31c81f9694d7da7474a72333169be38de62613c4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make sure QQuickBorderImage sets its pixmapChanged dirtyflagGunnar Sletta2013-10-251-5/+3
| | | | | | | Task-number: QTBUG-34298 Change-Id: Ie66f0bdd705335491496f5d583193b32cb7749f3 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Prevent badly formed texture nodes in the scene graph.Gunnar Sletta2013-10-211-2/+6
| | | | | | | | | | | | | | | | | A texture based node without a valid texture is not allowed, as the material and the renderer will only tolerate well-formed nodes. If a node is missing any part of its material state it should not be in the scene graph in the first place. Because of an "optimization" in QSGDefaultImageNode::setTexture and QSGSimpleTextureNode::setTexture, we must temporarily set the texture to 0 to ensure that it gets updated properly. This temporarily puts the node into an invalid state which can lead to crashes when QSGNode::markDirty() reaches the renderer. Task-number: QTBUG-34062 Change-Id: Ic1735c9b974b90b3684262de9589133c961bac6e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-14/+14
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: Fixed and updated Qt Quick's \qmlmodule pageJerome Pasion2013-09-251-1/+1
| | | | | | | | | | | -incremented version to Qt Quick 2.2 (in \qmlmodule page) -import changed to QtQuick 2.2 -\inqmlmodule no longer needs the version. QDoc will ignore the version but it is better to remove it now to avoid confusion Task-number: QTBUG-32172 Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Cleanup lots of V8 dependencies in QJS* classesLars Knoll2013-04-181-0/+1
| | | | | | | | | | | Implement a good part of QJSValue using V4. Keep the QV8Engine for now (as it is used everywhere), but add an ExecutionEngine pointer to it so other parts can more easily be ported to V4. Remove a lot of other stuff that's not required anymore. Change-Id: Ibe2c9ab10f0ee977e0e3d05a42f526206d7b22b5 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update usage of smooth and antialiasing.Michael Brasser2012-08-281-14/+6
| | | | | | Change-Id: Icc8b28bdd466389ed3f269f076f1bdb6e9abe3f2 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Doc: Changed \qmlclass to \qmltype and added \instantiates.Jerome Pasion2012-07-301-1/+2
| | | | | | | | | | -To simplify QDoc, \qmlclass is now \qmltype. -'\instantiates <C+++ class>' is for the types that are defined in C++. Change-Id: I29242d33daf7b972d8b86a356b9689638866b950 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-1/+1
| | | | | | | | | | | | | | | | QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Change Quick docs to refer to "types" rather than "elements"Martin Jones2012-07-161-8/+8
| | | | | | Task-number: QTBUG-24785 Change-Id: I223479b879514abaacb123852323c1cfada7a5e1 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix signal emission for the Image based items when loading.Damian Jansen2012-07-131-41/+41
| | | | | | | | | | | StatusChanged signals are now always emitted. Other properties only emit when altered. AnimatedImage local and remote loading was also unified in this fix. BorderImage duplicated loading code is streamlined. Task-number: QTBUG-26405 Change-Id: Ib412d5879e0007229a8098e1fa960003051508de Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Change antialiasing method for QML2.Kim Motoyoshi Kalland2012-07-131-15/+55
| | | | | | | | | | | | | Since multisampling can require a lot of memory, and might not be supported on some hardware, turn off multisampling and implement antialiasing in the vertex shader instead. The alternative method of antialiasing is implemented for Rectangle, Image, BorderImage and AnimatedImage, and must be explicitly enabled by setting the new antialiasing property. Task-number: QTBUG-26268 Change-Id: I39a93d978658a494bf51e9f0fd02d8414eb8be12 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Checking for QUrl equality is not all that expensive, so remove hack.Robin Burchell2012-06-261-2/+2
| | | | | | | | | | QUrl's operator== used to perform allocations by comparing normalized URLs, but even then, this code seemingly would not apply: Qt 4's QUrl still has a fast path for the case where the URLs are empty, the same as this code implemented. Change-Id: I69e82c848f47f5e5660bd707bfba0ff7343c8a42 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Remove superfluous statusChanged signalDamian Jansen2012-06-251-0/+2
| | | | | | | | | If the file name is empty, or is a local file, statusChanged would be emitted twice. Task-number: QTBUG-26155 Change-Id: Id341d1c76d45e3fca19260293f632b0b51a34e90 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Create new documentation structureChris Adams2012-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | The documentation currently has no clear separation between Qt QML and Qt Quick. With recent commits like: 6c8378eaf1edbbefe6aaa3672b0127816a004fd7 and ab1e510121c8a679fdaca12ccd30e0f7ac12a26b the separation between the language definition and implementation, provided by Qt QML, and the standard library for the QML language, provided by Qt Quick, is clear. This commit creates a new documentation structure that is more navigable and separates concepts into logical categories, with clear separation between QtQML and QtQuick. It also provides a more generic QML Application Developer Resources page which contains links to information for QML application developers. Change-Id: Ia807ccfbfd24ffa0e1c7f0a51ed9d2ed3aa6a733 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Doc: Grouped Qt Quick types into several groupsJerome Pasion2012-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -created new groups and converted some overviews into group pages -edited type documentation and added \ingroup -articles still need title fixes and link fixes Groups: qtquick-visual-types qtquick-item-graphics qtquick-shaders qtquick-canvas qtquick-text qtquick-text-validator qtquick-interaction qtquick-positioners qtquick-transformations qtquick-states qtquick-animation-define qtquick-animation-properties qtquick-animation-control qtquick-animation-modifiers qtquick-images-sprites qtquick-images qtquick-models qtquick-containers qtquick-views qtquick-paths qtquick-utility Task: QTBUG-25685 Change-Id: I81d4df3320bf5daad5cabb5e42408013fb24f464 Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Fix doc snippets paths and parsing errorsBea Lam2012-05-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtqml.qdocconf and qtquick.qdocconf now refer to the correct snippets and source directories. Snippet paths in .qdoc and .cpp files have been updated to refer to the new shortened path references, e.g. \snippet qml/file.cpp instead of \snippet doc/src/snippets/qml/file.cpp. This also deletes snippets from src/qml/doc/snippets that belonged under src/quick/doc/snippets (and were already duplicated there anyway) and restores some snippet files that shouldn't have been deleted. Also fixes some inline snippets to use \code .. \endcode instead of \qml .. \endqml as they contained javascript or partial QML snippets that were causing parsing errors from qdoc. There are still snippet errors arising from qmlintro.qdoc as the qmlintro snippets directory that it refers to cannot be located. There are also two references to a removed snippet identifier in examples/qml/cppextensions/plugins/plugin.cpp that need to be fixed in conjunction with the related docs in a later commit as the relevant code has changed and the docs are now invalid. Task-number: QTBUG-25721 Change-Id: I50c665245a74c140470c58a32546591d187dfe4b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Doc: Sanitized QML typesNico Vertriest2012-05-241-1/+1
| | | | | | | | | | -modified \brief -checked QML modules -added qml directory to the qdocconf file -added particles directory to the qdocconf file Change-Id: I589e32d3106cda37c7fa4d55a941afd9876fc2b2 Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-1/+2
| | | | | | | | | | For internal QML built types, creating a metaobject each time is just wasteful. Additionally, as the property caches were always created from the intermediate QMetaObject, it was difficult to pass information directly from the compiler to the property cache. Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Doc: Moving Qt Quick docs for new doc structureGeir Vattekar2012-05-091-3/+3
| | | | | | | | | | | | | | | -moved documentation from doc/src/qtquick2 doc/src/localstorage doc/src/particles to src/quick/doc/ -fixed qdocconf file -fixed snippets, images, and other qdoc errors related to the new directories -fixed links in the main Qt Quick page Change-Id: Ie3408c2624f623c17de07e5635d5c7284d02b973 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Initial bundle supportAaron Kennedy2012-05-041-2/+4
| | | | | Change-Id: I095249f64ecf4ef1e3fbfb164e3d50edffab61e8 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix the build & docs after QQmlImageProvider was renamedKent Hansen2012-03-201-1/+1
| | | | | | | | The class was renamed to QQuickImageProvider in commit 3bc907d155034fe64efc8cb6056b48f0c6401bfb. Change-Id: I91ff38244cee3ab651ed6caa4140a58cb742f1c9 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-131-11/+11
| | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I62d203f21df63a95ee236e578b10418fd9680707 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-14/+15
| | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Pass the QQuickCanvas to texture factories.Gunnar Sletta2012-02-091-1/+1
| | | | | | | | | This makes it a lot more convenient as we then have direct access to the GL context, createTexture(), invalidation signal and more. Change-Id: I114514d1379c4d0efcc35c512fa2b485da3438b0 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Kim M. Kalland <kim.kalland@nokia.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: If39bd256b0fa85eba17ea30f8ab87ea27d758908 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: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+600
This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>