code: private void render(SVG.Polygon obj)
     {
        debug("Polygon render");
  
        updateStyleForElement(state, obj);
  
        if (!display())
           return;
        if (!visible())
           return;
        if (!state.hasStroke && !state.hasFill)
           return;
  
        if (obj.transform != null)
           canvas.concat(obj.transform);
  
        int  numPoints = obj.points.length;
        if (numPoints < 2)
           return;
  
        Path  path = makePathAndBoundingBox(obj);
        updateParentBoundingBox(obj);
  
        checkForGradientsAndPatterns(obj);
        checkForClipPath(obj);
        
        boolean  compositing = pushLayer();
  
        if (state.hasFill)
           doFilledPath(obj, path);
        if (state.hasStroke)
           doStroke(path);
  
        renderMarkers(obj);
  
        if (compositing)
           popLayer(obj);
     }
docs: ==============================================================================