aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp
Commit message (Collapse)AuthorAgeFilesLines
...
* GLRegion + RegionRenderer: Add clearShader(..) to delete all ShaderPrograms ↵Sven Gothel2023-03-133-5/+32
| | | | and is references.
* GLMediaPlayerImpl: isTextureAvailable() is always true after lastFrame init; ↵Sven Gothel2023-03-131-2/+6
| | | | Use private isPausedOrPlaying() to determine shaderCodeHash
* GLMediaPlayer: Overhaul and simplify states, allow usage before stream ready ↵Sven Gothel2023-03-136-79/+191
| | | | | | | | | | | | | | | showing test-texture. Adding stop(); (API Change) - allow multiple initGL(..) @ uninitialized and initialized - allows usage before stream is ready - using a test-texture @ uninitialized - adding stop() API change - initStream() -> playStream() - play() -> resume() FFMPEG: Added 'ready' check for robustness
* Move png assets (NEWT icons + GLMediaPlayer dummy/test) to simple classpath, ↵Sven Gothel2023-03-132-1/+1
| | | | allowing access w/o jars. TODO: Test Android.
* Graph: Font: Add equals() + hash() API doc; GraphUI's Label*.setText(): Only ↵Sven Gothel2023-03-081-2/+1
| | | | modify values if text and/or font differs, skipping markShapeDirty() saves performance.
* [GL]Capabilities*: Enhance identity-check in root Capabilities.equals(..), ↵Sven Gothel2023-03-081-0/+14
| | | | | | | | | | comparing the VisualID first; Added VisualIDHolder.isVisualIDSupported(VIDType) We cannot accept 2 capabilities with different VisualID but same attributes otherwise accepted as equal, since the underlying windowing system uniquely identifies them via their VisualID. Such comparison is used in certail GLAutoDrawable implementations like AWT GLCanvas to determine a configuration change etc.
* Graph Perf: Add Region.countOutlineShape(), Font.processString(Visitor2,..), ↵Sven Gothel2023-03-071-5/+18
| | | | TextRegionUtil.countStringRegion() allowing to use Region.setBufferCapacity()
* Graph Perf: Font*: Remove PerfCounterCtrl since the Region counter is more ↵Sven Gothel2023-03-071-76/+1
| | | | than enough
* Graph Perf: Region*: Add setBufferCapacity(..) and cut-off growBuffer() ↵Sven Gothel2023-03-073-123/+203
| | | | early if not needed (track capacity); Align all VBORegion* buffer init/set/grow impl.
* Graph Perf: Region: split addOutlineShape() -> addOutlineShape0() (fast) and ↵Sven Gothel2023-03-073-3/+3
| | | | addOutlineShape1() (slow perf+debug), rename growBufferSize() -> growBuffer()
* Graph Perf: Region*: Rely on growBuffer(..) per addOutlineShape() and known ↵Sven Gothel2023-03-073-50/+62
| | | | buffer data-type to directly put[34][sif](..) skipping GLArrayDataClient/Buffers buffer-growth and validations
* GLArrayData: Promote sealed() from GLArrayDataEditable, to correctly being ↵Sven Gothel2023-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | used for getElemCount() instead of 0==position, ... (API change) API Change - sealed() moved up from GLArrayDataEditable -> GLArrayData - GLArrayDataWrapper is sealed by default - getSizeInBytes() -> getByteCount() - Semantics of getElemCount() and getByteCount() - Correctly use sealed() to switch from position to limit - instead of 0==position Aligned method names: - getElemCount() - elemPosition() - remainingElems() - getElemCapacity() to corresponding byte counts: - getByteCount() - bytePosition() - remainingBytes() - getByteCapacity()
* Graph: Bring back passing through temp AffineTransform instances (optional, ↵Sven Gothel2023-03-071-4/+9
| | | | but recommended)
* Clock: Use Clock.currentNanos() instead of System.nanoTime(); Enhancing ↵Sven Gothel2023-03-072-23/+33
| | | | | | 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-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Graph: Use PerfCounterCtrl interface and Instant/Duration & ↵Sven Gothel2023-03-061-38/+55
| | | | Clock.getMonotonicTime() ...
* Graph: Font: Add perf counter (w/ API)Sven Gothel2023-03-061-2/+70
|
* Graph: Region: Add perf counter (w/ API); Utilize put[34][sif](..); Fix ↵Sven Gothel2023-03-063-85/+169
| | | | | | | | | | | | | | | indices growBufferSize(); Add GLRegion.create(..) w/ initial vertices/indices count; Up default[VI]Count; Following heuristcs were found, hence we might want to calculate these for each font (TODO): /** * Heuristics with TestTextRendererNEWT00 text_1 + text_2 = 1334 chars * - FreeSans ~ vertices 64/char, indices 33/char * - Ubuntu Light ~ vertices 100/char, indices 50/char * - FreeSerif ~ vertices 115/char, indices 61/char * * Now let's assume a minimum of 10 chars will be rendered */
* FFMPEGMediaPlayer: Cleanup API doc FFmpeg versionsSven Gothel2023-03-051-4/+4
|
* GLDrawableFactoryImpl:createDummyDrawable(): Similar to ↵Sven Gothel2023-03-041-5/+15
| | | | | | createOffscreenDrawable() prefer createSurfacelessImpl() over createDummySurfaceImpl() to reduce resources (no actual window) This enhances the 'dummy drawable' use-case implementation, i.e. for shared context.
* GLDrawableFactoryImpl:createMutableSurfaceImpl(..): Pass orig ↵Sven Gothel2023-03-046-40/+42
| | | | AbstractGraphicsDevice to allow EGLDrawableFactory to use the original device's native-dislay-ID for sharing resources.
* GLDrawableFactoryImpl:createDummySurfaceImpl() and createSurfacelessImpl(): ↵Sven Gothel2023-03-047-69/+91
| | | | | | | Pass orig AbstractGraphicsDevice to allow EGLDrawableFactory to use the original device's native-dislay-ID for sharing resources. EGLDrawableFactory to use the original device's native-dislay-ID for sharing resources, e.g. GLContext. EGL 1.4 requires same native-display-ID of share-list context and newly created context!
* EGLGraphicsDevice: Cleanup and enhance API doc for clarity ...Sven Gothel2023-03-041-8/+8
|
* GLMediaPlayerImpl: destroyImpl(..) @ initGL(..) exception: Don't wait for ↵Sven Gothel2023-03-041-5/+8
| | | | streamWorker stop result (-> deadlock)
* Drop redundant NativeWindowFactory.getDefaultToolkitLock(type, deviceHandle) ↵Sven Gothel2023-03-021-3/+3
| | | | variant
* Graph Region: Fix printBufferStats(..) overrideSven Gothel2023-02-243-3/+3
|
* Graph Region: Address overflow issue using GL2ES3 integer indices (WIP...); ↵Sven Gothel2023-02-243-16/+128
| | | | | | | | | | | | | | | 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-37/+27
| | | | | | | | | | | | | 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 Font: Fix TypecastRenderer TTF corner-case: Prefer initial segment's ↵Sven Gothel2023-02-231-36/+68
| | | | | | | | | | moveTo (start) to be onCurve One of the FreeSerif fonts starts a new segment with two off-curves, where the mid-point is not onCurve. Here we have to test whether the previous (point-1 or in code: point_m) is onCurve and simply start our 'turtle' making the shape there ..
* FFMPEGMediaPlayer: Add implementation update for FFmpeg version 4.* (Debian ↵Sven Gothel2023-02-238-341/+197
| | | | | | | | | | | | | | | | | | | | | | | 11), 5.* (Debian 12) and 6.* (Current Development trunk) From here on, libav support has been dropped. Required FFmpeg libraries to be fully matched by their major runtime- and compiletime-versions are: - avcodec - avformat - avutil - swresample Library avdevice is optional and only used for video input devices (camera). Library avresample has been removed, since FFmpeg dropped it as well in version 6.* and swresample is preferred for lower versions. The matching major-versions of each library to the FFmpeg version is documented within FFMPEGMediaPlayer class API-doc. Each implementation version uses the non-deprecated FFmpeg code-path and compilation using matching header files is warning-free.
* Graph TypecastFont: Add hashCode() and equals(), feed TypecastGlyph w/ ↵Sven Gothel2023-02-191-3/+20
| | | | LeftSideBearings
* Graph Font.Glyph: Cleanup: Remove Font and getScale() from interface ↵Sven Gothel2023-02-191-76/+43
| | | | (redundant), add getLeftSideBearings*() from htmx table; Flatten TypecastGlyph impl by merging its Metrics, add equal() complementing hashCode()
* Graph Font: Add more DEBUG info ..Sven Gothel2023-02-191-3/+32
|
* Graph Font: Simplify CmapFormat selection (cmap symbol -> glyph-idx), just ↵Sven Gothel2023-02-191-51/+24
| | | | use Unicode and if not available use a symbol font
* Graph Font: Add 'name' to Glyph; Drop erroneous Glyph ID_SPACE, ID_CR manual ↵Sven Gothel2023-02-192-50/+40
| | | | | | | | | | | | | | mapping, rely on no-shape for 'space' non-contour. Drop erroneous Glyph ID_SPACE, ID_CR to rely on no-shape for 'space' non-contour resolves different cmap-mappings of fonts, not following 'some std'. Hence getGlyph(glyph_id) no more uses the `font.getGlyph(Glyph.ID_UNKNOWN)` shape, but a null-shape as intended and using the hmtx and hhea table values for asvance and bounds. This fixes 'space' spacing in general and specifically FreeSerif-Regular and the like. This path also simplifies processing/layout of glyphs in process(..) and get*BoundsFU(..).
* Graph Font.Metrics: Use unchanges sign of (+) ascent, (-) descent and (+) ↵Sven Gothel2023-02-192-8/+4
| | | | lineGap, document them properly and fix Font.getLineHeightFU()
* Rename VectorUtil.ccw(..) -> isCCW(..)Sven Gothel2023-02-172-2/+2
|
* Graph: Fix Loop.initFromPolyline()'s Winding determination, document Winding ↵Sven Gothel2023-02-173-58/+88
| | | | | | | | | | | | | | | | | | | | | | | 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-163-61/+39
| | | | dropping redundant getMetricWidth*(); Fix getMetricBoundsFU()
* Graph: TypecastRenderer: Fix point-loop (no reduced 'count - 1', no break on ↵Sven Gothel2023-02-161-94/+245
| | | | | | | | | | | | | | | | | | endOfContour), remove redundant branch B3, add Type-2 and add code dump for testing Realigned renderer code w/ Typecast's AWT demo: - TTF Quadratic Shape - The inner loop 'offset < count' is sufficient, otherwise could drop last point - point_0.endOfCountour is valid as a last point - Branch-3 and hence point-3 is not required as handled via B4 and subsequent B6 - Type-2 Cubic Shape - Added .. not tested yet Also added optional debug code dump via java cmdline `-Djogl.debug.graph.font.Renderer.Code`, which dumps plain OutlineShape construction code for testing and debugging our CurveRenderer.
* Typecast: Glyph: getGlyphIndex() -> getID() to simplify nameSven Gothel2023-02-161-1/+1
|
* Typecast: Assign _glyphIndex w/ ctor argument (+ code cleanup)Sven Gothel2023-02-161-10/+17
|
* Graph TextRegionUtil: Move ShapeVisitor to OutlineShape.Visitor and ↵Sven Gothel2023-02-154-25/+102
| | | | | | | | | | 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-143-34/+29
| | | | getPointsBoundsFU(); Glyph: Drop getSymbol()
* Graph Type Rendering: Drop pixelSize and use font em-size [0..1] throughout ↵Sven Gothel2023-02-134-300/+61
| | | | | | | | | 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-124-56/+147
| | | | | | | | | 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)
* Typecast: Table: Use package-protected static final const, remove ↵Sven Gothel2023-02-122-51/+49
| | | | notAvailable String
* Typecast: KernSubtableFormat2: Use package-protectionSven Gothel2023-02-121-2/+2
|
* Typecast: KernSubtable: Remove getKerningTable(..), will be implemented in ↵Sven Gothel2023-02-121-11/+1
| | | | higher API layer w/ binary-search
* GlyfCompositeDescript: Remove useless try { } in ctor; Remove redundant ↵Sven Gothel2023-02-121-27/+21
| | | | variable in range-based for-loops