aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickshadereffectsource.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix disfunctional QQuickRenderControl with multiple screensLaszlo Agocs2014-10-221-2/+2
| | | | | | | | | | | | | | | | | | | | Having a retina and non-retina screen connected resulted in getting no output from QQuickRenderControl and QQuickWidget on the non-retina screen. This is caused by the fact that Quick is blindly calling QWindow::devicePixelRatio(). This approach is wrong when using QQuickRenderControl since the QQuickWindow does not have an actual native window and so devicePixelRatio() merely returns some default value which will definitely be wrong for one of the screens. The patch fixes the problem by introducing QQuickWindow::effectiveDevicePixelRatio(), which, via QQuickRenderControl::renderWindowFor, supports the redirected case too. Task-number: QTBUG-42114 Change-Id: I057e01f0a00758dde438fc9b10af3a435b06bb0b Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Relax ShaderEffectSource's sourceItem vs window handling.Gunnar Sletta2014-10-091-1/+5
| | | | | | | | | | | For dynamically loaded items, the window may not be set on either the source or the item, so we need to be a bit more relaxed in our checking. This fixes a regression for dynamically loaded GaussianBlur. Change-Id: I3e888405a95058ca79ecd2dff42c0ed4c8fff065 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Partially revert d9c531781e6c95f80681b3c82700833e1de88794Gunnar Sletta2014-10-011-5/+19
| | | | | | | | | | | | This logic changed then timing for when the layer's m_dirtyTexture was set and unset, which had some side effects. Revert to the old and known-to-work behavior of using a connection. Change-Id: I4048e7ae70491afe36b2d766e6c506d9febc44ed Task-number: QTBUG-41451 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* prevent crash when set ShaderEffectSource::sourceItem nullTasuku Suzuki2014-09-121-16/+16
| | | | | | | | Regression introduced in 81ba77d736f07efac37d284cd741d71f9dad4149 Task-number: QTBUG-41241 Change-Id: I9a65af6915325e1cbf9205c7da94273d5b91b310 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix performance regression caused by SG signals in QQuickItem.Gunnar Sletta2014-09-031-2/+1
| | | | | | | | | | | | | For a testcase with thosands of items, I measured an increase in shutdown time from 800ms to 7500ms, all spent in disconnect(). This is not acceptible, so we're choosing a different approach. If items implement a invalidateSceneGraph slot, this function will be called during shutdown. It should be made a proper virtual in Qt 6. This approach costs very little. Change-Id: I5970143cc0a0744955687e17586f0bb00c9afb26 Reviewed-by: Lars Knoll <lars.knoll@digia.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>
* Cleanup: Separate the sub-tree layering out of QtQuick into the scene graphSimon Hausmann2014-08-231-411/+5
| | | | | | | | | | 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>
* Cleanup: Remove ShaderEffectSourceNodeSimon Hausmann2014-08-221-19/+27
| | | | | | | | We can simply use a standard image node and do the dirty marking also directly in the texture (both live in the same thread). Change-Id: I7345c702613782adec3c6a36a7705a2a54ed82ec Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Clean up Image and ShaderEffectSource properly.Gunnar Sletta2014-08-041-10/+39
| | | | | Change-Id: I9e3eb5f65ea5f46d30fb7905d0f9c479da367bf5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-291-1/+1
|\ | | | | | | Change-Id: Id95f7b01de36bccecbb7b73acc041654a1fe2ebe
| * Don't try to draw shader effect sources with dims < 0.Gunnar Sletta2014-07-281-1/+1
| | | | | | | | | | | | Task-number: QTBUG-40099 Change-Id: I0eb0d877963a9394765ec8e0f10569a98a263743 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Avoid direct GL calls in QuickLaszlo Agocs2014-05-231-16/+16
| | | | | | | | | | Change-Id: I9b8673fb3292c9d5ad2f9e8e63f56dc661699be6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Prevent crash when mixing shaders from different windowsGunnar Sletta2014-04-011-2/+8
|/ | | | | Change-Id: Iad9383ff02cb3130d725a215582400e7806df1dc Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Ensure that ShaderEffectSource's texture has correct parameters.Gunnar Sletta2014-02-281-0/+6
| | | | | | | | | | | The provider is created on demand in textureProvider(), but its parameters are set in updatePaintNode() so if updatePaintNode() was called before a consumer asked for the texture provider, they wouldn't be set until the next time updatePaintNode() was called. Change-Id: Iff866d50a8fe16f3d371cb8e590528f5f8c5ee61 Reviewed-by: Mikko Harju <mikko.harju@jolla.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix crashes and incorrect extension queries on GL3+Laszlo Agocs2014-02-251-3/+3
| | | | | | | | | | | | | | | glGetString(GL_EXTENSIONS) is deprecated in OpenGL 3.0+. This means that in core profiles on 3.2+ (or without the fwd compatibility bit on 3.0/3.1), the call is not supported and may return NULL. This causes a crash in at least one place where we try to blindly strstr the result. The correct solution is to use QOpenGLContext::extensions() and hasExtension() which is prepared to handle GL3+. Change-Id: I52fec7dcee001cdc0933af03f5eed4b7c822b2bb Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Release GL resources of ShaderEffectSource while we still have GL.Gunnar Sletta2013-12-031-3/+12
| | | | | | | | | | | | | When a Window element is used, the QML window item is deleted before the ShaderEffectSource component and the deleteLater to delete the texture gets handled too late. We now register for the sceneGraphInvalidated signal and release resources synchronously while shutting down. Task-number: QTBUG-35294 Change-Id: Id83b669ddc16723551e5612264ccbad6d3a9bbcb Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fill recursive ShaderEffectSource with transparent when using alpha.Gunnar Sletta2013-11-071-2/+17
| | | | | | | | | | The logic relies on m_fbo being 0 on the first render pass, in which case it will pick texture id 0 which is solid black. Though this works ok, it results in recursive shader effect sources starting out black which is ugly. Change-Id: I22b1d50e02c00583837b8152c5fb850263038a93 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-17/+14
| | | | | | | | | | | | | | | | | | | See the task for the full reasoning behind this patch. The threaded renderloop has been refactored to have one window per thread. This is mostly a simplification of the current code path where for loops over multiple windows are turned into if (window). The QSGContext has been split into two classes, QSGRenderContext for which there is one per OpenGLContext. The rest of the patch is name changes and a couple of cleanups in the hopes of simplifying this change. Task-number: QTBUG-33993 Change-Id: I31c81f9694d7da7474a72333169be38de62613c4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-10/+10
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: Fixed and updated Qt Quick's \qmlmodule pageJerome Pasion2013-09-251-1/+1
| | | | | | | | | | | -incremented version to Qt Quick 2.2 (in \qmlmodule page) -import changed to QtQuick 2.2 -\inqmlmodule no longer needs the version. QDoc will ignore the version but it is better to remove it now to avoid confusion Task-number: QTBUG-32172 Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Doc: Made Qt Quick items' \since consistent.Jerome Pasion2013-09-251-1/+1
| | | | | | | | | | | | | | | | Qt 5.2: -"\since QtQuick 2.2" -> "\since 5.2" Qt 5.1: -"\since QtQuick 2.1" -> "\since 5.1" -"\since Qt 5.1" -> "\since 5.1" Qt 5.0: -"\since QtQuick 2.0" -> "\since 5.0" Task-number: QTBUG-32172 Change-Id: I699b00b31373a434ddb8f4caccfef40c588bf8a4 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Initialize variables in ShaderEffectSource's texture provider.Gunnar Sletta2013-08-281-0/+4
| | | | | Change-Id: I3d737b923ee0282f58d7a2ee96824f184469daf5 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Do not draw negative-size ShaderEffect(Source) items.Gunnar Sletta2013-05-281-1/+1
| | | | | | | | | | | | | | | We were a bit inconsistent here. A negative size Image element would not render at all, a negative size ShaderEffect would render mirrored and a negative size ShaderEffectSource would trigger an assert. Be consistent and not draw any of them. DropShadow from QtGraphicalEffects uses both a ShaderEffectSource and a ShaderEffect together, so keeping the behavior in ShaderEffect would make it render incorrectly. Task-number: QTBUG-31383 Change-Id: Ied5568d7edbc2aed96b00adfdc6aae09b6f2a7d9 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Doc: Qt Quick: Fix module name format (Pt 1/2)Sze Howe Koh2013-04-231-2/+2
| | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Attempt to differentiate between the whole module ("Qt Quick") and the QML import ("QtQuick") by encoding the latter with monospace font. There are places in the text where both representations are valid. Change-Id: Id6e157a4191aaa4e23a9cd5c76abfe902fe43d33 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix distance field antialiasing for retina displays.Gunnar Sletta2013-04-021-3/+7
| | | | | | Change-Id: I01d7d41a4e70822555bae453978dbe92fbb5c98d Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Introduce QML_FBO_FLUSH_BEFORE_DETACH to work around FBO issue.Michael Brasser2013-03-121-0/+3
| | | | | | | | | | On some AMD hardware, detaching the depth attachment immediately after rendering to an FBO will cause rendering issues. Adding an explicit glFlush before detaching seems to work around the issue. Task-number: QTBUG-29265 Change-Id: I97c7b87c1c3d3a69a4d6228dd9459745710c5f4c Reviewed-by: Gunnar Sletta <gunnar.sletta@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>
* Fix other warnings in qtdeclarative found by GCC 4.7Thiago Macieira2012-12-231-0/+1
| | | | | | | | | | | | | qml/qml/qqmlimport.cpp:982:30: error: unused parameter 'errors' [-Werror=unused-parameter] quick/util/qquickanimationcontroller.cpp:66:6: error: unused parameter 'job' [-Werror=unused-parameter]' quick/items/qquickshadereffectnode.cpp:160:17: error: case value '38' not in enumerated type 'QVariant::Type' [-Werror=switch] quick/items/qquickwindowmanager.cpp:286:60: error: 'renderTime' may be used uninitialized in this function [-Werror=maybe-uninitialized] quick/items/qquickitem.cpp:5267:67: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] and a few more repeated from the above Change-Id: Id1950c6ba98f7f8475975716b21bd795ecb4bd20 Reviewed-by: Alan Alpert <aalpert@rim.com>
* Qt Quick high-dpi support.Morten Johan Sørvig2012-12-011-0/+5
| | | | | | | | | | | | | | Set the device and viewport rect to the full device pixel size. Set the projection matrix to the device independent pixel size. Scale shader effect source texture sizes. Change-Id: I61dd546ff36a7ce6ad05f908796555674c714c1a Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@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>
* Update usage of smooth and antialiasing.Michael Brasser2012-08-281-2/+3
| | | | | | Change-Id: Icc8b28bdd466389ed3f269f076f1bdb6e9abe3f2 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix uses of \inmodule, \inqqmlmodule and \sinceBea Lam2012-08-081-1/+2
| | | | | | | Some classes and QML types were missing these or had the wrong values. Change-Id: Ic6376b8b450301f8ae0549e636f4bc2db4400f2b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Fix uses of various qml doc commandsBea Lam2012-08-081-10/+10
| | | | | | | | | | | | | | Signals documented with \qmlsignal should indicate handler name, i.e. 'onSignal' rather than 'signal'. Methods documented with \qmlmethod do not need to document 'void' return values. Also the name of any documented attribute should be qualified with 'QtQuick2::<qmltype>'. Change-Id: I206dd9e8f39c3b84e029ae9d4101b05d0bfb3478 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Doc: Changed \qmlclass to \qmltype and added \instantiates.Jerome Pasion2012-07-301-1/+2
| | | | | | | | | | -To simplify QDoc, \qmlclass is now \qmltype. -'\instantiates <C+++ class>' is for the types that are defined in C++. Change-Id: I29242d33daf7b972d8b86a356b9689638866b950 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Martin Smith <martin.smith@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-14/+14
| | | | | | | | | | | | | | | | 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>
* Fix 'Unknown commands' in qtdeclarative documentation.Yann Bodson2012-07-171-1/+0
| | | | | | Change-Id: I179eb828a84af4feb834bac7159d5e1988cc3deb Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Change Quick docs to refer to "types" rather than "elements"Martin Jones2012-07-161-14/+14
| | | | | | Task-number: QTBUG-24785 Change-Id: I223479b879514abaacb123852323c1cfada7a5e1 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Change antialiasing method for QML2.Kim Motoyoshi Kalland2012-07-131-1/+1
| | | | | | | | | | | | | 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>
* Let ShaderEffectSource use same multisample count as GL context.Kim Motoyoshi Kalland2012-07-041-7/+11
| | | | | Change-Id: I9b772a2c405c2fab13dfee3527212117de16e9c0 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Create new documentation structureChris Adams2012-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | The documentation currently has no clear separation between Qt QML and Qt Quick. With recent commits like: 6c8378eaf1edbbefe6aaa3672b0127816a004fd7 and ab1e510121c8a679fdaca12ccd30e0f7ac12a26b the separation between the language definition and implementation, provided by Qt QML, and the standard library for the QML language, provided by Qt Quick, is clear. This commit creates a new documentation structure that is more navigable and separates concepts into logical categories, with clear separation between QtQML and QtQuick. It also provides a more generic QML Application Developer Resources page which contains links to information for QML application developers. Change-Id: Ia807ccfbfd24ffa0e1c7f0a51ed9d2ed3aa6a733 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Doc: Grouped Qt Quick types into several groupsJerome Pasion2012-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -created new groups and converted some overviews into group pages -edited type documentation and added \ingroup -articles still need title fixes and link fixes Groups: qtquick-visual-types qtquick-item-graphics qtquick-shaders qtquick-canvas qtquick-text qtquick-text-validator qtquick-interaction qtquick-positioners qtquick-transformations qtquick-states qtquick-animation-define qtquick-animation-properties qtquick-animation-control qtquick-animation-modifiers qtquick-images-sprites qtquick-images qtquick-models qtquick-containers qtquick-views qtquick-paths qtquick-utility Task: QTBUG-25685 Change-Id: I81d4df3320bf5daad5cabb5e42408013fb24f464 Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Doc: Sanitized QML typesNico Vertriest2012-05-241-2/+1
| | | | | | | | | | -modified \brief -checked QML modules -added qml directory to the qdocconf file -added particles directory to the qdocconf file Change-Id: I589e32d3106cda37c7fa4d55a941afd9876fc2b2 Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* Always emit signal after ShaderEffectSource::scheduleUpdate().Kim Motoyoshi Kalland2012-05-211-10/+6
| | | | | | | | | | | | | | The scheduledUpdateCompleted signal was originally added so that you can take some action after updating a ShaderEffectSource with scheduleUpdate(). However, before this commit, the signal would not be emitted if the ShaderEffectSource was already up-to-date. Instead, the signal would be delayed until the next time the ShaderEffectSource was redrawn. This commit ensures the signal is emitted even if the ShaderEffectSource is already up-to-date. Change-Id: Idd22cdea1f7c14ed7a45081c98b8cfbef896dccd Reviewed-by: Kim Gronholm <kim.1.gronholm@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Remove unused variable.Kim Motoyoshi Kalland2012-05-211-1/+0
| | | | | Change-Id: I49fee9c96a9f1b54a790d2dd8a3d1f0a3c7f8a5a Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Add a note in the docs about FBO multisamplingGunnar Sletta2012-04-191-0/+8
| | | | | Change-Id: I4c0b522ce937e681a9208cc94a1265f6b10ebcd3 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Release FBOs held by the shader effect source sooner.Kim Motoyoshi Kalland2012-03-271-2/+28
| | | | | Change-Id: I2bdb4a9e4da50afff6752c2c0fd7e60041ede14f Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Share depth-stencil buffers between ShaderEffectSources of same size.Kim Motoyoshi Kalland2012-03-221-5/+40
| | | | | Change-Id: If325a38175249c3a3ffe5043d42ba35dbf90ce0c Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Free ShaderEffectSource FBOs when no longer needed.Kim Motoyoshi Kalland2012-03-211-20/+43
| | | | | | | | This commit also fixes handling of texture provider deletion in ShaderEffect. Change-Id: Ib22a9308a35325972bc545cf29de11bd625b22b2 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-131-12/+12
| | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I62d203f21df63a95ee236e578b10418fd9680707 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>