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


C++ FloatQuad::setP4方法代码示例

本文整理汇总了C++中FloatQuad::setP4方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatQuad::setP4方法的具体用法?C++ FloatQuad::setP4怎么用?C++ FloatQuad::setP4使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FloatQuad的用法示例。


在下文中一共展示了FloatQuad::setP4方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: convertTargetSpaceQuadToCompositedLayer

static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpaceQuad, LayoutObject* targetRenderer, const LayoutBoxModelObject* paintInvalidationContainer, FloatQuad& compositedSpaceQuad)
{
    ASSERT(targetRenderer);
    ASSERT(paintInvalidationContainer);
    for (unsigned i = 0; i < 4; ++i) {
        IntPoint point;
        switch (i) {
        case 0: point = roundedIntPoint(targetSpaceQuad.p1()); break;
        case 1: point = roundedIntPoint(targetSpaceQuad.p2()); break;
        case 2: point = roundedIntPoint(targetSpaceQuad.p3()); break;
        case 3: point = roundedIntPoint(targetSpaceQuad.p4()); break;
        }

        // FIXME: this does not need to be absolute, just in the paint invalidation container's space.
        point = targetRenderer->frame()->view()->contentsToRootFrame(point);
        point = paintInvalidationContainer->frame()->view()->rootFrameToContents(point);
        FloatPoint floatPoint = paintInvalidationContainer->absoluteToLocal(point, UseTransforms);
        DeprecatedPaintLayer::mapPointToPaintBackingCoordinates(paintInvalidationContainer, floatPoint);

        switch (i) {
        case 0: compositedSpaceQuad.setP1(floatPoint); break;
        case 1: compositedSpaceQuad.setP2(floatPoint); break;
        case 2: compositedSpaceQuad.setP3(floatPoint); break;
        case 3: compositedSpaceQuad.setP4(floatPoint); break;
        }
    }
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:27,代码来源:LinkHighlight.cpp

示例2: convertTargetSpaceQuadToCompositedLayer

static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpaceQuad, RenderObject* targetRenderer, RenderObject* compositedRenderer, FloatQuad& compositedSpaceQuad)
{
    ASSERT(targetRenderer);
    ASSERT(compositedRenderer);

    for (unsigned i = 0; i < 4; ++i) {
        IntPoint point;
        switch (i) {
        case 0: point = roundedIntPoint(targetSpaceQuad.p1()); break;
        case 1: point = roundedIntPoint(targetSpaceQuad.p2()); break;
        case 2: point = roundedIntPoint(targetSpaceQuad.p3()); break;
        case 3: point = roundedIntPoint(targetSpaceQuad.p4()); break;
        }

        point = targetRenderer->frame()->view()->contentsToWindow(point);
        point = compositedRenderer->frame()->view()->windowToContents(point);
        FloatPoint floatPoint = compositedRenderer->absoluteToLocal(point, UseTransforms);

        switch (i) {
        case 0: compositedSpaceQuad.setP1(floatPoint); break;
        case 1: compositedSpaceQuad.setP2(floatPoint); break;
        case 2: compositedSpaceQuad.setP3(floatPoint); break;
        case 3: compositedSpaceQuad.setP4(floatPoint); break;
        }
    }
}
开发者ID:junmin-zhu,项目名称:blink,代码行数:26,代码来源:LinkHighlight.cpp

示例3: projectQuad

