< prev index next >

src/java.desktop/windows/classes/sun/java2d/windows/GDIWindowSurfaceData.java

Print this page




 299         return mgr.getReplacementScreenSurface(peer, this);
 300     }
 301 
 302     public Rectangle getBounds() {
 303         Rectangle r = peer.getBounds();
 304         r.x = r.y = 0;
 305         r.width = (int) Math.ceil(r.width * scaleX);
 306         r.height = (int) Math.ceil(r.height * scaleY);
 307         return r;
 308     }
 309 
 310     public boolean copyArea(SunGraphics2D sg2d,
 311                             int x, int y, int w, int h, int dx, int dy)
 312     {
 313         CompositeType comptype = sg2d.imageComp;
 314         if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE &&
 315             sg2d.clipState != SunGraphics2D.CLIP_SHAPE &&
 316             (CompositeType.SrcOverNoEa.equals(comptype) ||
 317              CompositeType.SrcNoEa.equals(comptype)))
 318         {
 319             x += sg2d.transX;
 320             y += sg2d.transY;
 321             int dstx1 = x + dx;
 322             int dsty1 = y + dy;
 323             int dstx2 = dstx1 + w;
 324             int dsty2 = dsty1 + h;
 325             Region clip = sg2d.getCompClip();
 326             if (dstx1 < clip.getLoX()) dstx1 = clip.getLoX();
 327             if (dsty1 < clip.getLoY()) dsty1 = clip.getLoY();
 328             if (dstx2 > clip.getHiX()) dstx2 = clip.getHiX();
 329             if (dsty2 > clip.getHiY()) dsty2 = clip.getHiY();
 330             if (dstx1 < dstx2 && dsty1 < dsty2) {
 331                 gdiPipe.devCopyArea(this, dstx1 - dx, dsty1 - dy,
 332                                     dx, dy,
 333                                     dstx2 - dstx1, dsty2 - dsty1);
 334             }
 335             return true;
 336         }
 337         return false;
 338     }
 339 
 340     private native void invalidateSD();




 299         return mgr.getReplacementScreenSurface(peer, this);
 300     }
 301 
 302     public Rectangle getBounds() {
 303         Rectangle r = peer.getBounds();
 304         r.x = r.y = 0;
 305         r.width = (int) Math.ceil(r.width * scaleX);
 306         r.height = (int) Math.ceil(r.height * scaleY);
 307         return r;
 308     }
 309 
 310     public boolean copyArea(SunGraphics2D sg2d,
 311                             int x, int y, int w, int h, int dx, int dy)
 312     {
 313         CompositeType comptype = sg2d.imageComp;
 314         if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE &&
 315             sg2d.clipState != SunGraphics2D.CLIP_SHAPE &&
 316             (CompositeType.SrcOverNoEa.equals(comptype) ||
 317              CompositeType.SrcNoEa.equals(comptype)))
 318         {


 319             int dstx1 = x + dx;
 320             int dsty1 = y + dy;
 321             int dstx2 = dstx1 + w;
 322             int dsty2 = dsty1 + h;
 323             Region clip = sg2d.getCompClip();
 324             if (dstx1 < clip.getLoX()) dstx1 = clip.getLoX();
 325             if (dsty1 < clip.getLoY()) dsty1 = clip.getLoY();
 326             if (dstx2 > clip.getHiX()) dstx2 = clip.getHiX();
 327             if (dsty2 > clip.getHiY()) dsty2 = clip.getHiY();
 328             if (dstx1 < dstx2 && dsty1 < dsty2) {
 329                 gdiPipe.devCopyArea(this, dstx1 - dx, dsty1 - dy,
 330                                     dx, dy,
 331                                     dstx2 - dstx1, dsty2 - dsty1);
 332             }
 333             return true;
 334         }
 335         return false;
 336     }
 337 
 338     private native void invalidateSD();


< prev index next >