本文整理汇总了C++中SVGPaint::uri方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGPaint::uri方法的具体用法?C++ SVGPaint::uri怎么用?C++ SVGPaint::uri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGPaint
的用法示例。
在下文中一共展示了SVGPaint::uri方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strokePaintServer
SVGPaintServer* KSVGPainterFactory::strokePaintServer(const RenderStyle* style, const RenderObject* item)
{
if (!style->svgStyle()->hasStroke())
return 0;
SVGPaint* stroke = style->svgStyle()->strokePaint();
SVGPaintServer* strokePaintServer = 0;
if (stroke->paintType() == SVGPaint::SVG_PAINTTYPE_URI) {
AtomicString id(SVGURIReference::getTarget(stroke->uri()));
strokePaintServer = getPaintServerById(item->document(), id);
SVGElement* svgElement = static_cast<SVGElement*>(item->element());
ASSERT(svgElement && svgElement->document() && svgElement->isStyled());
if (item->isRenderPath() && strokePaintServer)
strokePaintServer->addClient(static_cast<SVGStyledElement*>(svgElement));
else if (!strokePaintServer)
svgElement->document()->accessSVGExtensions()->addPendingResource(id, static_cast<SVGStyledElement*>(svgElement));
} else {
strokePaintServer = sharedSolidPaintServer();
SVGPaintServerSolid* strokePaintServerSolid = static_cast<SVGPaintServerSolid*>(strokePaintServer);
if (stroke->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR)
strokePaintServerSolid->setColor(style->color());
else
strokePaintServerSolid->setColor(stroke->color());
// FIXME: Ideally invalid colors would never get set on the RenderStyle and this could turn into an ASSERT
if (!strokePaintServerSolid->color().isValid())
strokePaintServer = 0;
}
return strokePaintServer;
}
示例2: strokePaintingResource
RenderSVGResource* RenderSVGResource::strokePaintingResource(const RenderObject* object, const RenderStyle* style)
{
ASSERT(object);
ASSERT(style);
const SVGRenderStyle* svgStyle = style->svgStyle();
if (!svgStyle || !svgStyle->hasStroke())
return 0;
SVGPaint* strokePaint = svgStyle->strokePaint();
ASSERT(strokePaint);
RenderSVGResource* strokePaintingResource = 0;
FloatRect objectBoundingBox = object->objectBoundingBox();
SVGPaint::SVGPaintType paintType = strokePaint->paintType();
if (!objectBoundingBox.isEmpty()
&& (paintType == SVGPaint::SVG_PAINTTYPE_URI || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR)) {
AtomicString id(SVGURIReference::getTarget(strokePaint->uri()));
strokePaintingResource = getRenderSVGResourceContainerById(object->document(), id);
if (!strokePaintingResource)
registerPendingResource(id, paintType, object);
}
if (paintType != SVGPaint::SVG_PAINTTYPE_URI && !strokePaintingResource) {
RenderSVGResourceSolidColor* solidResource = sharedSolidPaintingResource();
strokePaintingResource = solidResource;
Color strokeColor;
if (strokePaint->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR)
strokeColor = style->visitedDependentColor(CSSPropertyColor);
else
strokeColor = strokePaint->color();
adjustColorForPseudoRules(style, false /* useFillPaint */, strokeColor);
// FIXME: Ideally invalid colors would never get set on the RenderStyle and this could turn into an ASSERT
if (strokeColor.isValid())
solidResource->setColor(strokeColor);
else
strokePaintingResource = 0;
}
if (!strokePaintingResource) {
// default value (black), see bug 11017
RenderSVGResourceSolidColor* solidResource = sharedSolidPaintingResource();
solidResource->setColor(Color::black);
strokePaintingResource = solidResource;
}
return strokePaintingResource;
}
示例3: fillPaintServer
SVGPaintServer* SVGPaintServer::fillPaintServer(const RenderStyle* style, const RenderObject* item)
{
if (!style->svgStyle()->hasFill())
return 0;
SVGPaint* fill = style->svgStyle()->fillPaint();
SVGPaintServer* fillPaintServer = 0;
SVGPaint::SVGPaintType paintType = fill->paintType();
if (paintType == SVGPaint::SVG_PAINTTYPE_URI ||
paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR) {
AtomicString id(SVGURIReference::getTarget(fill->uri()));
fillPaintServer = getPaintServerById(item->document(), id);
SVGElement* svgElement = static_cast<SVGElement*>(item->node());
ASSERT(svgElement && svgElement->document() && svgElement->isStyled());
if (item->isRenderPath() && fillPaintServer)
fillPaintServer->addClient(static_cast<SVGStyledElement*>(svgElement));
else if (!fillPaintServer && paintType == SVGPaint::SVG_PAINTTYPE_URI)
svgElement->document()->accessSVGExtensions()->addPendingResource(id, static_cast<SVGStyledElement*>(svgElement));
}
if (paintType != SVGPaint::SVG_PAINTTYPE_URI && !fillPaintServer) {
fillPaintServer = sharedSolidPaintServer();
SVGPaintServerSolid* fillPaintServerSolid = static_cast<SVGPaintServerSolid*>(fillPaintServer);
if (paintType == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR)
fillPaintServerSolid->setColor(style->color());
else
fillPaintServerSolid->setColor(fill->color());
// FIXME: Ideally invalid colors would never get set on the RenderStyle and this could turn into an ASSERT
if (!fillPaintServerSolid->color().isValid())
fillPaintServer = 0;
}
if (!fillPaintServer) {
// default value (black), see bug 11017
fillPaintServer = sharedSolidPaintServer();
static_cast<SVGPaintServerSolid*>(fillPaintServer)->setColor(Color::black);
}
return fillPaintServer;
}
示例4: applySVGProperty
//.........这里部分代码省略.........
HANDLE_INHERIT_AND_INITIAL(fillRule, FillRule)
if (primitiveValue)
svgstyle->setFillRule(*primitiveValue);
break;
}
case CSSPropertyStrokeLinejoin:
{
HANDLE_INHERIT_AND_INITIAL(joinStyle, JoinStyle)
if (primitiveValue)
svgstyle->setJoinStyle(*primitiveValue);
break;
}
case CSSPropertyShapeRendering:
{
HANDLE_INHERIT_AND_INITIAL(shapeRendering, ShapeRendering)
if (primitiveValue)
svgstyle->setShapeRendering(*primitiveValue);
break;
}
// end of ident only properties
case CSSPropertyFill:
{
if (isInherit) {
const SVGRenderStyle* svgParentStyle = state.parentStyle()->svgStyle();
svgstyle->setFillPaint(svgParentStyle->fillPaintType(), svgParentStyle->fillPaintColor(), svgParentStyle->fillPaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
return;
}
if (isInitial) {
svgstyle->setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRenderStyle::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
return;
}
if (value->isSVGPaint()) {
SVGPaint* svgPaint = static_cast<SVGPaint*>(value);
svgstyle->setFillPaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, state.style()->color()), svgPaint->uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
}
break;
}
case CSSPropertyStroke:
{
if (isInherit) {
const SVGRenderStyle* svgParentStyle = state.parentStyle()->svgStyle();
svgstyle->setStrokePaint(svgParentStyle->strokePaintType(), svgParentStyle->strokePaintColor(), svgParentStyle->strokePaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
return;
}
if (isInitial) {
svgstyle->setStrokePaint(SVGRenderStyle::initialStrokePaintType(), SVGRenderStyle::initialStrokePaintColor(), SVGRenderStyle::initialStrokePaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
return;
}
if (value->isSVGPaint()) {
SVGPaint* svgPaint = static_cast<SVGPaint*>(value);
svgstyle->setStrokePaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, state.style()->color()), svgPaint->uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
}
break;
}
case CSSPropertyStrokeWidth:
{
HANDLE_INHERIT_AND_INITIAL(strokeWidth, StrokeWidth)
if (primitiveValue)
svgstyle->setStrokeWidth(SVGLength::fromCSSPrimitiveValue(primitiveValue));
break;
}
case CSSPropertyStrokeDasharray:
{
HANDLE_INHERIT_AND_INITIAL(strokeDashArray, StrokeDashArray)
if (!value->isValueList()) {
svgstyle->setStrokeDashArray(SVGRenderStyle::initialStrokeDashArray());
示例5: uriAttrGetter
static v8::Handle<v8::Value> uriAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.SVGPaint.uri._get");
SVGPaint* imp = V8SVGPaint::toNative(info.Holder());
return v8String(imp->uri());
}