aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential crash when using text and more than 1 QQuickViewEskil Abrahamsen Blomfeldt2012-09-282-7/+20
| | | | | | | | | | | We need to use a resource guard for the FBO in case there is no current context when the glyph cache is deleted. This reverts commit b3264e2cb6a8fe87754aa1335ab9f8d5e3910c14 which was implemented as a band-aid for this crash. Change-Id: I5b3a09a3998da38836ea851cd0978d3ddadcd2cc Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Work around mis-optimisation on QNX/SGX in AA vertex shaderSean Harmer2012-09-262-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | The new AA algorithm which is implemented in the vertex shader of SmoothColorMaterialShader and SmoothTextureMaterialShader exposes a driver bug in the glsl compiler/optimiser for the GPU used in the BlackBerry PlayBook. The bug results in the if (scale < 0.0) scale = 1.0 code always being executed even when the condition is false. This leads to massive corrupion of Image, Rectangle, and BorderImage elements when the antialiasing property is enabled. This commit works around the compiler bug by refactoring the vertex shader to explicitly include an else clause. The check for negative values is now performed on the numerator only as the denominator is dot(dir, dir) which is always positive (square of magnitude of dir vector). This gives the correct behaviour on all platforms (that I have access to). Change-Id: I236542c9b59ff2915e95cbd9300b442be316bba9 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2367-1610/+1610
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Avoid hanging if glGetIntegerv() fails.Jason Barron2012-09-211-1/+1
| | | | | | | | | If 'count' is not initialized, it could be anything and if the call to glGetIntegerv() fails and leaves this value unchanged then the loop could go through any number of iterations. Change-Id: Ibdcfd018b70e265ef6aeab87a5df8c0530c653a7 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* doc: fix some more typosSergio Ahumada2012-09-101-1/+1
| | | | | Change-Id: I7fa055049b9e5900d597754c6004febb153de12b Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* doc: fix some typos in .cpp filesSergio Ahumada2012-09-076-8/+8
| | | | | Change-Id: Ica7685aefde84ec80d8af7a67541af454de4adce Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Doc: Fix documentation issues.Kim Motoyoshi Kalland2012-09-073-1/+18
| | | | | Change-Id: I03c4faa1aee60cd1ad706cb6c1b983f03311d251 Reviewed-by: aavit <qt_aavit@ovi.com>
* Doc: Fix some documentation issues.Kim Motoyoshi Kalland2012-09-051-4/+0
| | | | | Change-Id: I0f7e60fd6060381bd8790dfaacc3a39a890a0fe7 Reviewed-by: aavit <qt_aavit@ovi.com>
* Document QSGTexture.Jason Barron2012-08-271-0/+41
| | | | | | Task-number: QTBUG-23192 Change-Id: I4a91dfaa0aa80d3cdc6c785fcaefdeafe60a2149 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix compilation on OSX 10.6Sean Harmer2012-08-211-2/+2
| | | | | | | OS X 10.6 does not support the GL_ARB_framebuffer_sRGB extension. Change-Id: Ifea8eaf3ffca6242d908538afeb983131a113c73 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Compile on OpenGL ES2 when using Khronos headersSean Harmer2012-08-162-1/+24
| | | | | | | | | | | | | | This change is needed to allow qtdeclarative to build with change https://codereview.qt-project.org/#change,28334 as OpenGL ES 2 and the EXT_sRGB do not define the symbol GL_FRAMEBUFFER_SRGB. Also use symbols defined by OES extensions where needed. The #defines will be removed in a follow-up commit once 28334 has been merged. Change-Id: I1c4e5297c29ecf723463da7fbfe353628c4c35ef Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Three scene graph examples with docs.Gunnar Sletta2012-08-132-1/+3
| | | | | | | | 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>
* Properly check for ability to use GL_REPEAT with npot texturesSean Harmer2012-08-072-2/+2
| | | | | Change-Id: I8dcc1c3f1d6959eef35a45f920bb37c08100a510 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>
* Adding mediump precision qualifier in distance-field fragment shaderThomas Senyk2012-07-241-1/+1
| | | | | | | | | sampler2D texture had no precision qualifier. This was intepreted as lowp on trim slice, leading to a glsl-compile-error because of mismatching types. Change-Id: I0a6726f6cde15c7d81f891ec75caed702f273021 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QSGContext::defaultSurfaceFormat() should be double-bufferedJan-Arve Saether2012-07-231-0/+1
| | | | | | | | | The problem was that if the opengl driver is single-buffered by default it will remain so. The scene graph really want double-buffered rendering. Change-Id: Ie80f71276d1dd1304c75170f3ca17e585800e8b8 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Correct attribute name in image shader.Michael Brasser2012-07-191-1/+1
| | | | | | Task-number: QTBUG-26563 Change-Id: I346bc155aa16e92367dee2082974856769bad90a Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-174-10/+10
| | | | | | | | | | | | | | | | 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>
* Change antialiasing method for QML2.Kim Motoyoshi Kalland2012-07-139-414/+1156
| | | | | | | | | | | | | Since multisampling can require a lot of memory, and might not be supported on some hardware, turn off multisampling and implement antialiasing in the vertex shader instead. The alternative method of antialiasing is implemented for Rectangle, Image, BorderImage and AnimatedImage, and must be explicitly enabled by setting the new antialiasing property. Task-number: QTBUG-26268 Change-Id: I39a93d978658a494bf51e9f0fd02d8414eb8be12 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* load plugins properly when QT_NO_SETTINGS is definedTasuku Suzuki2012-07-101-3/+3
| | | | | Change-Id: I2d28d698f4bb5cc299f1ce83b1ecb7fa87bc5fdb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add option to use native rasterizer for SceneGraph textEskil Abrahamsen Blomfeldt2012-07-103-7/+56
| | | | | | | | | | For old-style (desktop components) apps using QML 2 on regular density displays, distance field text will look out of place. We introduce an option to use the native rasterizer instead if you would rather have native look and feel than scalable text items. Change-Id: Idb38e3c89f2deab9ae1963357c6c5fb235ddeab8 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Use qFloor instead of qRound for glyph coordinatesJiang Jiang2012-07-051-2/+3
| | | | | | | | Like we did in raster paint engine to make sure glyphs are positioned correctly. Change-Id: I1327b8727bd2b5085dfb2edc11b4d049403a2fb5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* android: don't unconditionally use execinfo.hRobin Burchell2012-07-021-4/+16
| | | | | | | | | | | | android (a superset or subset, depending on your POV) of Linux doesn't seem to have execinfo.h, so disable it there. also simplify the conditional a little so we don't have to alter this all over the place if the platform support changes in the future. Change-Id: I937b04f363dfff2b10e1696f11e67d4ba55b3b06 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Use resolved font name for key in distance field cache.Andrew den Exter2012-06-272-8/+20
| | | | | | | | | | On windows at least multiple QRawFonts can share a family name but have different font engines. Prefer the faceId information when constructing a key for the distance field cache to avoid a conflict. Task-number: QTBUG-26201 Change-Id: I9111f22045eb35e6535039117ec4184075e778a4 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* initializeGLFunctions is deprecated, replace itThiago Macieira2012-06-261-1/+1
| | | | | Change-Id: I102bf78522a0d5b14dc8ce2c1d189f10634d7905 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fixed glyph margin in QSGDistanceFieldGlyphNode.Yoann Lopes2012-06-081-10/+17
| | | | | | | | | The margin was too big in some cases, causing visual artifacts. The margin should never be bigger than the margin used in the glyph cache. Change-Id: Ia6bd3a9d4a98a2a3484d0e5e803de95ca14fffbb Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Support for variable glyph width in QSGDefaultDistanceFieldGlyphCache.Yoann Lopes2012-06-084-71/+69
| | | | | | | | | | | 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>
* Improve on scenegraph documentation.Gunnar Sletta2012-06-0812-133/+680
| | | | | | | 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>
* Remove unused performance flags.Michael Brasser2012-06-064-132/+5
| | | | | | Change-Id: I9a9111703e2480af02b1af7033ea6bb12e7a75a5 Reviewed-by: Glenn Watson <glenn.watson@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix resizing of QQuickPaintedItems that use FBOs.Kim Motoyoshi Kalland2012-06-011-0/+4
| | | | | | | Task-number: QTBUG-25472 Change-Id: Icc8d0f93841a76bbc92d09e0bf96f147ac64a8c6 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Uses new batching API to potentially speed up glyph cacheEskil Abrahamsen Blomfeldt2012-05-302-11/+88
| | | | | | | | 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>
* Initialize data members in quick.Martin Jones2012-05-291-0/+1
| | | | | | | Found by static analysis. Change-Id: Ide1ce1d7964655664dc872de6da9962a281e229c Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Simplify the depth transformation in the scene graph.Kim Motoyoshi Kalland2012-05-253-12/+8
| | | | | | | | | | | | | Use default depth function GL_LESS and depth clear value 1, and set the near and far clipping planes to -1 and 1. This change will make the transformations a bit easier for people who implement custom 3D geometry since [-1, 1] is the typical z-range after a projection transformation. The change has no visual impact on 2D geometry. Change-Id: I75d4a8acc15131ffaa5d13a749e42dffbc1d09db Reviewed-by: Glenn Watson <glenn.watson@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QtDeclarative: Fix warnings about uninitialized variables.Friedemann Kleint2012-05-211-2/+2
| | | | | Change-Id: Ie918f1e813b243b250cedfc2e94e9c66288d08e3 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Remove unnecessary exportsMatthew Vogt2012-05-1814-30/+33
| | | | | | | | | Reduce library load time by removing any exports which are not required by existing clients. Task-number: QTBUG-24768 Change-Id: Ia5754d6f97bb2ed46e290820a5b092f85a4bc5b0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Only genereate new texture if texture id is 0Charles Yin2012-05-171-1/+1
| | | | | | | | | Otherwise a new texture would be created for accessing textureId() function everytime and even worse thing is these textures will never been deleted and eventually cause gl out of memory. Change-Id: I349fcf15b5aeabbd9420a8dd645e0fdcc1d256bf Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Removed ### from scenegraphGunnar Sletta2012-05-164-50/+5
| | | | | Change-Id: I6b114938d2c52df95469975ffa87449f7fd8c647 Reviewed-by: Kim M. Kalland <kim.kalland@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>
* 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>
* Remove usage of deprecated plugin loader functionality.Friedemann Kleint2012-05-151-1/+3
| | | | | | | | Use QFactoryLoader::instance(int) instead if deprecated QFactoryLoader::instance(key). Change-Id: I61d087e7e03d472f69427e53f5f194856eb5bffe Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QtQuick: Fix string related warnings, single character strings.Friedemann Kleint2012-05-143-8/+8
| | | | | | | | | - 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>
* Docs for QSGimpleMaterialShaderGunnar Sletta2012-05-093-2/+215
| | | | | Change-Id: I769eb68a1703a2cc7379af702fb888d3e9697300 Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* Adapt to _qpa file rename in qtbase.Girish Ramakrishnan2012-05-082-3/+3
| | | | | | | | | 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>
* Fix qmake logicKai Koehne2012-05-071-1/+1
| | | | | | | Regression introduced with 8867be2d1d92e981ed736330f036a681ce4b520b Change-Id: I8c109399c28c729403535332f8f15df8dfe32b8d Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Added some documentatio notes on QSGNode::markDirty()Gunnar Sletta2012-05-051-2/+28
| | | | | | Change-Id: I631d85596113c38c9f19da9e65e9cae90c3bfebf Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove QSGEngineGunnar Sletta2012-05-034-219/+1
| | | | | Change-Id: Iaab0d9f607b1f4ca6dfb13495a456d1b31bb980a Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Improved scene graph docsGunnar Sletta2012-04-302-0/+89
| | | | | Change-Id: I013e8eba2c13bd7abb01d2116af2e72c99ea5921 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qMalloc, qFree, qRealloc, qMemCopy, qMemSet are deprecatedOlivier Goffart2012-04-232-2/+2
| | | | | | | | Use the stdlib version directly instead Change-Id: Ifc600f6c418b395c4ada9e5beb207ad3985575e3 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* 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>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-04-172-3/+1
|\ | | | | | | Change-Id: I39905acde16ba6bb0ba39401cb73082a73dd9167