aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph/ui/layout
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-22 05:53:34 +0100
committerSven Göthel <[email protected]>2024-01-22 05:53:34 +0100
commita883f3e2e1563736df32573141fd5119f0678c92 (patch)
tree647dd5b5ec8fcd236406a27ed38d68eda0de5c7a /src/graphui/classes/com/jogamp/graph/ui/layout
parentffe4e670c9d35121934c6f3c95067d9c18aee386 (diff)
Bug 1490 - GraphUI Group: Resolve Performance Issues with Shape Mv Transform -> PMVMatrix4f
Shape.setTransformMv() is called for each renderer frame and for each shape, involving 6 Matrix4f.mul() and set*() operations. Since mutation of shape's position, rotation or scale is less frequent than rendering one frame (for all shapes), it is more efficient to maintain a local Matrix4f and update it on such single mutations. Rendering then only needs to perform one Matrix4f.mul() operation using this internal matrix. +++ Also changes name from setTransformMv(PMVMatrix4f) to applyMatToMv(PMVMatrix4f), as its name might be misleading.
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/layout')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java2
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java b/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java
index bed4b33eb..bd939f37e 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/layout/BoxLayout.java
@@ -182,7 +182,7 @@ public class BoxLayout implements Group.Layout {
// measure size
pmv.pushMv();
- s.setTransformMv(pmv);
+ s.applyMatToMv(pmv);
s.getBounds().transform(pmv.getMv(), sbox);
pmv.popMv();
diff --git a/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java b/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java
index 43358529a..e77f51aad 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java
@@ -208,7 +208,7 @@ public class GridLayout implements Group.Layout {
final Shape s = shapes.get(i);
// measure size
pmv.pushMv();
- s.setTransformMv(pmv);
+ s.applyMatToMv(pmv);
final AABBox sbox = s.getBounds().transform(pmv.getMv(), new AABBox());
pmv.popMv();