FloatQuad TransformationMatrix::projectQuad(const FloatQuad& q) const
{
    FloatQuad projectedQuad;
    projectedQuad.setP1(projectPoint(q.p1()));
    projectedQuad.setP2(projectPoint(q.p2()));
    projectedQuad.setP3(projectPoint(q.p3()));
    projectedQuad.setP4(projectPoint(q.p4()));
    return projectedQuad;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:9,代码来源:TransformationMatrix.cpp

示例4: contentsQuadToCoordinateSystem

static void contentsQuadToCoordinateSystem(const FrameView* mainView, const FrameView* view, FloatQuad& quad, InspectorOverlay::CoordinateSystem coordinateSystem)
{
    quad.setP1(view->contentsToRootView(roundedIntPoint(quad.p1())));
    quad.setP2(view->contentsToRootView(roundedIntPoint(quad.p2())));
    quad.setP3(view->contentsToRootView(roundedIntPoint(quad.p3())));
    quad.setP4(view->contentsToRootView(roundedIntPoint(quad.p4())));

    if (coordinateSystem == InspectorOverlay::CoordinateSystem::View)
        quad += mainView->scrollOffset();
}
开发者ID:aosm,项目名称:WebCore,代码行数:10,代码来源:InspectorOverlay.cpp

示例5: getTransformedRect

static FloatQuad getTransformedRect(const IntSize& bounds, const IntRect& rect, const TransformationMatrix& drawTransform)
{
    float x = -bounds.width() / 2.0 + rect.x();
    float y = -bounds.height() / 2.0 + rect.y();
    float w = rect.width();
    float h = rect.height();
    FloatQuad result;
    result.setP1(drawTransform.mapPoint(FloatPoint(x, y)));
    result.setP2(drawTransform.mapPoint(FloatPoint(x, y + h)));
    result.setP3(drawTransform.mapPoint(FloatPoint(x + w, y + h)));
    result.setP4(drawTransform.mapPoint(FloatPoint(x + w, y)));

    return result;
}
开发者ID:jbat100,项目名称:webkit,代码行数:14,代码来源:LayerCompositingThread.cpp

示例6:

FloatQuad LayerGLES2::getTransformedHolePunchRect() const
{
    float x = -m_bounds.width()/2.0 + m_holePunchRect.x();
    float y = -m_bounds.height()/2.0 + m_holePunchRect.y();
    float w = m_holePunchRect.width();
    float h = m_holePunchRect.height();
    FloatQuad result;
    result.setP1(m_drawTransform.mapPoint(FloatPoint(x, y)));
    result.setP2(m_drawTransform.mapPoint(FloatPoint(x, y+h)));
    result.setP3(m_drawTransform.mapPoint(FloatPoint(x+w, y+h)));
    result.setP4(m_drawTransform.mapPoint(FloatPoint(x+w, y)));

    return result;
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例7: drawRect

FloatRect LayerRendererSurface::drawRect() const
{
    float bx = m_size.width() / 2.0;
    float by = m_size.height() / 2.0;

    FloatQuad transformedBounds;
    transformedBounds.setP1(m_drawTransform.mapPoint(FloatPoint(-bx, -by)));
    transformedBounds.setP2(m_drawTransform.mapPoint(FloatPoint(-bx, by)));
    transformedBounds.setP3(m_drawTransform.mapPoint(FloatPoint(bx, by)));
    transformedBounds.setP4(m_drawTransform.mapPoint(FloatPoint(bx, -by)));

    FloatRect rect = transformedBounds.boundingBox();

    if (m_ownerLayer->replicaLayer()) {
        FloatQuad bounds;
        bounds.setP1(m_replicaDrawTransform.mapPoint(FloatPoint(-bx, -by)));
        bounds.setP2(m_replicaDrawTransform.mapPoint(FloatPoint(-bx, by)));
        bounds.setP3(m_replicaDrawTransform.mapPoint(FloatPoint(bx, by)));
        bounds.setP4(m_replicaDrawTransform.mapPoint(FloatPoint(bx, -by)));
        rect.unite(bounds.boundingBox());
    }

    return rect;
}
开发者ID:Moondee,项目名称:Artemis,代码行数:24,代码来源:LayerRendererSurface.cpp

示例8: mapQuad

FloatQuad AffineTransform::mapQuad(const FloatQuad& q) const
{
    if (isIdentityOrTranslation()) {
        FloatQuad mappedQuad(q);
        mappedQuad.move(narrowPrecisionToFloat(m_transform[4]), narrowPrecisionToFloat(m_transform[5]));
        return mappedQuad;
    }

    FloatQuad result;
    result.setP1(mapPoint(q.p1()));
    result.setP2(mapPoint(q.p2()));
    result.setP3(mapPoint(q.p3()));
    result.setP4(mapPoint(q.p4()));
    return result;
}
开发者ID:rmacnak-google,项目名称:engine,代码行数:15,代码来源:AffineTransform.cpp

示例9: mapRect

FloatRect AffineTransform::mapRect(const FloatRect& rect) const
{
    if (isIdentityOrTranslation()) {
        FloatRect mappedRect(rect);
        mappedRect.move(narrowPrecisionToFloat(m_transform[4]), narrowPrecisionToFloat(m_transform[5]));
        return mappedRect;
    }

    FloatQuad result;
    result.setP1(mapPoint(rect.location()));
    result.setP2(mapPoint(FloatPoint(rect.right(), rect.y())));
    result.setP3(mapPoint(FloatPoint(rect.right(), rect.bottom())));
    result.setP4(mapPoint(FloatPoint(rect.x(), rect.bottom())));
    return result.boundingBox();
}
开发者ID:dslab-epfl,项目名称:warr,代码行数:15,代码来源:AffineTransform.cpp

示例10: projectQuad

static FloatQuad projectQuad(const TransformationMatrix& transform, const FloatQuad& q, bool& clamped)
{
    FloatQuad projectedQuad;
    bool clampedPoint;
    projectedQuad.setP1(transform.projectPoint(q.p1(), &clampedPoint));
    clamped = clampedPoint;
    projectedQuad.setP2(transform.projectPoint(q.p2(), &clampedPoint));
    clamped |= clampedPoint;
    projectedQuad.setP3(transform.projectPoint(q.p3(), &clampedPoint));
    clamped |= clampedPoint;
    projectedQuad.setP4(transform.projectPoint(q.p4(), &clampedPoint));
    clamped |= clampedPoint;

    return projectedQuad;
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例11: mapQuad

FloatQuad TransformationMatrix::mapQuad(const FloatQuad& q) const
{
    if (isIdentityOrTranslation()) {
        FloatQuad mappedQuad(q);
        mappedQuad.move(static_cast<float>(m_matrix[3][0]), static_cast<float>(m_matrix[3][1]));
        return mappedQuad;
    }

    FloatQuad result;
    result.setP1(mapPoint(q.p1()));
    result.setP2(mapPoint(q.p2()));
    result.setP3(mapPoint(q.p3()));
    result.setP4(mapPoint(q.p4()));
    return result;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:15,代码来源:TransformationMatrix.cpp


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