aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove QSGSharedDistanceFieldGlyphCache.Robin Burchell2015-06-091-656/+0
| | | | | | | | No known users of this interface exist, and not having it helps to make things less complicated. Change-Id: I3d749cfbde9e84e1c7b8dc5cbd952c5c51d347ee Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Add 28 QList::reserve() callsSérgio Martins2015-06-081-0/+1
| | | | | Change-Id: Id4820ac458f48b10f2bf457144767efdef9e2c07 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QtQuick: Micro-optimize iterator loops.Friedemann Kleint2015-02-261-4/+6
| | | | | | | Avoid repeated instantiation of end() in loops, use variable instead. Change-Id: I6ab1fe2b82406d5ee91710a0333587ffb82c04d4 Reviewed-by: Erik Verbruggen <erik.verbruggen@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>
* Add a debug function to save contents of distance field cacheEskil Abrahamsen Blomfeldt2014-11-051-173/+0
| | | | | | | | | Just copy the one from QSGSharedDistanceFieldCache with some compile fixes to the superclass so we store the default cache as well. Change-Id: I1fcc390601eea58f8b7729c9cead418e4c94714c Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.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>
* Adapt Qt Quick 2 renderer to work with OpenGL Core ProfileSean Harmer2013-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The basic approach is to have the batched renderer create and bind a vertex array object if it detects we are using an OpenGL Core profile context. The VAO is bound for the duration of the QQ2 renderer's work cycle and unbound at the end so as to not interfere with any other VAO's a user may wish to use. All shaders have been copied and ported to be compliant with the GLSL 150 core specification which is the minimum for a Core profile context (OpenGL 3.2 Core). We are not using any newer features as yet so this will work anywhere we can get a Core profile context. The QSGShaderSourceBuilder class has been extended to resolve any requests for shaders to the same basefilename with "_core" appended prior to any file extension. This could be extended in the future to allow version, or GPU or platform specific shaders. The QSGShaderSourceBuilder has also been extended to allow it to insert #define definitions in the prologue of a shader. Any such definition is inserted: * After the last #extension directive (if any are found) * Otherwise after the #version directive (if found) * Otherwise at the start of the shader source This is required by the custom particle shaders which make extensive use of such #defines. In addition the mechanism used by the distance field glyph cache to extend the cache with new glyphs has been modified to work (and work more efficiently) when using a Core profile context. Rather than using a shader program and a buffer filling quad to blit the old texture into the new cache texture, we instead use the technique of framebuffer blitting. The existing fallback implementation using glTexSubImage2D() is still available if needed. The DECLARATIVE_EXAMPLE_MAIN macro has been extended to allow easy testing of any of the QtDeclarative examples with a core profile context. Just run the example with QT_QUICK_CORE_PROFILE=1 ./text for e.g. The only ones that may not work out of the box are those that provide GLSL shader source e.g. the customparticles or shader effect examples. These work fine if the shader source is adapted to GLSL 150 core. In the future it may be a good idea to expose some context property to QML that the user can use to determine what shader source variation to provide to Qt Quick. Along these lines it would also be very nice to allow the provision of shader source to ShaderEffect or CustomParticle from a separate source file just as we now do within Qt Quick. Task-number: QTBUG-32050 Change-Id: Ia6e9f06dbb8508af9ae03c6b60fb418b4cc9e41f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-2/+3
| | | | | | | | | | | | | | | | | | | 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>
* Don't use reserved keyword "texture" as uniform variable nameSean Harmer2013-10-211-1/+1
| | | | | | | | | | The "texture" keyword is a function name in OpenGL core profile. This commit is in preparation for making the Qt Quick 2 renderer and materials work with a core profile context. Change-Id: Iad243e64ab8db739fc46b85bb626bdb8b9ceb208 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@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>
* Updated distance field glyph caches to use QDistanceField.Yoann Lopes2013-08-271-9/+7
| | | | | | | | | | | | | | Some OpenGL drivers assume alpha-only images are always tightly packed, regardless of what is set for GL_UNPACK_ALIGNMENT. We now use QDistanceField to store glyphs, which aligns scanlines on a 1-byte boundary, instead of QImage which uses a 4-byte boundary. A previous workaround uploaded scanlines one at a time, but this is also broken with some other drivers... Task-number: QTBUG-30908 Task-number: QTBUG-32861 Change-Id: I46527fb48de1e00116f776427c45baa752c6176d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@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>
* Reduce number of relocationsMarc Mutz2012-11-231-2/+2
| | | | | | | ...by turning pointer into array variables. Change-Id: Ia5a0cedcf28d54210cc1f179db5c519e7e0672cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* QQuickCanvas renamesAlan Alpert2012-07-171-5/+5
| | | | | | | | | | | | | | | | 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>
* Uses new batching API to potentially speed up glyph cacheEskil Abrahamsen Blomfeldt2012-05-301-11/+82
| | | | | | | | Give the cache information that a burst of requests/releases are coming, so it can potentially optimize this. Change-Id: Icfb591a63075c2f1e93bf269402649116de9e5be Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Optimize cross-thread calls into the shared graphics cacheEskil Abrahamsen Blomfeldt2012-05-151-18/+119
| | | | | | | | | QMetaObject::invokeMethod() is quite slow compared to just posting events, since we don't really require deep copies of the input data as long as it's read-only. Change-Id: Ib5c0a14e1aac3120871a9bcf4aee8804e7d8b287 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QtQuick: Fix string related warnings, single character strings.Friedemann Kleint2012-05-141-1/+1
| | | | | | | | | - Fix warnings about truncation from size_t to int (MSVC 2010, 64bit). - Remove single character strings. Change-Id: Iaf4406e4e04d55d2d8b762f3433269868842a6f9 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Adapt to _qpa file rename in qtbase.Girish Ramakrishnan2012-05-081-1/+1
| | | | | | | | | qtbase change 36547f4eff44361f7a6acd0cff107c0e47561f93 renamed qpa headers. Change-Id: I903b48d145837557d305366e2eb4eedd0ad32c14 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Enabled widget free compilation of QtQuickDonald Carr2012-04-181-2/+0
| | | | | | | | | | There is no hard dependency of QtQuick on QWidget. This change makes the minor adjustments required to remove the build dependency altogether. This patch follows the path of least resistance bypassing any elements with a dependency on the legacy QWidget functionality. Change-Id: Ie3f47d3b4f60a1460dbb5d76a494a2c329469cc0 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update for API changes in the QPlatformSharedGraphicsCacheEskil Abrahamsen Blomfeldt2012-04-031-14/+11
| | | | | Change-Id: I6648d16a11343e2342b832c7416e72ce43ab175d Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Fix memory leak with the shared distance field glyph cache.Andrew den Exter2012-03-141-4/+15
| | | | | | | | | | | | | | | | | A new glyph node instance registers its owner element with its glyph cache which in the case of the shared distance field glyph cache connects a signal from the cache to a slot on the owner, changing the text creates a new node but destroying the old node didn't remove the connection causing them to accumulate over time. In the glyph node; unregister the owner element from the cache on destruction, and in the cache only connect an owner element the first time it is registered and keep a reference count so the items can be disconnected when registrations from all nodes have been cancelled. Change-Id: Ibf32a146e146dbbf4e0556d1bd756465bd8e45ba Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix missing glyphs when using shared distance-field cacheEskil Abrahamsen Blomfeldt2012-03-061-14/+21
| | | | | | | | | | | | | | | | | | | | | | When using a shared distance field cache, signals such as itemsMissing() and itemsUpdated() can be triggered in the server process by external requests. This, in turn, can lead to unnecessary storeGlyphs() calls (performance hit) and, even worse, calls to setGlyphPositions() for glyphs which have not previously been requested through populate(). The latter could cause missing glyphs when the same characters were requested later, as they would then be stored in the cache with the bounding rect of a default constructed QPainterPath (in setGlyphPositions()). To fix this, we ignore all glyphs which have no been requested in this process, thus filtering out all events for glyphs which have only been used externally so far. I've also added an assert to the setGlyphPositions() to help us catch this case early if it should return. Change-Id: Ief333f612e4affea768d9c60409d43ce29fe3f60 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-5/+34
|\ | | | | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
| * Avoid unnecessary updates when using in-process cacheEskil Abrahamsen Blomfeldt2012-03-011-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever an in-process cache is updated, it will emit itemsAvailable() signals to all listening glyph caches. This will in turn cause each of the glyph caches to update and each of the glyph nodes to be preprocessed (the entire scene graph will be updated.) This happens even if the changes to the in-process cache are requested by an external client, due to a cross-process cache sharing mechanism. However, itemsAvailable() signals are only interesting if the items were requested by the in-process cache. We therefore add a mechanism now to check if the glyphs were actually requested by the cache before updating anything. Change-Id: I529f94b3928c2a5e06fec354014fa11d21671057 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* | Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-1/+1
|/ | | | | | | | | | | | | 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>
* Fix outdated license headers.Jason McDonald2012-02-011-2/+2
| | | | | Change-Id: I8448e0d3dbce0c18f38a1ed9b6e2d75ba83f7088 Reviewed-by: Rohan McGovern <rohan.mcgovern@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>
* Add support for shared glyph cacheEskil Abrahamsen Blomfeldt2012-01-241-0/+621
Use a shared graphics cache to back the distance fields if it is available. Change-Id: Id5e6e7a28e38e349d787e66016b2d0faebc791d7 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>