[Interest] animation on font.pixelSize

Samuel Rødal samuel.rodal at digia.com
Mon Jan 14 12:54:56 CET 2013


On 01/11/2013 04:59 PM, Thomas Senyk wrote:
> Hi,
>
> as with Quick2.0 we got the very nice DistanceField-font-rendering.
> So in theory animations on Text{ font.pixelSize } should be fairly cheap,
> right?
>
> With the following code snipped I got performance problems never the less:
>
> import QtQuick 2.0
> Text {
>      id: text
>      width: 500
>      height: 100
>      text: "Test font.pixelSize animation"
>      NumberAnimation {
>          running: true
>          loops: Animation.Infinite
>          duration: 2000
>          target: text
>          property: "font.pixelSize"
>          from: 10
>          to: 90
>      }
> }
>
>
> The strange thing is, on my desktop he has 100% cpu load for the first 2-4
> loops.
> ... I wild guess: It looks like it needs to render the font-glyphs for each(?)
> size and after a few cycles it got all of them rendered and cached...?
> (it can't render all of them in the first loop as he jumps due to bad
> performance)
>
> On embedded (raspberry pi) I get <20% load all the time.
>
> On desktop I got:
>   - intel xeon 3ghz
>   - nvidia 8600gts
>   - Qt5 checkout from this week, branch: stable
>   - xcb as platform backend (using freetype and fontconfig)
>
> On the raspberry  I got:
>    - BCM 2835 (slow ARM11 cpu, fast VideoCore IV GPU)
>    - eglfs as platform backend
>    - no fontconfig -> QBasicFontDatabase
> (If it helps I can do a fontconfig build)
>
> Is this know? Can anyone verify?
> And possible explanation? .. maybe my Qt5 build on desktop is flawed?

Try adding "renderType: Text.QtRendering" in the Text element. On 
desktop it might be that Text.NativeRendering is the default (which does 
not use distance field glyphs but texture glyphs cached based on the 
pixel size, maybe even on the scale?).

--
Samuel




More information about the Interest mailing list