diff options
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | examples/shadereffectitem/Effectoids/Box4PointBlur.qml | 11 | ||||
-rw-r--r-- | examples/shadereffectitem/Effectoids/Colorize.qml | 6 | ||||
-rw-r--r-- | examples/shadereffectitem/Effectoids/Directional4PointBlur.qml | 11 | ||||
-rw-r--r-- | examples/shadereffectitem/Effectoids/Directional8PointBlur.qml | 20 | ||||
-rw-r--r-- | examples/shadereffectitem/Effectoids/DropShadow.qml | 13 | ||||
-rw-r--r-- | src/canvas/qvsyncanimationdriver.cpp | 7 | ||||
-rw-r--r-- | tests/big-flickable.qml | 20 |
8 files changed, 65 insertions, 28 deletions
@@ -15,3 +15,8 @@ Running Stuff: Using in your own application - Including the "src/scenegraph_include.pri" file in your own projects should be sufficient. + +Notes: + - If you are combining scenegraph with qt-lighthouse, the code assumes that the + platform plugin provides a single GL fullscreen window, like the EglFS plugin + does. diff --git a/examples/shadereffectitem/Effectoids/Box4PointBlur.qml b/examples/shadereffectitem/Effectoids/Box4PointBlur.qml index 9e24b6b..f64fbe7 100644 --- a/examples/shadereffectitem/Effectoids/Box4PointBlur.qml +++ b/examples/shadereffectitem/Effectoids/Box4PointBlur.qml @@ -48,12 +48,12 @@ ShaderEffectItem "varying highp vec2 my_TexCoord2; \n" + "varying highp vec2 my_TexCoord3; \n" + "varying highp vec2 my_TexCoord4; \n" + - "uniform sampler2D qt_Texture; \n" + + "uniform sampler2D source; \n" + "void main() { \n" + - " gl_FragColor = (texture2D(qt_Texture, qt_TexCoord) \n" + - " + texture2D(qt_Texture, my_TexCoord2) \n" + - " + texture2D(qt_Texture, my_TexCoord3) \n" + - " + texture2D(qt_Texture, my_TexCoord4)) * 0.25; \n" + + " gl_FragColor = (texture2D(source, qt_TexCoord) \n" + + " + texture2D(source, my_TexCoord2) \n" + + " + texture2D(source, my_TexCoord3) \n" + + " + texture2D(source, my_TexCoord4)) * 0.25; \n" + "}" vertexShader: @@ -76,6 +76,7 @@ ShaderEffectItem " gl_Position = qt_Matrix * qt_VertexPosition; \n" + "}" + property variant source; property real xOffset: 0.5 / width property real yOffset: 0.5 / height active: true diff --git a/examples/shadereffectitem/Effectoids/Colorize.qml b/examples/shadereffectitem/Effectoids/Colorize.qml index 73e3858..4d6ad53 100644 --- a/examples/shadereffectitem/Effectoids/Colorize.qml +++ b/examples/shadereffectitem/Effectoids/Colorize.qml @@ -45,11 +45,11 @@ ShaderEffectItem { fragmentShader: "varying highp vec2 qt_TexCoord; \n" + - "uniform sampler2D qt_Texture; \n" + + "uniform sampler2D source; \n" + "uniform lowp vec4 color; \n" + "uniform lowp float intensity; \n" + "void main() { \n" + - " lowp vec4 pix = texture2D(qt_Texture, qt_TexCoord); \n" + + " lowp vec4 pix = texture2D(source, qt_TexCoord); \n" + " lowp float gray = dot(pix.rgb, vec3(0.5, 0.5, 0.5)); \n" + " gl_FragColor = mix(pix, color * (gray * pix.w), intensity); \n" + "}" @@ -64,6 +64,8 @@ ShaderEffectItem " gl_Position = qt_Matrix * qt_VertexPosition; \n" + "}" + property variant source; + property color color; property real intensity; active: intensity > 0 diff --git a/examples/shadereffectitem/Effectoids/Directional4PointBlur.qml b/examples/shadereffectitem/Effectoids/Directional4PointBlur.qml index 1d7f74d..d5ab6f9 100644 --- a/examples/shadereffectitem/Effectoids/Directional4PointBlur.qml +++ b/examples/shadereffectitem/Effectoids/Directional4PointBlur.qml @@ -48,12 +48,12 @@ ShaderEffectItem "varying highp vec2 qt_TexCoord2; \n" + "varying highp vec2 qt_TexCoord3; \n" + "varying highp vec2 qt_TexCoord4; \n" + - "uniform sampler2D qt_Texture; \n" + + "uniform sampler2D source; \n" + "void main() { \n" + - " gl_FragColor = ( 2. / 6. * texture2D(qt_Texture, qt_TexCoord) \n" + - " + 1. / 6. * texture2D(qt_Texture, qt_TexCoord2) \n" + - " + 2. / 6. * texture2D(qt_Texture, qt_TexCoord3) \n" + - " + 1. / 6. * texture2D(qt_Texture, qt_TexCoord4)); \n" + + " gl_FragColor = ( 2. / 6. * texture2D(source, qt_TexCoord) \n" + + " + 1. / 6. * texture2D(source, qt_TexCoord2) \n" + + " + 2. / 6. * texture2D(source, qt_TexCoord3) \n" + + " + 1. / 6. * texture2D(source, qt_TexCoord4)); \n" + "}" vertexShader: @@ -77,6 +77,7 @@ ShaderEffectItem "}" + property variant source; property real spread: 1; property real xStep: 0 / width; property real yStep: 1 / height; diff --git a/examples/shadereffectitem/Effectoids/Directional8PointBlur.qml b/examples/shadereffectitem/Effectoids/Directional8PointBlur.qml index cc4e3b0..3aaaa18 100644 --- a/examples/shadereffectitem/Effectoids/Directional8PointBlur.qml +++ b/examples/shadereffectitem/Effectoids/Directional8PointBlur.qml @@ -52,17 +52,17 @@ ShaderEffectItem "varying highp vec2 qt_TexCoord6; \n" + "varying highp vec2 qt_TexCoord7; \n" + "varying highp vec2 qt_TexCoord8; \n" + - "uniform sampler2D qt_Texture; \n" + + "uniform sampler2D source; \n" + "void main() { \n" + " gl_FragColor = \n" + - " (4. / 20. * texture2D(qt_Texture, qt_TexCoord) \n" + - " + 3. / 20. * texture2D(qt_Texture, qt_TexCoord2) \n" + - " + 2. / 20. * texture2D(qt_Texture, qt_TexCoord3) \n" + - " + 1. / 20. * texture2D(qt_Texture, qt_TexCoord4) \n" + - " + 4. / 20. * texture2D(qt_Texture, qt_TexCoord5) \n" + - " + 3. / 20. * texture2D(qt_Texture, qt_TexCoord6) \n" + - " + 2. / 20. * texture2D(qt_Texture, qt_TexCoord7) \n" + - " + 1. / 20. * texture2D(qt_Texture, qt_TexCoord8)); \n" + + " (4. / 20. * texture2D(source, qt_TexCoord) \n" + + " + 3. / 20. * texture2D(source, qt_TexCoord2) \n" + + " + 2. / 20. * texture2D(source, qt_TexCoord3) \n" + + " + 1. / 20. * texture2D(source, qt_TexCoord4) \n" + + " + 4. / 20. * texture2D(source, qt_TexCoord5) \n" + + " + 3. / 20. * texture2D(source, qt_TexCoord6) \n" + + " + 2. / 20. * texture2D(source, qt_TexCoord7) \n" + + " + 1. / 20. * texture2D(source, qt_TexCoord8)); \n" + "}" vertexShader: @@ -93,7 +93,7 @@ ShaderEffectItem " gl_Position = qt_Matrix * qt_VertexPosition; \n" + "}" - + property variant source; property real spread: 1; property real xStep: 0 / width; property real yStep: 1 / height; diff --git a/examples/shadereffectitem/Effectoids/DropShadow.qml b/examples/shadereffectitem/Effectoids/DropShadow.qml index 89f68c8..b28a6ef 100644 --- a/examples/shadereffectitem/Effectoids/DropShadow.qml +++ b/examples/shadereffectitem/Effectoids/DropShadow.qml @@ -49,13 +49,13 @@ ShaderEffectItem "varying highp vec2 my_TexCoord2; \n" + "varying highp vec2 my_TexCoord3; \n" + "varying highp vec2 my_TexCoord4; \n" + - "uniform sampler2D qt_Texture; \n" + + "uniform sampler2D source; \n" + "void main() { \n" + - " lowp vec4 pix = texture2D(qt_Texture, qt_TexCoord); \n" + - " lowp float shadow = (texture2D(qt_Texture, my_TexCoord1).w \n" + - " + texture2D(qt_Texture, my_TexCoord2).w \n" + - " + texture2D(qt_Texture, my_TexCoord3).w \n" + - " + texture2D(qt_Texture, my_TexCoord4).w) * 0.1; \n" + + " lowp vec4 pix = texture2D(source, qt_TexCoord); \n" + + " lowp float shadow = (texture2D(source, my_TexCoord1).w \n" + + " + texture2D(source, my_TexCoord2).w \n" + + " + texture2D(source, my_TexCoord3).w \n" + + " + texture2D(source, my_TexCoord4).w) * 0.1; \n" + " gl_FragColor = mix(vec4(0, 0, 0, shadow), pix, pix.w); \n" + "}" @@ -84,6 +84,7 @@ ShaderEffectItem " gl_Position = qt_Matrix * qt_VertexPosition; \n" + "}" + property variant source; property real xOffset: 0.66 / width; property real yOffset: 0.66 / height; property real xDisplacement: 10 / width; diff --git a/src/canvas/qvsyncanimationdriver.cpp b/src/canvas/qvsyncanimationdriver.cpp index 465016a..dd84dd3 100644 --- a/src/canvas/qvsyncanimationdriver.cpp +++ b/src/canvas/qvsyncanimationdriver.cpp @@ -89,6 +89,13 @@ bool QVSyncAnimationDriver::eventFilter(QObject *object, QEvent *event) { Q_D(QVSyncAnimationDriver); if (isRunning()) { + +#ifdef Q_WS_QPA + if (object == d->window && event->type() == QEvent::UpdateRequest) + return true; + else +#endif + if (object == QApplication::instance() && event->type() == QEvent::Quit) { // If we get a close event while running, we are actually inside the processEvents() // block and need to exit an extra level to exit the final exec(). diff --git a/tests/big-flickable.qml b/tests/big-flickable.qml new file mode 100644 index 0000000..378300b --- /dev/null +++ b/tests/big-flickable.qml @@ -0,0 +1,20 @@ +import Qt 4.7 + +Item { + width: 360 + height: 640 + + Flickable { + id: flick + anchors.fill: parent + + contentWidth: 4000 + contentHeight: 3000 + + Image { + source: "img.png" + width: flick.contentWidth + height: flick.contentHeight + } + } +}
\ No newline at end of file |