aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgcontext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtDeclarative fixes and workarounds for NaClwip/naclMorten Johan Sørvig2016-05-131-0/+5
| | | | | | | | | | | Make QtDeclarative run on Native Client. Some of these should be looked at more closely at a later point in time, but will do as workarounds from now. Change-Id: Ifddcb45b190c3a80c6137772a05ababb5466ea22 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Quick: Sanitize reading environment variables.Friedemann Kleint2015-10-261-16/+19
| | | | | | | | | | | | | | Where possible, use qEnvironmentVariableIsSet()/ qEnvironmentVariableIsEmpty() instead of checking on the return value of qgetenv(). Where the value is required, add a check using one of qEnvironmentVariableIsSet()/Empty(). Move QSGAtlasTexture::qsg_envInt() to qsgrenderer.cpp for reuse as qt_sg_envInt() and add qt_sg_envFloat(). Change-Id: I4c93f16c228d4f537154f389a0fa1427654485f7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Retrieve services from debug connector, not via static instance()Ulf Hermann2015-08-041-2/+0
| | | | | | | | | This will allow us to remove the instance() methods and create the services from factories in plugins. Also, it allows us to remove the isDebugging member from QQmlEnginePrivate. Change-Id: Id9d9820a910902ecfdb1e8175e215093ce3d0965 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix inefficient usages of qDeleteAll()Sérgio Martins2015-06-261-1/+1
| | | | | | | | | | No reason to iterate through all items to create a temporary QList we don't need. Change-Id: I3c5388f026ded0290afb9dd35fc7934011c4998d Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Add QQuickWindow::TextureIsOpaque as option to createTextureFromImage.Gunnar Sletta2015-06-151-15/+19
| | | | | | | | | | | | | | | | Opaque textures can be a lot faster, so give this option without forcing the user to reimplement her/his own QSGTexture class. The old behavior was that createTextureFromImage() disregarded TextureHasAlphaChannel and looked solely at the image's format. To keep this behavior intact, we introduce a second opt-in flag to switch textures from auto-detect to false, namely TextureIsOpaque. [ChangeLog][QtQuick][QQuickWindow] Add TextureIsOpaque option to createTextureFromImage() Change-Id: I248db4bc5f7920864b6aa8d831ce24d23ad370ef Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Remove QSGSharedDistanceFieldGlyphCache.Robin Burchell2015-06-091-33/+1
| | | | | | | | 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>
* QtQuick: Fix const correctness in old style castsThiago Macieira2015-05-131-5/+5
| | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c9589afabc7ade Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make sure we have enough precision to run animations for years.Gunnar Sletta2015-04-161-3/+3
| | | | | | Task-number: QTBUG-45358 Change-Id: I4af0da937253f3ae578333c659dcbb132312a9cc Reviewed-by: Laszlo Agocs <laszlo.agocs@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>
* Introduce QSG_TRANSIENT_IMAGES.Gunnar Sletta2015-02-031-4/+1
| | | | | | | | | | | | | | This feature enables the same feature that we already have in the 'nonpreservedtexture' in the scene graph playground. This change also cleans up some leftover logic from the early Qt 5.2 days when we had to manually extract the image from the default texture factory rather than going through QQuickWindow::createTexture(). This cleanup is required for the logic to work. Change-Id: I7cdf15d981ba8af94f8d51781fc01e2b834b77c6 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-091-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Don't default to HighQualitySubPixelAntialiasing on WinRTAndrew Knight2014-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The subpixel shader is probably not a good default here because most devices are mobile (can change screen orientation) and have high pixel densities. Furthermore, it breaks text rendering on the Surface RT, where the graphics hardware is too weak to support the number of uniforms the subpixel shader uses. Task-number: QTBUG-41769 Change-Id: I10210af91976ab55e611025c0452a1ee1f3114a9 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * Initialize member variable QSGAnimationDriver::m_lag.Friedemann Kleint2014-11-051-0/+1
| | | | | | | | | | | | | | | | | | | | Fixes purify warning: [W] UMR: Uninitialized memory read in QSGAnimationDriver::advance(void) {1 occurrence} QSGAnimationDriver::advance(void) [qtdeclarative\src\quick\scenegraph\qsgcontext.cpp:221] Task-number: QTBUG-42213 Change-Id: Ide35830c60c5935644747da5cfbad1cdbd357232 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Remove the executioncontext in a few more places where it's not neededLars Knoll2014-11-211-0/+1
| | | | | | | | | | Change-Id: I4c92c7bc9d94d8265e306f45d863fdc080a5e2a6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-291-18/+18
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickaccessibleattached_p.h src/quick/items/qquickwindow.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp Change-Id: I8bf07487a75f9d1b0d6efa5914dd06875fc9654d
| * Tweak new animation driver.Gunnar Sletta2014-10-201-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're removing the bad/reallyBad concept for the benefit of an accumulated lag. When the lag passes over a certain threshold, we switch to time based. The logic for switching back remains unchanged. We also fixed the switching so that elapsed() does not jump from the predicted time to the animation system's wall time, but rather continues from the predicted time with a walltime offset (this is how it was always intended to be). Task-number: QTBUG-42020 Change-Id: I7ee9181aca46cbc18a74fae5e8d513365906c017 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-091-1/+134
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Finally: A default animation driver which doesn't use walltime.Gunnar Sletta2014-09-181-1/+134
| | | | | | | | | | | | | | | | | | | | | | I've wanted this for a long time, but the animation system didn't support it when mixed with timers/pauses. However, because of dfc8f8b5d4a02f33c7f9063c2a28450902a9d863 and 0db3ea4048fe572a256deb343ea5e64a55d98de9 to qtbase, it is now possible. Change-Id: Ic70c181ce49eae90276bd4f22a2d299061f96087 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Add QSG_OPENGL_DEBUG environment variableenkore2014-10-071-0/+4
|/ | | | | | | | | If QSG_OPENGL_DEBUG is set the OpenGL context is always created as a debug context. Not setting QSG_OPENGL_DEBUG uses the default value obtained from QSurfaceFormat::defaultFormat(). Change-Id: I8cc2c8f995cfdb2ed762eb155d77ca11b2db7b72 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Make minimum FBO size 1x1 on newer OSX.Gunnar Sletta2014-08-271-3/+3
| | | | | | | | | This problem existed on 10.6, but is not reproducible on newer MacBookPros, so disable it for 10.8 and up. Change-Id: I0ae216c8e2307df5f77a783ec2d2031bf12ccbf2 Task-number: QTBUG-20193 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Added QSGPainterNode abstraction to QSGAdaptationLayerAndy Nichols2014-08-271-0/+9
| | | | | | | | | This allows the scenegraph backend to customize how QSGPainterNodes are rendered. Change-Id: I640dcf121d0be6bda615cf30591d502329fc89d0 Reviewed-by: Lars Knoll <lars.knoll@digia.com> 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>
* Downscale textures which exceed the GL texture limitGunnar Sletta2014-08-231-1/+5
| | | | | | | | | | This way they will at least render. [ChangeLog][QtQuick] Images exceeding GL_MAX_TEXTURE_SIZE will be downscaled to fit so they will still show. Change-Id: I169ecac768036812b8e14265ec1a0a8902655666 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Cleanup: Separate the sub-tree layering out of QtQuick into the scene graphSimon Hausmann2014-08-231-0/+9
| | | | | | | | | | 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>
* Create rectangle nodes in the text editing through the contextLars Knoll2014-08-131-0/+13
| | | | | | | | | | Unfortunately we can't re-use the QSGSimpleRectNode, as it doesn't provide us with virtual methods to move it's creation into the context. But's since it's only 20 lines of code anyway, this is still a nice cleanup. And it also allows the re-use of any optimizations in the renderer for QSGRectangleNode. Change-Id: I957777fbbeb0a994a9c257baf3bfe87fce8cc9e8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix the nine patch node factory function (part 1)Simon Hausmann2014-08-121-1/+1
| | | | | Change-Id: I5981190dd43082715a7159efd478469365caf3a6 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Remove setDefaultFormat() from QQuickWindowLaszlo Agocs2014-08-111-1/+1
| | | | | | | Replaced by QSurfaceFormat::setDefaultFormat(). Change-Id: If4e37b75ccb55d556d80b0079be89e5a521f6dbb Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Added interface for the QStyle rendering in QtQuick ControlsSimon Hausmann2014-08-081-0/+9
| | | | | | | This allows a scene graph backend to customize the style rendering Change-Id: I6048df47ed3705d81140d63a21257f704a0e0a82 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Protect against crashes with invalid openglContext()Simon Hausmann2014-08-081-0/+2
| | | | | | | | | 1) Don't fail the assertion in the animator jobs if we don't have a context 2) Delegate the opengl context check in QQuickWindow::createTextureFromImage to the QSGContext Change-Id: I1b248895dcd6db406f1af8866fd0052dd7564899 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Expose the scene graph publically through a QSGEngine classJocelyn Turcotte2014-08-011-8/+14
| | | | | | | | | This change wraps QSGRenderContext and QSGContext in a new QSGEngine class, and expose a public interface of QSGRenderer through a QSGAbstractRenderer to make it usable on a standalone window or FBO. Change-Id: I2d41187472424f5ea64650a006bcd61f2711f6b9 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Use categorized logging for all things scenegraph.Gunnar Sletta2014-07-011-9/+43
| | | | | Change-Id: I865ee838b0fd6c257b7189f24130012b98206fd1 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Make sure program is bound before calling initialize().Gunnar Sletta2014-06-231-0/+1
| | | | | | | | | | Some implementations will use the initialization to set constant uniforms like texture locations, so bind the program before so this will work. Task-number: QTBUG-39472 Change-Id: I677c5aeefe68535bd4805e83b93308d0bd090030 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-06-041-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | The merge conflict is about the removal of "d1" from the register set on ARM, but that was already done in dev in commit ddb33ee9ba9e1344caa9be5dbf4b534c3ede692e The change in src/quick/scenegraph/coreapi/qsgrenderer.cpp with commit 2414f1675eab163b22dcc4e8ded80ed04d06369b was reverted to what it was before, per Laszlo's advice. Conflicts: src/qml/jit/qv4isel_masm.cpp Change-Id: I7bce546c5cdee01e37853a476d82279d4e72948b
| * Fix crash in QSGRenderContext::invalidate().Yoann Lopes2014-06-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | QSGRenderContext was holding pointers to QFontEngines without increasing the font engine's ref count, allowing them to be deleted before QSGRenderContext could make use of them. Task-number: QTBUG-36573 Task-number: QTBUG-38313 Change-Id: I0ed28bb44882c55f330c27c23b533b7999d7e04b Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Avoid direct GL calls in QuickLaszlo Agocs2014-05-231-5/+7
|/ | | | | Change-Id: I9b8673fb3292c9d5ad2f9e8e63f56dc661699be6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Follow QOpenGLContext API renamingLaszlo Agocs2014-04-251-1/+1
| | | | | | Task-number: QTBUG-38564 Change-Id: Ice1170339f7d650fcb6accfccf325471629343d6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use global context sharing from QtGui instead of QSGContextJocelyn Turcotte2014-04-041-18/+0
| | | | | | | | | This removes QSGContext::sharedOpenGLContext and replace its uses with QOpenGLContextPrivate::globalShareContext, which is also going to be used by QOpenGLWidget and QQuickWidget. Change-Id: I1e296c3e6832f717caaf31ba7d7b27c06249219b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Dynamic GL in QuickLaszlo Agocs2014-03-181-7/+16
| | | | | | | | | | The counterpart to I716fdebb. Implements the dynamic path in scenegraph. Task-number: QTBUG-36483 Change-Id: I2dc613ba84560b7b8e36d3cd1da61c050ab08db0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Prefer to use normalised signal/slot signaturesSergio Ahumada2014-03-031-1/+1
| | | | | | Change-Id: I9856c110399c4b6b1ea6aba2d92392cecff04656 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-02-241-14/+0
|\ | | | | | | Change-Id: I68fd0e1d837bcd918c8efaf67fa88dee4a90b3be
| * Revert "Fix scenegraph backend API for material shaders."old/5.2Michael Brasser2014-02-191-14/+0
| | | | | | | | | | | | | | | | | | This reverts commit a8a90519cb35481e96fe8889846bfaa424e13e8a. The same functionality is now available in a more extensible way via the program binary support recently added. Change-Id: I07b1939611a76858e65605ce625da6c4cbca2114 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-02-181-0/+34
|\| | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4functionobject.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h Change-Id: Id164f6c3b45501aa466908659ec4e3b957323753
| * Enable program binary support through QSGRenderContext API.Gunnar Sletta2014-02-131-0/+34
| | | | | | | | | | Change-Id: I4eecff3c8a2c727d38d394305d248eddeef87e8e Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-02-111-0/+19
|\| | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4context.cpp Change-Id: Ied5b23bec4dc14abe51127c507aed668f855c1e1
| * Fix scenegraph backend API for material shaders.Michael Brasser2014-02-061-0/+14
| | | | | | | | | | | | | | | | Without this change, it is not possible to implement a custom renderer (it has no way to compile or initialize material shaders). Change-Id: Ie8778f739f3551f88f0d44ccb9769063a87ff276 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Fix backend API, broken since 5.2.0Gunnar Sletta2014-02-041-0/+5
| | | | | | | | | | | | | | | | Without this change, it is not possible to implement a custom context without also implementing a renderloop. Change-Id: Iac2aa732251cdf7221b28f665394cdd336a3d846 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | Move logic for determining native vs. DF text into single factory functionTor Arne Vestbø2014-01-271-21/+3
|/ | | | | | | | | | Makes QSGContext::createGlyphNode() the central point of determining which glyph node to produce, instead of letting the caller call two different versions of the factory, each one calling the other in various cases and behind various ifdefs. Change-Id: I30fb17cceab45d9e13ddf3ece7a65f220c5e5acd Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Enforce texture cleanup to happen at the end of the sync phase.Gunnar Sletta2014-01-221-3/+10
| | | | | | | | | | | This was ok for the threaded renderer, but for the single-threaded renderers where the event loop was spinning we could run the risk of scheduling a texture for deleteLater() and then cleaning it up before we got around to the sync phase. Task-number: QTBUG-35670 Change-Id: I92074294b427fd8ab2a1823ba79c7ac3b59094ec Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Make it possible to render without a depth buffer.Gunnar Sletta2014-01-221-6/+15
| | | | | | | | | | | | Some GL implementations (especially on embedded) will give us an OpenGL context without a depth buffer. In low memory scenarios, it might also be feasible to request a non-depth buffer context to save the depth buffer memory. The renderer deals with this by treating all nodes as translucent, by not adjusting the shaders and by not creating the extra z-order vertex attribute for merged nodes. Change-Id: I8edc92d530daa3e2628df2ba52901b47d87eaf26 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Enable broken IBO fallback for Hisilicon Immersion 16 GPUEskil Abrahamsen Blomfeldt2013-11-291-0/+2
| | | | | | | | | This GPU is on the Huawei Ascend D1 and exhibits crashes in glDrawElements() when rendering scenegraph when the workaround is not turned on. Change-Id: Ic601d34c01e34faaa091a631cfed74c3601c9c43 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>