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

Lanai - Use optimum sized temporary buffer while replacing texture region

XMLWordPrintable

    • 2d
    • x86_64
    • os_x

      The temporary buffer used in the current implementation of replaceTextureRegion method in MTLBlitLoops.m has an incorrect size. This size is always larger than needed - hence we do not see crashes.

      Here is the illustration -
      For exaple, if the source RGBA image is of size 1000 x 1000, out of this, if we need to use 10 x 10 (dw x dh) region to be copied to the destination.

      Current temp buffer size is :
      = Source ScanStride * dh
      = Souce width * pixelStride * dh
      = 1000 * 4 * 10
      = 40000 bytes

      What temp buffer size needed is :
      = dw * dh * pixelStride
      = 10 * 10 * 4
      = 400 bytes

            aghaisas Ajit Ghaisas
            aghaisas Ajit Ghaisas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: