src/java.desktop/share/native/common/java2d/opengl/OGLBlitLoops.c
changeset 58626 a9ed3d93cca3
parent 58616 be9ef671a1b6
child 58679 9c3209ff7550
--- a/src/java.desktop/share/native/common/java2d/opengl/OGLBlitLoops.c	Mon May 27 01:36:04 2019 -0700
+++ b/src/java.desktop/share/native/common/java2d/opengl/OGLBlitLoops.c	Fri May 31 18:16:57 2019 +0100
@@ -710,8 +710,8 @@
     juint step = 0;
     // vertical flip and convert argbpre to argb if necessary
     for (; i < h / 2; ++i) {
-        juint *r1 = PtrAddBytes(pDst, (i * scanStride));
-        juint *r2 = PtrAddBytes(pDst, (h - i - 1) * scanStride);
+        juint *r1 = PtrPixelsRow(pDst, i, scanStride);
+        juint *r2 = PtrPixelsRow(pDst, h - i - 1, scanStride);
         if (tempRow) {
             // fast path
             memcpy(tempRow, r1, clippedStride);
@@ -733,7 +733,7 @@
     }
     // convert the middle line if necessary
     if (convert && h % 2) {
-        juint *r1 = PtrAddBytes(pDst, (i * scanStride));
+        juint *r1 = PtrPixelsRow(pDst, i, scanStride);
         for (step = 0; step < w; ++step) {
             LoadIntArgbPreTo1IntArgb(r1, 0, step, r1[step]);
         }
@@ -806,7 +806,7 @@
             height = srcInfo.bounds.y2 - srcInfo.bounds.y1;
 
             pDst = PtrAddBytes(pDst, dstx * dstInfo.pixelStride);
-            pDst = PtrAddBytes(pDst, dsty * dstInfo.scanStride);
+            pDst = PtrPixelsRow(pDst, dsty, dstInfo.scanStride);
 
             j2d_glPixelStorei(GL_PACK_ROW_LENGTH,
                               dstInfo.scanStride / dstInfo.pixelStride);