QSGRenderNode::RenderState Struct
struct QSGRenderNode::RenderState提供有关投影矩阵和剪切的信息。更多
公共函数
virtual const QRegion * | clipRegion() const = 0 |
virtual void * | get(const char *state) const |
virtual const QMatrix4x4 * | projectionMatrix() const = 0 |
virtual bool | scissorEnabled() const = 0 |
virtual QRect | scissorRect() const = 0 |
virtual bool | stencilEnabled() const = 0 |
virtual int | stencilValue() const = 0 |
另请参阅 QSGRenderNode::render().
成员函数文档
[pure virtual]
const QRegion *RenderState::clipRegion() const
返回当前剪辑区域,如果后端通过模板或剪切实现剪辑,则返回空值。
software
后端不使用投影、剪刀或钢网,这意味着大部分渲染状态都没有使用。不过,由于在render() 中手动重建剪辑区域并不合理,因此QPainter 上可设置的剪辑区域仍需进行通信。因此,可以通过此函数对其进行查询。该区域为世界坐标,可通过Qt::ReplaceClip 传递给QPainter::setClipRegion() 。这必须在调用QPainter::setTransform() 之前完成,因为剪辑区域已经映射到QSGRenderNode::matrix() 中提供的变换。
[virtual]
void *RenderState::get(const char *state) const
返回指向state 值的指针。
保留供将来使用。
[pure virtual]
const QMatrix4x4 *RenderState::projectionMatrix() const
返回当前投影矩阵的指针。
模型视图矩阵可通过QSGRenderNode::matrix() 获取。通常情况下,projection * modelview
是顶点着色器中用于变换顶点的矩阵。
[pure virtual]
bool RenderState::scissorEnabled() const
返回剪切的当前状态。
注意: 仅适用于具有专用剪刀差开/关状态的图形 API。
[pure virtual]
QRect RenderState::scissorRect() const
x 和 y 是左下角坐标。
[pure virtual]
bool RenderState::stencilEnabled() const
返回模版测试的当前状态。
注: 在图形 API 中,模版测试是在流水线状态对象(而不是单独的状态设置命令)中启用的,这取决于render() 的实现,即通过操作KEEP
、比较函数EQUAL
以及0xFF
的读写掩码来启用模版测试。
[pure virtual]
int RenderState::stencilValue() const
当剪切激活时,返回当前模板参考值。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.