QML 渲染引擎:帧刷新事件 [英] QML Rendering Engine: frame refresh event

查看:14
本文介绍了QML 渲染引擎:帧刷新事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

性能注意事项和建议文章说:

作为应用程序开发人员,您必须努力允许渲染引擎以实现一致的每秒 60 帧的刷新率.60FPS 意味着每个之间大约有 16 毫秒可以进行处理的框架,其中包括处理需要将绘制图元上传到图形硬件.

As an application developer, you must strive to allow the rendering engine to achieve a consistent 60 frames-per-second refresh rate. 60 FPS means that there is approximately 16 milliseconds between each frame in which processing can be done, which includes the processing required to upload the draw primitives to the graphics hardware.

是否有事件或信号或任何形式的回调使代码在刷新时被调用?

Is there an event or signal or any form of callback to make the code be called with that refresh?

目标是消除在 UI 线程槽中处理来自渲染线程的信号的需要.如果新数据到达,那么它将被绘制或标记为下一次要绘制的刷新(使用 update() 调用).

The goal is to eliminate the need for handling the signal from the rendering thread in the UI thread slot. If the new data arrived then it will be drawn or marked for the next refresh to be drawn (with update() call).

推荐答案

QQuickWindow 有一堆信号用于同步目的 - beforeRendering(), afterRendering()beforeSynchronizing()afterSynchronizing()frameSwapped().任君挑选.

QQuickWindow has a bunch of signals for the purpose of synchronization - beforeRendering(), afterRendering(), beforeSynchronizing(), afterSynchronizing(), frameSwapped(). Take your pick.

这篇关于QML 渲染引擎:帧刷新事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