< prev index next >

src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c

Print this page
rev 54069 : 8220528: [AIX] Fix basic Xinerama and Xrender functionality

*** 120,144 **** * operation on both OSes. Until then, some of the Xinerama-related code * is ifdef'd appropriately. -bchristi, 7/12/01 */ #define MAXFRAMEBUFFERS 16 ! #if defined(__linux__) || defined(MACOSX) typedef struct { int screen_number; short x_org; short y_org; short width; short height; } XineramaScreenInfo; typedef XineramaScreenInfo* XineramaQueryScreensFunc(Display*, int*); - - #else /* SOLARIS */ - typedef Status XineramaGetInfoFunc(Display* display, int screen_number, - XRectangle* framebuffer_rects, unsigned char* framebuffer_hints, - int* num_framebuffers); #endif Bool usingXinerama = False; XRectangle fbrects[MAXFRAMEBUFFERS]; --- 120,143 ---- * operation on both OSes. Until then, some of the Xinerama-related code * is ifdef'd appropriately. -bchristi, 7/12/01 */ #define MAXFRAMEBUFFERS 16 ! #if defined(__solaris__) ! typedef Status XineramaGetInfoFunc(Display* display, int screen_number, ! XRectangle* framebuffer_rects, unsigned char* framebuffer_hints, ! int* num_framebuffers); ! #else /* Linux, Mac, AIX */ typedef struct { int screen_number; short x_org; short y_org; short width; short height; } XineramaScreenInfo; typedef XineramaScreenInfo* XineramaQueryScreensFunc(Display*, int*); #endif Bool usingXinerama = False; XRectangle fbrects[MAXFRAMEBUFFERS];
*** 423,432 **** --- 422,432 ---- // Only use the RENDER extension if it is available on the X server if (XQueryExtension(awt_display, "RENDER", &major_opcode, &first_event, &first_error)) { + DTRACE_PRINTLN("RENDER extension available"); xrenderLibHandle = dlopen("libXrender.so.1", RTLD_LAZY | RTLD_GLOBAL); #ifdef MACOSX #define XRENDER_LIB "/usr/X11/lib/libXrender.dylib" #else
*** 436,457 **** if (xrenderLibHandle == NULL) { xrenderLibHandle = dlopen(XRENDER_LIB, RTLD_LAZY | RTLD_GLOBAL); } ! #ifndef __linux__ /* SOLARIS */ if (xrenderLibHandle == NULL) { xrenderLibHandle = dlopen("/usr/lib/libXrender.so.1", RTLD_LAZY | RTLD_GLOBAL); } #endif ! if (xrenderLibHandle != NULL) { xrenderFindVisualFormat = (XRenderFindVisualFormatFunc*)dlsym(xrenderLibHandle, "XRenderFindVisualFormat"); } } for (i = 0; i < nTrue; i++) { if (XVisualIDFromVisual(pVITrue[i].visual) == XVisualIDFromVisual(defaultConfig->awt_visInfo.visual) || --- 436,467 ---- if (xrenderLibHandle == NULL) { xrenderLibHandle = dlopen(XRENDER_LIB, RTLD_LAZY | RTLD_GLOBAL); } ! #ifdef __solaris__ if (xrenderLibHandle == NULL) { xrenderLibHandle = dlopen("/usr/lib/libXrender.so.1", RTLD_LAZY | RTLD_GLOBAL); } #endif ! #ifdef _AIX ! if (xrenderLibHandle == NULL) { ! xrenderLibHandle = dlopen("libXrender.a(libXrender.so.0)", ! RTLD_MEMBER | RTLD_LAZY | RTLD_GLOBAL); ! } ! #endif if (xrenderLibHandle != NULL) { + DTRACE_PRINTLN("Loaded libXrender"); xrenderFindVisualFormat = (XRenderFindVisualFormatFunc*)dlsym(xrenderLibHandle, "XRenderFindVisualFormat"); + } else { + DTRACE_PRINTLN1("Can't load libXrender (%s)", dlerror()); } + } else { + DTRACE_PRINTLN("RENDER extension NOT available"); } for (i = 0; i < nTrue; i++) { if (XVisualIDFromVisual(pVITrue[i].visual) == XVisualIDFromVisual(defaultConfig->awt_visInfo.visual) ||
*** 470,483 **** --- 480,500 ---- pVITrue [i].visual); if (format && format->type == PictTypeDirect && format->direct.alphaMask) { + DTRACE_PRINTLN1("GraphicsConfig[%d] supports Translucency", ind); graphicsConfigs [ind]->isTranslucencySupported = 1; memcpy(&graphicsConfigs [ind]->renderPictFormat, format, sizeof(*format)); + } else { + DTRACE_PRINTLN1(format ? + "GraphicsConfig[%d] has no Translucency support" : + "Error calling 'XRenderFindVisualFormat'", ind); } + } else { + DTRACE_PRINTLN1("Can't find 'XRenderFindVisualFormat' in libXrender (%s)", dlerror()); } } if (xrenderLibHandle != NULL) { dlclose(xrenderLibHandle);
*** 580,590 **** AWT_UNLOCK (); } #ifndef HEADLESS ! #if defined(__linux__) || defined(MACOSX) static void xinerama_init_linux() { void* libHandle = NULL; int32_t locNumScr = 0; XineramaScreenInfo *xinInfo; --- 597,607 ---- AWT_UNLOCK (); } #ifndef HEADLESS ! #if defined(__linux__) || defined(MACOSX) || defined(_AIX) static void xinerama_init_linux() { void* libHandle = NULL; int32_t locNumScr = 0; XineramaScreenInfo *xinInfo;
*** 593,610 **** /* load library */ libHandle = dlopen(VERSIONED_JNI_LIB_NAME("Xinerama", "1"), RTLD_LAZY | RTLD_GLOBAL); if (libHandle == NULL) { libHandle = dlopen(JNI_LIB_NAME("Xinerama"), RTLD_LAZY | RTLD_GLOBAL); } if (libHandle != NULL) { XineramaQueryScreens = (XineramaQueryScreensFunc*) dlsym(libHandle, XineramaQueryScreensName); if (XineramaQueryScreens != NULL) { ! DTRACE_PRINTLN("calling XineramaQueryScreens func on Linux"); xinInfo = (*XineramaQueryScreens)(awt_display, &locNumScr); if (xinInfo != NULL && locNumScr > XScreenCount(awt_display)) { int32_t idx; DTRACE_PRINTLN("Enabling Xinerama support"); usingXinerama = True; --- 610,631 ---- /* load library */ libHandle = dlopen(VERSIONED_JNI_LIB_NAME("Xinerama", "1"), RTLD_LAZY | RTLD_GLOBAL); if (libHandle == NULL) { + #if defined(_AIX) + libHandle = dlopen("libXext.a(shr_64.o)", RTLD_MEMBER | RTLD_LAZY | RTLD_GLOBAL); + #else libHandle = dlopen(JNI_LIB_NAME("Xinerama"), RTLD_LAZY | RTLD_GLOBAL); + #endif } if (libHandle != NULL) { XineramaQueryScreens = (XineramaQueryScreensFunc*) dlsym(libHandle, XineramaQueryScreensName); if (XineramaQueryScreens != NULL) { ! DTRACE_PRINTLN("calling XineramaQueryScreens func"); xinInfo = (*XineramaQueryScreens)(awt_display, &locNumScr); if (xinInfo != NULL && locNumScr > XScreenCount(awt_display)) { int32_t idx; DTRACE_PRINTLN("Enabling Xinerama support"); usingXinerama = True;
*** 620,641 **** fbrects[idx].height = xinInfo[idx].height; fbrects[idx].x = xinInfo[idx].x_org; fbrects[idx].y = xinInfo[idx].y_org; } } else { ! DTRACE_PRINTLN("calling XineramaQueryScreens didn't work"); } } else { DTRACE_PRINTLN("couldn't load XineramaQueryScreens symbol"); } dlclose(libHandle); } else { DTRACE_PRINTLN1("\ncouldn't open shared library: %s\n", dlerror()); } } #endif ! #if !defined(__linux__) && !defined(MACOSX) /* Solaris */ static void xinerama_init_solaris() { void* libHandle = NULL; unsigned char fbhints[MAXFRAMEBUFFERS]; int32_t locNumScr = 0; --- 641,665 ---- fbrects[idx].height = xinInfo[idx].height; fbrects[idx].x = xinInfo[idx].x_org; fbrects[idx].y = xinInfo[idx].y_org; } } else { ! DTRACE_PRINTLN((xinInfo == NULL) ? ! "calling XineramaQueryScreens didn't work" : ! "XineramaQueryScreens <= XScreenCount" ! ); } } else { DTRACE_PRINTLN("couldn't load XineramaQueryScreens symbol"); } dlclose(libHandle); } else { DTRACE_PRINTLN1("\ncouldn't open shared library: %s\n", dlerror()); } } #endif ! #if defined(__solaris__) static void xinerama_init_solaris() { void* libHandle = NULL; unsigned char fbhints[MAXFRAMEBUFFERS]; int32_t locNumScr = 0;
*** 687,701 **** DTRACE_PRINTLN("Xinerama extension is not available"); return; } DTRACE_PRINTLN("Xinerama extension is available"); ! #if defined(__linux__) || defined(MACOSX) ! xinerama_init_linux(); ! #else /* Solaris */ xinerama_init_solaris(); ! #endif /* __linux__ || MACOSX */ } #endif /* HEADLESS */ Display * awt_init_Display(JNIEnv *env, jobject this) --- 711,725 ---- DTRACE_PRINTLN("Xinerama extension is not available"); return; } DTRACE_PRINTLN("Xinerama extension is available"); ! #if defined(__solaris__) xinerama_init_solaris(); ! #else /* Linux, Mac, AIX */ ! xinerama_init_linux(); ! #endif } #endif /* HEADLESS */ Display * awt_init_Display(JNIEnv *env, jobject this)
< prev index next >