summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* QNode: initialize m_typeInfo to Q_NULLPTRPaul Lemire2016-05-011-0/+1
| | | | | Change-Id: I2cd1a8c2ab72ce10f67fd7d6c6658aeb92260461 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add missing import for Qt3DExtras.Volker Krause2016-05-011-0/+1
| | | | | Change-Id: I1ca89f0301df541a6ddcba52b12fbd842808cb18 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* ShaderData: Comment out NodeAdded/Removed sectionsPaul Lemire2016-04-301-14/+16
| | | | | | | Doesn't seemed to be used but commented until further investigation Change-Id: I7c614d514e0c9b2c46ec929d4d622bedbda84430 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* geometries: use QSharedPointer::create() for QBufferDataGeneratorsMarc Mutz2016-04-306-30/+30
| | | | | | | | More efficient, because control block and tracked object are co-located in a single memory allocation. Change-Id: I9a6fe07753620eb44814b9c9e4514c391f06a8ee Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* GenericDeviceBackendNode: aggregate mutex by valueMarc Mutz2016-04-302-7/+7
| | | | | | | | The mutex does not partake in shared ownership, so there's no reason to hold it in a shared pointer. Change-Id: Ifcc2195d6b942fb881419b9f67b712c63afa8060 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QThreadPooler: aggregate mutex by valueMarc Mutz2016-04-302-9/+7
| | | | | | | | There's no reason to incur a heap allocation for something as simple as a mutex. Change-Id: I9489b2348c142e028009b757d8f922fea43e168b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QRayCastingService: don't iterate over QHash::values()Marc Mutz2016-04-301-3/+2
| | | | | | | | | | | ... iterate over the container itself instead. Avoids creation of a temporary QList. Saves almost 1.5KiB in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: I771383f9848999bdbdd96e52f7956d44d5b3b15a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QItemModelBuffer: don't iterate over QHash::keys()Marc Mutz2016-04-301-2/+2
| | | | | | | | | | | | ... iterate over the container itself instead. Avoids temporary QList creation as well as the lookup cost when actually calling value(key). Saves almost 1.5KiB in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: Ia2f0635c76332423654643245e76ba2add93a8f3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* InputChord: replace a Q_FOREACH with assignmentMarc Mutz2016-04-301-3/+1
| | | | | | | | | | | | Both m_inputstoTrigger and m_chords are QVector<QNodeId>s, so just assign one to the other instead of looping over one and appending to the other. Saves 800b in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: I8b5b0d9e41b9d072240c4c559f3a257f3a63e6a8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAspectEngine: replace a Q_FOREACH loop with qDeleteAll()Marc Mutz2016-04-301-2/+1
| | | | | | | Saves 300b in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: I7aeb9c0739c1844f0fb5189625c0c49f1a22160c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* input/backend: eradicate Q_FOREACH loops [low-risk]Marc Mutz2016-04-3011-25/+42
| | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(), where needed. This is the batch with low-risk changes. They operate on local containers or the loop body clearly does not cause the container to change. Saves ~5.4KiB (1.08%) in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: I8be9ac2e0d7a200d9a4a286f06f1da26377e366d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* render/jobs: eradicate Q_FOREACH loops [low-risk]Marc Mutz2016-04-308-23/+38
| | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(), where needed. This is the batch with low-risk changes. They operate on local containers or the loop body clearly does not cause the container to change. Saves ~5.8KiB in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: I631b99e51a48e98090c2b255bf4bbb1438ac5448 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* PickBoundingVolumeJob: optimize EntityGathererMarc Mutz2016-04-301-7/+7
| | | | | | | | | | | | | | | | | | | | Instead of creating lots of small QVectors, use one, moving it in and out of gatherEntities(). Likewise, in EntityGatherer::entities(), reuse m_entities' capacity by clearing it and passing it as the initial vector to the first gatherEntities() call. As a result, we have reduced the number of allocations from O(N) to O(log N) for the first entities() call and from O(N) to (usually, eventually) zero for subsequent calls. Costs 200B in text size. I tried also passing the vector as an out parameter, but that increases text size by 600B, so I chose this approach. Change-Id: I304a67276429a123b9cc3e2a1a4921c1bfd0d8fa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make QNodeDestroyedChange publicPaul Lemire2016-04-296-18/+7
| | | | | Change-Id: I8d08102625d3a8bfd75804dde58581c41feb1950 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move QNodeIdPair into qnode.hPaul Lemire2016-04-292-16/+16
| | | | | | | It needs to be public as QNodeDestroyedChange should also become public. Change-Id: Ieab3b7ddc342217762563b8dd71a90403aefc636 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QLayer/Layer create and handle creation changesSean Harmer2016-04-295-2/+28
| | | | | Change-Id: Id12e4d99b56fcfb8b58c58da778c48fcfa19460b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QRenderTarget/RenderTarget create and handles creation changesSean Harmer2016-04-295-0/+24
| | | | | Change-Id: Iadbf2c54d11d9f445dc4b0122d9467c0e8edfa65 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNodeCreation overhaulPaul Lemire2016-04-2915-117/+295
| | | | | | | | | | | | | | | | | | When a node has its parent set from NULL to some valid parent it sends a QNodeCreatedChange. The new parent also subsequently receives a QNodeAddedChange telling him that a child was added to its children property. When a node with a valid parent changes parent to another valid parent, it sends a QNodeRemovedChange to the old parent and a QNodeAddedChange to the new parent. When a node with a valid parent has its parent set to NULL, it first sends a QNodeRemovedChange to the old parent followed by a QNodeDestroyed change. When a node is destroyed, prior to destruction it sets its parent to NULL, which sends notifications as explained above. Change-Id: Id99727542367797577c2bbb108580dfca902e776 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Strip out cloning subsystemSean Harmer2016-04-29205-2261/+741
| | | | | Change-Id: I4def54a11de0f9c676ef6b2d7bd8e723ded25ab9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix memory leaks in render aspectMäättä Antti2016-04-292-0/+7
| | | | | | | | | Deallocate objects in render aspect destructor. Task-number: QTBUG-47978 Change-Id: Ic1d25d7ab09f4921465a0aadd3bbe96acfe1c915 Reviewed-by: Tomi Korpipää <tomi.korpipaa@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix memory leaks in rendererMäättä Antti2016-04-291-0/+4
| | | | | | | | | Deallocate objecs in destructor Task-number: QTBUG-47978: Change-Id: I5c58067aef572668d6b817ed50f17e95a3de237f Reviewed-by: Tomi Korpipää <tomi.korpipaa@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* render/frontend: eradicate Q_FOREACH loops [low-risk]Marc Mutz2016-04-283-9/+9
| | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(), where needed. This is the batch with low-risk changes. They operate on local containers or the loop body clearly does not cause the container to change. Saves another ~2.2KiB in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: I4daec2939ab778565c20140244cdf58e88bb8129 Reviewed-by: Volker Krause <volker.krause@kdab.com>
* QSortPolicy: fix argument passingMarc Mutz2016-04-282-5/+5
| | | | | | | | | | | | | | Pass containers by reference to const, not by value. Exception: setSortTypes(QVector<SortType>), because that unconditionally stores the argument in a member variable. Add std::move() there. Saves ~0.5KiB in libQt53DRender text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: Ie48b80cd42973e69807f7832598cf15ffde25cc8 Reviewed-by: Volker Krause <volker.krause@kdab.com>
* Handle case where rendersurfaceselector is root of the FGSean Harmer2016-04-281-2/+3
| | | | | Change-Id: I2ce7f177cb7a22a4af6013a325f493e51ddadb0d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix wave exampleSean Harmer2016-04-281-0/+1
| | | | | Change-Id: I1ef71623b5865979885f4cc3413774476c1cc3ae Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Adapt the assimp scene parser to use the node factorySean Harmer2016-04-281-22/+69
| | | | | | | | Necessary since we no longer have the cloning phase but still need to ensure we create the correct object types (QML vs C++). Change-Id: I28535e6d92b3e4169be928025cb7b6a44f125ece Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Only try to move scene subtree if non nullSean Harmer2016-04-281-1/+2
| | | | | Change-Id: Iefca770a49e202712301e5f12f3c21f6bb0bff9d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QSortPolicy fixPaul Lemire2016-04-281-1/+1
| | | | | Change-Id: Ica4a39a66e2615fa543cce48a809eb2bf3437f20 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix direction for directional and spot lightsKevin Ottens2016-04-282-6/+6
| | | | | | | | | On the shader side this is always named "direction" whatever the name of the property on the frontend object. Change-Id: I01bb8c34c687727eb018d4ce90bcadf00d9707fa Task-number: QTBUG-52710 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Repair attenuation handlingKevin Ottens2016-04-281-7/+15
| | | | | | | | The property name changed, it used to be a single QVector3D but now it is three floats. Change-Id: I8ad7d502fdee648f5d8e8316829c9af8838dc506 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Repair this exampleKevin Ottens2016-04-282-0/+2
| | | | | Change-Id: I8ecf1091d8e3d84a92589a61b8acbccabbb72e64 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAbstractLight now inherits directly QComponentKevin Ottens2016-04-2817-107/+128
| | | | | | | | | | | | | We are turning the relationship between QAbstractLight and QShaderData from a "is-a" to a "has-a". For that we relay all the properties of the light to its internal shader data dynamic properties. Interestingly it also removes a couple of special handling for lights which aren't needed anymore. Change-Id: Ia937b8934f94ce318e02901d90ac340e172cbc75 Task-number: QTBUG-51489 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Don’t expose QGenericInputDevice to QMLMike Krus2016-04-281-1/+1
| | | | | | Task-number: QTBUG-51426 Change-Id: I650777a075e080fe4e14c1e641cd85301d17f2a1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Whitespace fixKevin Ottens2016-04-281-1/+1
| | | | | Change-Id: Ib560ebc982e763413d16afa9c61aa036dcfc695e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QShaderData also recognizes dynamic propertiesKevin Ottens2016-04-283-0/+53
| | | | | | | | Now those dynamic properties are copied as well and replicated on the backend side. Change-Id: Ia6b24c4fee2e412ad1b0f859b087d052c3510963 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Prevent QAbstractLight instances creationKevin Ottens2016-04-285-15/+19
| | | | | | Change-Id: I7cd0f780e0ca411f9b3a210989952eccf236554e Task-number: QTBUG-51489 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make the type property read-only on QAbstractLightKevin Ottens2016-04-282-12/+1
| | | | | | Change-Id: Ibef172f08ac22af9817c0db8ec8042be78acf494 Task-number: QTBUG-51489 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Don't copy non-writable propertiesKevin Ottens2016-04-281-3/+7
| | | | | Change-Id: Ic18d95079048ef1e8f16e8d5f9a3e7f8e6588c55 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename QLight to QAbstractLightKevin Ottens2016-04-2821-103/+103
| | | | | | Change-Id: I3ee3f6e3c9eef554fce7d79407825894b1be2450 Task-number: QTBUG-51489 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Activate input handlingKevin Ottens2016-04-281-6/+10
| | | | | Change-Id: I5d195a0a1b988dbd9a87340645ada814bc3872fd Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix attenuation use in SpotLightKevin Ottens2016-04-281-1/+1
| | | | | Change-Id: Iac7b2389556edd9ccecb309ff6fb1f6cdce5a66b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* MouseEventFilter: handle HoverMove eventsPaul Lemire2016-04-281-0/+8
| | | | | | | | | When using Scene3D, there are no MouseMove events. Instead there are HoverMove events being generated. For that reason we intercept these to allow the MouseHandlers to receive positionChanged events when used with Scene3D Change-Id: I638a86a1b574e3f99163e0b1b13cb47c83acdc1e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Scene3DItem: add the hoverEnabled propertyPaul Lemire2016-04-282-2/+17
| | | | | | | | | | | If set to true, the item will receive HoverEvents that will be transmitted as positionChanged events to MouseHandlers in the scene. For most cases this would result in high traffic for events that aren't handled. If hoverEnabled is set to true, then that processing will take place, otherwise it won't (unless you are pressing a mouse button). The default is hoverEnabled set to false. Change-Id: I8fc2d519ee902349ace8f4e130cd12f3018c01af Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix memory leaks in inputMäättä Antti2016-04-281-0/+15
| | | | | | | | | Deallocate objects in inputhandler destructor. Task-number: QTBUG-47978 Change-Id: Iea0320c1ad863d54579a13901ad21d9e9fb8b56a Reviewed-by: Tomi Korpipää <tomi.korpipaa@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix memory leaks in openglvertexarrayobjectMäättä Antti2016-04-281-10/+9
| | | | | | | | | Use QScopedPointer to store vao. Task-number: QTBUG-47978 Change-Id: I03b09cf97818c440e2241cdeff78975482463d75 Reviewed-by: Tomi Korpipää <tomi.korpipaa@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* De-inline some polymorphic dtorsMarc Mutz2016-04-2813-0/+105
| | | | | | | | | Helps avoid duplicated vtables and code (an out-of-line copy always needs to exist for the vtable to point at). Change-Id: I882552532cdba28a136542f3497f571d1593bac3 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix: restore FilterKeyManagerPaul Lemire2016-04-281-0/+7
| | | | | | | Which was mistakenly removed Change-Id: Ibd7c7e00085259f7f0bcf8b705633e8abc6daa59 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix forward declare of struct GraphicsApiFilterDataPaul Lemire2016-04-281-1/+1
| | | | | Change-Id: I8368a579e9a89ce7ff02b6bc64a41b24e8b42d27 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Render::Renderer: eradicate remaining Q_FOREACH loopMarc Mutz2016-04-281-1/+1
| | | | | | | | | | ... by replacing them with C++11 range-for loops. Saves 0.8KiB in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I8ae26e35d7d5ce8ed413279115f872d60ee663c9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* render/backend: eradicate Q_FOREACH loops [low-risk]Marc Mutz2016-04-287-40/+55
| | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(), where needed. This is the batch with low-risk changes. They operate on local containers or the loop body clearly does not cause the container to change. Saves 8.3KiB (2.8%) in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I7e4f8390b7530981185ad65d152b267e18a88c90 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>