code: private String registerClip(Shape clip) {
          if (clip == null) {
              this.clipRef = null;
              return null;
          }
          // generate the path
          String pathStr = getSVGPathData(new Path2D.Double(clip));
          int index = this.clipPaths.indexOf(pathStr);
          if (index < 0) {
              this.clipPaths.add(pathStr);
              index = this.clipPaths.size() - 1;
          }
          return this.defsKeyPrefix + CLIP_KEY_PREFIX + index;
      }
docs: Registers the clip so that we can later write out all the clip
  definitions in the DEFS element.
  
  @param clip  the clip (ignored if {@code null})