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


C++ LayoutBoxModelObject::frame方法代码示例

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


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

示例1: convertTargetSpaceQuadToCompositedLayer

static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpaceQuad, LayoutObject* targetLayoutObject, const LayoutBoxModelObject& paintInvalidationContainer, FloatQuad& compositedSpaceQuad)
{
    DCHECK(targetLayoutObject);
    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 = targetLayoutObject->frame()->view()->contentsToRootFrame(point);
        point = paintInvalidationContainer.frame()->view()->rootFrameToContents(point);
        FloatPoint floatPoint = paintInvalidationContainer.absoluteToLocal(point, UseTransforms);
        PaintLayer::mapPointInPaintInvalidationContainerToBacking(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:endlessm,项目名称:chromium-browser,代码行数:42,代码来源:LinkHighlightImpl.cpp


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