Lines Matching refs:from

2071 static void _cloneNode(SvgNode* from, SvgNode* parent, int depth);
2404 static void _inheritRadialCxAttr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritRadialCxAttr() argument
2406 to->radial->cx = from->radial->cx; in _inheritRadialCxAttr()
2407 to->radial->isCxPercentage = from->radial->isCxPercentage; in _inheritRadialCxAttr()
2412 static void _inheritRadialCyAttr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritRadialCyAttr() argument
2414 to->radial->cy = from->radial->cy; in _inheritRadialCyAttr()
2415 to->radial->isCyPercentage = from->radial->isCyPercentage; in _inheritRadialCyAttr()
2420 static void _inheritRadialFxAttr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritRadialFxAttr() argument
2422 to->radial->fx = from->radial->fx; in _inheritRadialFxAttr()
2423 to->radial->isFxPercentage = from->radial->isFxPercentage; in _inheritRadialFxAttr()
2428 static void _inheritRadialFyAttr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritRadialFyAttr() argument
2430 to->radial->fy = from->radial->fy; in _inheritRadialFyAttr()
2431 to->radial->isFyPercentage = from->radial->isFyPercentage; in _inheritRadialFyAttr()
2436 static void _inheritRadialFrAttr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritRadialFrAttr() argument
2438 to->radial->fr = from->radial->fr; in _inheritRadialFrAttr()
2439 to->radial->isFrPercentage = from->radial->isFrPercentage; in _inheritRadialFrAttr()
2444 static void _inheritRadialRAttr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritRadialRAttr() argument
2446 to->radial->r = from->radial->r; in _inheritRadialRAttr()
2447 to->radial->isRPercentage = from->radial->isRPercentage; in _inheritRadialRAttr()
2453 typedef void (*radialInheritMethod)(SvgStyleGradient* to, SvgStyleGradient* from);
2690 static void _inheritLinearX1Attr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritLinearX1Attr() argument
2692 to->linear->x1 = from->linear->x1; in _inheritLinearX1Attr()
2693 to->linear->isX1Percentage = from->linear->isX1Percentage; in _inheritLinearX1Attr()
2698 static void _inheritLinearX2Attr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritLinearX2Attr() argument
2700 to->linear->x2 = from->linear->x2; in _inheritLinearX2Attr()
2701 to->linear->isX2Percentage = from->linear->isX2Percentage; in _inheritLinearX2Attr()
2706 static void _inheritLinearY1Attr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritLinearY1Attr() argument
2708 to->linear->y1 = from->linear->y1; in _inheritLinearY1Attr()
2709 to->linear->isY1Percentage = from->linear->isY1Percentage; in _inheritLinearY1Attr()
2714 static void _inheritLinearY2Attr(SvgStyleGradient* to, SvgStyleGradient* from) in _inheritLinearY2Attr() argument
2716 to->linear->y2 = from->linear->y2; in _inheritLinearY2Attr()
2717 to->linear->isY2Percentage = from->linear->isY2Percentage; in _inheritLinearY2Attr()
2723 typedef void (*Linear_Inherit_Method)(SvgStyleGradient* to, SvgStyleGradient* from);
2860 static void _inheritGradient(SvgLoaderData* loader, SvgStyleGradient* to, SvgStyleGradient* from) in _inheritGradient() argument
2862 if (!to || !from) return; in _inheritGradient()
2864 …if (!(to->flags & SvgGradientFlags::SpreadMethod) && (from->flags & SvgGradientFlags::SpreadMethod… in _inheritGradient()
2865 to->spread = from->spread; in _inheritGradient()
2869 …if (!(to->flags & SvgGradientFlags::GradientUnits) && (from->flags & SvgGradientFlags::GradientUni… in _inheritGradient()
2870 to->userSpace = from->userSpace; in _inheritGradient()
2874 if (!to->transform && from->transform) { in _inheritGradient()
2876 if (to->transform) memcpy(to->transform, from->transform, sizeof(Matrix)); in _inheritGradient()
2882 if (!(to->flags & linear_tags[i].flag) && (from->flags & linear_tags[i].flag)) { in _inheritGradient()
2883 linear_tags[i].tagInheritHandler(to, from); in _inheritGradient()
2891 if (to->userSpace == from->userSpace) continue; in _inheritGradient()
2899 if (!(to->flags & radialTags[i].flag) && (from->flags & radialTags[i].flag)) { in _inheritGradient()
2900 radialTags[i].tagInheritHandler(to, from); in _inheritGradient()
2911 if (to->userSpace == from->userSpace) continue; in _inheritGradient()
2921 if (to->stops.empty()) _cloneGradStops(to->stops, from->stops); in _inheritGradient()
2925 static SvgStyleGradient* _cloneGradient(SvgStyleGradient* from) in _cloneGradient() argument
2927 if (!from) return nullptr; in _cloneGradient()
2932 grad->type = from->type; in _cloneGradient()
2933 grad->id = from->id ? _copyId(from->id) : nullptr; in _cloneGradient()
2934 grad->ref = from->ref ? _copyId(from->ref) : nullptr; in _cloneGradient()
2935 grad->spread = from->spread; in _cloneGradient()
2936 grad->userSpace = from->userSpace; in _cloneGradient()
2937 grad->flags = from->flags; in _cloneGradient()
2939 if (from->transform) { in _cloneGradient()
2941 if (grad->transform) memcpy(grad->transform, from->transform, sizeof(Matrix)); in _cloneGradient()
2947 memcpy(grad->linear, from->linear, sizeof(SvgLinearGradient)); in _cloneGradient()
2951 memcpy(grad->radial, from->radial, sizeof(SvgRadialGradient)); in _cloneGradient()
2954 _cloneGradStops(grad->stops, from->stops); in _cloneGradient()
3034 static void _styleCopy(SvgStyleProperty* to, const SvgStyleProperty* from) in _styleCopy() argument
3036 if (from == nullptr) return; in _styleCopy()
3038 if (from->curColorSet) { in _styleCopy()
3039 to->color = from->color; in _styleCopy()
3042 if (from->flags & SvgStyleFlags::Opacity) { in _styleCopy()
3043 to->opacity = from->opacity; in _styleCopy()
3045 if (from->flags & SvgStyleFlags::PaintOrder) { in _styleCopy()
3046 to->paintOrder = from->paintOrder; in _styleCopy()
3048 if (from->flags & SvgStyleFlags::Display) { in _styleCopy()
3049 to->display = from->display; in _styleCopy()
3052 to->fill.flags = (to->fill.flags | from->fill.flags); in _styleCopy()
3053 if (from->fill.flags & SvgFillFlags::Paint) { in _styleCopy()
3054 to->fill.paint.color = from->fill.paint.color; in _styleCopy()
3055 to->fill.paint.none = from->fill.paint.none; in _styleCopy()
3056 to->fill.paint.curColor = from->fill.paint.curColor; in _styleCopy()
3057 if (from->fill.paint.url) { in _styleCopy()
3059 to->fill.paint.url = _copyId(from->fill.paint.url); in _styleCopy()
3062 if (from->fill.flags & SvgFillFlags::Opacity) { in _styleCopy()
3063 to->fill.opacity = from->fill.opacity; in _styleCopy()
3065 if (from->fill.flags & SvgFillFlags::FillRule) { in _styleCopy()
3066 to->fill.fillRule = from->fill.fillRule; in _styleCopy()
3069 to->stroke.flags = (to->stroke.flags | from->stroke.flags); in _styleCopy()
3070 if (from->stroke.flags & SvgStrokeFlags::Paint) { in _styleCopy()
3071 to->stroke.paint.color = from->stroke.paint.color; in _styleCopy()
3072 to->stroke.paint.none = from->stroke.paint.none; in _styleCopy()
3073 to->stroke.paint.curColor = from->stroke.paint.curColor; in _styleCopy()
3074 if (from->stroke.paint.url) { in _styleCopy()
3076 to->stroke.paint.url = _copyId(from->stroke.paint.url); in _styleCopy()
3079 if (from->stroke.flags & SvgStrokeFlags::Opacity) { in _styleCopy()
3080 to->stroke.opacity = from->stroke.opacity; in _styleCopy()
3082 if (from->stroke.flags & SvgStrokeFlags::Width) { in _styleCopy()
3083 to->stroke.width = from->stroke.width; in _styleCopy()
3085 if (from->stroke.flags & SvgStrokeFlags::Dash) { in _styleCopy()
3086 if (from->stroke.dash.array.count > 0) { in _styleCopy()
3088 to->stroke.dash.array.reserve(from->stroke.dash.array.count); in _styleCopy()
3089 for (uint32_t i = 0; i < from->stroke.dash.array.count; ++i) { in _styleCopy()
3090 to->stroke.dash.array.push(from->stroke.dash.array[i]); in _styleCopy()
3094 if (from->stroke.flags & SvgStrokeFlags::DashOffset) { in _styleCopy()
3095 to->stroke.dash.offset = from->stroke.dash.offset; in _styleCopy()
3097 if (from->stroke.flags & SvgStrokeFlags::Cap) { in _styleCopy()
3098 to->stroke.cap = from->stroke.cap; in _styleCopy()
3100 if (from->stroke.flags & SvgStrokeFlags::Join) { in _styleCopy()
3101 to->stroke.join = from->stroke.join; in _styleCopy()
3103 if (from->stroke.flags & SvgStrokeFlags::Miterlimit) { in _styleCopy()
3104 to->stroke.miterlimit = from->stroke.miterlimit; in _styleCopy()
3109 static void _copyAttr(SvgNode* to, const SvgNode* from) in _copyAttr() argument
3112 if (from->transform) { in _copyAttr()
3114 if (to->transform) *to->transform = *from->transform; in _copyAttr()
3117 _styleCopy(to->style, from->style); in _copyAttr()
3118 to->style->flags = (to->style->flags | from->style->flags); in _copyAttr()
3119 if (from->style->clipPath.url) { in _copyAttr()
3121 to->style->clipPath.url = strdup(from->style->clipPath.url); in _copyAttr()
3123 if (from->style->mask.url) { in _copyAttr()
3125 to->style->mask.url = strdup(from->style->mask.url); in _copyAttr()
3129 switch (from->type) { in _copyAttr()
3131 to->node.circle.cx = from->node.circle.cx; in _copyAttr()
3132 to->node.circle.cy = from->node.circle.cy; in _copyAttr()
3133 to->node.circle.r = from->node.circle.r; in _copyAttr()
3137 to->node.ellipse.cx = from->node.ellipse.cx; in _copyAttr()
3138 to->node.ellipse.cy = from->node.ellipse.cy; in _copyAttr()
3139 to->node.ellipse.rx = from->node.ellipse.rx; in _copyAttr()
3140 to->node.ellipse.ry = from->node.ellipse.ry; in _copyAttr()
3144 to->node.rect.x = from->node.rect.x; in _copyAttr()
3145 to->node.rect.y = from->node.rect.y; in _copyAttr()
3146 to->node.rect.w = from->node.rect.w; in _copyAttr()
3147 to->node.rect.h = from->node.rect.h; in _copyAttr()
3148 to->node.rect.rx = from->node.rect.rx; in _copyAttr()
3149 to->node.rect.ry = from->node.rect.ry; in _copyAttr()
3150 to->node.rect.hasRx = from->node.rect.hasRx; in _copyAttr()
3151 to->node.rect.hasRy = from->node.rect.hasRy; in _copyAttr()
3155 to->node.line.x1 = from->node.line.x1; in _copyAttr()
3156 to->node.line.y1 = from->node.line.y1; in _copyAttr()
3157 to->node.line.x2 = from->node.line.x2; in _copyAttr()
3158 to->node.line.y2 = from->node.line.y2; in _copyAttr()
3162 if (from->node.path.path) { in _copyAttr()
3164 to->node.path.path = strdup(from->node.path.path); in _copyAttr()
3169 if ((to->node.polygon.pts.count = from->node.polygon.pts.count)) { in _copyAttr()
3170 to->node.polygon.pts = from->node.polygon.pts; in _copyAttr()
3175 if ((to->node.polyline.pts.count = from->node.polyline.pts.count)) { in _copyAttr()
3176 to->node.polyline.pts = from->node.polyline.pts; in _copyAttr()
3181 to->node.image.x = from->node.image.x; in _copyAttr()
3182 to->node.image.y = from->node.image.y; in _copyAttr()
3183 to->node.image.w = from->node.image.w; in _copyAttr()
3184 to->node.image.h = from->node.image.h; in _copyAttr()
3185 if (from->node.image.href) { in _copyAttr()
3187 to->node.image.href = strdup(from->node.image.href); in _copyAttr()
3192 to->node.use.x = from->node.use.x; in _copyAttr()
3193 to->node.use.y = from->node.use.y; in _copyAttr()
3194 to->node.use.w = from->node.use.w; in _copyAttr()
3195 to->node.use.h = from->node.use.h; in _copyAttr()
3196 to->node.use.isWidthSet = from->node.use.isWidthSet; in _copyAttr()
3197 to->node.use.isHeightSet = from->node.use.isHeightSet; in _copyAttr()
3198 to->node.use.symbol = from->node.use.symbol; in _copyAttr()
3202 to->node.text.x = from->node.text.x; in _copyAttr()
3203 to->node.text.y = from->node.text.y; in _copyAttr()
3204 to->node.text.fontSize = from->node.text.fontSize; in _copyAttr()
3205 if (from->node.text.text) { in _copyAttr()
3207 to->node.text.text = strdup(from->node.text.text); in _copyAttr()
3209 if (from->node.text.fontFamily) { in _copyAttr()
3211 to->node.text.fontFamily = strdup(from->node.text.fontFamily); in _copyAttr()
3222 static void _cloneNode(SvgNode* from, SvgNode* parent, int depth) in _cloneNode() argument
3232 if (!from || !parent || from == parent) return; in _cloneNode()
3234 newNode = _createNode(parent, from->type); in _cloneNode()
3238 _copyAttr(newNode, from); in _cloneNode()
3240 auto child = from->child.data; in _cloneNode()
3241 for (uint32_t i = 0; i < from->child.count; ++i, ++child) { in _cloneNode()