Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f3769f2
Add support capturing QtQuick windows backed by Qt Rhi
redstrate Feb 10, 2026
e352d8c
Don't let the grabbed QImage point into QRhi's readback buffer
Waqar144 Nov 13, 2026
17a290e
Free the QRhi grabber's readback result and RHI resources
Waqar144 Nov 13, 2026
32ae2e2
Only touch the QRhi grabber's RHI resources on the render thread
Waqar144 Nov 13, 2026
863acea
Handle a missing command buffer in the QRhi grabber
Waqar144 Nov 13, 2026
ab0b9db
Grab QQuickWidget and QQuickRenderControl windows through QRhi
Waqar144 Nov 13, 2026
d36e9aa
Don't draw decorations with a QRhi pipeline that failed to be created
Waqar144 Nov 13, 2026
9fdffe1
Don't query a half destroyed window for its graphics API
Waqar144 Nov 13, 2026
5453fc2
Initialize RemoteViewFrame::m_graphicsApi and bump the protocol version
Waqar144 Nov 13, 2026
d738754
Tidy up the QRhi screen grabber
Waqar144 Nov 13, 2026
9e56097
Draw the RHI decorations at device pixel resolution
Waqar144 Nov 13, 2026
ed1f943
Draw the decoration quad from a vertex buffer
Waqar144 Nov 14, 2026
7ae5aa1
Add tests for the QRhi screen grabber
Waqar144 Nov 13, 2026
242c1b7
Add a CHANGES entry for the QRhi screen grabber
Waqar144 Nov 13, 2026
973f46e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 13, 2026
3bfbcb3
Don't draw the RHI decorations upside down
Waqar144 Nov 16, 2026
511941d
Create the RHI decoration pipeline with the render target's sample count
Waqar144 Nov 16, 2026
34bf9e3
Wait for the QRhi readback in the grab frame
Waqar144 Nov 16, 2026
8b812d3
Keep the alpha channel of RGB10A2 QRhi readbacks
Waqar144 Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Unreleased
* Report failed debugger attaches, server startup errors and Windows injection failures right away instead of timing out
* Don't time out in in-process mode when remote access is disabled
* Fix process names with spaces or parentheses in the attach dialog
* Show QtQuick windows that use Vulkan, Metal or Direct3D in the remote view, including decorations (Qt 6.6 or newer)

Version 3.4.1
-------------
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ if(Qt6Gui_VERSION VERSION_GREATER_EQUAL "6.10.0")
find_package(Qt6WidgetsPrivate REQUIRED NO_MODULE)
find_package(Qt6QmlPrivate NO_MODULE)
find_package(Qt6QuickPrivate NO_MODULE)
find_package(Qt6QuickWidgetsPrivate NO_MODULE)
find_package(Qt6GuiPrivate NO_MODULE)
endif()

# these need to included after the last Qt-related find_package() call
Expand Down
2 changes: 1 addition & 1 deletion common/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ QModelIndex toQModelIndex(const QAbstractItemModel *model, const Protocol::Model

qint32 version()
{
return 38;
return 39;
}

qint32 broadcastFormatVersion()
Expand Down
13 changes: 12 additions & 1 deletion common/remoteviewframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,19 @@ void RemoteViewFrame::setImage(const QImage &image, const QTransform &transform)
m_image.setTransform(transform);
}

void RemoteViewFrame::setGraphicsApi(const int value)
{
m_graphicsApi = value;
}

int RemoteViewFrame::graphicsApi() const
{
return m_graphicsApi;
}

QDataStream &operator<<(QDataStream &stream, const RemoteViewFrame &frame)
{
stream << frame.m_image << frame.data << frame.m_viewRect << frame.m_sceneRect;
stream << frame.m_image << frame.data << frame.m_viewRect << frame.m_sceneRect << frame.m_graphicsApi;
return stream;
}

Expand All @@ -80,6 +90,7 @@ QDataStream &operator>>(QDataStream &stream, RemoteViewFrame &frame)
stream >> frame.data;
stream >> frame.m_viewRect;
stream >> frame.m_sceneRect;
stream >> frame.m_graphicsApi;
return stream;
}
}
4 changes: 4 additions & 0 deletions common/remoteviewframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class GAMMARAY_COMMON_EXPORT RemoteViewFrame
void setImage(const QImage &image);
void setImage(const QImage &image, const QTransform &transform);

