aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi/qsggeometry.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clean up QSGGeometry docs to not refer to OpenGLLaszlo Agocs2020-06-151-46/+38
| | | | | | | | Most of this is just updating based on the changes done back in Qt 5.8, e.g. referring to our own enum values instead talking about OpenGL and GL_*. Change-Id: Id4dd823acbb004d61a1b54cc4c92d1490d7f42a1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove OpenGL dependency from QSGGeometryPaul Olav Tvete2020-06-101-14/+0
| | | | | | Task-number: QTBUG-84623 Change-Id: I150867f256a1e9f30d66e8b6d8cde047d7b6dbdf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add missing doc entries for QSGGeometry::Type valuesLaszlo Agocs2019-09-181-0/+4
| | | | | Change-Id: Iaef8dfa6a984eb709aaae35a94641c3e0183254e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add the graphics api independent scenegraph portLaszlo Agocs2019-07-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt in via environment variables: QSG_RHI=1 -> enable using QRhi instead of GL QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default (the default is d3d11 on Windows, metal on Mac, gl elsewhere) Or force a given rhi backend via the existing QQuickWindow::setSceneGraphBackend(). Otherwise the default behavior is the same as before, the rhi code path is never active by default. -no-opengl builds are supported in the sense that they work and default to the software backend. However, the rhi code path cannot currently be used in such builds, even though QRhi from qtbase is fully functional with Vulkan, D3D, or Metal even when qtbase was configured with -no-opengl. This cannot be utilized by Quick atm due to OpenGL usage being all over the place in the sources corresponding to the default backend, and those host the rhi code path as well. This will be cleaned up hopefully in Qt 6, with the removal all direct OpenGL usage. Other env.vars.: QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer (assuming the system is set up for this) QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too) QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both merged/unmerged, convert when needed - with some rhi backends this is implicit) QSG_RENDER_LOOP -> to override the render loop as usual. The default with RHI is threaded for Metal, threaded for Vulkan on Windows, basic for Vulkan on Linux and Android (to be checked later), while the existing rules apply for OpenGL. Not supported when running with QRhi: - particles - compressed atlases (though this is transparent to the apps) - QSGRenderNode - QQuickRenderControl - QQuickFramebufferObject - certain QQuickWindow functionality that depends directly on OpenGL - anisotropic filtering for textures - native text may lack some gamma correction - QSGEngine applicability unclear - some QML profiler logs may be incorrect or irrelevant Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-191-1/+1
| | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-4/+4
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* doc: Add documentation for undocumented thingsMartin Smith2018-02-141-0/+13
| | | | | | | | | | There were several undocumented elements in the API that clang-qdoc warned about. These are now documented, although original authors might want to contribute better descriptions. A few uses of a macro "qdoc" were corrected to Q_CLANG_QDOC. Change-Id: I4e1d4c5f3266a334d7286e55ed1b113319de2273 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Q_CHECK_PTR QSGGeometry allocationsUlf Hermann2016-12-201-0/+1
| | | | | | | | We want to cleanly crash if they fail, rather than return a null pointer from vertexData(). Change-Id: Ie88adaa9f0977c70ef4a47a59463509dcd15bdcf Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-2/+2
| | | | | | | | 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>
* Fix enums in QSGGeometryLaszlo Agocs2016-10-121-27/+46
| | | | | | | | | | | | | | | | Minor fixes based on comments from the 5.8 API changes review: Revert to using Qt-style enum values (POSITION -> PositionAttribute). Use ByteType, FloatType, etc. instead of TypeByte, TypeFloat, ... Add comments about magic GL values. Add missing docs for Attribute::createWithAttributeType(). Change-Id: I1b8242efd3936f000ce8df6c11ff9ab7affb5713 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add cross-backend simple rect, texture, and ninepatch nodesLaszlo Agocs2016-06-221-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QSGSimpleRectNode is deprecated -> use QSGRectangleNode via QQuickWindow::createRectangleNode() instead. QSGSimpleTextureNode is deprecated -> use QSGImageNode via QQuickWindow::createImageNode() instead. The OpenGL version of the simple rectangle node is switched over to the vertex color material instead of flat, to allow for better batching. Use the same concept for nine patch nodes. The "style" node from Quick Controls 1 is now QSGNinePatchNode in order to provide a proper cross-backend solution which is already necessary due to the software backend, but now generalize it to apply to the accelerated backends with proper materials as well. QC can now simply call createNinePatchNode() without further ado. Also fixes a bug with the D3D12 texture material not enabling blending when needed. When it comes to the internal class names, QSGRectangleNode and QSGImageNode get the Internal prefix in the adaptation layer in order to differentiate from the public API. This involves quite a lot of renaming, but results in a nice and clean public API. Change-Id: Iddf9f9412377843ea6d652bcf25e68d1d74659ea Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Remove unnecessary ifdef in QSGGeometryLaszlo Agocs2016-05-231-22/+57
| | | | | | | ...and fix up the docs for the GL-mirroring enums. Change-Id: Iafac2bdde2fd1ce6453809b3e3709c89d885f7dc Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Enable building Qt Quick module with QT_NO_OPENGL definedAndy Nichols2016-03-221-19/+25
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix shadowing and rvalue warningsLaszlo Agocs2016-03-091-1/+7
| | | | | | | | | | | | The tests attempt to initialize the struct members directly is invalid in any case. The static create() functions are mandatory since new members may be added (via the reserved bits) at any time. Also expand the Attribute struct spec to keep VS2012 happy (this can be reverted later once it's gone from CI). Change-Id: Ibec1fdb8e2787c3665ec397b6adb906210d570e4 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Add the skeleton for a D3D12 backendLaszlo Agocs2016-02-191-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Proof of concept. The plan is to proceed slowly with supporting node types one by one, starting with QSGRectangleNode. Opaque rectangles work already, but only non-smooth for now. The renderer is incomplete (no clip/opacity) and is based on simplerenderer on scenegraph playground. Buffer handling is not necessarily optimal yet. Use QT_QUICK_BACKEND=d3d12 to request this backend. Set QT_D3D_DEBUG=1 to enable the D3D debug layer. The render loop handles everything, incl. swap chain setup, handling resizes, etc. This being D3D, there are no further enablers needed from the QtGui or platform plugin side. By default the first hardware adapter is picked. In the absence of that, WARP is tried. The list of adapters is printed at startup, use QT_D3D_ADAPTER_INDEX to force a given card in case there are multiple ones in the system. The goal is not to productize a fast and great renderer, but to pave the way to better future backends for D3D12 and similar graphics APIs. Compiling in the support into Qt Quick is bad since the dependency onto d3d12.dll is not necessarily acceptable, but it's good enough for now, this being a wip branch. Change-Id: Ifbe088e7507223328096b22eec2c73f77bb5680e Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Revert "Build (and fail) Quick with -no-opengl"Laszlo Agocs2016-02-121-3/+0
| | | | | | | | | This reverts commit 707e6f528fc79db236d282e7ea41eb952c825433. We will not pursue this route for the time being. Change-Id: Idd1fce362440f6bf1b58901a289843fdfb39a5b7 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Build (and fail) Quick with -no-openglLaszlo Agocs2016-02-051-0/+3
| | | | | | | | | | | | | Disable qmltest, particles, Quick examples and tests. Also guard private QOpenGL header includes because, unlike the public QOpenGL* headers, this is not done in the private headers. This allows build attempts against a -no-opengl qtbase. It will of course fail when encontering the GL symbols and QOpenGL class usage in Quick/SG. Change-Id: I323f7a8b8854cc6e486e264517df30be3e5f8d3c Reviewed-by: Andy Nichols <andy.nichols@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>
* Merge remote-tracking branch 'origin/5.4' into 5.5Oswald Buddenhagen2015-07-201-2/+8
|\ | | | | | | | | | | | | Conflicts: tests/auto/quick/qquickwindow/tst_qquickwindow.cpp Change-Id: I272074fa2ca259439cae2f686325932f7f9d7c01
| * Doc: Document limits of QSGGeometry::setLineWidth5.4Kai Koehne2015-06-041-2/+8
| | | | | | | | | | | | Task-number: QTBUG-46260 Change-Id: Ib84a41da10d38391c3248a209a851f5b603d46b0 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>
* 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>
* Clearly point out the distinction between GUI and Render threads.Gunnar Sletta2014-03-201-0/+3
| | | | | | | | This is something it is easy to get wrong, so try to make it as visible as possible. Change-Id: I2253ae63214cef0fb91c8b9423d7918ffc20e888 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Use QSGGeometry::lineWidth() when drawing GL_POINTSAlex Montgomery2014-01-131-4/+6
| | | | | | | | | | | | | | Since glLineWidth doesn't affect the drawing of GL_POINTS, it makes sense to use the lineWidth member to affect point size when drawing points. [ChangeLog][QtQuick][QSGGeometry] Changed QSGGeometry::lineWidth to also affect point size (glPointSize) when drawing GL_POINTS, in addition to the existing behavior of affecting line width when drawing GL_LINES, GL_LINE_STRIP, and GL_LINE_LOOP. Task-number: QTBUG-35772 Change-Id: I0ea73f9261509e8d356f91a063dc90dc0f8980bd Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Add Q_UNUSED for reserved fields.Alan Alpert2013-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Prevents the following compiler errors with Clang src/quick/scenegraph/coreapi/qsggeometry.h:183:10: error: private field 'm_reserved_bits' is not used [-Werror,-Wunused-private-field] uint m_reserved_bits : 25; ^ src/quick/scenegraph/util/qsgsimplerectnode.h:66:11: error: private field 'reserved' is not used [-Werror,-Wunused-private-field] void *reserved; ^ src/quick/items/qquickclipnode_p.h:66:10: error: private field 'm_reserved' is not used [-Werror,-Wunused-private-field] uint m_reserved : 31; ^ src/quick/scenegraph/coreapi/qsgmaterial.h:143:11: error: private field 'm_reserved' is not used [-Werror,-Wunused-private-field] void *m_reserved; ^ src/quick/scenegraph/coreapi/qsgnode.h:267:10: error: private field 'm_reserved' is not used [-Werror,-Wunused-private-field] uint m_reserved : 31; Change-Id: I0ea00fbd4b45156dedabfd16a3cb3e5f6170f2ff Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* improve docs of QSGGeometry::set[Vertex|Index]DataPatternGunnar Sletta2013-05-161-2/+4
| | | | | Change-Id: I6ca0d8549891302cc9d71bdfac11704752caaf60 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Doc: corrections, spelling, and ListView requirements commentsDavid Fries2013-05-151-6/+6
| | | | | | | | | | From the ListView comment I thought the model had to be derived from QAbstractListModel, but that's not the case, QAbstractListModel will work just fine, it just doesn't support specific cases such as trees. Change-Id: I59305006540ddc049e276cf412571373cbfa6c67 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Added examples on how to use FBOs with scene graph.Gunnar Sletta2013-03-031-1/+1
| | | | | | | | | | I also cleaned up the naming of the other scene graph examples a bit, so that they sort together in the samples list and have a more obvious naming scheme. Task-number: QTBUG-29548 Change-Id: I455eacb02c06058a6d49e12e4f1813ec80b655f6 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>
* doc: fix some typos in .cpp filesSergio Ahumada2012-09-071-1/+1
| | | | | Change-Id: Ica7685aefde84ec80d8af7a67541af454de4adce Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Three scene graph examples with docs.Gunnar Sletta2012-08-131-1/+1
| | | | | | | | How to make a custom QSGGeometry, how to use QSGSimpleMaterial and how to use render with raw GL. Change-Id: I3e5a32b6ae12d7d781c11050ed26a54845e92cca Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix various broken links in documentationBea Lam2012-08-031-1/+1
| | | | | Change-Id: I9e2dac37d18e3ca62e4a92be25e5c2e60ffeba00 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Improve on scenegraph documentation.Gunnar Sletta2012-06-081-33/+306
| | | | | | | Change-Id: Ib584a45454f6fd2a3c0bfb32a76b19839e4a2a09 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Fix documentation for QSGGeometry::allocate()Glenn Watson2012-05-161-0/+3
| | | | | | | | | | Make clear in the documentation that client code must dirty the geometry node that contains the geometry class, to allow the renderer implementation to update internal buffers. Change-Id: I5cfddee1d0969410d7b3175c381679bd9083cc2b Reviewed-by: Damian Jansen <damian.jansen@nokia.com> Reviewed-by: Alex Wilson <alex.wilson@nokia.com>
* Fix compilation on QNX.Tobias Koenig2012-03-201-0/+4
| | | | | Change-Id: I5e01cad23066a645c1434ce1463d370733f53e4f Reviewed-by: Alan Alpert <alan.alpert@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 Nokia copyright headers.Jason McDonald2012-01-171-1/+1
| | | | | | | | Update copyright headers from before 2011, and a couple of new ones that were merged after the previous change to copyright headers. Change-Id: Ia76e08e2734afa4ef3f1207dbcda5ff3bc81b366 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove out-of-line uses of qMalloc/qFree/qRealloc.Robin Burchell2012-01-121-3/+3
| | | | | | | | | Per http://codereview.qt-project.org/#change,11562, we are trying to remove these in favour of direct allocation, or (in the case of inline code) specialised out-of-line wrappers. Change-Id: I113609c4f97dc5c8020a72cbd398572cdb5b7505 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add lineWidth property to QSGGeometryAlex Wilson2011-12-151-0/+25
| | | | | | | | | Allows users to set a line width when using drawingModes GL_LINES, GL_LINE_LOOP etc. Only calls glLineWidth on these drawingModes, and does it just before the glDrawElements/glDrawArrays. Change-Id: I2af583970b2acf0ddb59025a454caa75a8ddbd4f Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+466
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>