isOptimized = clip instanceof Rectangle
boolean optimizedClip = (clip == null || clip instanceof Rectangle); isOptimized = optimizedClip
  private void updateOptimization()  {    int transformType = transform.getType();    boolean optimizedTransform =      (transformType &      (AffineTransform.TYPE_TRANSLATION | AffineTransform.TYPE_IDENTITY)) != 0;    isOptimized = clip instanceof Rectangle                  && optimizedTransform && paint instanceof Color                  && composite == AlphaComposite.SrcOver                  && stroke.equals(new BasicStroke());  }