void LayoutSVGShape::createPath() { clearPath(); m_path = adoptPtr(new Path); ASSERT(LayoutSVGShape::isShapeEmpty()); updatePathFromGraphicsElement(toSVGGraphicsElement(element()), path()); }
void RenderSVGShape::createShape() { ASSERT(!m_path); m_path = adoptPtr(new Path); ASSERT(isEmpty()); SVGPathElement* element = static_cast<SVGPathElement*>(node()); updatePathFromGraphicsElement(element, path()); processZeroLengthSubpaths(); }
void RenderSVGShape::updateShapeFromElement() { m_path = std::make_unique<Path>(); ASSERT(RenderSVGShape::isEmpty()); updatePathFromGraphicsElement(&graphicsElement(), path()); processMarkerPositions(); m_fillBoundingBox = calculateObjectBoundingBox(); m_strokeBoundingBox = calculateStrokeBoundingBox(); }
void RenderSVGShape::updateShapeFromElement() { m_path.clear(); m_path = adoptPtr(new Path); ASSERT(RenderSVGShape::isEmpty()); updatePathFromGraphicsElement(&graphicsElement(), path()); processMarkerPositions(); m_fillBoundingBox = calculateObjectBoundingBox(); m_strokeBoundingBox = calculateStrokeBoundingBox(); }
void RenderSVGShape::updateShapeFromElement() { m_path.clear(); m_path = adoptPtr(new Path); ASSERT(RenderSVGShape::isEmpty()); SVGStyledTransformableElement* element = toSVGStyledTransformableElement(node()); updatePathFromGraphicsElement(element, path()); processMarkerPositions(); m_fillBoundingBox = calculateObjectBoundingBox(); m_strokeBoundingBox = calculateStrokeBoundingBox(); }
Path RenderSVGTextPath::layoutPath() const { Element* targetElement = SVGURIReference::targetElementFromIRIString(textPathElement().href(), document()); if (!targetElement || !targetElement->hasTagName(SVGNames::pathTag)) return Path(); SVGPathElement* pathElement = toSVGPathElement(targetElement); Path pathData; updatePathFromGraphicsElement(pathElement, pathData); // Spec: The transform attribute on the referenced 'path' element represents a // supplemental transformation relative to the current user coordinate system for // the current 'text' element, including any adjustments to the current user coordinate // system due to a possible transform attribute on the current 'text' element. // http://www.w3.org/TR/SVG/text.html#TextPathElement pathData.transform(pathElement->animatedLocalTransform()); return pathData; }
void SVGAnimateMotionElement::updateAnimationPath() { m_animationPath = Path(); bool foundMPath = false; for (auto& mPath : childrenOfType<SVGMPathElement>(*this)) { SVGPathElement* pathElement = mPath.pathElement(); if (pathElement) { updatePathFromGraphicsElement(pathElement, m_animationPath); foundMPath = true; break; } } if (!foundMPath && fastHasAttribute(SVGNames::pathAttr)) m_animationPath = m_path; updateAnimationMode(); }
Path RenderSVGTextPath::layoutPath() const { SVGTextPathElement* textPathElement = toSVGTextPathElement(node()); Element* targetElement = SVGURIReference::targetElementFromIRIString(textPathElement->href()->currentValue()->value(), textPathElement->treeScope()); if (!isSVGPathElement(targetElement)) return Path(); SVGPathElement& pathElement = toSVGPathElement(*targetElement); Path pathData; updatePathFromGraphicsElement(&pathElement, pathData); // Spec: The transform attribute on the referenced 'path' element represents a // supplemental transformation relative to the current user coordinate system for // the current 'text' element, including any adjustments to the current user coordinate // system due to a possible transform attribute on the current 'text' element. // http://www.w3.org/TR/SVG/text.html#TextPathElement pathData.transform(pathElement.calculateAnimatedLocalTransform()); return pathData; }
void SVGGraphicsElement::toClipPath(Path& path) { updatePathFromGraphicsElement(this, path); // FIXME: How do we know the element has done a layout? path.transform(animatedLocalTransform()); }