From d7cb4a77b71cb3703ff7ac0667c5a97f29a5bdb4 Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Mon, 15 Jan 2024 04:47:34 +0100 Subject: Graph/GraphUI AA-Quality (shader): Region: Add DEFAULT_AA_QUALITY and clipping funs for aaQuality/sampleCount; TextRegionUtil: Pass quality parameter in draw-functions Region.DEFAULT_AA_QUALITY defaults to MAX_AA_QUALITY still - TODO: AA shader is subject to change .. Region.draw(..) clips the quality param (save) TextRegionUtil: Pass quality parameter in draw-functions - Allowing to select the AA shader GraphUI Scene and some demos add the AA-quality param to the status line or screenshot-filename. - See Region.getRenderModeString(..) +++ TestTextRendererNEWT20 and TestTextRendererNEWT21 now iterate through all fonts, AA-quality shader and sample-sizes. Most demos and some more tests take AA-quality into acount, demos via CommandlineOptions.graphAAQuality --- .../classes/com/jogamp/graph/ui/GraphShape.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/graphui/classes/com/jogamp/graph/ui/GraphShape.java') diff --git a/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java b/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java index 1e00d72f7..65363fa2b 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java @@ -58,7 +58,7 @@ public abstract class GraphShape extends Shape { protected int pass2TexUnit = GLRegion.DEFAULT_TWO_PASS_TEXTURE_UNIT; protected GLRegion region = null; protected float oshapeSharpness = OutlineShape.DEFAULT_SHARPNESS; - private int regionPass2Quality = Region.MAX_AA_QUALITY; + private int regionPass2Quality = Region.DEFAULT_AA_QUALITY; private final List dirtyRegions = new ArrayList(); /** @@ -87,16 +87,22 @@ public abstract class GraphShape extends Shape { public final int getRenderModes() { return renderModes; } /** - * Sets the shape's Graph {@link Region}'s pass2 AA-quality parameter. Default is {@link Region#MAX_AA_QUALITY}. - * @param q Graph {@link Region}'s pass2 AA-quality parameter, default is {@link Region#MAX_AA_QUALITY}. + * Sets the shape's Graph {@link Region}'s pass2 AA-quality parameter. Default is {@link Region#DEFAULT_AA_QUALITY}. + * @param v Graph {@link Region}'s pass2 AA-quality parameter, default is {@link Region#DEFAULT_AA_QUALITY}. * @return this shape for chaining. */ - public final GraphShape setAAQuality(final int q) { - this.regionPass2Quality = q; + public final GraphShape setAAQuality(final int v) { + this.regionPass2Quality = Region.clipAAQuality(v); markStateDirty(); return this; } + /** + * Return the shape's Graph {@link Region}'s quality parameter. + * @see #setAAQuality(int) + */ + public final int getAAQuality() { return regionPass2Quality; } + /** Set the 2nd pass texture unit. */ public void setTextureUnit(final int pass2TexUnit) { this.pass2TexUnit = pass2TexUnit; @@ -105,12 +111,6 @@ public abstract class GraphShape extends Shape { } } - /** - * Return the shape's Graph {@link Region}'s quality parameter. - * @see #setAAQuality(int) - */ - public final int getAAQuality() { return regionPass2Quality; } - /** * Sets the shape's Graph {@link OutlineShape}'s sharpness parameter. Default is {@link OutlineShape#DEFAULT_SHARPNESS}. * @@ -228,7 +228,7 @@ public abstract class GraphShape extends Shape { } @Override - protected final void validateImpl(final GLProfile glp, final GL2ES2 gl) { + protected final void validateImpl(final GL2ES2 gl, final GLProfile glp) { if( null != gl ) { clearDirtyRegions(gl); } -- cgit v1.2.3