From c04c8947c7cd0788ea8a4e615887d236eb2fbbb8 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 19 Mar 2023 07:47:18 +0100 Subject: Graph Scene: RegionRenderer is owned and never null --- .../classes/com/jogamp/graph/ui/gl/Scene.java | 24 ++++++---------------- 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src/graphui') diff --git a/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java index f095783c9..9c9334182 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java +++ b/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java @@ -177,18 +177,10 @@ public final class Scene implements GLEventListener { public RegionRenderer getRenderer() { return renderer; } /** Returns the associated RegionRenderer's RenderState, may be null. */ - public RenderState getRenderState() { - if( null != renderer ) { - return renderer.getRenderState(); - } - return null; - } - public final Vertex.Factory getVertexFactory() { - if( null != renderer ) { - return renderer.getRenderState().getVertexFactory(); - } - return null; - } + public RenderState getRenderState() { return renderer.getRenderState(); } + + public final Vertex.Factory getVertexFactory() { return renderer.getRenderState().getVertexFactory(); } + /** * Sets the clear parameter for {@link GL#glClearColor(float, float, float, float) glClearColor(..)} and {@link GL#glClear(int) glClear(..)} * to be issued at {@link #display(GLAutoDrawable)}. @@ -281,9 +273,7 @@ public final class Scene implements GLEventListener { public void init(final GLAutoDrawable drawable) { System.err.println("SceneUIController: init"); cDrawable = drawable; - if( null != renderer ) { - renderer.init(drawable.getGL().getGL2ES2()); - } + renderer.init(drawable.getGL().getGL2ES2()); } private static Comparator shapeZAscComparator = new Comparator() { @@ -543,9 +533,7 @@ public final class Scene implements GLEventListener { } shapes.clear(); cDrawable = null; - if( null != renderer ) { - renderer.destroy(gl); - } + renderer.destroy(gl); } /** -- cgit v1.2.3