changeset 9926:2c1da2208c2b

8233250: Better X11 rendering Reviewed-by: andrew
author bae
date Wed, 08 Apr 2020 01:25:28 +0100
parents bf7ec0e106be
children a421cf366d06
files src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.c src/solaris/native/sun/awt/multiVis.c src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c src/solaris/native/sun/java2d/x11/X11TextRenderer_md.c src/solaris/native/sun/java2d/x11/XRBackendNative.c
diffstat 5 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.c	Tue Oct 15 08:18:48 2019 -0400
+++ b/src/share/native/sun/awt/splashscreen/splashscreen_gfx_impl.c	Wed Apr 08 01:25:28 2020 +0100
@@ -206,7 +206,7 @@
     int depthBytes = format->depthBytes;
 
     pRect->pBits = pBits;
-    INCPN(byte_t, pRect->pBits, y * stride + x * depthBytes);
+    INCPN(byte_t, pRect->pBits, (intptr_t) y * stride + x * depthBytes);
     pRect->numLines = height;
     pRect->numSamples = width;
     pRect->stride = stride * jump;
--- a/src/solaris/native/sun/awt/multiVis.c	Tue Oct 15 08:18:48 2019 -0400
+++ b/src/solaris/native/sun/awt/multiVis.c	Wed Apr 08 01:25:28 2020 +0100
@@ -425,9 +425,9 @@
     bytes_per_line = ximage->bytes_per_line;
 
     if (format == ZPixmap)
-          ximage->data = malloc(height*bytes_per_line);
+        ximage->data = malloc((size_t) height * bytes_per_line);
     else
-        ximage->data = malloc(height*bytes_per_line*depth);
+        ximage->data = malloc((size_t) height * bytes_per_line * depth);
 
     ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/
 
--- a/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c	Tue Oct 15 08:18:48 2019 -0400
+++ b/src/solaris/native/sun/java2d/x11/X11PMBlitLoops.c	Wed Apr 08 01:25:28 2020 +0100
@@ -257,7 +257,7 @@
         return;
     }
     dstScan = image->bytes_per_line;
-    image->data = malloc(dstScan * height);
+    image->data = malloc((size_t) dstScan * height);
     if (image->data == NULL) {
         XFree(image);
         AWT_UNLOCK();
--- a/src/solaris/native/sun/java2d/x11/X11TextRenderer_md.c	Tue Oct 15 08:18:48 2019 -0400
+++ b/src/solaris/native/sun/java2d/x11/X11TextRenderer_md.c	Wed Apr 08 01:25:28 2020 +0100
@@ -154,7 +154,7 @@
         height = bottom - top;
         top -= clipTop;
         left -= clipLeft;
-        pPix = ((jubyte *) theImage->data) + (left >> 3) + top * scan;
+        pPix = ((jubyte *) theImage->data) + (left >> 3) + (intptr_t) top * scan;
         left &= 0x07;
         if (theImage->bitmap_bit_order == MSBFirst) {
             left = 0x80 >> left;
--- a/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Tue Oct 15 08:18:48 2019 -0400
+++ b/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Wed Apr 08 01:25:28 2020 +0100
@@ -653,7 +653,7 @@
     if (ea != 1.0f) {
         for (line=0; line < height; line++) {
             for (pix=0; pix < width; pix++) {
-                int index = maskScan*line + pix + maskOff;
+                size_t index = (size_t) maskScan * line + pix + maskOff;
                 mask[index] = (((unsigned char) mask[index])*ea);
             }
         }
@@ -678,8 +678,8 @@
         if (imageFits) {
             for (line=0; line < height; line++) {
                 for (pix=0; pix < width; pix++) {
-                    img->data[line*img->bytes_per_line + pix] =
-                        (unsigned char) (mask[maskScan*line + pix + maskOff]);
+                    img->data[(size_t) line * img->bytes_per_line + pix] =
+                        (unsigned char) (mask[(size_t) maskScan * line + pix + maskOff]);
                 }
             }
         } else {