modules/graphics/src/main/java/com/sun/glass/ui/Application.java
Print this page
*** 619,645 ****
return new MenuItem(title, callback, shortcutKey, shortcutModifiers, pixels);
}
public abstract Pixels createPixels(int width, int height, ByteBuffer data);
public abstract Pixels createPixels(int width, int height, IntBuffer data);
! public abstract Pixels createPixels(int width, int height, IntBuffer data, float scale);
protected abstract int staticPixels_getNativeFormat();
/* utility method called from native code */
! static Pixels createPixels(int width, int height, int[] data, float scale) {
! return Application.GetApplication().createPixels(width, height, IntBuffer.wrap(data), scale);
}
/* utility method called from native code */
static float getScaleFactor(final int x, final int y, final int w, final int h) {
float scale = 0.0f;
// Find the maximum scale for screens this area overlaps
for (Screen s : Screen.getScreens()) {
final int sx = s.getX(), sy = s.getY(), sw = s.getWidth(), sh = s.getHeight();
if (x < (sx + sw) && (x + w) > sx && y < (sy + sh) && (y + h) > sy) {
! if (scale < s.getRenderScale()) {
! scale = s.getRenderScale();
}
}
}
return scale == 0.0f ? 1.0f : scale;
}
--- 619,648 ----
return new MenuItem(title, callback, shortcutKey, shortcutModifiers, pixels);
}
public abstract Pixels createPixels(int width, int height, ByteBuffer data);
public abstract Pixels createPixels(int width, int height, IntBuffer data);
! public abstract Pixels createPixels(int width, int height, IntBuffer data, float scalex, float scaley);
protected abstract int staticPixels_getNativeFormat();
/* utility method called from native code */
! static Pixels createPixels(int width, int height, int[] data, float scalex, float scaley) {
! return Application.GetApplication().createPixels(width, height, IntBuffer.wrap(data), scalex, scaley);
}
/* utility method called from native code */
static float getScaleFactor(final int x, final int y, final int w, final int h) {
float scale = 0.0f;
// Find the maximum scale for screens this area overlaps
for (Screen s : Screen.getScreens()) {
final int sx = s.getX(), sy = s.getY(), sw = s.getWidth(), sh = s.getHeight();
if (x < (sx + sw) && (x + w) > sx && y < (sy + sh) && (y + h) > sy) {
! if (scale < s.getRecommendedOutputScaleX()) {
! scale = s.getRecommendedOutputScaleX();
! }
! if (scale < s.getRecommendedOutputScaleY()) {
! scale = s.getRecommendedOutputScaleY();
}
}
}
return scale == 0.0f ? 1.0f : scale;
}