diff options
author | Sven Göthel <[email protected]> | 2024-01-16 05:02:24 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-16 05:02:24 +0100 |
commit | 6b1979992a7da2573c420ce3eb22f35abcbd35b7 (patch) | |
tree | 5786a3286a773ccc3082977e1888c13b3f481dc9 /src/graphui/classes/com/jogamp/graph/ui | |
parent | 33ec9480da3d414a4c973607970afa06b5ed79ca (diff) |
Graph/GraphUI AA-Quality + SampleCount (shader): Push params down to RegionRenderer's RenderState usually rarely set from top of user API, reducing complexity.
Discussion:
Alternative was to pass AA-Quality same as SampleCount from the top (e.g. GraphUI Scene),
however, this convolutes the API even more.
Both parameter modify the resulting shader code in pass2 rendering (only).
The used 'renderMode' is still maintained within the Region,
since it contains more dynamic states individual to each Region instance (color-texture, ..).
This despite 'renderMode' also changes the RenderState's shader program.
In the end, it really doesn't matter and is a choice of frequency - the pipeline is
usually rendering from on OpenGL rendering thread sequentially.
AA-Quality and SampleCount simply usually don't change that often
and are set only once.
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui')
11 files changed, 71 insertions, 128 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/AnimGroup.java b/src/graphui/classes/com/jogamp/graph/ui/AnimGroup.java index 2c733f1fc..01e9f0611 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/AnimGroup.java +++ b/src/graphui/classes/com/jogamp/graph/ui/AnimGroup.java @@ -510,7 +510,7 @@ public class AnimGroup extends Group { } ); } - /** Sets whether {@link #tick()} shall be automatic issued on {@link #draw(GL2ES2, RegionRenderer, int[])}, default is {@code true}. */ + /** Sets whether {@link #tick()} shall be automatic issued on {@link #draw(GL2ES2, RegionRenderer)}, default is {@code true}. */ public final void setTickOnDraw(final boolean v) { tickOnDraw = v; } public final boolean getTickOnDraw() { return tickOnDraw; } @@ -539,11 +539,11 @@ public class AnimGroup extends Group { public final boolean getTickPaused() { return tickPaused; } @Override - public void draw(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) { + public void draw(final GL2ES2 gl, final RegionRenderer renderer) { if( tickOnDraw && !tickPaused) { tickImpl(); } - super.draw(gl, renderer, sampleCount); + super.draw(gl, renderer); } public final void resetAnimation() { @@ -575,7 +575,7 @@ public class AnimGroup extends Group { } /** - * Issues an animation tick, usually done at {@link #draw(GL2ES2, RegionRenderer, int[])}. + * Issues an animation tick, usually done at {@link #draw(GL2ES2, RegionRenderer)}. * @see #setTickOnDraw(boolean) * @see #setTickPaused(boolean) */ diff --git a/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java b/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java index 65363fa2b..6f3b7bb71 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java @@ -58,7 +58,6 @@ 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.DEFAULT_AA_QUALITY; private final List<GLRegion> dirtyRegions = new ArrayList<GLRegion>(); /** @@ -86,23 +85,6 @@ 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#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 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; @@ -164,14 +146,14 @@ public abstract class GraphShape extends Shape { } @Override - protected final void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount, final Vec4f rgba) { + protected final void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final Vec4f rgba) { renderer.setColorStatic(rgba); - region.draw(gl, renderer, regionPass2Quality, sampleCount); + region.draw(gl, renderer); } @Override - protected final void drawToSelectImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) { - region.draw(gl, renderer, 0, sampleCount); + protected final void drawToSelectImpl0(final GL2ES2 gl, final RegionRenderer renderer) { + region.drawToSelect(gl, renderer); } /** diff --git a/src/graphui/classes/com/jogamp/graph/ui/Group.java b/src/graphui/classes/com/jogamp/graph/ui/Group.java index 765bc229a..a4451501a 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Group.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Group.java @@ -126,7 +126,7 @@ public class Group extends Shape implements Container { /** * Enable {@link AABBox} clipping on {@link #getBounds()} for this group and its shapes as follows * <ul> - * <li>Discard {@link Shape} {@link #draw(GL2ES2, RegionRenderer, int[]) rendering} if completely outside of {@code clip-box*cullingScale}.</li> + * <li>Discard {@link Shape} {@link #draw(GL2ES2, RegionRenderer) rendering} if completely outside of {@code clip-box*cullingScale}.</li> * <li>Otherwise perform pixel-accurate clipping inside the shader within [{@code clip-box} .. {@code clip-box*cullingScale}].</li> * <li>If {@code clip-box} >= {@code clip-box*cullingScale} for all axis, no pixel-accurate clipping is performed as shapes are culled before.</li> * </ul> @@ -134,7 +134,7 @@ public class Group extends Shape implements Container { * {@link #setClipBBox(AABBox)} takes precedence over {@link #setClipOnBounds(boolean)}. * </p> * @param v boolean to toggle clipping - * @param cullingScale culling scale factor per axis for the {@code clip-box} to discard {@link #draw(GL2ES2, RegionRenderer, int[]) rendering} completely, + * @param cullingScale culling scale factor per axis for the {@code clip-box} to discard {@link #draw(GL2ES2, RegionRenderer) rendering} completely, * should be {@code >= 1} for each axis. * @return this instance for chaining * @see #setClipBBox(AABBox) @@ -146,7 +146,7 @@ public class Group extends Shape implements Container { /** * Enable {@link AABBox} clipping on explicit given pre-multiplied Mv-matrix {@code clip-box} as follows * <ul> - * <li>Discard {@link Shape} {@link #draw(GL2ES2, RegionRenderer, int[]) rendering} if completely outside of {@code clip-box*cullingScale}.</li> + * <li>Discard {@link Shape} {@link #draw(GL2ES2, RegionRenderer) rendering} if completely outside of {@code clip-box*cullingScale}.</li> * <li>Otherwise perform pixel-accurate clipping inside the shader within [{@code clip-box} .. {@code clip-box*cullingScale}].</li> * <li>If {@code clip-box} >= {@code clip-box*cullingScale} for all axis, no pixel-accurate clipping is performed as shapes are culled before.</li> * </ul> @@ -154,7 +154,7 @@ public class Group extends Shape implements Container { * {@link #setClipBBox(AABBox)} takes precedence over {@link #setClipOnBounds(boolean)}. * </p> * @param v {@link AABBox} pre-multiplied Mv-matrix - * @param cullingScale culling scale factor per axis for the {@code clip-box} to discard {@link #draw(GL2ES2, RegionRenderer, int[]) rendering} completely, + * @param cullingScale culling scale factor per axis for the {@code clip-box} to discard {@link #draw(GL2ES2, RegionRenderer) rendering} completely, * should be {@code >= 1} for each axis. * @return this instance for chaining * @see #setClipOnBounds(boolean) @@ -283,7 +283,7 @@ public class Group extends Shape implements Container { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override - protected void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount, final Vec4f rgba) { + protected void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final Vec4f rgba) { final PMVMatrix4f pmv = renderer.getMatrix(); final Object[] shapesS = shapes.toArray(); Arrays.sort(shapesS, (Comparator)Shape.ZAscendingComparator); @@ -309,7 +309,7 @@ public class Group extends Shape implements Container { if( clipBox.contains( childBox.transform(pmv.getMv(), tempBB0) ) && ( !doFrustumCulling || !pmv.getFrustum().isAABBoxOutside( childBox ) ) ) { - shape.draw(gl, renderer, sampleCount); + shape.draw(gl, renderer); } pmv.popMv(); } @@ -323,14 +323,14 @@ public class Group extends Shape implements Container { pmv.pushMv(); shape.setTransformMv(pmv); if( !doFrustumCulling || !pmv.getFrustum().isAABBoxOutside( shape.getBounds() ) ) { - shape.draw(gl, renderer, sampleCount); + shape.draw(gl, renderer); } pmv.popMv(); } } } if( null != border ) { - border.draw(gl, renderer, sampleCount); + border.draw(gl, renderer); } } private final AABBox tempBB0 = new AABBox(); // OK, synchronized @@ -338,7 +338,7 @@ public class Group extends Shape implements Container { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override - protected final void drawToSelectImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) { + protected final void drawToSelectImpl0(final GL2ES2 gl, final RegionRenderer renderer) { final PMVMatrix4f pmv = renderer.getMatrix(); final Object[] shapesS = shapes.toArray(); Arrays.sort(shapesS, (Comparator)Shape.ZAscendingComparator); @@ -351,13 +351,13 @@ public class Group extends Shape implements Container { shape.setTransformMv(pmv); if( !doFrustumCulling || !pmv.getFrustum().isAABBoxOutside( shape.getBounds() ) ) { - shape.drawToSelect(gl, renderer, sampleCount); + shape.drawToSelect(gl, renderer); } pmv.popMv(); } } if( null != border ) { - border.drawToSelect(gl, renderer, sampleCount); + border.drawToSelect(gl, renderer); } } diff --git a/src/graphui/classes/com/jogamp/graph/ui/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/Scene.java index d41378251..3541473ea 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Scene.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Scene.java @@ -137,9 +137,6 @@ public final class Scene implements Container, GLEventListener { private final RegionRenderer renderer; - private final int[] sampleCount = new int[1]; - private int globalAAQuality = -1; // undefined - /** Describing the bounding box in shape's object model-coordinates of the near-plane parallel at its scene-distance, post {@link #translate(PMVMatrix4f)} */ private final AABBox planeBox = new AABBox(0f, 0f, 0f, 0f, 0f, 0f); @@ -160,37 +157,38 @@ public final class Scene implements Container, GLEventListener { /** * Create a new scene with an internally created {@link RegionRenderer}, a graph AA sample-count 4 and using {@link DefaultPMVMatrixSetup#DefaultPMVMatrixSetup()}. - * @see #Scene(RegionRenderer, int) + * @see #Scene(RegionRenderer) * @see #setSampleCount(int) + * @see #setAAQuality(int) */ public Scene() { - this(createRenderer(), 4); + this( createRenderer() ); } /** * Create a new scene with an internally created {@link RegionRenderer}, using {@link DefaultPMVMatrixSetup#DefaultPMVMatrixSetup()}. * @param sampleCount sample count for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT}, * clipped to [{@link Region#MIN_AA_SAMPLE_COUNT}..{@link Region#MAX_AA_SAMPLE_COUNT}] - * @see #Scene(RegionRenderer, int) + * @see #Scene(RegionRenderer) * @see #setSampleCount(int) + * @see #setAAQuality(int) */ public Scene(final int sampleCount) { - this(createRenderer(), sampleCount); + this( createRenderer() ); + this.getRenderer().setSampleCount(sampleCount); } /** * Create a new scene taking ownership of the given RegionRenderer, using {@link DefaultPMVMatrixSetup#DefaultPMVMatrixSetup()}. * @param renderer {@link RegionRenderer} to be owned - * @param sampleCount sample count for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT}, - * clipped to [{@link Region#MIN_AA_SAMPLE_COUNT}..{@link Region#MAX_AA_SAMPLE_COUNT}] * @see #setSampleCount(int) + * @see #setAAQuality(int) */ - public Scene(final RegionRenderer renderer, final int sampleCount) { + public Scene(final RegionRenderer renderer) { if( null == renderer ) { throw new IllegalArgumentException("Null RegionRenderer"); } this.renderer = renderer; - this.sampleCount[0] = Region.clipAASampleCount(sampleCount); this.screenshot = new GLReadBufferUtil(false, false); } @@ -360,44 +358,28 @@ public final class Scene implements Container, GLEventListener { return null; } - /** Returns sample count for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT} */ - public int getSampleCount() { return sampleCount[0]; } - + /** Returns {@link RegionRenderer#getSampleCount()}. */ + public int getSampleCount() { return renderer.getSampleCount(); } /** - * Sets pass2 AA sample count for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT} or {@link Region#MSAA_RENDERING_BIT} - * @param v pass2 AA sample count, clipped to [{@link Region#MIN_AA_SAMPLE_COUNT}..{@link Region#MAX_AA_SAMPLE_COUNT}] + * Sets {@link RegionRenderer#setSampleCount(int)} * @return clipped and set value */ - public int setSampleCount(final int v) { - sampleCount[0] = Region.clipAASampleCount(v); - markStatesDirty(); - return sampleCount[0]; - } + public int setSampleCount(final int v) { return renderer.setSampleCount(v); /* markStatesDirty() -> autodetected within GLRegion.draw(..) */ } + /** Returns {@link RegionRenderer#getAAQuality()}. */ + public int getAAQuality() { return renderer.getAAQuality(); } /** - * Sets pass2 AA-quality for Graph Region AA {@link Region#getRenderModes() render-modes}: {@link Region#VBAA_RENDERING_BIT} - * @param v pass2 AA-quality, clipped to [{@link Region#MIN_AA_QUALITY}..{@link Region#MAX_AA_QUALITY}] + * Sets {@link RegionRenderer#setAAQuality(int)}. * @return clipped and set value */ - public void setAAQuality(final int v) { - final int q = Region.clipAAQuality(v); - globalAAQuality = q; - forAll((final Shape s) -> { - if( s instanceof GraphShape ) { - ((GraphShape)s).setAAQuality(q); - } - return false; - }); - } - /** Returns the global AA quality value if set via {@link #setAAQuality(int)}, otherwise {@code -1}. */ - public int getAAQuality() { return globalAAQuality; } + public int setAAQuality(final int v) { return renderer.setAAQuality(v); /* markStatesDirty() -> autodetected within GLRegion.draw(..) */ } public void setSharpness(final float sharpness) { forAll((final Shape s) -> { if( s instanceof GraphShape ) { ((GraphShape)s).setSharpness(sharpness); } - return false; + return false; }); } public void markShapesDirty() { @@ -481,18 +463,13 @@ public final class Scene implements Container, GLEventListener { display(drawable, shapesS); } - private static final int[] sampleCountGLSelect = { -1 }; - private void display(final GLAutoDrawable drawable, final Object[] shapes) { final GL2ES2 gl = drawable.getGL().getGL2ES2(); - final int[] sampleCount0; if( null != clearColor ) { gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); gl.glClear(clearMask); } - sampleCount0 = sampleCount; - final PMVMatrix4f pmv = renderer.getMatrix(); renderer.enable(gl, true); @@ -505,7 +482,7 @@ public final class Scene implements Container, GLEventListener { shape.setTransformMv(pmv); if( !doFrustumCulling || !pmv.getFrustum().isAABBoxOutside( shape.getBounds() ) ) { - shape.draw(gl, renderer, sampleCount0); + shape.draw(gl, renderer); } pmv.popMv(); } @@ -527,9 +504,7 @@ public final class Scene implements Container, GLEventListener { private void displayGLSelect(final GLAutoDrawable drawable, final Object[] shapes) { final GL2ES2 gl = drawable.getGL().getGL2ES2(); - final int[] sampleCount0; gl.glClearColor(0f, 0f, 0f, 1f); - sampleCount0 = sampleCountGLSelect; gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); final PMVMatrix4f pmv = renderer.getMatrix(); @@ -548,7 +523,7 @@ public final class Scene implements Container, GLEventListener { // FIXME // System.err.printf("drawGL: color %f, index %d of [0..%d[%n", color, i, shapeCount); renderer.setColorStatic(color, color, color, 1f); - shape.drawToSelect(gl, renderer, sampleCount0); + shape.drawToSelect(gl, renderer); } pmv.popMv(); } @@ -1269,11 +1244,10 @@ public final class Scene implements Container, GLEventListener { * Return a formatted status string containing avg fps and avg frame duration. * @param glad GLAutoDrawable instance for FPSCounter, its chosen GLCapabilities and its GL's swap-interval * @param renderModes render modes for {@link Region#getRenderModeString(int, int, int, int)} - * @param quality the Graph-Curve quality setting or -1 to be ignored * @param dpi the monitor's DPI (vertical preferred) * @return formatted status string */ - public String getStatusText(final GLAutoDrawable glad, final int renderModes, final int quality, final float dpi) { + public String getStatusText(final GLAutoDrawable glad, final int renderModes, final float dpi) { final FPSCounter fpsCounter = glad.getAnimator(); final float lfps, tfps, td; if( null != fpsCounter ) { @@ -1286,7 +1260,7 @@ public final class Scene implements Container, GLEventListener { td = 0f; } final GLCapabilitiesImmutable caps = glad.getChosenGLCapabilities(); - final String modeS = Region.getRenderModeString(renderModes, quality, getSampleCount(), caps.getNumSamples()); + final String modeS = Region.getRenderModeString(renderModes, getAAQuality(), getSampleCount(), caps.getNumSamples()); final String blendStr; if( getRenderer().isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED) ) { blendStr = ", blend"; @@ -1296,16 +1270,6 @@ public final class Scene implements Container, GLEventListener { return String.format("%03.1f/%03.1f fps, %.1f ms/f, vsync %d, dpi %.1f, %s%s, a %d", lfps, tfps, td, glad.getGL().getSwapInterval(), dpi, modeS, blendStr, caps.getAlphaBits()); } - /** - * Return a formatted status string containing avg fps and avg frame duration using {@link #getAAQuality()} - * @param glad GLAutoDrawable instance for FPSCounter, its chosen GLCapabilities and its GL's swap-interval - * @param renderModes render modes for {@link Region#getRenderModeString(int, int, int, int)} - * @param dpi the monitor's DPI (vertical preferred) - * @return formatted status string - */ - public String getStatusText(final GLAutoDrawable glad, final int renderModes, final float dpi) { - return getStatusText(glad, renderModes, globalAAQuality, dpi); - } /** * Return a formatted status string containing avg fps and avg frame duration. @@ -1340,7 +1304,7 @@ public final class Scene implements Container, GLEventListener { final String dir2 = ( null != dir && dir.length() > 0 ) ? dir : ""; final String prefix2 = ( null != prefix && prefix.length() > 0 ) ? prefix+"-" : ""; final RegionRenderer renderer = getRenderer(); - final String modeS = Region.getRenderModeString(renderModes, globalAAQuality, getSampleCount(), caps.getNumSamples()); + final String modeS = Region.getRenderModeString(renderModes, getAAQuality(), getSampleCount(), caps.getNumSamples()); final String contentDetail2 = ( null != contentDetail && contentDetail.length() > 0 ) ? contentDetail+"-" : ""; return new File( String.format((Locale)null, "%s%s%s-%ssnap%02d-%04dx%04d.png", dir2, prefix2, modeS, contentDetail2, diff --git a/src/graphui/classes/com/jogamp/graph/ui/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/Shape.java index eaca76236..b48163753 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Shape.java @@ -415,7 +415,7 @@ public abstract class Shape { * Set a user one-shot initializer callback. * <p> * {@link ListenerBool#run(Shape)} will be called - * after each {@link #draw(GL2ES2, RegionRenderer, int[])} + * after each {@link #draw(GL2ES2, RegionRenderer)} * until it returns true, signaling user initialization is completed. * </p> * @param l callback, which shall return true signaling user initialization is done @@ -588,7 +588,7 @@ public abstract class Shape { public final Vec3f getScale() { return scale; } /** - * Marks the shape dirty, causing next {@link #draw(GL2ES2, RegionRenderer, int[]) draw()} + * Marks the shape dirty, causing next {@link #draw(GL2ES2, RegionRenderer) draw()} * to recreate the Graph shape and reset the region. */ public final void markShapeDirty() { @@ -598,7 +598,7 @@ public abstract class Shape { } /** - * Marks the rendering state dirty, causing next {@link #draw(GL2ES2, RegionRenderer, int[]) draw()} + * Marks the rendering state dirty, causing next {@link #draw(GL2ES2, RegionRenderer) draw()} * to notify the Graph region to reselect shader and repaint potentially used FBOs. */ public final void markStateDirty() { @@ -634,7 +634,7 @@ public abstract class Shape { * The returned {@link AABBox} will cover the unscaled shape * as well as its optional {@link #getPadding()} and optional {@link #getBorderThickness()}. * - * The returned {@link AABBox} is only valid after an initial call to {@link #draw(GL2ES2, RegionRenderer, int[]) draw(..)} + * The returned {@link AABBox} is only valid after an initial call to {@link #draw(GL2ES2, RegionRenderer) draw(..)} * or {@link #validate(GL2ES2)}. * * @see #getBounds(GLProfile) @@ -647,7 +647,7 @@ public abstract class Shape { * The returned width will cover the scaled shape * as well as its optional scaled {@link #getPadding()} and optional scaled {@link #getBorderThickness()}. * - * The returned width is only valid after an initial call to {@link #draw(GL2ES2, RegionRenderer, int[]) draw(..)} + * The returned width is only valid after an initial call to {@link #draw(GL2ES2, RegionRenderer) draw(..)} * or {@link #validate(GL2ES2)}. * * @see #getBounds() @@ -662,7 +662,7 @@ public abstract class Shape { * The returned height will cover the scaled shape * as well as its optional scaled {@link #getPadding()} and optional scaled {@link #getBorderThickness()}. * - * The returned height is only valid after an initial call to {@link #draw(GL2ES2, RegionRenderer, int[]) draw(..)} + * The returned height is only valid after an initial call to {@link #draw(GL2ES2, RegionRenderer) draw(..)} * or {@link #validate(GL2ES2)}. * * @see #getBounds() @@ -679,7 +679,7 @@ public abstract class Shape { * Returns the unscaled bounding {@link AABBox} for this shape. * * This variant differs from {@link #getBounds()} as it - * returns a valid {@link AABBox} even before {@link #draw(GL2ES2, RegionRenderer, int[]) draw(..)} + * returns a valid {@link AABBox} even before {@link #draw(GL2ES2, RegionRenderer) draw(..)} * and having an OpenGL instance available. * * @see #getBounds() @@ -690,10 +690,10 @@ public abstract class Shape { } /** Experimental selection draw command used by {@link Scene}. */ - public void drawToSelect(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) { + public void drawToSelect(final GL2ES2 gl, final RegionRenderer renderer) { synchronized ( dirtySync ) { validate(gl); - drawToSelectImpl0(gl, renderer, sampleCount); + drawToSelectImpl0(gl, renderer); } } @@ -704,9 +704,8 @@ public abstract class Shape { * </p> * @param gl the current GL object * @param renderer {@link RegionRenderer} which might be used for Graph Curve Rendering, also source of {@link RegionRenderer#getMatrix()} and {@link RegionRenderer#getViewport()}. - * @param sampleCount sample count if used by Graph renderModes */ - public void draw(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) { + public void draw(final GL2ES2 gl, final RegionRenderer renderer) { final boolean isPressed = isPressed(), isToggleOn = isToggleOn(); final Vec4f rgba; if( hasColorChannel() ) { @@ -737,7 +736,7 @@ public abstract class Shape { } synchronized ( dirtySync ) { validate(gl); - drawImpl0(gl, renderer, sampleCount, rgba); + drawImpl0(gl, renderer, rgba); } if( null != onInitListener ) { if( onInitListener.run(this) ) { @@ -1954,21 +1953,19 @@ public abstract class Shape { protected abstract void validateImpl(final GL2ES2 gl, final GLProfile glp); /** - * Actual draw implementation, called by {@link #draw(GL2ES2, RegionRenderer, int[])} + * Actual draw implementation, called by {@link #draw(GL2ES2, RegionRenderer)} * @param gl * @param renderer - * @param sampleCount * @param rgba */ - protected abstract void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount, Vec4f rgba); + protected abstract void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final Vec4f rgba); /** - * Actual draw implementation, called by {@link #drawToSelect(GL2ES2, RegionRenderer, int[])} + * Actual draw implementation, called by {@link #drawToSelect(GL2ES2, RegionRenderer)} * @param gl * @param renderer - * @param sampleCount */ - protected abstract void drawToSelectImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount); + protected abstract void drawToSelectImpl0(final GL2ES2 gl, final RegionRenderer renderer); /** Custom {@link #clear(GL2ES2, RegionRenderer)} task, called 1st. */ protected abstract void clearImpl0(final GL2ES2 gl, final RegionRenderer renderer); @@ -1978,9 +1975,9 @@ public abstract class Shape { /** * Returns true if implementation uses an extra color channel or texture - * which will be modulated with the passed rgba color {@link #drawImpl0(GL2ES2, RegionRenderer, int[], float[])}. + * which will be modulated with the passed rgba color {@link #drawImpl0(GL2ES2, RegionRenderer, float[])}. * - * Otherwise the base color will be modulated and passed to {@link #drawImpl0(GL2ES2, RegionRenderer, int[], float[])}. + * Otherwise the base color will be modulated and passed to {@link #drawImpl0(GL2ES2, RegionRenderer, float[])}. */ public abstract boolean hasColorChannel(); diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java index 635da98ce..afe54216b 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java @@ -169,12 +169,12 @@ public class Button extends BaseButton { public CharSequence getText() { return labelNow.getText(); } @Override - public void draw(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) { + public void draw(final GL2ES2 gl, final RegionRenderer renderer) { // No need to setup an poly offset for z-fighting, using one region now // Setup poly offset for z-fighting // gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); // gl.glPolygonOffset(0f, 1f); - super.draw(gl, renderer, sampleCount); + super.draw(gl, renderer); // gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); } diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java index d5a192456..c0d911646 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java @@ -103,7 +103,7 @@ public class GLButton extends TexSeqButton { } @Override - public void draw(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) { + public void draw(final GL2ES2 gl, final RegionRenderer renderer) { final int[/*2*/] surfaceSize = getSurfaceSize(renderer.getMatrix(), renderer.getViewport(), new int[2]); final boolean got_sz = null != surfaceSize && 0 < surfaceSize[0] && 0 < surfaceSize[1]; @@ -172,7 +172,7 @@ public class GLButton extends TexSeqButton { fboGLAD.display(); } - super.draw(gl, renderer, sampleCount); + super.draw(gl, renderer); if( animateGLEL ) { markStateDirty(); // keep on going diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/ImageButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/ImageButton.java index d8c79d8e7..a6c5bda34 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/ImageButton.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/ImageButton.java @@ -67,8 +67,8 @@ public class ImageButton extends TexSeqButton { } @Override - public void draw(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) { - super.draw(gl, renderer, sampleCount); + public void draw(final GL2ES2 gl, final RegionRenderer renderer) { + super.draw(gl, renderer); if( !((ImageSequence)texSeq).getManualStepping() ) { markStateDirty(); // keep on going } diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/Label.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/Label.java index 06e82d659..9301a840a 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/Label.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/Label.java @@ -87,7 +87,7 @@ public class Label extends GraphShape { } /** - * Set the text to be rendered. Shape update is pending until next {@link #draw(GL2ES2, RegionRenderer, int[])} or {@link #validate(GL2ES2)}. + * Set the text to be rendered. Shape update is pending until next {@link #draw(GL2ES2, RegionRenderer)} or {@link #validate(GL2ES2)}. * @param text the text to be set. * @return true if text has been updated, false if unchanged. */ diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java index 248887e90..543248746 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java @@ -137,7 +137,7 @@ public class MediaButton extends TexSeqButton { volatile boolean resetGL = true; @Override - public void draw(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) { + public void draw(final GL2ES2 gl, final RegionRenderer renderer) { final GLMediaPlayer mPlayer = (GLMediaPlayer)texSeq; if( resetGL ) { resetGL = false; @@ -150,7 +150,7 @@ public class MediaButton extends TexSeqButton { e.printStackTrace(); } } - super.draw(gl, renderer, sampleCount); + super.draw(gl, renderer); markStateDirty(); // keep on going }; diff --git a/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java b/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java index 8f68a99fc..8336a7631 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java +++ b/src/graphui/classes/com/jogamp/graph/ui/widgets/RangedGroup.java @@ -86,7 +86,7 @@ public class RangedGroup extends Widget { * @param content the {@link Group} with content to view * @param contentSize the fixed size of the clipped content to view, i.e. page-size * @param cullingScale culling scale factor per axis for the {@code clip-box} to discard - * {@link #draw(GL2ES2, RegionRenderer, int[]) rendering} completely outside of {@code clip-box*cullingScale}. + * {@link #draw(GL2ES2, RegionRenderer) rendering} completely outside of {@code clip-box*cullingScale}. * Pixel-accurate clipping is applied within [{@code clip-box} .. {@code clip-box*cullingScale}] if any scale-axis of {@code cullingScale} > 1. * See {@link Group#setClipBBox(AABBox, Vec3f)}. * @param horizSliderParam optional horizontal slider parameters, null for none @@ -169,12 +169,12 @@ public class RangedGroup extends Widget { } } @Override - protected void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount, final Vec4f rgba) { + protected void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final Vec4f rgba) { if( content.isVisible() ) { // Mv pre-multiplied AABBox, clippedContent is on same PMV final AABBox clipBBox = clippedContent.getBounds().transform(renderer.getMatrix().getMv(), tempBB); content.setClipBBox(clipBBox, clipCullingScale); - super.drawImpl0(gl, renderer, sampleCount, rgba); + super.drawImpl0(gl, renderer, rgba); content.setClipBBox(null, clipCullingScale); } } |