From 900c35c6a49e0d53e38dd07da709bf81e28abd3e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 15 May 2023 06:47:22 +0200 Subject: HiDPI: Revise AWT GLCanvas/GLJPanel ScalableSurface: No setSurfaceScale(), have AWT toolkit define pixelScale only (simplification) This aligns with Glenn's initial AWT patch commit e5e7514d649cd7dd28bbb8e04b72338dc09c2c83, i.e. removing redundancies... Tested on Linux, Windows and MacOS w/ GLCanvas, GLJPanel and GLWindow using pixelScale values: - Linux: 1, 2 - Windows: 1, 1.25, 2 - MacOS: 1, 2 --- src/newt/classes/com/jogamp/newt/Window.java | 2 +- src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 9 +++++++++ src/newt/classes/jogamp/newt/WindowImpl.java | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src/newt') diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java index 60ed53c9f..47c03557e 100644 --- a/src/newt/classes/com/jogamp/newt/Window.java +++ b/src/newt/classes/com/jogamp/newt/Window.java @@ -1,5 +1,5 @@ /** - * Copyright 2010 JogAmp Community. All rights reserved. + * Copyright 2010-2023 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 1435aa20a..cbac22e26 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -482,6 +482,15 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind return window.convertToPixelUnits(windowUnitsAndResult); } + /** + * {@inheritDoc} + *

+ * This implementation returns true, i.e. supporting manual change of pixel-scale. + *

+ */ + @Override + public final boolean canSetSurfaceScale() { return true; } + @Override public final boolean setSurfaceScale(final float[] pixelScale) { return window.setSurfaceScale(pixelScale); diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 0a8bc0e63..a19218ead 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -2694,6 +2694,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer return hasPixelScale[1]; } + /** + * {@inheritDoc} + *

+ * This implementation returns true, i.e. supporting manual change of pixel-scale. + *

+ */ + @Override + public final boolean canSetSurfaceScale() { return true; } + /** * {@inheritDoc} */ -- cgit v1.2.3