public void drawRenderedImage(RenderedImage image, AffineTransform xform) {
    if (comp == null || comp instanceof AlphaComposite) super.drawRenderedImage(image, xform);
    else {
      createBuffer();

      Graphics2D g2d = (Graphics2D) buffer.getGraphics();
      g2d.setRenderingHints(this.getRenderingHints());
      g2d.drawRenderedImage(image, xform);

      drawComposite(buffer.getRaster().getBounds(), null);
    }
  }