aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/fboitem/main.qml
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-11-12 10:57:15 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-11-14 15:33:37 +0100
commitb6b1d5899415fef3231120c08c56a1dc2e246940 (patch)
tree7bf4db6ba359bf76d968fdd58d5b63a5b997b782 /examples/quick/scenegraph/fboitem/main.qml
parent0a649f25813b8c2ecf679db106cb8ec175b9145a (diff)
Make QQuickFbo work with the OpenGL backend of QRhi
So no matter if Quick goes directly to OpenGL, or via QRhi, QQuickFramebufferObject will still work. Also fix up the fboitem example to use a ShaderEffect that works with both rendering paths. With graphics APIs other than OpenGL the item will be empty, as QQuickFbo is not something we can support there. Task-number: QTBUG-79222 Change-Id: I52177d3a75f619f7075a2fc829573c17031eded1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples/quick/scenegraph/fboitem/main.qml')
-rw-r--r--examples/quick/scenegraph/fboitem/main.qml15
1 files changed, 1 insertions, 14 deletions
diff --git a/examples/quick/scenegraph/fboitem/main.qml b/examples/quick/scenegraph/fboitem/main.qml
index 92fa99e847..1f1829deda 100644
--- a/examples/quick/scenegraph/fboitem/main.qml
+++ b/examples/quick/scenegraph/fboitem/main.qml
@@ -67,20 +67,7 @@ Item {
property size pixelSize: Qt.size(width / tileSize, height / tileSize);
- fragmentShader:
- "
- uniform lowp vec4 color1;
- uniform lowp vec4 color2;
- uniform highp vec2 pixelSize;
- varying highp vec2 qt_TexCoord0;
- void main() {
- highp vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * pixelSize));
- if (tc.x != tc.y)
- gl_FragColor = color1;
- else
- gl_FragColor = color2;
- }
- "
+ fragmentShader: "qrc:/scenegraph/fboitem/shaders/checker.frag"
}
Renderer {