aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/util
Commit message (Collapse)AuthorAgeFilesLines
* Correct declaration in doc to match const in code.Edward Welbourne2016-01-061-2/+2
| | | | | | | | | QSGTextureProvider::texture() was getting a warning from qdoc because it didn't find an exact match for its signature: the doc lacked const. Ditch some spurious semicolons while we're about it. Change-Id: I785ae8b8d46c839a1e29339284834a8b8e44bffe Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
* qDelete(hash/map.values()) -> qDelete(hash/map)Albert Astals Cid2015-12-151-1/+1
| | | | | | | Saves iterating the whole container and unneeded allocation of a list Change-Id: Iae1f8e0cf3a17b163cf930c43a27b2ebb4315e5c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-171-0/+8
|\ | | | | | | | | | | | | Conflicts: src/quick/util/qquickimageprovider.cpp Change-Id: I7ca4e49468b5ba697208287be4684e42b9900023
| * Doc: added documentation to undocumented functionsNico Vertriest2015-11-021-0/+8
| | | | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: I219375d405fbfb53611c0138698e955d9cd5d821 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
* | Quick: Sanitize reading environment variables.Friedemann Kleint2015-10-263-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Where possible, use qEnvironmentVariableIsSet()/ qEnvironmentVariableIsEmpty() instead of checking on the return value of qgetenv(). Where the value is required, add a check using one of qEnvironmentVariableIsSet()/Empty(). Move QSGAtlasTexture::qsg_envInt() to qsgrenderer.cpp for reuse as qt_sg_envInt() and add qt_sg_envFloat(). Change-Id: I4c93f16c228d4f537154f389a0fa1427654485f7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Libraries: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | | | | | | | | Use character literals where applicable. Change-Id: I294fc4cb5cbbd23df9735ba2b398118f37cbe08a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-069-0/+99
| | | | | | | | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Introduce QQuickPaintedItem::textureSize and support HighDpi.Gunnar Sletta2015-09-152-16/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | contentsSize/Scale/BoundingRect are confusing and will in most cases not produce what the user wants, but since they might be in use, we keep their behavior and simply obsolete them. New code should use textureSize, though most code can simply rely on implicit HighDpi support. [ChangeLog][QtQuick][QQuickPaintedItem] Implement high-dpi support and add function textureSize. This obsoletes the existing contentsSize, contentsScale and contentsBoundingRect functions. Task-number: QTBUG-32510 Task-number: QTBUG-40489 Change-Id: I660bbf394594b6ea588d4de9cc83c8c5eb28cb28 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* | Move all bools of painternode to the end as bitfieldsGunnar Sletta2015-09-152-13/+13
| | | | | | | | | | | | | | Saves us a few bytes Change-Id: Ie2cdda5ca0cd4a82aa00ea26e28418e6b027afac Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-181-1/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
| * QSGSimpleTextureNode: Fix ownership of QSGTextureTobias Koenig2015-07-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the QSGSimpleTextureNode deletes the old QSGTexture if a new one is set via setTexture() and the ownsTexture flag is true. [ChangeLog][QtQuick][SceneGraph] QSGSimpleTextureNode will now delete the currently set QSGTexture object, if a new QSGTexture is set and the ownsTexture flag is on. Change-Id: Iabfbccd390e16948d4575baf29e6c8b4a184a404 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-301-0/+11
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/qml/qqmlengine.cpp src/quick/items/qquickitemsmodule.cpp tools/qml/main.cpp Change-Id: Ida8daf6b4d7e675385f2f5514c446e52dedaf136
| * Fix missing images when alpha and shader effects are involvedLaszlo Agocs2015-06-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once we hit removedFromAtlas() and the glCopyTexImage2D() path, bad things tend to happen with OpenGL ES, both on certain embedded devices (Beaglebone, RPi) and ANGLE. ANGLE just rejects GL_BGRA_EXT with INVALID_ENUM. So if it fails, just try with GL_RGBA. The BGRA extensions do not mention glCopyTexImage2D in any form and in plain GLES (any version) BGRA does not exist. So rejecting it may be valid, depending on how one reads the specs. Same problem on Beaglebone, where the call with BGRA fails as INVALID_OPERATION. The RPi 1 and 2 fails in a different way: the temporary framebuffer is not complete because BGRA textures are not supported as color attachments. So our only choice here is to do what we do for some Android devices already: ignore BGRA support. Task-number: QTBUG-46806 Change-Id: I89b3b38bf7f8883c39509606ec5ae525f131292b Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Add QQuickWindow::TextureIsOpaque as option to createTextureFromImage.Gunnar Sletta2015-06-154-12/+15
|/ | | | | | | | | | | | | | | | Opaque textures can be a lot faster, so give this option without forcing the user to reimplement her/his own QSGTexture class. The old behavior was that createTextureFromImage() disregarded TextureHasAlphaChannel and looked solely at the image's format. To keep this behavior intact, we introduce a second opt-in flag to switch textures from auto-detect to false, namely TextureIsOpaque. [ChangeLog][QtQuick][QQuickWindow] Add TextureIsOpaque option to createTextureFromImage() Change-Id: I248db4bc5f7920864b6aa8d831ce24d23ad370ef Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Fix regressed atlas texture log output. Broken since: a49b0ad786Gunnar Sletta2015-04-161-2/+2
| | | | | Change-Id: I5df32609b45047666ea8bde500cf771736c396e5 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* QtQuick: Micro-optimize iterator loops.Friedemann Kleint2015-02-261-1/+1
| | | | | | | Avoid repeated instantiation of end() in loops, use variable instead. Change-Id: I6ab1fe2b82406d5ee91710a0333587ffb82c04d4 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-2/+11
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf LICENSE.GPLv2 examples/qml/networkaccessmanagerfactory/view.qml src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4stringobject.cpp Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
| * Scale mipmapped npot images when not supportedLaszlo Agocs2015-01-191-2/+11
| | | | | | | | | | | | | | Task-number: QTBUG-43847 Task-number: QTBUG-40789 Change-Id: Iceacaa49bafffb31752a9fb26c896df570153fec Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix some qdoc-warnings.Friedemann Kleint2015-02-232-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | qtdeclarative/src/quick/scenegraph/coreapi/qsgmaterial.cpp:384: warning: Class RenderState has no \inmodule command; using project name by default: QtQuick qtdeclarative/src/quick/scenegraph/util/qsgsimplerectnode.cpp:39: warning: Class QSGSimpleRectNode has no \inmodule command; using project name by default: QtQuick qtdeclarative/src/quick/scenegraph/util/qsgtextureprovider.cpp:38: warning: Class QSGTextureProvider has no \inmodule command; using project name by default: QtQuick qtdeclarative/src/quick/items/qquickwindow.cpp:3156: warning: Cannot find 'closing(...)' in '\fn' void QQuickWindow::closing() qtdeclarative/src/quick/items/qquickwindow.h:160: warning: No documentation for 'QQuickWindow::closing()' qtdeclarative/src/quick/items/qquickwindow.cpp:3134: warning: Can't link to 'Window.closing()' qtdeclarative/src/qml/qml/qqmlfileselector.cpp:90: warning: Undocumented parameter 'parent' in QQmlFileSelector::QQmlFileSelector() Change-Id: I42cf1e06c9e7a63327acc470bd33a726acc69bfc Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-1233-229/+229
| | | | | | | | | | | | | | | | | | 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>
* | Release atlas texture's image instance once uploadedGunnar Sletta2015-02-032-14/+62
| | | | | | | | | | | | | | | | | | | | | | Sitting on the instance makes it impossible for custom texture factories to release images to keep down memory. Also, ditch the extra QRect used to store the nonpadded atlas rect as this is easily reachable from the padded one. Change-Id: I4914753cc43a6f3173cfc9b210e02b2770ef33fd Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-091-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
| * Add since 5.4 markersAlbert Astals Cid2014-11-281-0/+4
| | | | | | | | | | | | Change-Id: Ic0e594cb53016e6f68fbfb6e6064707344afefef Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Expose a getter for the QSGEnginePrivateJocelyn Turcotte2014-11-191-1/+1
| | | | | | | | | | | | | | This allows getting its underlying QSGContext and QSGRenderContext. Change-Id: If0773d09b6faa360e706949757db1a6ddbe244e1 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Allow setting the source rect on QSGSimpleTextureNodeJocelyn Turcotte2014-11-192-10/+53
| | | | | | | | | | | | | | | | This allows the QtQuick 2D Renderer to get this information without having to extract it from the QSGGeometry. Change-Id: Iec99c4bc910fea9c7d0e6712a418787254a70cb2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-092-2/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/context2d/qquickcanvasitem.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp src/quick/scenegraph/coreapi/qsgrenderer.cpp src/quick/scenegraph/qsgadaptationlayer.cpp src/quick/scenegraph/qsgrenderloop.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp src/quick/scenegraph/qsgwindowsrenderloop.cpp src/quick/scenegraph/util/qsgatlastexture.cpp src/quick/scenegraph/util/qsgtexture.cpp src/quick/util/qquickprofiler_p.h Change-Id: Ie274c3baf72a8a0711c87d67238d68e2b2887429
| * Let QSGPlainTexture support shutting down without a GL context.Gunnar Sletta2014-09-121-1/+1
| | | | | | | | | | | | Change-Id: Iae934e4d9e91f4ea21dd5bf27c4fafc5d481fb0a Task-number: QTBUG-41278 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Select specific features to be recorded when profiling QMLUlf Hermann2014-09-112-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Some features, like the memory profiler, create huge amounts of data. Often enough, we're not actually interested in all the data available from the profiler and collecting it all can lead to excessive memory consumption. This change enables us to optionally turn various aspects of QML profiling off. Task-number: QTBUG-41118 Change-Id: I7bb223414e24eb903124ffa6e0896af6ce974e49 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-09-081-1/+10
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4arraydata.cpp src/quick/scenegraph/util/qsgatlastexture.cpp Change-Id: Ic4c96066d5c37dcf0d5446baed590ea005d445ce
| | * Support padding in images stored in atlas textureEskil Abrahamsen Blomfeldt2014-08-301-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | If the stride does not match the width of the image, we upload it line-by-line instead of as one big rect. Change-Id: I5e08afcf5c35dc810fed25e45255d55d932b2a4c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | Use QQuickProfiler's own timer to sample eventsUlf Hermann2014-09-122-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | Like that the timings are more accurate. Task-number: QTBUG-39876 Change-Id: Ia6bdce9c8089417e88797ec3a98c8a3e367f73f2 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-1133-658/+414
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickpainteditem.h src/quick/items/qquickshadereffectsource.cpp src/quick/items/qquickshadereffectsource_p.h Change-Id: If98096443afe85fc4370cef971eace050006a61b
| * | Remove Q_ASSERT when getting the OpenGL Context ProfileAndy Nichols2014-09-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do not actually use the OpenGL context in this method other than to query the profile type if one is available. In the case that there is no context the profile type does not matter and the default value of QSurfaceFormat::NoProfile is correct. Change-Id: Ice4440fe0e578d4cdcba347f5325768667722af8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | Fix the dynamic build by not calling glGet directlyLaszlo Agocs2014-08-291-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I97ee290c31ca4fa0ffc2f822f14bc7d5e34dd222 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
| * | Added QSGPainterNode abstraction to QSGAdaptationLayerAndy Nichols2014-08-272-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the scenegraph backend to customize how QSGPainterNodes are rendered. Change-Id: I640dcf121d0be6bda615cf30591d502329fc89d0 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * | Added an example that shows how to consume texture providers from C++.Gunnar Sletta2014-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | And how to use use two textures in the same material. Change-Id: Idcc618ed359422c2a104eeed105b7c4f5086ee4e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * | Make QQuickPaintedItem a texture provider.Gunnar Sletta2014-08-261-0/+2
| | | | | | | | | | | | | | | Change-Id: I605dc35fcc2284a890851c41946cf95537e92d2e Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * | Update license headers and add new licensesJani Heikkinen2014-08-2533-622/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
| * | Downscale textures which exceed the GL texture limitGunnar Sletta2014-08-231-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way they will at least render. [ChangeLog][QtQuick] Images exceeding GL_MAX_TEXTURE_SIZE will be downscaled to fit so they will still show. Change-Id: I169ecac768036812b8e14265ec1a0a8902655666 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | | Merge branch 'origin/5.4' into devFrederik Gladhorn2014-08-211-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | This merges 0af61d773fc7263573afc6b7a973451783bf7424 since there is a circular dependency introduced with a111b1b108f2d3344cb2b2b677e738fd9dd68945 in qtquickcontrols. Change-Id: Ia4fcad8df69326fba3f6b5927151e9d98206e872
| * | Doc: Remove duplicated wordsTopi Reinio2014-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Removes duplicated (repeated) words and fixes other minor documentation issues. Change-Id: I891f2b3e60194b207737425c1dcc1d35a5bd921a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* | | Doc note about premultiplied alphaGunnar Sletta2014-08-171-3/+6
|/ / | | | | | | | | | | Task-number: QTBUG-40677 Change-Id: I43b8cb4f3af8c62f67353197ffadf571a675eab7 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Expose the scene graph publically through a QSGEngine classJocelyn Turcotte2014-08-013-0/+350
| | | | | | | | | | | | | | | | | | This change wraps QSGRenderContext and QSGContext in a new QSGEngine class, and expose a public interface of QSGRenderer through a QSGAbstractRenderer to make it usable on a standalone window or FBO. Change-Id: I2d41187472424f5ea64650a006bcd61f2711f6b9 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Merge remote-tracking branch 'origin/5.3' into devSimon Hausmann2014-07-261-0/+3
|\| | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4engine.cpp Change-Id: Ie3ef6202b6a3a8521971e1be10c40c6a2db6989c
| * Do not crash AtlasTexture if image is nullDavid Edmundson2014-07-231-0/+3
| | | | | | | | | | | | Change-Id: I77ae68f523641a2e6b75623200f65407b64e1b40 Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Call glBindTexture() via QOpenGLFunctions in qsg_safeguard_texture().Friedemann Kleint2014-07-081-1/+3
| | | | | | | | | | | | | | Fix linking for dynamic OpenGL builds. Change-Id: I82e6597d2cb9a74707e3f1e9fce245cce1a5d72b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Verbose fatal instead of crash when the scene graph state is invalid.Gunnar Sletta2014-07-043-0/+33
| | | | | | | | | | Change-Id: I9a55bcbf9e94084c0cadac561e4707d47f5f8744 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* | 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>
* | Properly collect polish timings from all render loopsUlf Hermann2014-07-022-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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-012-57/+25
| | | | | | | | | | Change-Id: I865ee838b0fd6c257b7189f24130012b98206fd1 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>