Shape outline = at.createTransformedShape(path);
// apply the 'clip-path' of the current clipPath's child
ShapeNode outlineNode = new ShapeNode();
outlineNode.setShape(outline);
ClipRable clip = CSSUtilities.convertClipPath(child,
outlineNode,
ctx);
if (clip != null) {
Area area = new Area(outline);
area.subtract(new Area(clip.getClipPath()));
outline = area;
}
clipPath.add(new Area(outline));
}
if (!hasChildren) {
return null; // empty clipPath
}
// construct the shape node that represents the clipPath
ShapeNode clipPathNode = new ShapeNode();
clipPathNode.setShape(clipPath);
// apply the 'clip-path' of the clipPath element (already in user space)
ClipRable clipElementClipPath =
CSSUtilities.convertClipPath(clipElement, clipPathNode, ctx);
if (clipElementClipPath != null) {
clipPath.subtract(new Area(clipElementClipPath.getClipPath()));
}
Filter filter = clipedNode.getFilter();
if (filter == null) {
// Make the initial source as a RenderableImage