提交 0ed11756 编写于 作者: B bae

8233250: Better X11 rendering

Reviewed-by: andrew
上级 fea3b886
......@@ -206,7 +206,7 @@ initRect(ImageRect * pRect, int x, int y, int width, int height, int jump,
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;
......
......@@ -401,7 +401,7 @@ list_ptr regions;/* list of regions to read from */
ximage = XCreateImage(disp,fakeVis,(uint32_t) depth,format,0,NULL,
(uint32_t)width,(uint32_t)height,8,0);
ximage->data = calloc(ximage->bytes_per_line*height*((format==ZPixmap)? 1 : depth), sizeof(char));
ximage->data = calloc((size_t) ximage->bytes_per_line*height*((format==ZPixmap)? 1 : depth), sizeof(char));
ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/
for (reg = (image_region_type *) first_in_list( regions); reg;
......
......@@ -263,7 +263,7 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask
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();
......
......@@ -154,7 +154,7 @@ static void FillBitmap(XImage *theImage,
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;
......
......@@ -756,7 +756,7 @@ Java_sun_java2d_xr_XRBackendNative_putMaskNative
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);
}
}
......@@ -781,8 +781,8 @@ Java_sun_java2d_xr_XRBackendNative_putMaskNative
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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册