[Interest] Qt Quick and animatic 12MP image

Tomasz Olszak olszak.tomasz at gmail.com
Wed Sep 5 23:06:26 CEST 2018


Ola, thanks for the snippet.

Unfortunately I don't see any difference.

But what is interesting - at least on my I7 haswell laptop now (also
Kubuntu 18.04). When my snippet starts it stutters for about 2 seconds then
is super fluent. There is one condition though - you can't move mouse. As
soon as you use mouse it stutters a lot.
Tomorrow I will try with eglfs and QT_QPA_EGLFS_HIDECURSOR=true. Seems like
it  is related to cursor rendering or input handling.

śr., 5 wrz 2018 o 17:20 Ola Røer Thorsen <ola at silentwings.no> napisał(a):

> 2018-09-05 14:08 GMT+02:00 Tomasz Olszak <olszak.tomasz at gmail.com>:
>
>> Hi, I want to animate (change flickable contentX and contentY) image
>> position in screen. Image is bigger(4000x3000) than screen. Currently, I
>> implemented it on I7 ivybridge on Kubuntu 18.04.
>> It simply stutters few times a second. If anyone has integrated Intel GPU
>> - could I kindly ask to check if it also stutter for him? Is it a GPU limit
>> to handle such big texture or perhaps I can tweak something to make it
>> fluent:
>>
>>
> Instead of flickable i'd use GridView (which uses flickable). Only the
> items actually on screen will be instantiated, so it scales much better.
>
> If your real case is an image and your GPU supports texture sizes as big
> as your image size then maybe something like this could be faster (let a
> shader to the zooming/cropping):
>
>
> import QtQuick 2.9
>
> import QtQuick.Window 2.2
>
>
> Window {
>
>     visible: true
>
>     width: 640
>
>     height: 480
>
>
>     Image {
>
>         id: img
>
>         source: "http://www.letsgodigital.org/images/producten/1515/testrapport/underwater-photos.jpg"
>
>         visible: false
>
>     }
>
>
>     Flickable {
>
>         anchors.fill: parent
>
>         id: flicker
>
>         contentWidth: dummyFlickItem.width
>
>         contentHeight: dummyFlickItem.height
>
>
>         Item {
>
>             id: dummyFlickItem
>
>             width: img.sourceSize.width
>
>             height: img.sourceSize.height
>
>         }
>
>     }
>
>
>     ShaderEffect {
>
>         anchors.fill: flicker
>
>         property variant src: img
>
>         property real xPosition: flicker.visibleArea.xPosition
>
>         property real yPosition: flicker.visibleArea.yPosition
>
>         property real widthRatio: flicker.visibleArea.widthRatio
>
>         property real heightRatio: flicker.visibleArea.heightRatio
>
>
>         vertexShader: "
>
>                   uniform highp mat4 qt_Matrix;
>
>                   attribute highp vec4 qt_Vertex;
>
>                   attribute highp vec2 qt_MultiTexCoord0;
>
>
>                   uniform highp float xPosition;
>
>                   uniform highp float yPosition;
>
>                   uniform highp float widthRatio;
>
>                   uniform highp float heightRatio;
>
>
>                   varying highp vec2 coord;
>
>                   void main() {
>
>                       coord.x = xPosition + widthRatio*qt_MultiTexCoord0.x;
>
>                       coord.y = yPosition + heightRatio*qt_MultiTexCoord0.y;
>
>                       gl_Position = qt_Matrix * qt_Vertex;
>
>                   }"
>
>         fragmentShader: "
>
>                   varying highp vec2 coord;
>
>                   uniform sampler2D src;
>
>                   uniform lowp float qt_Opacity;
>
>                   void main() {
>
>                       gl_FragColor = texture2D(src, coord);
>
>                   }"
>
>     }
>
> }
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180905/7b36f3d4/attachment.html>


More information about the Interest mailing list