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

Dead code in the sun.java2d.xr.XRPMBlitLoops$XrSwToPMBlit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • Resolved In Build:
      b21
    • CPU:
      generic
    • OS:
      linux

      Description

      The XrSwToPMBlit is a blit which is used as a direct(unscaled) blit of the image in the memory to the pixmap. It tries to optimize the SrcOver composite in case of an opaque source image and use Src instead:

              if (CompositeType.SrcOverNoEa.equals(comp) && (src.getTransparency() == Transparency.OPAQUE)) {
                  Blit opaqueSwToSurfaceBlit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dst.getSurfaceType());
                  opaqueSwToSurfaceBlit.Blit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
              } else {

      The code above does not work for two reasons:
      - The check "CompositeType.SrcOverNoEa.equals(comp)" always fails because the comp is of type Composite(AlphaComposite/XORComposite/etc) not a CompositeType
       - This optimisation is applied already in the sun.java2d.pipe.DrawImage#blitSurfaceData:
      https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java#L933

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serb Sergey Bylokhov
              Reporter:
              serb Sergey Bylokhov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: