< prev index next >

src/java.desktop/unix/native/common/java2d/x11/X11PMBlitLoops.c

Print this page


   1 /*
   2  * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  43     SurfaceDataBounds span, srcBounds;
  44     RegionData clipInfo;
  45     GC xgc;
  46 
  47     if (width <= 0 || height <= 0) {
  48         return;
  49     }
  50 
  51     srcXsdo = (X11SDOps *)jlong_to_ptr(srcData);
  52     if (srcXsdo == NULL) {
  53         return;
  54     }
  55     dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
  56     if (dstXsdo == NULL) {
  57         return;
  58     }
  59     if (Region_GetInfo(env, clip, &clipInfo)) {
  60         return;
  61     }
  62 
  63     xgc = (GC)gc;
  64     if (xgc == NULL) {
  65         return;
  66     }
  67 
  68 #ifdef MITSHM
  69     if (srcXsdo->isPixmap) {
  70         X11SD_UnPuntPixmap(srcXsdo);
  71     }
  72 #endif /* MITSHM */
  73 
  74     /* clip the source rect to the source pixmap's dimensions */
  75     srcBounds.x1 = srcx;
  76     srcBounds.y1 = srcy;
  77     srcBounds.x2 = srcx + width;
  78     srcBounds.y2 = srcy + height;
  79     SurfaceData_IntersectBoundsXYXY(&srcBounds,
  80                                     0, 0, srcXsdo->pmWidth, srcXsdo->pmHeight);
  81     span.x1 = dstx;
  82     span.y1 = dsty;
  83     span.x2 = dstx + width;


 134 {
 135 #ifndef HEADLESS
 136     X11SDOps *srcXsdo, *dstXsdo;
 137     GC dstGC;
 138     SurfaceDataBounds dstBounds, srcBounds;
 139     Drawable srcDrawable;
 140 
 141     if (width <= 0 || height <= 0) {
 142         return;
 143     }
 144 
 145     srcXsdo = (X11SDOps *)jlong_to_ptr(srcData);
 146     if (srcXsdo == NULL) {
 147         return;
 148     }
 149     dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
 150     if (dstXsdo == NULL) {
 151         return;
 152     }
 153 
 154     dstGC = (GC)xgc;
 155     if (dstGC == NULL) {
 156         return;
 157     }
 158 
 159 #ifdef MITSHM
 160     if (srcXsdo->isPixmap) {
 161         X11SD_UnPuntPixmap(srcXsdo);
 162     }
 163 #endif /* MITSHM */
 164 
 165     srcDrawable = srcXsdo->GetPixmapWithBg(env, srcXsdo, pixel);
 166     if (srcDrawable == 0) {
 167         return;
 168     }
 169 
 170     /* clip the source rect to the source pixmap's dimensions */
 171     srcBounds.x1 = srcx;
 172     srcBounds.y1 = srcy;
 173     srcBounds.x2 = srcx + width;
 174     srcBounds.y2 = srcy + height;


   1 /*
   2  * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  43     SurfaceDataBounds span, srcBounds;
  44     RegionData clipInfo;
  45     GC xgc;
  46 
  47     if (width <= 0 || height <= 0) {
  48         return;
  49     }
  50 
  51     srcXsdo = (X11SDOps *)jlong_to_ptr(srcData);
  52     if (srcXsdo == NULL) {
  53         return;
  54     }
  55     dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
  56     if (dstXsdo == NULL) {
  57         return;
  58     }
  59     if (Region_GetInfo(env, clip, &clipInfo)) {
  60         return;
  61     }
  62 
  63     xgc = (GC) jlong_to_ptr(gc);
  64     if (xgc == NULL) {
  65         return;
  66     }
  67 
  68 #ifdef MITSHM
  69     if (srcXsdo->isPixmap) {
  70         X11SD_UnPuntPixmap(srcXsdo);
  71     }
  72 #endif /* MITSHM */
  73 
  74     /* clip the source rect to the source pixmap's dimensions */
  75     srcBounds.x1 = srcx;
  76     srcBounds.y1 = srcy;
  77     srcBounds.x2 = srcx + width;
  78     srcBounds.y2 = srcy + height;
  79     SurfaceData_IntersectBoundsXYXY(&srcBounds,
  80                                     0, 0, srcXsdo->pmWidth, srcXsdo->pmHeight);
  81     span.x1 = dstx;
  82     span.y1 = dsty;
  83     span.x2 = dstx + width;


 134 {
 135 #ifndef HEADLESS
 136     X11SDOps *srcXsdo, *dstXsdo;
 137     GC dstGC;
 138     SurfaceDataBounds dstBounds, srcBounds;
 139     Drawable srcDrawable;
 140 
 141     if (width <= 0 || height <= 0) {
 142         return;
 143     }
 144 
 145     srcXsdo = (X11SDOps *)jlong_to_ptr(srcData);
 146     if (srcXsdo == NULL) {
 147         return;
 148     }
 149     dstXsdo = (X11SDOps *)jlong_to_ptr(dstData);
 150     if (dstXsdo == NULL) {
 151         return;
 152     }
 153 
 154     dstGC = (GC) jlong_to_ptr(xgc);
 155     if (dstGC == NULL) {
 156         return;
 157     }
 158 
 159 #ifdef MITSHM
 160     if (srcXsdo->isPixmap) {
 161         X11SD_UnPuntPixmap(srcXsdo);
 162     }
 163 #endif /* MITSHM */
 164 
 165     srcDrawable = srcXsdo->GetPixmapWithBg(env, srcXsdo, pixel);
 166     if (srcDrawable == 0) {
 167         return;
 168     }
 169 
 170     /* clip the source rect to the source pixmap's dimensions */
 171     srcBounds.x1 = srcx;
 172     srcBounds.y1 = srcy;
 173     srcBounds.x2 = srcx + width;
 174     srcBounds.y2 = srcy + height;


< prev index next >