您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ toSVGSVGElement函数代码示例

51自学网 2021-06-03 08:53:32
  C++
这篇教程C++ toSVGSVGElement函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中toSVGSVGElement函数的典型用法代码示例。如果您正苦于以下问题:C++ toSVGSVGElement函数的具体用法?C++ toSVGSVGElement怎么用?C++ toSVGSVGElement使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: toSVGSVGElement

bool SVGLengthContext::determineViewport(FloatSize& viewportSize) const{    if (!m_context)        return false;    // If an overriden viewport is given, it has precedence.    if (!m_overridenViewport.isEmpty()) {        viewportSize = m_overridenViewport.size();        return true;    }    // Root <svg> element lengths are resolved against the top level viewport.    if (m_context->isOutermostSVGSVGElement()) {        viewportSize = toSVGSVGElement(m_context)->currentViewportSize();        return true;    }    // Take size from nearest viewport element.    SVGElement* viewportElement = m_context->viewportElement();    if (!isSVGSVGElement(viewportElement))        return false;    const SVGSVGElement& svg = toSVGSVGElement(*viewportElement);    viewportSize = svg.currentViewBoxRect().size();    if (viewportSize.isEmpty())        viewportSize = svg.currentViewportSize();    return true;}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:29,


示例2: toSVGSVGElement

LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight() const{    SVGSVGElement* svg = toSVGSVGElement(node());    ASSERT(svg);    // When we're embedded through SVGImage (border-image/background-image/<html:img>/...) we're forced to resize to a specific size.    if (!m_containerSize.isEmpty())        return m_containerSize.height();    if (style()->logicalHeight().isSpecified() || style()->logicalMaxHeight().isSpecified())        return RenderReplaced::computeReplacedLogicalHeight();    if (svg->heightAttributeEstablishesViewport()) {        Length height = svg->intrinsicHeight(SVGSVGElement::IgnoreCSSProperties);        if (height.isPercent()) {            RenderBlock* cb = containingBlock();            ASSERT(cb);            while (cb->isAnonymous()) {                cb = cb->containingBlock();                cb->addPercentHeightDescendant(const_cast<RenderSVGRoot*>(this));            }        } else            RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot*>(this));        return resolveLengthAttributeForSVG(height, style()->effectiveZoom(), containingBlock()->availableLogicalHeight(IncludeMarginBorderPadding), view());    }    // SVG embedded through object/embed/iframe.    if (isEmbeddedThroughFrameContainingSVGDocument())        return document()->frame()->ownerRenderer()->availableLogicalHeight(IncludeMarginBorderPadding);    // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SVG.    return RenderReplaced::computeReplacedLogicalHeight();}
开发者ID:windyuuy,项目名称:opera,代码行数:34,


示例3: toSVGSVGElement

FloatSize LayoutSVGRoot::calculateIntrinsicSize() const{    SVGSVGElement* svg = toSVGSVGElement(node());    ASSERT(svg);    return FloatSize(floatValueForLength(svg->intrinsicWidth(), 0), floatValueForLength(svg->intrinsicHeight(), 0));}
开发者ID:mtucker6784,项目名称:chromium,代码行数:7,


示例4: toSVGSVGElement

void RenderSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const{    // Spec: http://www.w3.org/TR/SVG/coords.html#IntrinsicSizing    // SVG needs to specify how to calculate some intrinsic sizing properties to enable inclusion within other languages.    // The intrinsic width and height of the viewport of SVG content must be determined from the ‘width’ and ‘height’ attributes.    SVGSVGElement* svg = toSVGSVGElement(node());    ASSERT(svg);    // The intrinsic aspect ratio of the viewport of SVG content is necessary for example, when including SVG from an ‘object’    // element in HTML styled with CSS. It is possible (indeed, common) for an SVG graphic to have an intrinsic aspect ratio but    // not to have an intrinsic width or height. The intrinsic aspect ratio must be calculated based upon the following rules:    // - The aspect ratio is calculated by dividing a width by a height.    // - If the ‘width’ and ‘height’ of the rootmost ‘svg’ element are both specified with unit identifiers (in, mm, cm, pt, pc,    //   px, em, ex) or in user units, then the aspect ratio is calculated from the ‘width’ and ‘height’ attributes after    //   resolving both values to user units.    intrinsicSize.setWidth(floatValueForLength(svg->intrinsicWidth(), 0));    intrinsicSize.setHeight(floatValueForLength(svg->intrinsicHeight(), 0));    if (!intrinsicSize.isEmpty()) {        intrinsicRatio = intrinsicSize.width() / static_cast<double>(intrinsicSize.height());    } else {        // - If either/both of the ‘width’ and ‘height’ of the rootmost ‘svg’ element are in percentage units (or omitted), the        //   aspect ratio is calculated from the width and height values of the ‘viewBox’ specified for the current SVG document        //   fragment. If the ‘viewBox’ is not correctly specified, or set to 'none', the intrinsic aspect ratio cannot be        //   calculated and is considered unspecified.        FloatSize viewBoxSize = svg->viewBox()->currentValue()->value().size();        if (!viewBoxSize.isEmpty()) {            // The viewBox can only yield an intrinsic ratio, not an intrinsic size.            intrinsicRatio = viewBoxSize.width() / static_cast<double>(viewBoxSize.height());        }    }}
开发者ID:smil-in-javascript,项目名称:blink,代码行数:32,


示例5: toSVGSVGElement

void RenderSVGViewportContainer::determineIfLayoutSizeChanged(){    if (!node()->hasTagName(SVGNames::svgTag))        return;    m_isLayoutSizeChanged = toSVGSVGElement(node())->hasRelativeLengths() && selfNeedsLayout();}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:7,


示例6: ASSERT

void LayoutSVGViewportContainer::determineIfLayoutSizeChanged(){    ASSERT(element());    if (!isSVGSVGElement(*element()))        return;    m_isLayoutSizeChanged = toSVGSVGElement(element())->hasRelativeLengths() && selfNeedsLayout();}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:8,


示例7: documentElement

SVGSVGElement* SVGDocument::rootElement() const{    Element* elem = documentElement();    if (elem && elem->hasTagName(SVGNames::svgTag))        return toSVGSVGElement(elem);    return 0;}
开发者ID:3163504123,项目名称:phantomjs,代码行数:8,


示例8: paint

void RenderSVGViewportContainer::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset){    // An empty viewBox disables rendering.    if (node()->hasTagName(SVGNames::svgTag)) {        if (toSVGSVGElement(node())->hasEmptyViewBox())            return;    }    RenderSVGContainer::paint(paintInfo, paintOffset);}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:10,


示例9: parentOrShadowHostNode

SVGSVGElement* SVGElement::ownerSVGElement() const{    ContainerNode* n = parentOrShadowHostNode();    while (n) {        if (isSVGSVGElement(*n))            return toSVGSVGElement(n);        n = n->parentOrShadowHostNode();    }    return nullptr;}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:12,


示例10: parentOrShadowHostNode

SVGSVGElement* SVGElement::ownerSVGElement() const{    ContainerNode* n = parentOrShadowHostNode();    while (n) {        if (n->hasTagName(SVGNames::svgTag))            return toSVGSVGElement(n);        n = n->parentOrShadowHostNode();    }    return 0;}
开发者ID:3163504123,项目名称:phantomjs,代码行数:12,


示例11: ASSERT

void SVGElement::updateRelativeLengthsInformation(bool clientHasRelativeLengths, SVGElement* clientElement){    ASSERT(clientElement);    // If we're not yet in a document, this function will be called again from insertedInto(). Do nothing now.    if (!inDocument())        return;    // An element wants to notify us that its own relative lengths state changed.    // Register it in the relative length map, and register us in the parent relative length map.    // Register the parent in the grandparents map, etc. Repeat procedure until the root of the SVG tree.    for (ContainerNode* currentNode = this; currentNode && currentNode->isSVGElement(); currentNode = currentNode->parentNode()) {        SVGElement* currentElement = toSVGElement(currentNode);        ASSERT(!currentElement->m_inRelativeLengthClientsInvalidation);        bool hadRelativeLengths = currentElement->hasRelativeLengths();        if (clientHasRelativeLengths)            currentElement->m_elementsWithRelativeLengths.add(clientElement);        else            currentElement->m_elementsWithRelativeLengths.remove(clientElement);        // If the relative length state hasn't changed, we can stop propagating the notification.        if (hadRelativeLengths == currentElement->hasRelativeLengths())            return;        clientElement = currentElement;        clientHasRelativeLengths = clientElement->hasRelativeLengths();    }    // Register root SVG elements for top level viewport change notifications.    if (isSVGSVGElement(*clientElement)) {        SVGDocumentExtensions& svgExtensions = accessDocumentSVGExtensions();        if (clientElement->hasRelativeLengths())            svgExtensions.addSVGRootWithRelativeLengthDescendents(toSVGSVGElement(clientElement));        else            svgExtensions.removeSVGRootWithRelativeLengthDescendents(toSVGSVGElement(clientElement));    }}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:38,


示例12: ASSERT

void RenderSVGRoot::layout(){    StackStats::LayoutCheckPoint layoutCheckPoint;    ASSERT(needsLayout());    m_resourcesNeedingToInvalidateClients.clear();    // Arbitrary affine transforms are incompatible with LayoutState.    LayoutStateDisabler layoutStateDisabler(view());    bool needsLayout = selfNeedsLayout();    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout);    LayoutSize oldSize = size();    updateLogicalWidth();    updateLogicalHeight();    buildLocalToBorderBoxTransform();    SVGSVGElement* svg = toSVGSVGElement(node());    ASSERT(svg);    m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size());    SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this));    if (!m_resourcesNeedingToInvalidateClients.isEmpty()) {        // Invalidate resource clients, which may mark some nodes for layout.        HashSet<RenderSVGResourceContainer*>::iterator end = m_resourcesNeedingToInvalidateClients.end();        for (HashSet<RenderSVGResourceContainer*>::iterator it = m_resourcesNeedingToInvalidateClients.begin(); it != end; ++it)            (*it)->removeAllClientsFromCache();        m_isLayoutSizeChanged = false;        SVGRenderSupport::layoutChildren(this, false);    }    // At this point LayoutRepainter already grabbed the old bounds,    // recalculate them now so repaintAfterLayout() uses the new bounds.    if (m_needsBoundariesOrTransformUpdate) {        updateCachedBoundaries();        m_needsBoundariesOrTransformUpdate = false;    }    updateLayerTransform();    repainter.repaintAfterLayout();    setNeedsLayout(false);}
开发者ID:windyuuy,项目名称:opera,代码行数:46,


示例13: ASSERT

void RenderSVGRoot::layout(){    ASSERT(needsLayout());    // Arbitrary affine transforms are incompatible with LayoutState.    LayoutStateDisabler layoutStateDisabler(*this);    bool needsLayout = selfNeedsLayout();    LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && needsLayout);    LayoutSize oldSize = size();    updateLogicalWidth();    updateLogicalHeight();    buildLocalToBorderBoxTransform();    SVGRenderSupport::layoutResourcesIfNeeded(this);    SVGSVGElement* svg = toSVGSVGElement(node());    ASSERT(svg);    m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size());    SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this));    // At this point LayoutRepainter already grabbed the old bounds,    // recalculate them now so repaintAfterLayout() uses the new bounds.    if (m_needsBoundariesOrTransformUpdate) {        updateCachedBoundaries();        m_needsBoundariesOrTransformUpdate = false;    }    m_overflow.clear();    addVisualEffectOverflow();    if (!shouldApplyViewportClip()) {        FloatRect contentRepaintRect = repaintRectInLocalCoordinates();        contentRepaintRect = m_localToBorderBoxTransform.mapRect(contentRepaintRect);        addVisualOverflow(enclosingLayoutRect(contentRepaintRect));    }    updateLayerTransform();    m_hasBoxDecorations = isDocumentElement() ? calculateHasBoxDecorations() : hasBoxDecorations();    invalidateBackgroundObscurationStatus();    repainter.repaintAfterLayout();    clearNeedsLayout();}
开发者ID:coinpayee,项目名称:blink,代码行数:45,


示例14: toSVGSVGElement

void SVGRootPainter::paintReplaced(const PaintInfo& paintInfo,                                   const LayoutPoint& paintOffset) {  // An empty viewport disables rendering.  if (pixelSnappedSize(paintOffset).isEmpty())    return;  // SVG outlines are painted during PaintPhaseForeground.  if (shouldPaintSelfOutline(paintInfo.phase))    return;  // An empty viewBox also disables rendering.  // (http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute)  SVGSVGElement* svg = toSVGSVGElement(m_layoutSVGRoot.node());  DCHECK(svg);  if (svg->hasEmptyViewBox())    return;  // Apply initial viewport clip.  Optional<BoxClipper> boxClipper;  if (m_layoutSVGRoot.shouldApplyViewportClip()) {    // TODO(pdr): Clip the paint info cull rect here.    boxClipper.emplace(m_layoutSVGRoot, paintInfo, paintOffset,                       ForceContentsClip);  }  PaintInfo paintInfoBeforeFiltering(paintInfo);  AffineTransform transformToBorderBox =      transformToPixelSnappedBorderBox(paintOffset);  paintInfoBeforeFiltering.updateCullRect(transformToBorderBox);  SVGTransformContext transformContext(paintInfoBeforeFiltering.context,                                       m_layoutSVGRoot, transformToBorderBox);  SVGPaintContext paintContext(m_layoutSVGRoot, paintInfoBeforeFiltering);  if (paintContext.paintInfo().phase == PaintPhaseForeground &&      !paintContext.applyClipMaskAndFilterIfNecessary())    return;  BoxPainter(m_layoutSVGRoot).paint(paintContext.paintInfo(), LayoutPoint());  PaintTiming& timing =      PaintTiming::from(m_layoutSVGRoot.node()->document().topDocument());  timing.markFirstContentfulPaint();}
开发者ID:mirror,项目名称:chromium,代码行数:43,


示例15: ASSERT

void RenderSVGRoot::layout(){    ASSERT(needsLayout());    // Arbitrary affine transforms are incompatible with LayoutState.    ForceHorriblySlowRectMapping slowRectMapping(*this);    bool needsLayout = selfNeedsLayout();    LayoutSize oldSize = size();    updateLogicalWidth();    updateLogicalHeight();    buildLocalToBorderBoxTransform();    SVGRenderSupport::layoutResourcesIfNeeded(this);    SVGSVGElement* svg = toSVGSVGElement(node());    ASSERT(svg);    m_isLayoutSizeChanged = needsLayout || (svg->hasRelativeLengths() && oldSize != size());    SVGRenderSupport::layoutChildren(this, needsLayout || SVGRenderSupport::filtersForceContainerLayout(this));    if (m_needsBoundariesOrTransformUpdate) {        updateCachedBoundaries();        m_needsBoundariesOrTransformUpdate = false;    }    m_overflow.clear();    addVisualEffectOverflow();    if (!shouldApplyViewportClip()) {        FloatRect contentRepaintRect = paintInvalidationRectInLocalCoordinates();        contentRepaintRect = m_localToBorderBoxTransform.mapRect(contentRepaintRect);        addVisualOverflow(enclosingLayoutRect(contentRepaintRect));    }    updateLayerTransformAfterLayout();    m_hasBoxDecorationBackground = isDocumentElement() ? calculateHasBoxDecorations() : hasBoxDecorationBackground();    invalidateBackgroundObscurationStatus();    clearNeedsLayout();}
开发者ID:smil-in-javascript,项目名称:blink,代码行数:41,


示例16: calculateIntrinsicSize

void LayoutSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const{    // https://www.w3.org/TR/SVG/coords.html#IntrinsicSizing    intrinsicSize = calculateIntrinsicSize();    if (!isHorizontalWritingMode())        intrinsicSize = intrinsicSize.transposedSize();    if (!intrinsicSize.isEmpty()) {        intrinsicRatio = intrinsicSize.width() / static_cast<double>(intrinsicSize.height());    } else {        SVGSVGElement* svg = toSVGSVGElement(node());        ASSERT(svg);        FloatSize viewBoxSize = svg->viewBox()->currentValue()->value().size();        if (!viewBoxSize.isEmpty()) {            // The viewBox can only yield an intrinsic ratio, not an intrinsic size.            intrinsicRatio = viewBoxSize.width() / static_cast<double>(viewBoxSize.height());            if (!isHorizontalWritingMode())                intrinsicRatio = 1 / intrinsicRatio;        }    }}
开发者ID:mtucker6784,项目名称:chromium,代码行数:23,


示例17: toSVGSVGElement

bool SVGDocument::childShouldCreateRenderer(const NodeRenderingContext& childContext) const{    if (childContext.node()->hasTagName(SVGNames::svgTag))        return toSVGSVGElement(childContext.node())->isValid();    return true;}
开发者ID:3163504123,项目名称:phantomjs,代码行数:6,



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


C++ toShadowRoot函数代码示例
C++ toSVGElement函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。