Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4419581

Optimize Graphics2D.drawRenderedImage for integer translations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • 2d
    • beta
    • generic
    • solaris_7

        The current implementation of the Graphics2D.drawRenderedImage method cobbles
      (copies) all of the source data needed in order to draw the image into a
      new BufferedImage, which is then drawn using the given AffineTransformation
      (modulo a translation to deal with any change in the image origin). This
      results in an extra buffer the size of the clipping region being used.
      For screen updates, the clipping region will typically have a reasonable
      size, but for a printing or offscreen drawing application this memory
      consumption could be problematic. Avoiding the copy should also be faster.
       
        If the desired AffineTransform consists only of an integer translation,
      a more memory-efficient approach would be to draw each tile that intersects
      the clipping region with the appropriate translation, without doing any
      copying.

        In sun.java2d.SunGraphics2D.java, there is already a "TODO" comment to this
      effect from the previous release.

            dricesunw Daniel Rice (Inactive)
            dricesunw Daniel Rice (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: