< prev index next >
src/java.desktop/share/classes/sun/awt/image/SurfaceManager.java
Print this page
*** 288,305 ****
flush(true);
}
}
/**
! * Returns a scale factor of the image. This is utility method, which
! * fetches information from the SurfaceData of the image.
*
! * @see SurfaceData#getDefaultScale
*/
! public static int getImageScale(final Image img) {
if (!(img instanceof VolatileImage)) {
return 1;
}
final SurfaceManager sm = getManager(img);
! return sm.getPrimarySurfaceData().getDefaultScale();
}
}
--- 288,319 ----
flush(true);
}
}
/**
! * Returns a horizontal scale factor of the image. This is utility method,
! * which fetches information from the SurfaceData of the image.
*
! * @see SurfaceData#getDefaultScaleX
*/
! public static double getImageScaleX(final Image img) {
if (!(img instanceof VolatileImage)) {
return 1;
}
final SurfaceManager sm = getManager(img);
! return sm.getPrimarySurfaceData().getDefaultScaleX();
! }
!
! /**
! * Returns a vertical scale factor of the image. This is utility method,
! * which fetches information from the SurfaceData of the image.
! *
! * @see SurfaceData#getDefaultScaleY
! */
! public static double getImageScaleY(final Image img) {
! if (!(img instanceof VolatileImage)) {
! return 1;
! }
! final SurfaceManager sm = getManager(img);
! return sm.getPrimarySurfaceData().getDefaultScaleY();
}
}
< prev index next >