From 59a70377683445f4355b5e3eef50869b61331cfa Mon Sep 17 00:00:00 2001 From: Berthold Krevert Date: Mon, 1 May 2017 23:03:41 +0200 Subject: Fix QSG_VISUALIZE=batches Since I362e1cb8e10 the batch renderer defaults to QSG_SEPARATE_INDEX_BUFFER which broke the batches visualization Change-Id: If1d51cabb0cc4a3a98ac2c01bd78789d08fe72f7 Reviewed-by: Gunnar Sletta Reviewed-by: Robin Burchell --- src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/quick') diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index b8ebeaca63..78f2c86f6c 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -2966,7 +2966,11 @@ void Renderer::visualizeBatch(Batch *b) for (int ds=0; dsdrawSets.size(); ++ds) { const DrawSet &set = b->drawSets.at(ds); glVertexAttribPointer(a.position, 2, a.type, false, g->sizeOfVertex(), (void *) (qintptr) (set.vertices)); +#ifdef QSG_SEPARATE_INDEX_BUFFER + glDrawElements(g->drawingMode(), set.indexCount, GL_UNSIGNED_SHORT, (void *) (qintptr) (b->ibo.data + set.indices)); +#else glDrawElements(g->drawingMode(), set.indexCount, GL_UNSIGNED_SHORT, (void *) (qintptr) (b->vbo.data + set.indices)); +#endif } } else { Element *e = b->first; -- cgit v1.2.3 From ee6b07b3ce8ba80632868181d45d96253acb1064 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 11 May 2017 20:25:47 +0200 Subject: Temporarily restore QQuickPointerDevice::pointerEvent() accessor This can be reverted as soon as the relevant qtlocation change is integrated. Task-number: QTBUG-57253 Change-Id: I72b71f61ba8fe421ac57c963801176098fe9f11c Reviewed-by: Robin Burchell --- src/quick/items/qquickevents_p_p.h | 7 +++++++ src/quick/items/qquickwindow.cpp | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index 3735d68a85..323ecfa4ff 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -501,6 +501,7 @@ public: : m_deviceType(devType), m_pointerType(pType), m_capabilities(caps) , m_maximumTouchPoints(maxPoints), m_buttonCount(buttonCount), m_name(name) , m_uniqueId(QPointingDeviceUniqueId::fromNumericId(uniqueId)) + , m_event(nullptr) { } @@ -513,6 +514,8 @@ public: QString name() const { return m_name; } QPointingDeviceUniqueId uniqueId() const { return m_uniqueId; } + QQuickPointerEvent *pointerEvent() const { return m_event; } // deprecated + static QQuickPointerDevice *touchDevice(QTouchDevice *d); static QList touchDevices(); static QQuickPointerDevice *genericMouseDevice(); @@ -527,6 +530,10 @@ private: QString m_name; QPointingDeviceUniqueId m_uniqueId; + // the event instance used last time within the context of one window + QQuickPointerEvent *m_event; // deprecated + friend class QQuickWindowPrivate; // not needed after removing the above + Q_DISABLE_COPY(QQuickPointerDevice) }; diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index c441cfc357..816c057ab0 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2117,8 +2117,10 @@ QQuickPointerEvent *QQuickWindowPrivate::pointerEventInstance(QQuickPointerDevic { // the list of devices should be very small so a linear search should be ok for (QQuickPointerEvent *e: pointerEventInstances) { - if (e->device() == device) + if (e->device() == device) { + device->m_event = e; return e; + } } QQuickPointerEvent *ev = nullptr; @@ -2136,6 +2138,7 @@ QQuickPointerEvent *QQuickWindowPrivate::pointerEventInstance(QQuickPointerDevic break; } pointerEventInstances << ev; + device->m_event = ev; return ev; } -- cgit v1.2.3