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

Graphics.copyArea() on offscreen image ignores clip area (except for pixmaps)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • client-libs
    • None
    • 2d
    • b32
    • x86
    • windows_nt

      Run the attached test (CopyAreaTest). It draws a grid of four colored squares in the back buffer, then sets a clip to be the upper-left quadrant, then fills a black rectangle the size of the buffer, then copies the upper-left quadrant to a moving target on the Component. It eventually exits when the copyArea x location exceeds the width of the window.

      What you should see is a grid with black in the upper-left quadrant, green on the
      upper right, blue in the lower-left, and white in the lower-right. You should not see any change until the app exits.

      What you will see on Windows (with or without ddraw) or on Unix (when pixmaps are disabled, such as by using the -Dsun.java2d.pmoffscreen=false flag) is that the black rectangle is drawn in a path moving to the lower-right (overdrawing the other colored quadrants). When you see this behavior, it is because the copyArea() call is ignoring the clip that is being set to the upper-left quadrant.

            tdv Dmitri Trembovetski (Inactive)
            chaasesunw Chet Haase (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: