aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* Say hello to QtQuick moduleKent Hansen2011-12-0263-16705/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove QSGContext and QSGTexture from QDeclarativePixmapDataGunnar Sletta2011-12-022-29/+36
| | | | | | | | | | | | | | | | | | | | | | | In order to cleanly support multiple windows we need to not have the QSGContext reference in QDeclarativeEngine and we need to be able to have one copy of the texture for each QSGContext that is not sharing when we have multiple windows. This also makes it easier to the release graphical resources from a running application, which is another feature that we want to eventually implement. This patch does remove an adaptation feature which is the decodeToTexture, which seemed like a good idea at the time but in hindsight has not been used for anything. Edit: resolved conflict in qquickimage.cpp Edit: updated QDeclarativePixmap testcase Edit: updated QQuickImage testcase Edit: Rebased on top of QDeclarativePixmapCacheChanges Change-Id: Ifc61dd8158d3f841437d029b6031a91196145517 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix unused variable warning in QSGContext constructorKent Hansen2011-11-281-1/+0
| | | | | Change-Id: I8b6fbc7765093e3ec98f5847d99dbb406ff71221 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Remove documentation for non-existing functionGunnar Sletta2011-11-231-8/+0
| | | | | Change-Id: I1f08e0501694bde6991eb35adaadb9fa4a3356c1 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Silence compiler warnings about unused variables (MSVC)Kai Koehne2011-11-211-0/+4
| | | | | | | Fixes most 'C4189: local variable is initialized but not referenced' warnings Change-Id: I8c5a1ba0a50dd3fcb22294e564425846362ee911 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix Qt Declarative namespace compilation.Toby Tomkins2011-11-212-0/+4
| | | | | Change-Id: Ib3294278985cd43e40610dacd7b69bf98ff4d788 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Copy QSGEngine functions to QQuickCanvas.Gunnar Sletta2011-11-184-179/+23
| | | | | | | | | | | | Long term we intend to remove the QSGEngine class all together so this is the first step. It duplicates some of the logic but doesn't break anything. Also including an example on how to use it in examples/declarative/openglunderqml Change-Id: I69ed93ec5fa1b5c4c746169306d38f8d6ce80477 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fixes crash in QSGDefaultDistanceFieldGlyphCache::resizeTexture()Yoann Lopes2011-11-172-82/+73
| | | | | | | | | The blit shader was not valid anymore after deleting and recreating a QQuickCanvas. Task-number: QTBUG-22783 Change-Id: Id13578006b89859b862685b3a695eb8b59a48c56 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Performance optimization in transform node traversal.Tero Tiittanen2011-11-172-8/+12
| | | | | | | | | | | | | Transform node matrix calculation was modified to use the combined matrix stack instead of matrix stack. Combined matrix stack has already been used by clip and geometry nodes. This improves performance because combined matrix stack stores pointers (matrix stack stored objects). It also removes duplication of information. Change-Id: I1a5a2546fa9aa5a4823328dd8a321ddc42fd15a0 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fixed some copy-paste errors is documentation.Tero Tiittanen2011-11-161-4/+4
| | | | | Change-Id: I882df7dffea032e9fae16e87f48f70c5d26beb26 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Texture coordinates fixed in subrect tiling in SG image node.Tero Tiittanen2011-11-161-4/+9
| | | | | | | | | Fixes the texture coordinates for the inner tiles in a tiling algorithm that scenegraph default image node uses when texture is a subrect and image repeats. Change-Id: Iacf3e63c4c02bdbdc473f8128efecc7908322a50 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Distance field glyph cache refactoring.Yoann Lopes2011-11-1414-801/+1199
| | | | | | | | | | | | | | | The distance field glyph cache is now an abstract class part of the adaptation layer. It can be implemented to define the way the glyphs are stored in graphics memory on a specific platform. The typical use case is for having a cross-process glyph cache. To implement a custom glyph cache, one has to override three pure virtual functions: requestGlyphs(), storeGlyphs() and releaseGlyphs(). The default implementation works the same way as before the refactoring (no cross-process cache). Change-Id: I6e231a119abbffbe36f5f0d690f0b8be0664ff4f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Export QSGDynamicTextureCharles Yin2011-11-111-1/+1
| | | | | | | | The QSGDynamicTexture is in the public header and documented, it should be exported like QSGTexture as well. Change-Id: I7c1811509b0311b177d3b9c9bdb893d1383c6d59 Reviewed-by: Juha Vuolle <juha.vuolle@nokia.com>
* Fix default glyph node after qtbase refactorJiang Jiang2011-11-081-1/+1
| | | | | Change-Id: Ib08c1bcf33bafcee828169b3ddfa264bd010cfef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Minor improvements to some of the node implementations.Kim Motoyoshi Kalland2011-11-073-20/+12
| | | | | Change-Id: I05c7c4810b37d8f808e812eac7b2128d21de36c8 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Fixed Rectangle where the radius is less than half the border width.Kim Motoyoshi Kalland2011-11-011-4/+12
| | | | | | | Task-number: QTBUG-21215 Change-Id: Ife6a8aa9070e3da49d02825507a00feb1ecf338f Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Declarative: Fix gcc 4.6 warnings about assigned/unused variables.Friedemann Kleint2011-11-011-1/+1
| | | | | | Change-Id: Iac4bb4a6b1aa4071a239bb25f25f01b71e36868b Reviewed-by: Alexis Menard <alexis.menard@openbossa.org> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Eliminate some warningsJiang Jiang2011-10-311-3/+3
| | | | | Change-Id: Ic76e02ee0a46002e8a30614fb7b1799dd0b74d95 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix PaintedItem redraw bugCharles Yin2011-10-282-3/+3
| | | | | | | | | | | | 1) After QQuickItem::update() being called (means item's content is dirty), the paint() function should always been called, so the contentsDirty and geometryDirty flags are not needed. 2) Update the smile example to validate the above changes Task-number:QTBUG-22250 Change-Id: I5a72f18e6982bdb3ba23e78a253c2876aca2e8cb Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Fixed QQuickPaintedItem texture binding when using Image render target.Yoann Lopes2011-10-271-18/+23
| | | | | Change-Id: Ia5c0f8de1109a26471c69267fdd9c9d71325dd39 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Remove Q_WS_*, symbian and maemo code in QtDeclarativeDamian Jansen2011-10-261-1/+1
| | | | | Change-Id: If64daf80f9d19973e0bc2d864b003a66be5ca61d Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Get rid of legacy glTexParameterf calls.Samuel Rødal2011-10-243-14/+14
| | | | | | | | | | | ES 1.0 didn't have glTexParameteri, which is why we sometimes used glTexParameterf. However, we shouldn't use glTexParameterf because that's treating integer values as floating point, which is not type safe. ES 1.1+ and ES 2.x have glTexParameteri, and we don't really care about supporting ES 1.0 in any case in Qt 5. Change-Id: I12247e4ffc8cb0e18b0ffca5759d4655b5432008 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Provide a way to cheaply flip your painted FBOSarah Smith2011-10-231-3/+7
| | | | | | | | | | | | After recent changes the painted images are upside down from previous and there is no way to get at the texture coordinates to flip them back without reimplementing QSGPainterNode and QSGPaintedItem. This change adds only an enum and has minimal impact, while providing useful functionality that also fixes this problem. Change-Id: I6884da884d9303f6e08a984d4560cc7f7728d918 Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
* Rename Qt Quick-specific classes to QQuick*Kent Hansen2011-10-218-40/+39
| | | | | | | | | | | | | | | | | | | | | | The QSG (SceneGraph) prefix is too generic for Qt Quick(2)-specific classes. All the classes and files in the declarative/items directory have been renamed. In particular, for classes that are currently public, the renaming is as follows: QSGView --> QQuickView QSGCanvas --> QQuickCanvas QSGItem --> QQuickItem QSGPaintedItem --> QQuickPaintedItem The header files have been renamed accordingly (e.g. qsgview.h --> qquickview.h). Change-Id: Iac937fff81db20bb639486a793c3aeb5230b038c Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Declarative: Fix MSVC and g++ warningsFriedemann Kleint2011-10-192-1/+3
| | | | | | | | | | | | | | | | | Potentially severe: - Fix int/bool mismatches - Use of uninitialized variable - Do connectionMask shift operations in 64bit - Enum type mismatch for QLineControl::EchoMode Various: - class/struct mismatches - UnhandledEnumeration values - Unused variables - Constructor initialization order Change-Id: Ieb52f8990445fe95f94070175a0f9beb66863240 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Clean up declarative includesKent Hansen2011-10-174-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This commit is in preparation of moving several files to a separate library (QtQuick2).) Don't add all subfolders to the includepath (from the .pri files). There's no good reason to do that. For headers (both public and private) that are in the same folder as the file that includes them, prefer to use #include "foo.h" #include "bar_p.h" For public headers that are outside the current folder but have "unambiguous" names (e.g. qdeclarative prefix), use #include <foo.h> For private headers that are outside the current folder, use #include <private/baz_p.h> Also change #include <QtDeclarative/private/foo_p.h> to #include <private/foo_p.h> The header filenames already have a qdeclarative or qsg prefix; there's no need to prefix by module name to disambiguate. Finally, #include "private/foo_p.h" should be avoided. private/ is used for auto-generated (forwarding) headers, which never reside in the current (source) directory. Use angle brackets instead. Change-Id: I04f8477fdba043546064ee276475c09dc373f8f2 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Don't accidentally use atlas images in particle nodesGunnar Sletta2011-10-051-0/+6
| | | | | | | Change-Id: I3058d9262bbc32c873ba26e51b04668f89ed060a Reviewed-on: http://codereview.qt-project.org/6039 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Make sure the Image texture provider does not return an atlassed textureGunnar Sletta2011-10-052-3/+26
| | | | | | | | | | | | | | | | | | This has the implication that textures from texture providers are always the complete texture with coordinates from 0-1, which is means we get a copy for atlas textures which may end up affecting performance. Alternatives are: - ShaderEffect does this, which means texture providers can provide atlas textures. - We expose the subrect to ShaderEffect, which means an API change in all shader effect classes, and let the vertex shader solve this. Worst API, fastest and most memory efficient. Change-Id: Id58eb866f315012637345a6f731626abf4a7a86c Reviewed-on: http://codereview.qt-project.org/6029 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Add debug description to QSGDistanceFieldGlyphNodeGunnar Sletta2011-10-041-0/+3
| | | | | | | Change-Id: If66482f6e00bfade2da3b9067ff51ef782cd486e Reviewed-on: http://codereview.qt-project.org/5849 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* move depth logic out of QSGRendererGunnar Sletta2011-10-042-3/+3
| | | | | | | Change-Id: I1fc3baf858664ea9648922204fa0e4d5ca64d740 Reviewed-on: http://codereview.qt-project.org/5848 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Have textureId() return the correct value and document this behaviorGunnar Sletta2011-10-042-5/+34
| | | | | | | Change-Id: Ia75b5fc3b6c9f15bb15e8850295c33ba32a485f1 Reviewed-on: http://codereview.qt-project.org/5970 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Include the textureid/glyph cache in the material sortingGunnar Sletta2011-09-301-0/+2
| | | | | | | Change-Id: Ic9740081e9e0e53801bbda64f6b147ab74102663 Reviewed-on: http://codereview.qt-project.org/5887 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Add QSGPaintedItem docs to module and fix non-standard wording.Casper van Donderen2011-09-274-11/+29
| | | | | | | Change-Id: I763b1fdabdac36935bd14005a9e38b2494319726 Reviewed-on: http://codereview.qt-project.org/5521 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Disable reordering as it is currently brokenGunnar Sletta2011-09-261-1/+1
| | | | | | | Change-Id: I28b622422aff62ea988a2918830338736df6fdbe Reviewed-on: http://codereview.qt-project.org/5528 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Make surface format plugable from the scene graph pluginGunnar Sletta2011-09-262-3/+17
| | | | | | | | | | | | | | | Also enable depth, stencil and samples by default as our default renderer requires both depth and stencil and our default rounded rectangles require multisampling The user should be able to override the default format, by getting the QSGCanvas::format(), modify it and set it back, but this is currently not supported in QWindow, so that will have to wait Change-Id: I1869003705709987ab2e9a3cebbeeec4d45a2021 Reviewed-on: http://codereview.qt-project.org/5464 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* do not pollute the global namespaceGunnar Sletta2011-09-232-28/+29
| | | | | | | Change-Id: I6a6bd1b9ff89535c7af0f11dd9c501945ee0718b Reviewed-on: http://codereview.qt-project.org/5428 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added PerformanceHints flags to QSGPaintedItem.Yoann Lopes2011-09-202-4/+28
| | | | | | | | | | | | At the moment only contains FastFBOResizing. If this flag is set to true and when using a FBO as render target, the FBO will use a larger texture than the size of the item to avoid too many resizing. Change-Id: I3b8a51a5a07329ff3ed010a35dc8235913201a8e Reviewed-on: http://codereview.qt-project.org/4651 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Fix warnings.Michael Brasser2011-09-161-3/+3
| | | | | | | Change-Id: I7f066550fa2e1799f1c44b787da84c882f549b03 Reviewed-on: http://codereview.qt-project.org/5036 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Fix missing/outdated license headers.Jason McDonald2011-09-161-0/+41
| | | | | | Change-Id: Ib5f244a61cb65db829ee83ec9e4d5e4189319a9f Reviewed-on: http://codereview.qt-project.org/4936 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Fixed failing test in QSGFocusScope.Matthew Cattell2011-09-141-1/+4
| | | | | | added some waits and removed unnecessary lines from autotest Change-Id: I847bde6db5222b12d0f0b88a8c323fd09aad9d7c
* Fix QtDeclarative refactor branch clean compilationJoona Petrell2011-09-121-1/+1
| | | | | | | Change-Id: I6a5d6cc4de7a7b50cbf49a535cd764cb07ce3c40 Reviewed-on: http://codereview.qt-project.org/4684 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Vesa Rantanen <vesa.rantanen@nokia.com>
* changed include to use newly public qsgvertexcolormaterial headerMatthew Cattell2011-09-122-2/+2
| | | | | | | Change-Id: I701b573b6c93d6e69ea6f8fc16b5913162bf9ace Reviewed-on: http://codereview.qt-project.org/4680 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Implement QSGVertexColorMaterial::compare and make the class publicGunnar Sletta2011-09-123-10/+10
| | | | | | | | | | Since the opaque state is just as easily settable through the Blending flag, we ditch it Change-Id: I92598e3305bd056fdf0711f1fbd6c1be8bf88275 Reviewed-on: http://codereview.qt-project.org/4628 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* orient the fbo rendering the same way as other fbo rendering and enable ↵Gunnar Sletta2011-09-121-3/+6
| | | | | | | | | multisampling Change-Id: Ibfb3bd9577efc50ca7654019638d22b9077df6bb Reviewed-on: http://codereview.qt-project.org/4627 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* rename QSGGeometry::stride() to sizeOfVertex for symetry with indexGunnar Sletta2011-09-086-20/+32
| | | | | | | | | Also support GL_UNSIGNED_INT as index type when supported by GL Change-Id: I0988e102c8a04ce6cd02fb02528204ba810f853a Reviewed-on: http://codereview.qt-project.org/4453 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* compile againGunnar Sletta2011-09-082-4/+21
| | | | | | | Change-Id: If041994fdadcd24f9b002bbcf76ce50f3b56ce87 Reviewed-on: http://codereview.qt-project.org/4431 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* make render timing an environment variableGunnar Sletta2011-09-071-13/+26
| | | | | | Change-Id: Iadc72a0beb5e6d700b0110d11116a7533c69f311 Reviewed-on: http://codereview.qt.nokia.com/4338 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Added QSGGeometry::Attribute::isPosition to give a hint about vertex dataGunnar Sletta2011-09-072-5/+52
| | | | | | | | | Also added a QSGGeomtry::sizeOfIndex() function for convenience Change-Id: If1f13afd4c1c5295dcfb00254144ef6b8b8b7878 Reviewed-on: http://codereview.qt.nokia.com/4307 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* move QSGNodeUpdater into private header where it belongsGunnar Sletta2011-09-074-42/+42
| | | | | | | Change-Id: I5cb12cac3d49cfd9b1682b405e65b2cdea4eb57d Reviewed-on: http://codereview.qt.nokia.com/4306 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add QSGFlatColorMaterial::compare for better sortingGunnar Sletta2011-09-012-0/+10
| | | | | | | Change-Id: Ic6229c777a30191ba131b3896984da4f3fecc9d5 Reviewed-on: http://codereview.qt.nokia.com/4066 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>