< prev index next >

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

Print this page




 248         return; // Does not intersect with root window
 249     }
 250 
 251     gboolean gtk_failed = TRUE;
 252     jint _x, _y;
 253 
 254     jint x = MAX(sx, attr.x);
 255     jint y = MAX(sy, attr.y);
 256     jint width = MIN(sx + swidth, attr.x + attr.width) - x;
 257     jint height = MIN(sy + sheight, attr.y + attr.height) - y;
 258 
 259 
 260     int dx = attr.x > sx ? attr.x - sx : 0;
 261     int dy = attr.y > sy ? attr.y - sy : 0;
 262 
 263     int index;
 264 
 265     if (isGtkSupported) {
 266         gtk->gdk_threads_enter();
 267         gtk_failed = gtk->get_drawable_data(env, pixelArray, x, y, width,
 268                                             jwidth, height, dx, dy, scale);
 269         gtk->gdk_threads_leave();
 270     }
 271 
 272     if (gtk_failed) {
 273         image = getWindowImage(awt_display, rootWindow, sx, sy, swidth, sheight);
 274 
 275         ary = (*env)->GetPrimitiveArrayCritical(env, pixelArray, NULL);
 276 
 277         if (!ary) {
 278             XDestroyImage(image);
 279             AWT_UNLOCK();
 280             return;
 281         }
 282 
 283         dx /= scale;
 284         dy /= scale;
 285         width /= scale;
 286         height /= scale;
 287 
 288         /* convert to Java ARGB pixels */




 248         return; // Does not intersect with root window
 249     }
 250 
 251     gboolean gtk_failed = TRUE;
 252     jint _x, _y;
 253 
 254     jint x = MAX(sx, attr.x);
 255     jint y = MAX(sy, attr.y);
 256     jint width = MIN(sx + swidth, attr.x + attr.width) - x;
 257     jint height = MIN(sy + sheight, attr.y + attr.height) - y;
 258 
 259 
 260     int dx = attr.x > sx ? attr.x - sx : 0;
 261     int dy = attr.y > sy ? attr.y - sy : 0;
 262 
 263     int index;
 264 
 265     if (isGtkSupported) {
 266         gtk->gdk_threads_enter();
 267         gtk_failed = gtk->get_drawable_data(env, pixelArray, x, y, width,
 268                                             height, jwidth, dx, dy, scale);
 269         gtk->gdk_threads_leave();
 270     }
 271 
 272     if (gtk_failed) {
 273         image = getWindowImage(awt_display, rootWindow, sx, sy, swidth, sheight);
 274 
 275         ary = (*env)->GetPrimitiveArrayCritical(env, pixelArray, NULL);
 276 
 277         if (!ary) {
 278             XDestroyImage(image);
 279             AWT_UNLOCK();
 280             return;
 281         }
 282 
 283         dx /= scale;
 284         dy /= scale;
 285         width /= scale;
 286         height /= scale;
 287 
 288         /* convert to Java ARGB pixels */


< prev index next >