summaryrefslogtreecommitdiffstats
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
* Clock: Use Clock.currentNanos() instead of System.nanoTime(); Enhancing ↵Sven Gothel2023-03-075-49/+97
| | | | | | FPSCounterImpl accuracy by maintaining timestamps in [ns] Idea: Perhaps we want to use [ns] for FPSCounter's method types by now?
* Graph Perf Counter: Use GlueGen's Clock.currentNanos() to ease on ↵Sven Gothel2023-03-071-70/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performance-hit measuring performance. This was mostly notable on a Raspberry-Pi 4 arm64, where perfromance degragated around 3x using high-freq counter. Using our well determined Clock.currentNanos() removes this overhead, back to 'easy measuring' and having a well defined 'currentNanos()' since module start. TestTextRendererNEWT00 can enable Region and Font perf-counter w/ '-perf', w/o it only uses its own counter and hence reduce the high-freq burden (64% perf win on raspi4). +++ Below numbers show that Region.addOutlineShape() perhaps needs a little performance work to allow long text to be processed in 'real time' on embedded platform. Hower, usually we cache the Region for long text and can have at least one liner to be renderer within 60fps fast, i.e. Region produced in ~26ms for a 81 char line instead of ~130ms for 664 chars. +++ Raspberry Pi 4b, OpenJDK17, Debian 11: Using current medium sized text_1 w/ 664 chars, w/o '-perf' and after having passed 40 frames, we have following durations: - process the OutlineShape -> Region: 129ms (text) - Render the Region: 53ms Startup Times: - loading GlueGen - loading test 0 [ms] - loading GlueGen - start test 1,910 [ms] - loading test - start test 1,910 [ms] - loading test - gl 2,631 [ms] - loading test - graph 2,636 [ms] - loading test - txt 2,844 [ms] - loading test - draw 3,062 [ms] Perf .. 1 / 1: Perf Launch: Total: graph 5, txt 207, draw 218, txt+draw 425 [ms] 1 / 1: Perf Launch: PerLoop: graph 5,505,740, txt 207,530,736, draw 218,393,680, txt+draw 425,924,416 [ns] 20 / 20: Perf Frame20: Total: graph 16, txt 376, draw 281, txt+draw 657 [ms] 20 / 20: Perf Frame20: PerLoop: graph 807,055, txt 18,820,824, draw 14,075,146, txt+draw 32,895,970 [ns] 20 / 40: Perf Frame40: Total: graph 3, txt 129, draw 53, txt+draw 182 [ms] 20 / 40: Perf Frame40: PerLoop: graph 176,670, txt 6,451,330, draw 2,658,217, txt+draw 9,109,547 [ns] +++ On a modern desktop (~2y old), GNU/Linux Debian 11, AMD GPU on Mesa3D: Using current medium sized text_1 w/ 664 chars, w/o '-perf' and after having passed 40 frames, we have following durations: - process the OutlineShape -> Region: 42ms (text) - Render the Region: 5ms Startup Times: - loading GlueGen - loading test 0 [ms] - loading GlueGen - start test 310 [ms] - loading test - start test 309 [ms] - loading test - gl 459 [ms] - loading test - graph 460 [ms] - loading test - txt 490 [ms] - loading test - draw 506 [ms] Perf .. 1 / 1: Perf Launch: Total: graph 1, txt 29, draw 15, txt+draw 45 [ms] 1 / 1: Perf Launch: PerLoop: graph 1,191,096, txt 29,868,436, draw 15,519,445, txt+draw 45,387,881 [ns] 20 / 20: Perf Frame20: Total: graph 240, txt 68, draw 21, txt+draw 89 [ms] 20 / 20: Perf Frame20: PerLoop: graph 12,045,651, txt 3,415,402, draw 1,069,348, txt+draw 4,484,750 [ns] 20 / 40: Perf Frame40: Total: graph 283, txt 42, draw 5, txt+draw 47 [ms] 20 / 40: Perf Frame40: PerLoop: graph 14,152,395, txt 2,116,114, draw 265,292, txt+draw 2,381,406 [ns]
* Adapt to GlueGen dropping Platform.currentTimeMicros(), use ↵Sven Gothel2023-03-062-22/+26
| | | | Platform.currentTimeMillis()
* Graph: Use PerfCounterCtrl interface and Instant/Duration & ↵Sven Gothel2023-03-061-65/+77
| | | | Clock.getMonotonicTime() ...
* TestTextRendererNEWT00: Add '-perf' mode using new perf counter, testing on ↵Sven Gothel2023-03-061-25/+162
| | | | PC and raspi-aarch64 ..
* NEWT Screen: Allow injection of global (single) monitor size in [mm] via ↵Sven Gothel2023-03-051-0/+3
| | | | | | | | newt.ws.mmwidth and newt.ws.mmheight property This is essential on bare-metal devices where the screen DRM/GBM driver does not provide the screen-size (in mm). Otherwise we would have resolution/(size_mm=0) infinity density and none of our graph font demos would work, as we compute pixel-em-size based using dpi and pixel-pt-size.
* Movie* Demos: Add screenshots w/ 'S' key; Cleanup screenshot filename ↵Sven Gothel2023-02-255-16/+80
| | | | creation in other demos.
* Graph Region: Address overflow issue using GL2ES3 integer indices (WIP...); ↵Sven Gothel2023-02-2423-132/+143
| | | | | | | | | | | | | | | Ease GLArrayData* buffer growth. Using integer indices, i.e. GL_UNSIGNED_INT, requires us to pass a GLProfile 'hint' to the GLRegion ctor. Region.max_indices is computed in this regard and used in Region.addOutlineShape(). TODO: If exceeding max_indices, the code path needs some work. Buffer growth is eased via GLArrayData using its golden growth ratio and manually triggering growth before processing all triangles in Region.addOutlineShape(). +++ TextRegionUtil static drawText() won't clear passed Region anymore, caller has to do this if so intended.
* GLArrayData*: Shorten methods (*API Change*), use proper constructor and ↵Sven Gothel2023-02-245-5/+5
| | | | | | | | | | | | | finalize immutables, add growthFactor (default golden ratio 1.618), add getCapacity*() and printStats(..) The growthFactor becomes essential for better growth behavior and can be set via setGrowthFactor(). The other changes were merely to clean up the GLArrayData interface and its 4 implementations. Not great to change its API, but one name was misleading ['getComponentCount' -> 'getCompsPerEleme'], so overall .. readability is enhanced. Motivation for this change was the performance analysis and improvement of our Graph Curve Renderer.
* Graph UI: Update demos, move pure demo code from demos/ui -> demos, rename ↵Sven Gothel2023-02-2312-129/+1431
| | | | test-shapes
* Graph: Update demos ..Sven Gothel2023-02-196-120/+177
|
* Graph Font.Metrics: Use unchanges sign of (+) ascent, (-) descent and (+) ↵Sven Gothel2023-02-192-3/+288
| | | | lineGap, document them properly and fix Font.getLineHeightFU()
* Graph Overflow Bug: Reorder TestTextRendererNEWT* tests from simple to ↵Sven Gothel2023-02-175-790/+805
| | | | complex example code, ascending
* Graph UI: Fix UIShape's PMVMatrix handling of getSurfaceSize, objToWinCoord ↵Sven Gothel2023-02-175-22/+67
| | | | and winToObjCoord (expect all set, no doubling); GLEventListenerButton: Resize FBO to screen-size for proper 1:1 quality
* Graph RoundButton: setDimension -> setSizeSven Gothel2023-02-171-1/+1
|
* Graph GPUUISceneGLListener0A: Prep for reshape_resize, notch up relative ↵Sven Gothel2023-02-171-40/+88
| | | | sizes a little
* Graph Demos: Formatting ..Sven Gothel2023-02-173-85/+82
| | | | GPUUISceneGLListener0A: Formatting and move reshape() after init()
* TestTextRendererNEWT01: Drop unused importSven Gothel2023-02-171-1/+0
|
* Graph: Fix Loop.initFromPolyline()'s Winding determination, document Winding ↵Sven Gothel2023-02-175-43/+403
| | | | | | | | | | | | | | | | | | | | | | | rules for OutlineShape and add get/setWinding in Outline Loop.initFromPolyline()'s Winding determination used a 3-point triangle-area method, which is insufficent for complex shapes like serif 'g' or 'æ'. Solved by using the whole area over the Outline shape. Note: Loop.initFromPolyline()'s Winding determination is used to convert the inner shape or holes to CW only. Therefor the outter bondary shapes must be CCW. This details has been documented within OutlineShape, anchor 'windingrules'. Since the conversion of 'CCW -> CW' for inner shapes or holes is covered, a safe user path would be to completely create CCW shapes. However, this has not been hardcoded and is left to the user. Impact: Fixes rendering serif 'g' or 'æ'. The enhanced unit test TestTextRendererNEWT01 produces snapshots for all fonts within FontSet01. While it shows proper rendering of the single Glyphs it exposes another Region/Curve Renderer bug, i.e. sort-of a Region overflow crossing over from the box-end to the start.
* Graph Font: Enhance API doc (source of values), better get*Bounds() names, ↵Sven Gothel2023-02-161-1/+1
| | | | dropping redundant getMetricWidth*(); Fix getMetricBoundsFU()
* Graph Unit Tests: General cleanup, adding UITypeDemo01 w/ TestObject* to ↵Sven Gothel2023-02-169-52/+1400
| | | | determine CurveRenderer issues
* Graph UI: Move methods SceneUIController to UIShape public providing ↵Sven Gothel2023-02-164-172/+444
| | | | | | | | | | win<->obj coord transformation, enhance documentation a little, Have win<->obj coord transformation in UIShape public: - Move SceneUIController.transformShape() -> UIShape.setTransform() - Move SceneUIController.windowToShapeCoordsImpl() -> UIShape.winToObjCoord() - Add UIShape.objToWinCoord() - Add UIShape.getSurfaceSize()
* Graph: Merge UIListener01 + UINewtDemo01 -> UIShapeDemo01 to have simple ↵Sven Gothel2023-02-162-97/+0
| | | | test cases
* Graph: TextRegionUtil: Make addStringToRegion(..) versatile/usable w/ ↵Sven Gothel2023-02-152-45/+22
| | | | optional AffineTransform (see Label0)
* Graph TextRegionUtil: Move ShapeVisitor to OutlineShape.Visitor and ↵Sven Gothel2023-02-154-16/+9
| | | | | | | | | | processString(..) to Font, cleaning up .. Further having Font.processString() return the AABBox of the whole string's 'laidout' OutlineShapes, which is used for (debug) Font.getPointsBounds2(..) just to validate the coordinated with the Glyph based AABBox of Font.getPointsBounds(..). Static TextRegionUtil.drawString(..) no more require to pass the temp AffineTransform instances (ugly).
* Graph Font: getGlyph(char symbol -> int glyph_id), add kerning to ↵Sven Gothel2023-02-141-2/+2
| | | | getPointsBoundsFU(); Glyph: Drop getSymbol()
* Graph OutlineShape: Path2F alike sub-path ctor: Add z coordinate for custom ↵Sven Gothel2023-02-142-36/+35
| | | | plane.
* Graph Type Rendering: Drop pixelSize and use font em-size [0..1] throughout ↵Sven Gothel2023-02-1316-207/+196
| | | | | | | | | system. - All pixelSize metrics methods are dropped in Font* - TypecastGlyph.Advance dropped, i.e. dropping prescales glyph advance based on pixelSize - TextRegionUtil produces OutlineShape in font em-size [0..1] added to GLRegion - Adjusted demos
* Graph font/typecast: Adopt to our Typecast updates (see below); Fix kerning; ↵Sven Gothel2023-02-1210-164/+246
| | | | | | | | | Use TestTextRendererNEWT01 to produce validation snaps - Move kerning handling from Font to Font.Glyph using binary-search for right-glyph-id on kerning subset from this instance (left) - TextRegionUtil: Kerning must be added before translation as it applies before the current right-glyph. - TestTextRendererNEWT01 produces validation snapshots against LibreOffice print-preview snapshots - GPUTextRendererListenerBase01 added another text for kerning validation, show more font-size details (pt, px, mm)
* Font/Graph, {Font, Glyph}/Typecast: Add kerning and expose values in ↵Sven Gothel2023-02-1015-93/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | original font-units (FU) to have them scaled later ( fu * pixelScale / unitsPerEM ) Scaling from font-units (funits, or FU) is now performed by the renderer itself, i.e. applying the scale-factor 'fontPixelSize / font.getMetrics().getUnitsPerEM()' to the PMV matrix to render the whole graph GLRegion. This finally provides proper device and resolution independent font utilization. Further, preliminary kerning has been added. +++ Also ... TypecastFont: - getGlyphID(..) getGlyph(..) enforce symbol mapping to Glyph.ID_SPACE Glyph.ID_CR, as some fonts ave an erroneous cmap (FreeSerif-Regular) - add getKerning(..) TODO: Add binary search - Set TypecastFont.USE_PRESCALED_ADVANCE := false, i.e. dropping all prescaled pixel-sized advance values mapped to font pixel-size as we utilize font-units only for later uniform scaling. - Drop virtual getPixelSize() and add static FontScale.toPixels(..) - Add fullString() for debugging purposed, including some font tables
* Graph: Path2D -> self-contained Path2D (w/ Iterator) fixed; OutlineShape: ↵Sven Gothel2023-02-065-19/+360
| | | | | | Add Path2F addPath(..), emphasize required Winding.CW GPURegionGLListener01 used by TestRegionRendererNEWT01 covers Path2F CCW and CW (reverse add) methods.
* Graph: Fix Region/Text Renderer: Add RegionRenderer enable/disable for ↵Sven Gothel2023-02-053-0/+11
| | | | blending stubs in display (Mesa3D results are otherwise broken)
* Graph: TestTextRendererNEWT01: No VBAA sample-count on MSAA test, fixed ↵Sven Gothel2023-02-051-6/+13
| | | | window size 1024x640
* Graph: TestTextRendererNEWT00: Alin w/ other tests, add DEPTH_TEST and allow ↵Sven Gothel2023-02-051-2/+13
| | | | custom window size
* Graph: Complete move jogamp.graph.plane to public com.jogamp.graph.planeSven Gothel2023-02-043-8/+3
|
* NEWT Soft-PixelScale (p7): get{Global->}PixelScaleEnv(..): Support per ↵v2.4.0Sven Gothel2023-01-311-2/+4
| | | | | | | | | | | | | | | | | monitor values w/ QT_SCREEN_SCALE_FACTORS syntax, use for X11 Per-monitor values are parsed if value is not a float and stored in a given Map<String,float[2]>, parallel to a detected global_pixel_scale_xy. The per-monitor value syntax matches QT_SCREEN_SCALE_FACTORS, i.e. the regular expression '(<string>=<float>;)+', e.g. QT_SCREEN_SCALE_FACTORS='DP-1=1.25;DP-2=1.25;HDMI-1=1.25;' The per-monitor value is preferred and on X11 stored within the MonitorDevice, matching the MonitorDevice's name. The following env-var names are searched on X11: "QT_SCREEN_SCALE_FACTORS", "QT_SCALE_FACTOR", "GDK_SCALE", "SOFT_SCALE"
* NEWT Soft-PixelScale (p6): Implement Soft-PixelScale for X11 and Windows ... ↵Sven Gothel2023-01-313-6/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (working state) Both: - Using Soft-PixelScale mode, i.e. converting all given window-units to pixel-units for native GDI/X11 ops - Using scaled pixel-sized surface - Adjusting NEWT's Monitor's window-unit viewport value to pixel-scale For X11: - Using global scale factor from environment variable, either: "GDK_SCALE", "QT_SCALE_FACTOR" or "SOFT_SCALE". The latter is for testing only. See https://wiki.archlinux.org/title/HiDPI For Windows: - Using actual monitor's pixel-scale via native SHC API (Shellscaling API, shcore.dll) Misc: - SurfaceScaleUtils.getGlobalPixelScaleEnv() reads a float value from given env names, first come, first serve - MonitorModeProps.streamInMonitorDevice(..): Add `invscale_wuviewport` argument to scale wuvieport for soft-pixel-scale - TestGearsNEWT: Enhance GL2 demo to be suitable for manual tests, this since my Windows KVM machine doesn't support ES2 - TestGLContextDrawableSwitch10NEWT: Add a few more test constraints .. working Tested: - Manually on a Windows virtual machine (KVM) using - 2 virtualized 'Video QXL' cards and - and 'remote-viewer' to see the 2 monitors since `Virtual Machine Manager` build-in doesn't support - remote-viewer spice://localhost:5917 - Manually on a Linux machine w/ SOFT_SCALE - Both, X11 and Windows - Place window on each monitor - Move window across monitors w/ pixel-scale change (or not) - TODO: Test and fix utilization with AWT, i.e. NewtCanvasAWT
* NativeWindow: Add getBounds() (moved from NEWT Window) and getSurfaceBounds()Sven Gothel2023-01-311-3/+14
|
* GDIUtil: Add GetMonitor*() variants incl. PixelScale; NEWT MonitorDevice: ↵Sven Gothel2023-01-291-2/+5
| | | | Add 64-bit nativeHandle (Windows HMONITOR), add PixelScale for Windows
* TestDisplayLifecycle01NEWT: Invisible window might have been moved away ↵Sven Gothel2023-01-232-5/+21
| | | | (Windows 10)
* Execute AWT's Frame.setTitle() on AWT-EDT if already visible (avoid rare ↵Sven Gothel2023-01-223-13/+35
| | | | deadlock)
* TestSharedContextVBOES2SWT3: Remove unused importSven Gothel2023-01-221-1/+0
|
* Workaround MacOS + SWT 4.26: java.lang.NullPointerException: Cannot invoke ↵Sven Gothel2023-01-224-67/+143
| | | | | | | | | | | | | | | | | | | | | | | | | "org.eclipse.swt.internal.cocoa.NSGraphicsContext.saveGraphicsState()" because "context" is null On MacOS 12+ and SWT 4.26 while not using AWT (-Djava.awt.headless=true, -XstartOnFirstThread), we recently get the following Exception from SWT (suppressed): java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.internal.cocoa.NSGraphicsContext.saveGraphicsState()" because "context" is null at org.eclipse.swt.widgets.Widget.drawRect(Widget.java:764) at org.eclipse.swt.widgets.Canvas.drawRect(Canvas.java:170) at org.eclipse.swt.widgets.Display.windowProc(Display.java:6287) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:5565) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5965) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:92) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3983) at com.jogamp.opengl.test.junit.util.SWTTestUtil$WaitAction$1.run(SWTTestUtil.java:52) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:183) at org.eclipse.swt.widgets.Display.syncExec(Display.java:5250) at com.jogamp.opengl.test.junit.util.SWTTestUtil$WaitAction.run(SWTTestUtil.java:63) at com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2SWT3.test02AsyncEachAnimator(TestSharedContextVBOES2SWT3.java:376) This is not observed if running using AWT (-Djava.awt.headless=false).
* AWTRobot.getClickTimeout(): NEWT Case: Return maximum(AWT, NEWT), otherwise ↵Sven Gothel2023-01-222-18/+43
| | | | we see click-count 2 on MacOS 12
* Test MouseAdapter: Use volatile qualifier to avoid reading too old valuesSven Gothel2023-01-222-6/+6
|
* Minor auto formatting: @Override, ..Sven Gothel2023-01-224-5/+38
|
* TestSharedContextVBOES2NEWT5: Try harder having the objects destroyed and ↵Sven Gothel2023-01-211-1/+7
| | | | | | taken from the GLContextShareSet map The objects were more sticky on my MacOS 12 x86_64 machine, this double GC w/ sleep 100ms resolved it.
* Test: Linux: Disable automatic tests (TBD, WIP)Sven Gothel2023-01-181-17/+31
|
* Test: MacOS: Disable automatic tests (TBD, WIP)Sven Gothel2023-01-183-0/+47
|
* Test*NewtEventModifiers*: Ensure SWT is initialized before AWTSven Gothel2023-01-175-25/+66
|