本文整理汇总了C++中SVGStyledElement::canvasResource方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGStyledElement::canvasResource方法的具体用法?C++ SVGStyledElement::canvasResource怎么用?C++ SVGStyledElement::canvasResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGStyledElement
的用法示例。
在下文中一共展示了SVGStyledElement::canvasResource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeRenderResources
void writeRenderResources(TextStream& ts, Node* parent)
{
ASSERT(parent);
Node* node = parent;
do {
if (!node->isSVGElement())
continue;
SVGElement* svgElement = static_cast<SVGElement*>(node);
if (!svgElement->isStyled())
continue;
SVGStyledElement* styled = static_cast<SVGStyledElement*>(svgElement);
RefPtr<SVGResource> resource(styled->canvasResource());
if (!resource)
continue;
String elementId = svgElement->getAttribute(svgElement->idAttributeName());
// FIXME: These names are lies!
if (resource->isPaintServer()) {
RefPtr<SVGPaintServer> paintServer = WTF::static_pointer_cast<SVGPaintServer>(resource);
ts << "KRenderingPaintServer {id=\"" << elementId << "\" " << *paintServer << "}" << "\n";
} else
ts << "KCanvasResource {id=\"" << elementId << "\" " << *resource << "}" << "\n";
} while ((node = node->traverseNextNode(parent)));
}
示例2: writeRenderResources
void writeRenderResources(TextStream &ts, Node *parent)
{
ASSERT(parent);
Node *node = parent;
do {
if (!node->isSVGElement())
continue;
SVGElement *svgElement = static_cast<SVGElement *>(node);
if (!svgElement->isStyled())
continue;
SVGStyledElement *styled = static_cast<SVGStyledElement *>(svgElement);
KCanvasResource *resource = styled->canvasResource();
if (!resource)
continue;
DeprecatedString elementId = svgElement->getAttribute(HTMLNames::idAttr).deprecatedString();
if (resource->isPaintServer())
ts << "KRenderingPaintServer {id=\"" << elementId << "\" " << *static_cast<KRenderingPaintServer *>(resource) << "}" << endl;
else
ts << "KCanvasResource {id=\"" << elementId << "\" " << *resource << "}" << endl;
} while ((node = node->traverseNextNode(parent)));
}