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

Lanai - Use optimum sized temporary buffer while replacing texture region

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • CPU:
      x86_64
    • OS:
      os_x

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: