< prev index next >

src/java.desktop/share/classes/sun/awt/image/VolatileSurfaceManager.java

Print this page

        

*** 23,44 **** * questions. */ package sun.awt.image; - import java.awt.Color; import java.awt.Graphics; import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.ImageCapabilities; import java.awt.image.BufferedImage; import java.awt.image.VolatileImage; import sun.awt.DisplayChangedListener; - import sun.awt.image.SunVolatileImage; import sun.java2d.SunGraphicsEnvironment; import sun.java2d.SurfaceData; - import sun.java2d.loops.CompositeType; import static sun.java2d.pipe.hw.AccelSurface.*; /** * This SurfaceManager variant manages an accelerated volatile surface, if it * is possible to create that surface. If there is limited accelerated --- 23,42 ---- * questions. */ package sun.awt.image; import java.awt.Graphics; import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.ImageCapabilities; + import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.awt.image.VolatileImage; import sun.awt.DisplayChangedListener; import sun.java2d.SunGraphicsEnvironment; import sun.java2d.SurfaceData; import static sun.java2d.pipe.hw.AccelSurface.*; /** * This SurfaceManager variant manages an accelerated volatile surface, if it * is possible to create that surface. If there is limited accelerated
*** 258,273 **** * cannot be allocated. This allows apps to at least run, * albeit more slowly than they would otherwise. */ protected SurfaceData getBackupSurface() { if (sdBackup == null) { ! BufferedImage bImg = vImg.getBackupImage(); // Sabotage the acceleration capabilities of the BufImg surface SunWritableRaster.stealTrackable(bImg .getRaster() .getDataBuffer()).setUntrackable(); ! sdBackup = BufImgSurfaceData.createData(bImg); } return sdBackup; } /** --- 256,275 ---- * cannot be allocated. This allows apps to at least run, * albeit more slowly than they would otherwise. */ protected SurfaceData getBackupSurface() { if (sdBackup == null) { ! GraphicsConfiguration gc = vImg.getGraphicsConfig(); ! AffineTransform tx = gc.getDefaultTransform(); ! double scaleX = tx.getScaleX(); ! double scaleY = tx.getScaleY(); ! BufferedImage bImg = vImg.getBackupImage(scaleX, scaleY); // Sabotage the acceleration capabilities of the BufImg surface SunWritableRaster.stealTrackable(bImg .getRaster() .getDataBuffer()).setUntrackable(); ! sdBackup = BufImgSurfaceData.createData(bImg, scaleX, scaleY); } return sdBackup; } /**
< prev index next >