aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgadaptationlayer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Run includemocs in qtdeclarativeThiago Macieira2017-04-261-0/+2
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-1/+1
| | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-281-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The renderers added in 5.8 had to be adapted to the changed profiling macros from 5.6. Conflicts: src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp src/quick/util/qquickprofiler_p.h tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp Change-Id: Icb370b7c95aab12589ad73881ac6d178759a5c6b
| * Merge remote-tracking branch 'origin/5.6' into 5.75.7Liang Qi2016-11-251-1/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/quick/util/qquickprofiler_p.h Change-Id: I11a89c2a166115d6697adfba09928805643e709e
| | * QmlProfiler: Explicitly specify the offsets for scene graph eventsUlf Hermann2016-11-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The profiler can be switched on in the middle of a frame. In that case the last offset into the timing data would be some random number, which may lead to a crash when recording the sample. However, as we know all the data points we are going to record, we can as well specify where they are supposed to go. The timings themselves may still be random for frames of which we only recorded parts, but the clients can deal with this. Task-number: QTBUG-57304 Change-Id: I1d507f2591516e43d5b3cd25f7939716f2b64ed9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Windows: Fix distance field rendering with fonts with broken cmapEskil Abrahamsen Blomfeldt2016-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the CMAP table of a font is not present on Windows, then the font will not be counted as a ttf file, likewise if the CMAP table has a bug in it. An effect of this is that the glyphCount() will be returned as 0 since we will bail out before fetching the maxp table, and the distance field renderer assumes the glyph count is valid. While the font in question is obviously broken and may have other issues, it is possible to still support using it for rendering text by bypassing the check when we cannot get a reliable glyph count from the font. [ChangeLog][Windows][Text] Worked around an issue with fonts that have corrupt cmap tables. Task-number: QTBUG-45321 Change-Id: I9cfd7809661ae6b902f6b9d47ffb18bfbc06bcd4 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | | software: Add support for QSGRenderNodeLaszlo Agocs2016-07-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Have to change getResource() a bit since it turns out it is not suitable currently for backends that do not have a per-window rendercontext and do not implement the interface on the rendercontext. Pass in the window to make sure it can always figure out which window we want the resources for. (we do not want rendererInterface() to return window-specific instances created on the fly, with ownership issues, so stick with the simple model where backends implement the interface on one of their existing classes) To support clipping, QSGRenderNode::RenderState is extended accordingly. Also updated the docs since some claims in the rendernode docs are not true since Qt 5.3. Change-Id: I34779c83926f5231b888fcab7131e873ae97964f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | scenegraph: Port foreach to range-forRobin Burchell2016-07-091-1/+1
| | | | | | | | | | | | | | | Change-Id: I5e7c144e60959b9230c0757b4ad0e035f5f52f58 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | D3D12: Long Live Wobble!Laszlo Agocs2016-04-291-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | D3D12 shader effect node. Cull mode, atlas (qt_SubRect_*) support, and some nice-to-haves are currently missing. The built-in shaders won't yet work due to not sending 'source' down the stack so both have to be application-supplied. Nonetheless..the wobble test works! Change-Id: If4cd0143fa5794a8d5f89b576ffcfb084efeb343 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | Adaptable shader effect enablersLaszlo Agocs2016-04-291-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The D3D12 node implementation is mostly missing. The rest of the enablers should be in place now however. Importing QtQuick 2.8 provides new properties for ShaderEffect: - shaderType can be used to decide which language should be used - shaderCompilationType tells if compilation is runtime or offline - shaderSourceType tells if the vertex/fragmentShader properties refer to source strings or source files or pre-compiled bytecode files The last two are bitmasks. In practice however we will support only one approach per backend for now (runtime + source string for OpenGL, offline + bytecode for D3D12). In addition to QSGShaderEffectNode, introduce the QSGGuiThreadShaderEffectManager interface. This provides the gui thread bits for the above and performs shader reflection. Backends that use the new ShaderEffect system must provide both. For each ShaderEffect item there will be a manager (on the gui thread) and a node (on the render thread). Reflection is expected to be done via standard helper libs (d3d12shader + D3DReflect from d3dcompiler for the D3D12 backend), or via manually inspecting SPIR-V, or parsing the source (like the GL path does now), or by using some 3rd party library (not recommended). In any case we require that reflection is doable on the gui thread without dependencies to the actual graphics API. The ShaderEffect documentation is greatly extended, covering HLSL and the new properties. The test app uses manually compiled shaders on its HLSL path for now. This is because there is no story yet for build system integration for public use (the internal HLSL -> bytecode in C header rule is only suitable for the d3d12 plugin itself, apps need something different). Change-Id: Id112104906fbcb26b9902a35f19d8d509b340d1b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | Enable building Qt Quick module with QT_NO_OPENGL definedAndy Nichols2016-03-221-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the Qt Quick module depends on either the OpenGL or OpenGLES headers being available at build time. Since we are adding support for adaptations that do not depend on OpenGL, it should be possible to build Qt Quick in environments that do not have OpenGL development headers. This does present many challenges though because in some cases GL types, and classes that require OpenGL are part of the public APIs. However since these classes were never available when QT_NO_OPENGL was defined, it should be possible to redefine the function signatures under this scenario, since it's not possible to break binary compatibility if there never were any binaries to break compatibility with. One of the bigger changes that was necessary to facilitate this change is creating interfaces out of QSGContext and QSGRenderContext. Here the default behavior was usage of OpenGL directly, even though subclasses could override all OpenGL usage. Making them interfaces should bring QSGContext and QSGRenderContext more in line with the other classes present in the adaptation layer. Change-Id: Iaa54dc0f6cfd18d2da1d059548abf509bd71f200 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | Use the QT_DISTANCEFIELD_HIGHGLYPHCOUNT function from qtbaseAram So2016-03-111-1/+1
|/ / | | | | | | | | | | | | Change-Id: Ica11d2d6499a8194a65f561d32fafd5b5b34579e Task-number: QTBUG-51714 Reviewed-by: Aram So <aram.so@lge.com> Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* / Updated license headersJani Heikkinen2016-01-191-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add 28 QList::reserve() callsSérgio Martins2015-06-081-1/+3
| | | | | Change-Id: Id4820ac458f48b10f2bf457144767efdef9e2c07 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Optimize distance field construction.Michael Brasser2015-02-251-4/+12
| | | | | | | | | | Reduce the number of times we construct a painter path from a glyph. Change-Id: Ic1f32c78ab5dfd3b75d5442da163cda1dedab3ee Task-number: QTBUG-42853 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* 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>
* Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-091-0/+162
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
| * Debug: Make it possible to save distance field cache on WindowsEskil Abrahamsen Blomfeldt2014-11-071-75/+67
| | | | | | | | | | | | | | | | | | | | This makes compilation possible of the saveTexture() function which is used to store the distance field glyph cache on disk when debugging. It also changes the warnings output from here to have no prefix, since this is anyway always available as the context in Qt 5. Change-Id: If3b64f0921a59c485b5321a5465369708e764afc Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
| * Add a debug function to save contents of distance field cacheEskil Abrahamsen Blomfeldt2014-11-051-0/+170
| | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-091-21/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/context2d/qquickcanvasitem.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp src/quick/scenegraph/coreapi/qsgrenderer.cpp src/quick/scenegraph/qsgadaptationlayer.cpp src/quick/scenegraph/qsgrenderloop.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp src/quick/scenegraph/qsgwindowsrenderloop.cpp src/quick/scenegraph/util/qsgatlastexture.cpp src/quick/scenegraph/util/qsgtexture.cpp src/quick/util/qquickprofiler_p.h Change-Id: Ie274c3baf72a8a0711c87d67238d68e2b2887429
| * Partially revert d9c531781e6c95f80681b3c82700833e1de88794Gunnar Sletta2014-10-011-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | This logic changed then timing for when the layer's m_dirtyTexture was set and unset, which had some side effects. Revert to the old and known-to-work behavior of using a connection. Change-Id: I4048e7ae70491afe36b2d766e6c506d9febc44ed Task-number: QTBUG-41451 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Select specific features to be recorded when profiling QMLUlf Hermann2014-09-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Some features, like the memory profiler, create huge amounts of data. Often enough, we're not actually interested in all the data available from the profiler and collecting it all can lead to excessive memory consumption. This change enables us to optionally turn various aspects of QML profiling off. Task-number: QTBUG-41118 Change-Id: I7bb223414e24eb903124ffa6e0896af6ce974e49 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Use QQuickProfiler's own timer to sample eventsUlf Hermann2014-09-121-5/+5
|/ | | | | | | | Like that the timings are more accurate. Task-number: QTBUG-39876 Change-Id: Ia6bdce9c8089417e88797ec3a98c8a3e367f73f2 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>
* Improve the internal NodeVisitorEx APISimon Hausmann2014-08-231-9/+15
| | | | | | | | | Allow the implementation of visit to control whether the children should be processed afterwards or not. This is modelled after the JS AST visitor in Qml. Change-Id: I5b1adf5e1aefd8899bf444e993ddfbf2c5c125c9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup: Separate the sub-tree layering out of QtQuick into the scene graphSimon Hausmann2014-08-231-0/+22
| | | | | | | | | | This basically renames QQuickShaderEffectTexture to QSGDefaultLayer and introduces QSGLayer as interface to be used. QQuickShaderEffectTexture is generic for the scene graph and has no QtQuick dependencies. The interface separation allows scene graph backends to customize layers. Change-Id: I9a7f37addaa4b80a34ff9a1456b0cb9b16d4e9f3 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Improve support for node iteration in the internal APISimon Hausmann2014-08-081-0/+48
| | | | | | | | Added a new node visitor that allows easier traversal of the specialized node types such as the image or rectangle nodes. Change-Id: I45a7d3e1513b4a4db9d07998a6bcee9eba34044e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Properly collect polish timings from all render loopsUlf Hermann2014-07-021-1/+1
| | | | | | | | | | | Previously the polish timings were collected incorrectly from the windows render loop and not at all from the basic render loop. By collecting the polish times at the right places we can get rid of the 2-argument profile macro as well. Task-number: QTBUG-39876 Change-Id: I0b4aaf87162c652b8dcea6cd4f54db053f8312fe Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Use categorized logging for all things scenegraph.Gunnar Sletta2014-07-011-17/+10
| | | | | Change-Id: I865ee838b0fd6c257b7189f24130012b98206fd1 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Move QtQuick profiling to own profiler adapterUlf Hermann2014-02-151-3/+3
| | | | | | | | The QtQuick parts of the QML profiler service thus become a proper global profiler which can be independently enabled and disabled. Change-Id: Ifad03801cab2be66a264fc46fdebdae582fcc99b Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Further pack messages for QQmlProfilerServiceUlf Hermann2014-01-221-2/+1
| | | | | | | | | | | Allow multiple detailTypes in each packet and extend the profiling code to make use of that. Note that this changes the usual order of pixmapSizeKnown and PixmapLoadingFinished events. As far as I can see this doesn't affect the QML profiler frontend and the order of these events isn't specified anywhere. Change-Id: Id39ad98594ccf35add4415e08daf9e92ab561237 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Unify calls to profiler service event methods.Ulf Hermann2014-01-221-7/+5
| | | | | | | | | | | | Don't needlessly duplicate information about the profiler being available and allow inlining. Use macros to check availability of the profiler in calling code and generally simplify the code. Task-number: QTBUG-35315 Change-Id: I0a9daec4a95f74b9db795ef2918a01fb772ea107 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Use qDebug for all debug under src/quick/scenegraph.Gunnar Sletta2014-01-071-1/+1
| | | | | | | Mixing printf and qDebug can make the output come out of sync. Change-Id: Ia71e71b09cb3bf651010eb2eb652db7899b07f0d Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Adapt Qt Quick 2 renderer to work with OpenGL Core ProfileSean Harmer2013-11-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+2
| | | | | | | | | | | | | | | | | | | 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>
* 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-6/+4
| | | | | | | | | | | | | | 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>
* QmlProfiler: SceneGraph profilingChristiaan Janssen2013-05-061-6/+15
| | | | | Change-Id: Ide71b330b13fc3816ed191bd9af84e0fce0d9587 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Our debug env vars are a mess. Standardize on QSG_RENDER_TIMINGGunnar Sletta2013-04-041-5/+5
| | | | | Change-Id: I4e88b479a8a9a5126312a05800e8170511b1f7ac Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Added to QML_RENDERER_TIMING logic to capture most render bottlenecks.Gunnar Sletta2013-01-301-0/+29
| | | | | | | | | The typical bottlenecks during rendering are usually compiling shader programs, uploading textures and preparing glyphs, so add profiling data around them. Change-Id: I9c330a0f6b769836d303a035b2c0dce832842aec Reviewed-by: Samuel Rødal <samuel.rodal@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>
* Support for variable glyph width in QSGDefaultDistanceFieldGlyphCache.Yoann Lopes2012-06-081-8/+11
| | | | | | | | | | | The glyphs are not stored in a fixed 64x64px tile anymore. Glyphs are stored in area equal to <glyph_width> + 10 (margin) x 64px. Allocation is now done with QSGAreaAllocator. When glyph recycling is needed, unused glyphs are freed until the new glyph can fit in the cache. Change-Id: I179a8f17bfe35468bdb63bca5113ea4d0f06c414 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Removed ### from scenegraphGunnar Sletta2012-05-161-35/+0
| | | | | Change-Id: I6b114938d2c52df95469975ffa87449f7fd8c647 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Decouple QSGDistanceFieldGlyphNode from it's cache manager.Andrew den Exter2012-03-201-3/+2
| | | | | | | | | | | | | To implement a custom distance field glyph node currently it's necessary to also provide a duplicate implementation of QSGContext::createDistanceFieldGlyphCache() as the default implemention references the cache manager created by createGlyphNode(). By isolating references to the cache manager to just createDistanceFieldGlyph() cache it becomes possible to just overwrite createGlyphNode() and still use the default cache. Change-Id: I7261bdbf247966b55512d2671e2ee85239bcca05 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Use a single distance-field cache instance for all sizes of a given font.Yoann Lopes2012-03-191-125/+65
| | | | | | | | | | | Previously we had a different cache instance for each font size, but they all shared the same textures and positions. Only the glyph metrics were specific to each font size. The metrics for each font sizes are now calculated by scaling the metrics of the distance-field size (54px). Change-Id: I0d9016990dedd93318893506afb1dba7a5249e2e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix missing glyphs when using shared distance-field cacheEskil Abrahamsen Blomfeldt2012-03-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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-0/+1
|\ | | | | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
| * Move distance field util functions to QtGuiJiang Jiang2012-02-281-0/+1
| | | | | | | | | | | | | | These distance field generation functions have been moved to QtGui. Change-Id: I78d9015c8776717ede2d1299c2ef3787d165e0b9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@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>