aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* Enable QSG_RUNTIME_DESCRIPTION by default for debug builds.Gunnar Sletta2014-07-032-5/+8
| | | | | | | | | This can be quite helpful when doing scene graph debugging with QSG_RENDERER_DEBUG=dump or using qDebug() on nodes in general. Change-Id: I6328d3f2a0fad87161c386bed14408598c986dcb Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/devFrederik Gladhorn2014-07-021-0/+2
|\
| * Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-021-0/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/quick/scenegraph/openglunderqml/squircle.h src/quick/doc/src/qmltypereference.qdoc src/quick/scenegraph/qsgthreadedrenderloop.cpp Change-Id: Ife4f4b897044a7ffcd0710493c6aed1d87cf1ef9
| | * Merge remote-tracking branch 'origin/stable' into 5.3Frederik Gladhorn2014-06-251-0/+2
| | |\ | | | | | | | | | | | | Change-Id: Iafccb173a9b5569bc9fd1022abb210955519fc61
| | | * Set locked state while locking for grab.Gunnar Sletta2014-06-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If4b8fa77e6e3a288487a011e83791ad6a189675c Reviewed-by: Manish Sharma <83.manish@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | | | Use qNextPowerOfTwo instead of reimplementing itAllan Sandfeld Jensen2014-07-022-29/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses the new shared qNextPowerOfTwo implementation introduced in qtbase. Change-Id: I831d056f584897a99df2ceb8c1d840764464e344 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | | | Fix output of swap times for basic render loopUlf Hermann2014-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The swap time was treated as absolute by the qCDebug output, but was actually relative. Change-Id: Ia1539b8f8305ca37430022803419eb12a05934cb Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | | | Properly collect polish timings from all render loopsUlf Hermann2014-07-028-17/+19
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0110-332/+239
| | | | | | | | | | | | | | | Change-Id: I865ee838b0fd6c257b7189f24130012b98206fd1 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | Avoid deadlock during window hiding.Gunnar Sletta2014-07-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we do event processing in polishAndSync, hide() or handleObscurity() might have been called by the time we continue execution. We already handled that windowDestroyed() was called. Change-Id: If45bcf3fa18cef1a60ca31bc26d3830045f581d9 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | | Warn at runtime about badly threaded calls to QQuickItem::update()Gunnar Sletta2014-06-251-3/+5
| | | | | | | | | | | | | | | Change-Id: Ia3fc01f11ff28441d4ef095b520297a73e3399d6 Reviewed-by: Laszlo Agocs <laszlo.agocs@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/5.3' into devSimon Hausmann2014-06-135-6/+11
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/quickwidgets/qquickwidget.cpp Change-Id: Id4b080aea713df68608847bb82570231e37ce536
| * | Initialize QSGPaintedNode with an empty size.Gunnar Sletta2014-06-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Failing to do so would cause it to not update its size when set to 1x1 which in turn would cause it to never update its texture, causing crashes later during rendering. Task-number: QTBUG-39555 Change-Id: I099d9ef2d6968ece21f7c03819abfd6685bec430 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
| * | Add node description to painted items.Gunnar Sletta2014-06-121-0/+4
| | | | | | | | | | | | | | | Change-Id: I47ad9df1550649131ac5379acbf7d133088c60a8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * | Make sure shader rewriter stops immediately on an empty string.Gunnar Sletta2014-06-121-3/+1
| |/ | | | | | | | | | | | | | | | | The 'invalid' token didn't really serve a purpose. If a string contains 0 for any reason, it one has reached the end. Task-number: QTBUG-39505 Change-Id: I3fc9b8f28dc223386a72bbfa28f70fcca0fde223 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Stop polish-and-sync timer when the window is destroyedLaszlo Agocs2014-06-101-0/+2
| | | | | | | | | | | | | | | | | | | | The threaded render loop continues to run the polish-and-sync timer for ever in case the QQuickWindow is destroyed while the timer is active. Instead of pumping the timer events on the render thread for ever, the timer has to be killed somewhere. Change-Id: I8e458624e26ebfacb6cc69a4f2fbb3da57ae5e0e Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Fix opacity issue in the renderer.Gunnar Sletta2014-06-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the following tree: OpacityNode | TransformNode (which is a batch root) | GeometryNode If both opacity and transform nodes were changed this frame, we would hit the optimized "scrolling" path while traversing the tree and abort updating that subtree. As a result the opacity change was not propegated to the geometry node and it would be rendered incorrectly. Fix this by skipping the optimized path when there are opacity changes in an ancestor. Task-number: QTBUG-39190 Change-Id: Ieaebfe3de62b961204bd3103fe9913d60e75e412 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Use the correct precision specifier in visualizer GLSL.Gunnar Sletta2014-06-041-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-39119 Change-Id: I0ec4909167f5694ce4229df8202c89742be21d0a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-06-042-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Keep the internal state about the bound fbo up to dateLaszlo Agocs2014-06-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When binding an FBO directly via glBindFramebuffer, the QOpenGLContext's internal current_fbo, that is maintained by QOpenGLFramebufferObject, becomes out of sync. This will lead to QOpenGLFramebufferObjects thinking they are still bound. This fix prevents ShaderEffect items in QQuickWidget from complaining about "'recursive' must be set to true when rendering recursively". Ideally the entire tracking of the current fbo should be removed, since it cannot be done robustly enough, but that will likely happen in 5.4 only. Task-number: QTBUG-38994 Change-Id: I39015d90bb2e0985d2a084b79ffe2004a9bc9f07 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Fix QSGPlainTexture object leakLiang Jian2014-05-281-0/+1
| | | | | | | | | | | | | | Delete m_texture in the destructor of QSGTextMaskMaterial class Change-Id: I0f3c59d2c5f094dcbc02eafa6ed782d16315eb44 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Avoid direct GL calls in QuickLaszlo Agocs2014-05-2310-171/+185
| | | | | | | | | | Change-Id: I9b8673fb3292c9d5ad2f9e8e63f56dc661699be6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Be conservative with atlas allocation for Cover windows.Gunnar Sletta2014-05-221-0/+10
| | | | | | | | | | | | | | | | | | These are usually small and require a very small amount of textures. Change-Id: I51a1d2965c37ac39c1f1f70d9bb6d7baf41e0562 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-1022-117/+204
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/accessible/quick/quick.pro src/quick/items/qquickpincharea.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp Manually adjusted for TestHTTPServer constructor change: tests/auto/quick/qquickimage/tst_qquickimage.cpp Change-Id: I5e58a7c08ea92d6fc5e3bce98571c54f7b2ce08f
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-0110-13/+13
| |\ | | | | | | | | | Change-Id: I996a85744753598bb48c7e0d7954049202f4f037
| | * Follow QOpenGLContext API renamingLaszlo Agocs2014-04-2510-13/+13
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-38564 Change-Id: Ice1170339f7d650fcb6accfccf325471629343d6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Mark material as dirty after changing color's opacity in Rectangle.Gunnar Sletta2014-04-301-5/+15
| | | | | | | | | | | | | | | Change-Id: I8037908bb2ba494001c516e2c7606c3bb54a14d8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * | Ensure RGB32 images are not converted on upload to atlas.Michael Brasser2014-04-281-1/+1
| |/ | | | | | | | | | | | | Fixes "Typo No.12" reported at http://www.viva64.com/en/b/0251/ Change-Id: Ifa4d57df68b9515c76a8fb94f87d0a70ba3b5faf Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Regenerate mipmaps after changing the imagedata of a texture.Gunnar Sletta2014-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | This has been a latent bug since the class was written, but has only surfaced after 15999f14f146b5c04fb40b31b69ceeeece273430 when mipmapping was allowed for all QSGPlainTextures. Task-number: QTBUG-38321 Change-Id: I058e554c4035c573d2ddb4ea793d8ad53e11e54b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Disable mipmap filtering by default in texture materials.Gunnar Sletta2014-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 15999f14f146b5c04fb40b31b69ceeeece273430 changed QSGPlainTexture so it allows mipmap filtering by default. This requires a call to glGenerateMipmap() for textures to be valid, if mipmap filtering is used. Our texture materials follow the GL default which is to use the somewhat useless GL_NEAREST_MIPMAP_NEAREST. As a result we've had a number of bugs where textures are used and the call to glGenerateMipmap() is omitted. This happens for instance when using QQuickTexture::createTextureFromId(). Generating mipmaps by default is also a serious performance regression. To remedy this and minimize the impact on existing code, we disable mipmapping by default. [ChangeLog][QtQuick][SceneGraph] QSGTextureMaterial and QSGOpaqueTextureMaterial uses QSGTexture::None as default mipmap mode. Task-number: QTBUG-38321 Change-Id: Ia9d09fbcf710efb4575938053d0a2046f604a197 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Don't mipmap by default in QSGSimpleTextureNodeGunnar Sletta2014-04-071-0/+2
| | | | | | | | | | | | Task-number: QTBUG-37646 Change-Id: I2f27568ebd89c1f451f910dd03ea21c01c4adad1 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Use global context sharing from QtGui instead of QSGContextJocelyn Turcotte2014-04-045-27/+6
| | | | | | | | | | | | | | | | | | 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>
| * Don't crash when render node doesn't have a batchrootGunnar Sletta2014-03-311-1/+3
| | | | | | | | | | Change-Id: Ib8f70414eb477b4ec45097c8784a5fe1375cf012 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Destroy render loop when QCoreApplication is cleaned up.Gunnar Sletta2014-03-292-8/+9
| | | | | | | | | | | | | | | | | | Doing it on 'aboutToQuit' meant we would clean it up whenever an application ran QCoreApp::exec() which could be multiple times per application run. Change-Id: I59e06398a551ae7979e3832dff811937037fa106 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * Let render loop be more tolerant wrt when markDirty is called.Gunnar Sletta2014-03-272-0/+6
| | | | | | | | | | Change-Id: I95f1d6fe4695a09b1b6ccaf026137dabc22ec82c Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * Pass the actual window format to the offscreen surface during cleanupLaszlo Agocs2014-03-272-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the requested format (we don't have anything else since the platform window is gone) is wrong on EGL implementations that offer a different set of configurations for window and pbuffer surfaces, because we may end up with a pbuffer surface that is incompatible with the context/window due to having different color buffer sizes. To be absolutely sure that the surface is compatible, store the actual surface format so that it is available even after the platform window is gone. Change-Id: Id17c25439c463d4c37af95fc90f336d3f67c6427 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Fix QQuickView::grabWindow() on retina displaysMorten Johan Sørvig2014-03-203-3/+3
| | | | | | | | | | | | | | | | | | Multiply by window->devicePixelRatio() at all qt_gl_read_framebuffer() call sites. Task-number: QTBUG-35962 Change-Id: If58e4f97fc5d931ba2e222f8cb1a0641d52c3257 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Clearly point out the distinction between GUI and Render threads.Gunnar Sletta2014-03-205-6/+39
| | | | | | | | | | | | | | | | 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>
| * Invalidate all batches potentially affected by a change.Gunnar Sletta2014-03-192-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | When two separate changes have occurred, we need to not only invalidate the batches directly overlapping those, but also any batch which has render orders between the two. So, keep track of the range of invalidated render orders and invalidate everything in between. Task-number: QTBUG-37422 Change-Id: Ie5a289d5c569b84917ec9ac52671173c566e69b3 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Dynamic GL in QuickLaszlo Agocs2014-03-188-54/+68
| | | | | | | | | | | | | | | | | | | | 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>
| * Register animation profiler callback also from render threadUlf Hermann2014-03-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | The QUnifiedTimer in the GUI thread doesn't cover the render thread animations. We need a separate registration for those. We also need to keep track of which animation events are coming from which threads. Task-number: QTCREATORBUG-11659 Change-Id: I1fdd80a5630cc6a33e527b99be7347f3bd63510f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Fix potential crash during shutdown for QQuickWindowsGunnar Sletta2014-03-176-24/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The cleanup() function would deregister the render loop from all windows the render loop had seen, but the render loop doesn't see windows until the window gets a showEvent and for some implementations it was removed as a result of hideEvent. So add explicit tracking to QSGRenderLoop which is managed by QQuickWindow's constructor and destructor. With this, we no longer need the lists from the subclasses, so these functions are removed again. Change-Id: I05e5507ad57e23c80bacd99752654cc7d0890dc1 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
| * Unset the current gl window when deletedGiulio Camuffo2014-03-171-0/+2
| | | | | | | | | | | | | | | | | | | | This does in the QSGGuiThreadRenderLoop what 403045a did for the QSGThreadedRenderLoop. Fix a memory corruption in Mesa's dri2 EGL when setting a window current after deleting the previous current one. Change-Id: I8df0bacdf12f71e969a9ea39842a402c9a2a303f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Use stable sort when cleaning batches.Michael Brasser2014-03-151-1/+1
| | | | | | | | | | | | | | | | | | Ensure valid batches do not change order. This was causing rendering issues when m_rebuild was 0, as we would not re-sort the list in correct render order after cleanup. Change-Id: I912fb313d4029f96e263fad24d68462f252003df Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Make sure QSGRenderLoop is cleaned up cleanly.Gunnar Sletta2014-03-146-11/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e13547c595913c58e6bd6a5ed80fdc729fae7d47 used a global static to clean up QSGRenderLoop which is triggered very late, potentially after SG backend API plugins have been unloaded. This results in crashes when used in combination with scenegraph-playgrounds's customcontext. Partially revert the change and instead clean up at the time of QApp::aboutToQuit and make sure we also disconnect cleanly from all QQuickWindows. This change also ensures that QSGRenderLoop::windowDestroyed() gets called for all QQuickWindows registered with the render loop. This ensures that rendering stops and that scene graph nodes and resources will be cleaned up regardless of whether the application has remembered to delete the window or not. This is a good thing as it makes the scene graph shutdown a bit cleaner. Change-Id: I9cb9093979f8eac05542f118a6ff9cfe5c84f745 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Use correct matrix for render nodes.Gunnar Sletta2014-05-071-2/+7
| | | | | | | | | | Change-Id: I8c137383fa32a64ba64ffb4ed48aa123d0ebf000 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Compress touch events in QQuickWindow.Gunnar Sletta2014-05-054-17/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of sending multiple touch updates per frame, we store the last one and flush the pending events just before we enter into the scene graph sync phase. [ChangeLog][QtQuick] QQuickWindow will compresses touch events and delivers at most one touch event per frame. Done-with: Robin Burchell <robin.burchell@jollamobile.com> Change-Id: Ia0169bc4a3f0da67709b91ca65c326934b55d372 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Opt-in that QSGSimpleTextureNode can own the texture.Gunnar Sletta2014-05-012-0/+42
| | | | | | | | | | | | | | | | | | Having to subclass just to delete the texture is a bit tedious. Change-Id: I26c7e0b5c053ba70e004949ead748e50756d9b39 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>