From 3f8d5d0ad7eee1defe81543cf12142779e9e4bfc Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Sat, 7 Dec 2013 09:41:44 +0100 Subject: Visualization modes for rendering. There are two ways of setting this right now. One is to set it on startup using an environment varible. QSG_VISUALIZE= "batches" - Visualize batchtes in the renderer. Merged batches are drawn with solid color and Unmerged batches are drawn with a diagonal line pattern. Few unique colors means good batching. Unmerged batches are bad if they contain many individual nodes. "clip" - Visualize clipping as red areas on top of the scene. "overdraw" - Visualize all items in 3D to highlight overdraws. This mode can also be used to detect geometry outside the viewport to some extent. Opaque items are rendered with a green tint while translucent items are rendered with a red tint. The bounding box for the viewport is rendered in blue. Opaque content is easier for the scenegraph to process and it can also be faster to render on some hardware. "changes" - Changes in the scenegraph are visualized with a flashing overlay with a random color. Changes on a primitive is visualized with a solid color while changes in an ancestor, such as a matrix or opacity changes is visualized with a pattern. The second way to set the visualization mode is to set it at runtime through QString QQuickWindowPrivate::customRenderMode. This "API" is string based so it is not tied to the batch renderer and in theory can support other custom renderers. The visualized elements do not respect clipping and rendering order is arbitrary. Change-Id: I31efbe53fc905145bf48080ede3e36945cb60dcf Reviewed-by: Michael Brasser --- src/quick/scenegraph/coreapi/qsgrenderer_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quick/scenegraph/coreapi/qsgrenderer_p.h') diff --git a/src/quick/scenegraph/coreapi/qsgrenderer_p.h b/src/quick/scenegraph/coreapi/qsgrenderer_p.h index 43811e6d5e..296d6e2cfd 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgrenderer_p.h @@ -132,6 +132,8 @@ public: void setClearMode(ClearMode mode) { m_clear_mode = mode; } ClearMode clearMode() const { return m_clear_mode; } + virtual void setCustomRenderMode(const QByteArray &) { }; + Q_SIGNALS: void sceneGraphChanged(); // Add, remove, ChangeFlags changes... -- cgit v1.2.3