void setGraphicsApi(int value);
int graphicsApi() const;

/// tool specific frame data
QVariant data;

Expand All @@ -55,6 +58,7 @@ class GAMMARAY_COMMON_EXPORT RemoteViewFrame
TransferImage m_image;
QRectF m_viewRect;
QRectF m_sceneRect;
int m_graphicsApi = 0; // QSGRendererInterface::GraphicsApi, only set and used by the QtQuick preview. 0 is Unknown.
};
}

Expand Down
18 changes: 18 additions & 0 deletions plugins/quickinspector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,30 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD)
)
endif()

# Only needed for the RHI screen grabber for >=6.6
if(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.6.0")
find_package(Qt${QT_VERSION_MAJOR}ShaderTools REQUIRED)
qt_add_shaders(
gammaray_quickinspector
"gammaray_quickinspector_shaders"
PRECOMPILE
PREFIX
"/gammaray_quickinspector_shaders/"
FILES
"shaders/rhi_inspector_decorations.vert"
"shaders/rhi_inspector_decorations.frag"
)
endif()

target_link_libraries(
gammaray_quickinspector
gammaray_quickinspector_shared
gammaray_core
Qt::Quick
Qt::QuickPrivate
Qt::QuickWidgets
Qt::QuickWidgetsPrivate
Qt::GuiPrivate
gammaray_kitemmodels
)

Expand Down
12 changes: 8 additions & 4 deletions plugins/quickinspector/quickinspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ void RenderModeRequest::apply()
if (connection)
disconnect(connection);

if (window && window->rendererInterface()->graphicsApi() != QSGRendererInterface::OpenGL)
if (window && window->rendererInterface()->graphicsApi() == QSGRendererInterface::Software)
return;

if (window) {
Expand Down Expand Up @@ -574,6 +574,10 @@ void QuickInspector::sendRenderedScene(const GammaRay::GrabbedFrame &grabbedFram
frame.data = QVariant::fromValue(grabbedFrame.itemsGeometry);
else if (!grabbedFrame.itemsGeometry.isEmpty())
frame.data = QVariant::fromValue(grabbedFrame.itemsGeometry.at(0));
// Not m_window->rendererInterface(): this also runs for the empty frame sent from
// AbstractScreenGrabber::eventFilter() while ~QWindow hides the window, when the QQuickWindow
// part is already destroyed.
frame.setGraphicsApi(grabbedFrame.graphicsApi);
m_remoteView->sendFrame(frame);
}

Expand Down Expand Up @@ -612,10 +616,10 @@ void QuickInspector::checkFeatures()
return;
}

if (m_window->rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL)
f = AllCustomRenderModes;
else if (m_window->rendererInterface()->graphicsApi() == QSGRendererInterface::Software)
if (m_window->rendererInterface()->graphicsApi() == QSGRendererInterface::Software)
f = AnalyzePainting;
else
f = AllCustomRenderModes;

emit features(f);
}
Expand Down
12 changes: 12 additions & 0 deletions plugins/quickinspector/quickscenepreviewwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include <QMouseEvent>
#include <QPainter>

#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
#include <qsgrendererinterface.h>
#endif

using namespace GammaRay;
static const qint32 QuickScenePreviewWidgetStateVersion = 4;

Expand Down Expand Up @@ -152,6 +156,14 @@ void QuickScenePreviewWidget::resizeEvent(QResizeEvent *e)

void QuickScenePreviewWidget::renderDecoration(QPainter *p, double zoom) const
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
// We want to skip rendering decorations in the client, if we draw it on RHI targets and this rendering backend cannot discern between the two.
const auto graphicsApi = static_cast<QSGRendererInterface::GraphicsApi>(frame().graphicsApi());
if (QSGRendererInterface::isApiRhiBased(graphicsApi) && m_control->serverSideDecorationsEnabled()) {
return;
}
#endif

// Scaling and translations on QuickItemGeometry will be done on demand

if (frame().data.userType() == qMetaTypeId<QuickItemGeometry>()) {
Expand Down
Loading
Loading