< prev index next >
src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
Print this page
rev 59383 : [mq]: final
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -33,25 +33,10 @@
#ifdef __linux__
#include <sys/utsname.h>
#endif
-/* On Solaris 10 updates 8, 9, the render.h file defines these
- * protocol values but does not define the structs in Xrender.h.
- * Thus in order to get these always defined on Solaris 10
- * we will undefine the symbols if we have determined via the
- * makefiles that Xrender.h is lacking the structs. This will
- * trigger providing our own definitions as on earlier updates.
- * We could assume that *all* Solaris 10 update versions will lack the updated
- * Xrender.h and do this based solely on O/S being any 5.10 version, but this
- * could still change and we'd be broken again as we'd be re-defining them.
- */
-#ifdef SOLARIS10_NO_XRENDER_STRUCTS
-#undef X_RenderCreateLinearGradient
-#undef X_RenderCreateRadialGradient
-#endif
-
#ifndef X_RenderCreateLinearGradient
typedef struct _XLinearGradient {
XPointFixed p1;
XPointFixed p2;
} XLinearGradient;
@@ -70,33 +55,10 @@
} XRadialGradient;
#endif
#include <dlfcn.h>
-#if defined(__solaris__)
-/* Solaris 10 will not have these symbols at compile time */
-
-typedef Picture (*XRenderCreateLinearGradientFuncType)
- (Display *dpy,
- const XLinearGradient *gradient,
- const XFixed *stops,
- const XRenderColor *colors,
- int nstops);
-
-typedef Picture (*XRenderCreateRadialGradientFuncType)
- (Display *dpy,
- const XRadialGradient *gradient,
- const XFixed *stops,
- const XRenderColor *colors,
- int nstops);
-
-static
-XRenderCreateLinearGradientFuncType XRenderCreateLinearGradientFunc = NULL;
-static
- XRenderCreateRadialGradientFuncType XRenderCreateRadialGradientFunc = NULL;
-#endif
-
#define BUILD_TRANSFORM_MATRIX(TRANSFORM, M00, M01, M02, M10, M11, M12) \
{ \
TRANSFORM.matrix[0][0] = M00; \
TRANSFORM.matrix[0][1] = M01; \
TRANSFORM.matrix[0][2] = M02; \
@@ -160,31 +122,10 @@
if (xrenderlib != NULL) {
dlclose(xrenderlib);
} else {
available = JNI_FALSE;
}
-#elif defined(__solaris__)
- xrenderlib = dlopen("libXrender.so",RTLD_GLOBAL|RTLD_LAZY);
- if (xrenderlib != NULL) {
-
- XRenderCreateLinearGradientFunc =
- (XRenderCreateLinearGradientFuncType)
- dlsym(xrenderlib, "XRenderCreateLinearGradient");
-
- XRenderCreateRadialGradientFunc =
- (XRenderCreateRadialGradientFuncType)
- dlsym(xrenderlib, "XRenderCreateRadialGradient");
-
- if (XRenderCreateLinearGradientFunc == NULL ||
- XRenderCreateRadialGradientFunc == NULL)
- {
- available = JNI_FALSE;
- }
- dlclose(xrenderlib);
- } else {
- available = JNI_FALSE;
- }
#else
Dl_info info;
jboolean versionInfoIsFound = JNI_FALSE;
memset(&info, 0, sizeof(Dl_info));
@@ -591,17 +532,11 @@
colors[i].alpha = pixels[i*4 + 0];
colors[i].red = pixels[i*4 + 1];
colors[i].green = pixels[i*4 + 2];
colors[i].blue = pixels[i*4 + 3];
}
-#ifdef __solaris__
- if (XRenderCreateLinearGradientFunc!=NULL) {
- gradient = (*XRenderCreateLinearGradientFunc)(awt_display, &grad, stops, colors, numStops);
- }
-#else
gradient = XRenderCreateLinearGradient(awt_display, &grad, stops, colors, numStops);
-#endif
free(colors);
free(stops);
(*env)->ReleasePrimitiveArrayCritical(env, pixelsArray, pixels, JNI_ABORT);
(*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, fractions, JNI_ABORT);
@@ -675,17 +610,11 @@
colors[i].alpha = pixels[i*4 + 0];
colors[i].red = pixels[i*4 + 1];
colors[i].green = pixels[i*4 + 2];
colors[i].blue = pixels[i*4 + 3];
}
-#ifdef __solaris__
- if (XRenderCreateRadialGradientFunc != NULL) {
- gradient = (jint) (*XRenderCreateRadialGradientFunc)(awt_display, &grad, stops, colors, numStops);
- }
-#else
gradient = (jint) XRenderCreateRadialGradient(awt_display, &grad, stops, colors, numStops);
-#endif
free(colors);
free(stops);
(*env)->ReleasePrimitiveArrayCritical(env, pixelsArray, pixels, JNI_ABORT);
(*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, fractions, JNI_ABORT);
< prev index next >