当前位置: 首页>>代码示例>>C++>>正文


C++ QMatrix4x4::mapRect方法代码示例

本文整理汇总了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);
}
开发者ID:rgabor-dev,项目名称:webkitnix,代码行数:12,代码来源:qrawwebview.cpp

示例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);
}
开发者ID:bdholt1,项目名称:WebKit,代码行数:12,代码来源:qrawwebview.cpp

示例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;
    }
开发者ID:3163504123,项目名称:phantomjs,代码行数:45,代码来源:QtWebPageSGNode.cpp


注:本文中的QMatrix4x4::mapRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。