--- old/src/java.desktop/unix/native/common/java2d/x11/X11Renderer.c 2017-10-16 13:03:47.997451119 -0700 +++ new/src/java.desktop/unix/native/common/java2d/x11/X11Renderer.c 2017-10-16 13:03:47.841451580 -0700 @@ -225,13 +225,13 @@ jint x1, jint y1, jint x2, jint y2) { #ifndef HEADLESS - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return; } - XDrawLine(awt_display, xsdo->drawable, (GC) xgc, + XDrawLine(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), CLAMP_TO_SHORT(x1), CLAMP_TO_SHORT(y1), CLAMP_TO_SHORT(x2), CLAMP_TO_SHORT(y2)); X11SD_DirectRenderNotify(env, xsdo); @@ -249,7 +249,7 @@ jint x, jint y, jint w, jint h) { #ifndef HEADLESS - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL || w < 0 || h < 0) { return; @@ -263,11 +263,11 @@ * the anomalies of various X11 implementations that draw * nothing for degenerate Polygons and Rectangles. */ - XFillRectangle(awt_display, xsdo->drawable, (GC) xgc, + XFillRectangle(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), CLAMP_TO_SHORT(x), CLAMP_TO_SHORT(y), CLAMP_TO_USHORT(w+1), CLAMP_TO_USHORT(h+1)); } else { - XDrawRectangle(awt_display, xsdo->drawable, (GC) xgc, + XDrawRectangle(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), CLAMP_TO_SHORT(x), CLAMP_TO_SHORT(y), CLAMP_TO_USHORT(w), CLAMP_TO_USHORT(h)); } @@ -289,7 +289,7 @@ #ifndef HEADLESS long ty1, ty2, tx1, tx2, cx, cy, cxw, cyh, halfW, halfH, leftW, rightW, topH, bottomH; - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL || w < 0 || h < 0) { return; @@ -334,32 +334,32 @@ topH = (ty1 - cy) * 2; bottomH = (cyh - ty2) * 2; - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), cx, cy, leftW, topH, 90, 90, JNI_FALSE); - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), cxw - rightW, cy, rightW, topH, 0, 90, JNI_FALSE); - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), cx, cyh - bottomH, leftW, bottomH, 180, 90, JNI_FALSE); - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), cxw - rightW, cyh - bottomH, rightW, bottomH, 270, 90, JNI_FALSE); if (tx1 <= tx2) { - XDrawLine(awt_display, xsdo->drawable, (GC) xgc, + XDrawLine(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), tx1, cy, tx2, cy); if (h > 0) { - XDrawLine(awt_display, xsdo->drawable, (GC) xgc, + XDrawLine(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), tx1, cyh, tx2, cyh); } } if (ty1 <= ty2) { - XDrawLine(awt_display, xsdo->drawable, (GC) xgc, + XDrawLine(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), cx, ty1, cx, ty2); if (w > 0) { - XDrawLine(awt_display, xsdo->drawable, (GC) xgc, + XDrawLine(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), cxw, ty1, cxw, ty2); } } @@ -378,7 +378,7 @@ jint x, jint y, jint w, jint h) { #ifndef HEADLESS - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return; @@ -393,11 +393,11 @@ * for speed and to deal better with degenerate sizes. */ if (w >= 0 && h >= 0) { - XFillRectangle(awt_display, xsdo->drawable, (GC) xgc, + XFillRectangle(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), x, y, w+1, h+1); } } else { - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), x, y, w, h, 0, 360, JNI_FALSE); } X11SD_DirectRenderNotify(env, xsdo); @@ -416,13 +416,13 @@ jint angleStart, jint angleExtent) { #ifndef HEADLESS - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return; } - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), x, y, w, h, angleStart, angleExtent, JNI_FALSE); X11SD_DirectRenderNotify(env, xsdo); #endif /* !HEADLESS */ @@ -442,7 +442,7 @@ { #ifndef HEADLESS XPoint pTmp[POLYTEMPSIZE], *points; - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return; @@ -476,11 +476,11 @@ * non-degenerate as this may invoke less processing * down the line than a Poly primitive anyway. */ - XDrawLine(awt_display, xsdo->drawable, (GC) xgc, + XDrawLine(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), points[0].x, points[0].y, points[1].x, points[1].y); } else { - XDrawLines(awt_display, xsdo->drawable, (GC) xgc, + XDrawLines(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), points, npoints, CoordModeOrigin); } if (points != pTmp) { @@ -569,7 +569,7 @@ jint transX, jint transY, jobject p2df, jboolean isFill) { #ifndef HEADLESS - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); jarray typesArray; jobject pointArray; jarray coordsArray; @@ -609,7 +609,7 @@ return; } - XDHD_INIT(&dHData, (GC)xgc, xsdo->drawable); + XDHD_INIT(&dHData, (GC) jlong_to_ptr(xgc), xsdo->drawable); drawHandler.pData = &dHData; stroke = (((*env)->GetIntField(env, sg2d, sg2dStrokeHintID) == @@ -666,13 +666,13 @@ jint x, jint y, jint w, jint h) { #ifndef HEADLESS - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return; } - XFillRectangle(awt_display, xsdo->drawable, (GC) xgc, + XFillRectangle(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), CLAMP_TO_SHORT(x), CLAMP_TO_SHORT(y), CLAMP_TO_USHORT(w), CLAMP_TO_USHORT(h)); X11SD_DirectRenderNotify(env, xsdo); @@ -693,7 +693,7 @@ #ifndef HEADLESS long ty1, ty2, tx1, tx2, cx, cy, cxw, cyh, halfW, halfH, leftW, rightW, topH, bottomH; - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL || w <= 0 || h <= 0) { return; @@ -738,31 +738,31 @@ topH = (ty1 - cy) * 2; bottomH = (cyh - ty2) * 2; - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), cx, cy, leftW, topH, 90, 90, JNI_TRUE); - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), cxw - rightW, cy, rightW, topH, 0, 90, JNI_TRUE); - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), cx, cyh - bottomH, leftW, bottomH, 180, 90, JNI_TRUE); - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), cxw - rightW, cyh - bottomH, rightW, bottomH, 270, 90, JNI_TRUE); if (tx1 < tx2) { if (cy < ty1) { - XFillRectangle(awt_display, xsdo->drawable, (GC) xgc, + XFillRectangle(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), tx1, cy, tx2 - tx1, ty1 - cy); } if (ty2 < cyh) { - XFillRectangle(awt_display, xsdo->drawable, (GC) xgc, + XFillRectangle(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), tx1, ty2, tx2 - tx1, cyh - ty2); } } if (ty1 < ty2) { - XFillRectangle(awt_display, xsdo->drawable, (GC) xgc, + XFillRectangle(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), cx, ty1, cxw - cx, ty2 - ty1); } X11SD_DirectRenderNotify(env, xsdo); @@ -780,7 +780,7 @@ jint x, jint y, jint w, jint h) { #ifndef HEADLESS - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return; @@ -820,10 +820,10 @@ } #undef SQRT_3_4 if (w > 0 && h > 0) { - XFillRectangle(awt_display, xsdo->drawable, (GC) xgc, x, y, w, h); + XFillRectangle(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), x, y, w, h); } } else { - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), x, y, w, h, 0, 360, JNI_TRUE); } X11SD_DirectRenderNotify(env, xsdo); @@ -842,13 +842,13 @@ jint angleStart, jint angleExtent) { #ifndef HEADLESS - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return; } - awt_drawArc(env, xsdo->drawable, (GC) xgc, + awt_drawArc(env, xsdo->drawable, (GC) jlong_to_ptr(xgc), x, y, w, h, angleStart, angleExtent, JNI_TRUE); X11SD_DirectRenderNotify(env, xsdo); #endif /* !HEADLESS */ @@ -867,7 +867,7 @@ { #ifndef HEADLESS XPoint pTmp[POLYTEMPSIZE], *points; - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return; @@ -892,7 +892,7 @@ pTmp, (int *)&npoints, JNI_FALSE); if (points != 0) { if (npoints > 2) { - XFillPolygon(awt_display, xsdo->drawable, (GC) xgc, + XFillPolygon(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), points, npoints, Complex, CoordModeOrigin); X11SD_DirectRenderNotify(env, xsdo); } @@ -919,7 +919,7 @@ void *srData; jint x, y, w, h; jint spanbox[4]; - X11SDOps *xsdo = (X11SDOps *) pXSData; + X11SDOps *xsdo = (X11SDOps *) jlong_to_ptr(pXSData); if (xsdo == NULL) { return; @@ -940,7 +940,7 @@ y = spanbox[1] + transy; w = spanbox[2] - spanbox[0]; h = spanbox[3] - spanbox[1]; - XFillRectangle(awt_display, xsdo->drawable, (GC) xgc, + XFillRectangle(awt_display, xsdo->drawable, (GC) jlong_to_ptr(xgc), CLAMP_TO_SHORT(x), CLAMP_TO_SHORT(y), CLAMP_TO_USHORT(w), CLAMP_TO_USHORT(h)); } @@ -971,7 +971,7 @@ return; } - xgc = (GC)gc; + xgc = (GC) jlong_to_ptr(gc); if (xgc == NULL) { return; }