本文整理汇总了C++中QMatrix4x4::mapRect方法的典型用法代码示例。如果您正苦于以下问题:C++ QMatrix4x4::mapRect方法的具体用法?C++ QMatrix4x4::mapRect怎么用?C++ QMatrix4x4::mapRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMatrix4x4
的用法示例。
在下文中一共展示了QMatrix4x4::mapRect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paint
void QRawWebView::paint(const QMatrix4x4& transform, float opacity, unsigned paintFlags)
{
WebKit::LayerTreeRenderer* renderer = layerTreeRenderer();
if (!renderer)
return;
renderer->setActive(true);
WebCore::FloatRect rect(0, 0, d->m_size.width(), d->m_size.height());
renderer->paintToCurrentGLContext(transform, opacity, transform.mapRect(rect), paintFlags);
}
示例2: paint
void QRawWebView::paint(const QMatrix4x4& transform, float opacity, unsigned paintFlags)
{
WebCore::CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
if (!scene)
return;
scene->setActive(true);
WebCore::FloatRect rect(0, 0, d->m_size.width(), d->m_size.height());
scene->paintToCurrentGLContext(transform, opacity, transform.mapRect(rect), paintFlags);
}
示例3: clipRect
QRectF clipRect() const
{
// Start with an invalid rect.
QRectF resultRect(0, 0, -1, -1);
for (const QSGClipNode* clip = clipList(); clip; clip = clip->clipList()) {
QMatrix4x4 clipMatrix;
if (pageNode()->devicePixelRatio() != 1.0) {
clipMatrix.scale(pageNode()->devicePixelRatio());
if (clip->matrix())
clipMatrix *= (*clip->matrix());
} else if (clip->matrix())
clipMatrix = *clip->matrix();
QRectF currentClip;
if (clip->isRectangular())
currentClip = clipMatrix.mapRect(clip->clipRect());
else {
const QSGGeometry* geometry = clip->geometry();
// Assume here that clipNode has only coordinate data.
const QSGGeometry::Point2D* geometryPoints = geometry->vertexDataAsPoint2D();
// Clip region should be at least triangle to make valid clip.
if (geometry->vertexCount() < 3)
continue;
QPolygonF polygon;
for (int i = 0; i < geometry->vertexCount(); i++)
polygon.append(clipMatrix.map(QPointF(geometryPoints[i].x, geometryPoints[i].y)));
currentClip = polygon.boundingRect();
}
if (currentClip.isEmpty())
continue;
if (resultRect.isValid())
resultRect &= currentClip;
else
resultRect = currentClip;
}
return resultRect;
}