| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
FPSCounterImpl accuracy by maintaining timestamps in [ns]
Idea: Perhaps we want to use [ns] for FPSCounter's method types by now?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
| |
Platform.currentTimeMillis()
|
|
|
|
| |
Clock.getMonotonicTime() ...
|
|
|
|
| |
PC and raspi-aarch64 ..
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
creation in other demos.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
test-shapes
|
| |
|
|
|
|
| |
lineGap, document them properly and fix Font.getLineHeightFU()
|
|
|
|
| |
complex example code, ascending
|
|
|
|
| |
and winToObjCoord (expect all set, no doubling); GLEventListenerButton: Resize FBO to screen-size for proper 1:1 quality
|
| |
|
|
|
|
| |
sizes a little
|
|
|
|
| |
GPUUISceneGLListener0A: Formatting and move reshape() after init()
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
dropping redundant getMetricWidth*(); Fix getMetricBoundsFU()
|
|
|
|
| |
determine CurveRenderer issues
|
|
|
|
|
|
|
|
|
|
| |
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()
|
|
|
|
| |
test cases
|
|
|
|
| |
optional AffineTransform (see Label0)
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
getPointsBoundsFU(); Glyph: Drop getSymbol()
|
|
|
|
| |
plane.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Add Path2F addPath(..), emphasize required Winding.CW
GPURegionGLListener01 used by TestRegionRendererNEWT01 covers Path2F CCW and CW (reverse add) methods.
|
|
|
|
| |
blending stubs in display (Mesa3D results are otherwise broken)
|
|
|
|
| |
window size 1024x640
|
|
|
|
| |
custom window size
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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
|
| |
|
|
|
|
| |
Add 64-bit nativeHandle (Windows HMONITOR), add PixelScale for Windows
|
|
|
|
| |
(Windows 10)
|
|
|
|
| |
deadlock)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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).
|
|
|
|
| |
we see click-count 2 on MacOS 12
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|