Lines Matching defs:xsdo

76                           X11SDOps *xsdo);
78 X11SDOps *xsdo);
79 static void X11SD_SwapBytes(X11SDOps *xsdo, XImage *img, int depth, int bpp);
80 static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
210 X11SDOps *xsdo = X11SurfaceData_GetOps(env, this);
213 if (xsdo->drawable != 0 || X11SD_InitWindow(env, xsdo) == SD_SUCCESS) {
263 X11SDOps *xsdo = (X11SDOps*)SurfaceData_InitOps(env, xsd, sizeof(X11SDOps));
264 if (xsdo == NULL) {
268 xsdo->sdOps.Lock = X11SD_Lock;
269 xsdo->sdOps.GetRasInfo = X11SD_GetRasInfo;
270 xsdo->sdOps.Unlock = X11SD_Unlock;
271 xsdo->sdOps.Dispose = X11SD_Dispose;
272 xsdo->GetPixmapWithBg = X11SD_GetPixmapWithBg;
273 xsdo->ReleasePixmapWithBg = X11SD_ReleasePixmapWithBg;
287 xsdo->widget = cdata->widget;
289 xsdo->widget = NULL;
292 xsdo->widget = NULL;
294 xsdo->drawable = JNU_CallMethodByName(env, NULL, peer, "getWindow", "()J").j;
296 xsdo->drawable = 0;
299 xsdo->depth = depth;
300 xsdo->dgaAvailable = dgaAvailable;
301 xsdo->isPixmap = JNI_FALSE;
302 xsdo->bitmask = 0;
303 xsdo->bgPixel = 0;
304 xsdo->isBgInitialized = JNI_FALSE;
306 xsdo->shmPMData.shmSegInfo = NULL;
307 xsdo->shmPMData.xRequestSent = JNI_FALSE;
308 xsdo->shmPMData.pmSize = 0;
309 xsdo->shmPMData.usingShmPixmap = JNI_FALSE;
310 xsdo->shmPMData.pixmap = 0;
311 xsdo->shmPMData.shmPixmap = 0;
312 xsdo->shmPMData.numBltsSinceRead = 0;
313 xsdo->shmPMData.pixelsReadSinceBlt = 0;
314 xsdo->shmPMData.numBltsThreshold = 2;
317 xsdo->configData = (AwtGraphicsConfigDataPtr)
321 if (xsdo->configData == NULL) {
327 xsdo->pixelmask = (xsdo->configData->awt_visInfo.red_mask |
328 xsdo->configData->awt_visInfo.green_mask |
329 xsdo->configData->awt_visInfo.blue_mask);
331 xsdo->pixelmask = 0xfff;
333 xsdo->pixelmask = 0xff;
336 xsdo->xrPic = None;
381 X11SDOps * xsdo = (X11SDOps*)ops;
385 xsdo->invalid = JNI_TRUE;
387 if (xsdo->xrPic != None) {
388 XRenderFreePicture(awt_display, xsdo->xrPic);
389 xsdo->xrPic = None;
392 if (xsdo->isPixmap == JNI_TRUE && xsdo->drawable != 0) {
394 if (xsdo->shmPMData.shmSegInfo != NULL) {
395 X11SD_DropSharedSegment(xsdo->shmPMData.shmSegInfo);
396 xsdo->shmPMData.shmSegInfo = NULL;
398 if (xsdo->shmPMData.pixmap) {
399 XFreePixmap(awt_display, xsdo->shmPMData.pixmap);
400 xsdo->shmPMData.pixmap = 0;
402 if (xsdo->shmPMData.shmPixmap) {
403 XFreePixmap(awt_display, xsdo->shmPMData.shmPixmap);
404 xsdo->shmPMData.shmPixmap = 0;
407 XFreePixmap(awt_display, xsdo->drawable);
409 xsdo->drawable = 0;
411 if (xsdo->bitmask != 0) {
412 XFreePixmap(awt_display, xsdo->bitmask);
413 xsdo->bitmask = 0;
415 if (xsdo->javaGC != NULL) {
416 XFreeGC(awt_display, xsdo->javaGC);
417 xsdo->javaGC = NULL;
419 if (xsdo->cachedGC != NULL) {
420 XFreeGC(awt_display, xsdo->cachedGC);
421 xsdo->cachedGC = NULL;
424 if(xsdo->xrPic != None) {
425 XRenderFreePicture(awt_display, xsdo->xrPic);
440 X11SDOps *xsdo = (X11SDOps *) SurfaceData_GetOps(env, xsd);
442 if (xsdo != NULL) {
443 xsdo->invalid = JNI_TRUE;
449 jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width, jint height, jlong drawable)
455 xsdo->drawable = drawable;
456 xsdo->isPixmap = JNI_FALSE;
458 xsdo->isPixmap = JNI_TRUE;
462 xsdo->dgaAvailable = useDGAWithPixmaps;
464 xsdo->pmWidth = width;
465 xsdo->pmHeight = height;
468 xsdo->shmPMData.pmSize = width * height * depth;
469 xsdo->shmPMData.pixelsReadThreshold = width * height / 8;
472 xsdo->drawable = X11SD_CreateSharedPixmap(xsdo);
474 if (xsdo->drawable) {
475 xsdo->shmPMData.usingShmPixmap = JNI_TRUE;
476 xsdo->shmPMData.shmPixmap = xsdo->drawable;
483 xsdo->drawable =
486 xsdo->configData->awt_visInfo.screen),
490 xsdo->shmPMData.usingShmPixmap = JNI_FALSE;
491 xsdo->shmPMData.pixmap = xsdo->drawable;
494 if (xsdo->drawable == 0) {
517 X11SDOps *xsdo = X11SurfaceData_GetOps(env, xsd);
518 if (xsdo == NULL) {
522 if (xsdo->configData->awt_cmap == (Colormap)NULL) {
523 awtJNI_CreateColorData(env, xsdo->configData, 1);
527 xsdo->cData = xsdo->configData->color_data;
529 XShared_initSurface(env, xsdo, depth, width, height, drawable);
530 xsdo->xrPic = NULL;
548 XImage* X11SD_CreateSharedImage(X11SDOps *xsdo,
562 img = XShmCreateImage(awt_display, xsdo->configData->awt_visInfo.visual,
563 xsdo->depth, ZPixmap, NULL, shminfo,
620 XImage* X11SD_GetSharedImage(X11SDOps *xsdo, jint width, jint height,
626 xsdo->depth, readBits)) {
631 } else if (width * height * xsdo->depth > 0x10000) {
632 retImage = X11SD_CreateSharedImage(xsdo, width, height);
637 Drawable X11SD_CreateSharedPixmap(X11SDOps *xsdo)
643 int width = xsdo->pmWidth;
644 int height = xsdo->pmHeight;
646 if (xsdo->shmPMData.pmSize < 0x10000) {
652 img = X11SD_CreateSharedImage(xsdo, width, height);
663 xsdo->configData->awt_visInfo.screen),
665 width, height, xsdo->depth);
671 xsdo->shmPMData.shmSegInfo = shminfo;
672 xsdo->shmPMData.bytesPerLine = scan;
676 void X11SD_PuntPixmap(X11SDOps *xsdo, jint width, jint height)
687 xsdo->shmPMData.numBltsSinceRead = 0;
689 xsdo->shmPMData.pixelsReadSinceBlt += width * height;
690 if (xsdo->shmPMData.pixelsReadSinceBlt >
691 xsdo->shmPMData.pixelsReadThreshold) {
692 if (!xsdo->shmPMData.shmPixmap) {
693 xsdo->shmPMData.shmPixmap =
694 X11SD_CreateSharedPixmap(xsdo);
696 if (xsdo->shmPMData.shmPixmap) {
697 GC xgc = XCreateGC(awt_display, xsdo->shmPMData.shmPixmap, 0L, NULL);
699 xsdo->shmPMData.usingShmPixmap = JNI_TRUE;
700 xsdo->drawable = xsdo->shmPMData.shmPixmap;
702 xsdo->shmPMData.pixmap, xsdo->drawable, xgc,
703 0, 0, xsdo->pmWidth, xsdo->pmHeight, 0, 0);
705 xsdo->shmPMData.xRequestSent = JNI_FALSE;
712 void X11SD_UnPuntPixmap(X11SDOps *xsdo)
717 xsdo->shmPMData.pixelsReadSinceBlt = 0;
718 if (xsdo->shmPMData.numBltsSinceRead >=
719 xsdo->shmPMData.numBltsThreshold)
721 if (xsdo->shmPMData.usingShmPixmap) {
722 if (!xsdo->shmPMData.pixmap) {
723 xsdo->shmPMData.pixmap =
726 xsdo->configData->awt_visInfo.screen),
727 xsdo->pmWidth, xsdo->pmHeight, xsdo->depth);
729 if (xsdo->shmPMData.pixmap) {
730 GC xgc = XCreateGC(awt_display, xsdo->shmPMData.pixmap, 0L, NULL);
732 xsdo->drawable = xsdo->shmPMData.pixmap;
734 xsdo->shmPMData.shmPixmap, xsdo->drawable, xgc,
735 0, 0, xsdo->pmWidth, xsdo->pmHeight, 0, 0);
738 xsdo->shmPMData.xRequestSent = JNI_FALSE;
739 xsdo->shmPMData.usingShmPixmap = JNI_FALSE;
740 xsdo->shmPMData.numBltsThreshold *= 2;
745 xsdo->shmPMData.numBltsSinceRead++;
790 jint X11SD_InitWindow(JNIEnv *env, X11SDOps *xsdo)
792 if (xsdo->isPixmap == JNI_TRUE) {
796 if (!XtIsRealized(xsdo->widget)) {
801 xsdo->drawable = XtWindow(xsdo->widget);
803 xsdo->cData = xsdo->configData->color_data;
813 X11SDOps *xsdo = (X11SDOps *) ops;
819 if (xsdo->invalid) {
825 xsdo->cData = xsdo->configData->color_data;
827 if (xsdo->drawable == 0 && X11SD_InitWindow(env, xsdo) == SD_FAILURE) {
832 (xsdo->cData == NULL ||
833 xsdo->cData->awt_icmLUT == NULL))
840 (xsdo->cData == NULL ||
841 xsdo->cData->img_clr_tbl == NULL ||
842 xsdo->cData->img_oda_red == NULL ||
843 xsdo->cData->img_oda_green == NULL ||
844 xsdo->cData->img_oda_blue == NULL))
851 (xsdo->cData == NULL ||
852 xsdo->cData->pGrayInverseLutData == NULL))
858 if (xsdo->dgaAvailable && (lockflags & (SD_LOCK_RD_WR))) {
861 dgaret = (*pJDgaInfo->pGetLock)(env, awt_display, &xsdo->dgaDev,
862 xsdo->drawable, &xsdo->surfInfo,
868 int wx = xsdo->surfInfo.window.lox;
869 int wy = xsdo->surfInfo.window.loy;
870 pRasInfo->bounds.x1 = xsdo->surfInfo.visible.lox - wx;
871 pRasInfo->bounds.y1 = xsdo->surfInfo.visible.loy - wy;
872 pRasInfo->bounds.x2 = xsdo->surfInfo.visible.hix - wx;
873 pRasInfo->bounds.y2 = xsdo->surfInfo.visible.hiy - wy;
878 xsdo->dgaAvailable = JNI_FALSE;
886 if (xsdo->isPixmap) {
888 if (xsdo->shmPMData.usingShmPixmap) {
898 if (pRasInfo->bounds.x2 > xsdo->pmWidth) {
899 pRasInfo->bounds.x2 = xsdo->pmWidth;
901 if (pRasInfo->bounds.y2 > xsdo->pmHeight) {
902 pRasInfo->bounds.y2 = xsdo->pmHeight;
920 X11SDOps *xsdo = (X11SDOps *) ops;
923 jint depth = xsdo->depth;
924 int mult = xsdo->configData->pixelStride;
926 if (xsdo->dgaAvailable &&
933 dgaret = (*pJDgaInfo->pGetLock)(env, awt_display, &xsdo->dgaDev,
934 xsdo->drawable, &xsdo->surfInfo,
940 int wx = xsdo->surfInfo.window.lox;
941 int wy = xsdo->surfInfo.window.loy;
942 pRasInfo->bounds.x1 = xsdo->surfInfo.visible.lox - wx;
943 pRasInfo->bounds.y1 = xsdo->surfInfo.visible.loy - wy;
944 pRasInfo->bounds.x2 = xsdo->surfInfo.visible.hix - wx;
945 pRasInfo->bounds.y2 = xsdo->surfInfo.visible.hiy - wy;
948 xsdo->dgaAvailable = JNI_FALSE;
953 int scan = xsdo->surfInfo.surfaceScan;
954 int wx = xsdo->surfInfo.window.lox;
955 int wy = xsdo->surfInfo.window.loy;
957 (void *)(((uintptr_t) xsdo->surfInfo.basePtr) + (scan*wy + wx) * mult);
963 if (xsdo->shmPMData.xRequestSent == JNI_TRUE) {
967 xsdo->shmPMData.xRequestSent = JNI_FALSE;
971 pRasInfo->rasBase = xsdo->shmPMData.shmSegInfo->shmaddr;
974 pRasInfo->scanStride = xsdo->shmPMData.bytesPerLine;
983 xpriv->img = X11SD_GetImage(env, xsdo, &pRasInfo->bounds, lockFlags);
1006 pRasInfo->lutBase = (jint *) xsdo->cData->awt_icmLUT;
1007 pRasInfo->lutSize = xsdo->cData->awt_numICMcolors;
1013 pRasInfo->invColorTable = xsdo->cData->img_clr_tbl;
1014 pRasInfo->redErrTable = xsdo->cData->img_oda_red;
1015 pRasInfo->grnErrTable = xsdo->cData->img_oda_green;
1016 pRasInfo->bluErrTable = xsdo->cData->img_oda_blue;
1024 pRasInfo->invGrayTable = xsdo->cData->pGrayInverseLutData;
1034 X11SDOps *xsdo = (X11SDOps *) ops;
1038 (*pJDgaInfo->pReleaseLock)(env, xsdo->dgaDev, xsdo->drawable);
1047 Drawable drawable = xsdo->drawable;
1048 GC xgc = xsdo->cachedGC;
1050 xsdo->cachedGC = xgc =
1057 if (xsdo->depth > 16) {
1058 X11SD_SwapBytes(xsdo, xpriv->img, xsdo->depth,
1059 xsdo->configData->awtImage->wsImageFormat.bits_per_pixel);
1072 if (xsdo->shmPMData.usingShmPixmap) {
1073 xsdo->shmPMData.xRequestSent = JNI_TRUE;
1080 (*pJDgaInfo->pXRequestSent)(env, xsdo->dgaDev, drawable);
1087 xsdo->isBgInitialized = JNI_FALSE;
1095 X11SDOps *xsdo)
1102 Widget w = xsdo->widget;
1125 Window window = (Window)(xsdo->drawable); /* is always a Window */
1143 x2 = x1 + DisplayWidth(awt_display, xsdo->configData->awt_visInfo.screen);
1144 y2 = y1 + DisplayHeight(awt_display, xsdo->configData->awt_visInfo.screen);
1168 X11SD_FindClip(SurfaceDataBounds *b, SurfaceDataBounds *bounds, X11SDOps *xsdo)
1185 child_widget = xsdo->widget;
1186 current_widget = XtParent(xsdo->widget);
1257 X11SD_SwapBytes(X11SDOps *xsdo, XImage * img, int depth, int bpp) {
1286 if (xsdo->configData->awt_visInfo.red_mask == 0xff) {
1322 static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
1330 int depth = xsdo->depth;
1331 int mult = xsdo->configData->pixelStride;
1342 if (xsdo->isPixmap) {
1344 X11SD_PuntPixmap(xsdo, w, h);
1346 maxWidth = xsdo->pmWidth;
1347 maxHeight = xsdo->pmHeight;
1351 (Window) xsdo->drawable, &winAttr) != 0) {
1366 img = X11SD_GetSharedImage(xsdo, w, h, maxWidth, maxHeight, readBits);
1369 drawable = xsdo->drawable;
1391 xsdo->configData->awt_visInfo.visual,
1404 if (xsdo->isPixmap == JNI_FALSE &&
1405 X11SD_ClipToRoot(&temp, bounds, xsdo)) {
1415 if (X11SD_FindClip(&temp, bounds, xsdo)) {
1448 X11SD_SwapBytes(xsdo, img, depth,
1449 xsdo->configData->awtImage->wsImageFormat.bits_per_pixel);
1461 xsdo->configData->awt_visInfo.visual,
1553 X11SD_DirectRenderNotify(JNIEnv *env, X11SDOps *xsdo)
1556 if (xsdo->shmPMData.usingShmPixmap) {
1557 xsdo->shmPMData.xRequestSent = JNI_TRUE;
1560 (*pJDgaInfo->pXRequestSent)(env, xsdo->dgaDev, xsdo->drawable);
1574 X11SD_GetPixmapWithBg(JNIEnv *env, X11SDOps *xsdo, jint pixel)
1578 if (xsdo->invalid) {
1585 if (xsdo->bitmask == 0) {
1588 return xsdo->drawable;
1593 if (xsdo->isBgInitialized == JNI_FALSE || xsdo->bgPixel != pixel) {
1597 if (xsdo->drawable == 0) {
1602 bmGC = XCreateGC(awt_display, xsdo->bitmask, 0, NULL);
1611 XFillRectangle(awt_display, xsdo->bitmask, bmGC,
1612 0, 0, xsdo->pmWidth, xsdo->pmHeight);
1614 srcGC = XCreateGC(awt_display, xsdo->drawable, 0L, NULL);
1622 XSetClipMask(awt_display, srcGC, xsdo->bitmask);
1624 XFillRectangle(awt_display, xsdo->drawable, srcGC,
1625 0, 0, xsdo->pmWidth, xsdo->pmHeight);
1628 XFillRectangle(awt_display, xsdo->bitmask, bmGC,
1629 0, 0, xsdo->pmWidth, xsdo->pmHeight);
1633 xsdo->bgPixel = pixel;
1634 xsdo->isBgInitialized = JNI_TRUE;
1637 return xsdo->drawable;
1641 X11SD_ReleasePixmapWithBg(JNIEnv *env, X11SDOps *xsdo)
1644 if (xsdo->shmPMData.usingShmPixmap) {
1645 xsdo->shmPMData.xRequestSent = JNI_TRUE;
1664 X11SDOps *xsdo;
1668 xsdo = (X11SDOps *) pXSData;
1669 if (xsdo == NULL) {
1673 xsdo->javaGC = XCreateGC(awt_display, xsdo->drawable, 0, NULL);
1674 ret = (jlong) xsdo->javaGC;