本文整理汇总了C++中SVGResources::markerEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGResources::markerEnd方法的具体用法?C++ SVGResources::markerEnd怎么用?C++ SVGResources::markerEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGResources
的用法示例。
在下文中一共展示了SVGResources::markerEnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateMarkerBoundsIfNeeded
FloatRect RenderSVGPath::calculateMarkerBoundsIfNeeded()
{
SVGElement* svgElement = static_cast<SVGElement*>(node());
ASSERT(svgElement && svgElement->document());
if (!svgElement->isStyled())
return FloatRect();
SVGStyledElement* styledElement = static_cast<SVGStyledElement*>(svgElement);
if (!styledElement->supportsMarkers())
return FloatRect();
const SVGRenderStyle* svgStyle = style()->svgStyle();
ASSERT(svgStyle->hasMarkers());
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this);
if (!resources)
return FloatRect();
RenderSVGResourceMarker* markerStart = resources->markerStart();
RenderSVGResourceMarker* markerMid = resources->markerMid();
RenderSVGResourceMarker* markerEnd = resources->markerEnd();
if (!markerStart && !markerMid && !markerEnd)
return FloatRect();
return m_markerLayoutInfo.calculateBoundaries(markerStart, markerMid, markerEnd, svgStyle->strokeWidth().value(svgElement), m_path);
}
示例2: paintMarkers
void SVGShapePainter::paintMarkers(const PaintInfo& paintInfo, const FloatRect& boundingBox)
{
const Vector<MarkerPosition>* markerPositions = m_layoutSVGShape.markerPositions();
if (!markerPositions || markerPositions->isEmpty())
return;
SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(&m_layoutSVGShape);
if (!resources)
return;
LayoutSVGResourceMarker* markerStart = resources->markerStart();
LayoutSVGResourceMarker* markerMid = resources->markerMid();
LayoutSVGResourceMarker* markerEnd = resources->markerEnd();
if (!markerStart && !markerMid && !markerEnd)
return;
float strokeWidth = m_layoutSVGShape.strokeWidth();
unsigned size = markerPositions->size();
for (unsigned i = 0; i < size; ++i) {
if (LayoutSVGResourceMarker* marker = SVGMarkerData::markerForType((*markerPositions)[i].type, markerStart, markerMid, markerEnd)) {
SkPictureBuilder pictureBuilder(boundingBox, nullptr, &paintInfo.context);
PaintInfo markerPaintInfo(pictureBuilder.context(), paintInfo);
// It's expensive to track the transformed paint cull rect for each
// marker so just disable culling. The shape paint call will already
// be culled if it is outside the paint info cull rect.
markerPaintInfo.m_cullRect.m_rect = LayoutRect::infiniteIntRect();
paintMarker(markerPaintInfo, *marker, (*markerPositions)[i], strokeWidth);
pictureBuilder.endRecording()->playback(paintInfo.context.canvas());
}
}
}
示例3: paintMarkers
void SVGShapePainter::paintMarkers(const PaintInfo& paintInfo)
{
const Vector<MarkerPosition>* markerPositions = m_renderSVGShape.markerPositions();
if (!markerPositions || markerPositions->isEmpty())
return;
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(&m_renderSVGShape);
if (!resources)
return;
RenderSVGResourceMarker* markerStart = resources->markerStart();
RenderSVGResourceMarker* markerMid = resources->markerMid();
RenderSVGResourceMarker* markerEnd = resources->markerEnd();
if (!markerStart && !markerMid && !markerEnd)
return;
float strokeWidth = m_renderSVGShape.strokeWidth();
unsigned size = markerPositions->size();
for (unsigned i = 0; i < size; ++i) {
if (RenderSVGResourceMarker* marker = SVGMarkerData::markerForType((*markerPositions)[i].type, markerStart, markerMid, markerEnd))
paintMarker(paintInfo, *marker, (*markerPositions)[i], strokeWidth);
}
}