aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph
Commit message (Collapse)AuthorAgeFilesLines
* Graph: Region: Enhance API doc, fix typo .. (brace close left open during ↵Sven Gothel2023-03-071-12/+34
| | | | selected commits)
* Graph Perf: Add Region.countOutlineShape(), Font.processString(Visitor2,..), ↵Sven Gothel2023-03-074-4/+79
| | | | TextRegionUtil.countStringRegion() allowing to use Region.setBufferCapacity()
* Graph Perf: Font*: Remove PerfCounterCtrl since the Region counter is more ↵Sven Gothel2023-03-071-1/+0
| | | | than enough
* Graph Perf: OutlineShape: Uncomment all debug code to keep it smallerSven Gothel2023-03-071-7/+7
|
* Graph Perf: Region*: Add setBufferCapacity(..) and cut-off growBuffer() ↵Sven Gothel2023-03-072-3/+21
| | | | 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-071-54/+81
| | | | addOutlineShape1() (slow perf+debug), rename growBufferSize() -> growBuffer()
* Graph Perf: Region*: Rely on growBuffer(..) per addOutlineShape() and known ↵Sven Gothel2023-03-071-0/+13
| | | | buffer data-type to directly put[34][sif](..) skipping GLArrayDataClient/Buffers buffer-growth and validations
* Graph: Bring back passing through temp AffineTransform instances (optional, ↵Sven Gothel2023-03-072-17/+44
| | | | but recommended)
* Graph Perf Counter: Use GlueGen's Clock.currentNanos() to ease on ↵Sven Gothel2023-03-071-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-062-68/+91
| | | | Clock.getMonotonicTime() ...
* Graph: Font: Add perf counter (w/ API)Sven Gothel2023-03-061-0/+11
|
* Graph: Region: Add perf counter (w/ API); Utilize put[34][sif](..); Fix ↵Sven Gothel2023-03-062-23/+184
| | | | | | | | | | | | | | | 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 */
* Graph Region: Address overflow issue using GL2ES3 integer indices (WIP...); ↵Sven Gothel2023-02-243-25/+81
| | | | | | | | | | | | | | | 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.
* Graph TextRegionUtil: Fix HashMap (font,text)->GLRegion: Preserve key data ↵Sven Gothel2023-02-191-20/+40
| | | | | | (fontName, text) for equals Otherwise we would need to use a mostly collision free secure hash algo, Black2b-512 or sha256/512
* Graph Font.Glyph: Cleanup: Remove Font and getScale() from interface ↵Sven Gothel2023-02-191-12/+7
| | | | (redundant), add getLeftSideBearings*() from htmx table; Flatten TypecastGlyph impl by merging its Metrics, add equal() complementing hashCode()
* Graph Font: Add 'name' to Glyph; Drop erroneous Glyph ID_SPACE, ID_CR manual ↵Sven Gothel2023-02-191-2/+3
| | | | | | | | | | | | | | 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-191-22/+33
| | | | lineGap, document them properly and fix Font.getLineHeightFU()
* Graph: Outline: Remove minor redundancySven Gothel2023-02-171-2/+1
|
* Graph: Fix Loop.initFromPolyline()'s Winding determination, document Winding ↵Sven Gothel2023-02-172-49/+140
| | | | | | | | | | | | | | | | | | | | | | | 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-39/+97
| | | | dropping redundant getMetricWidth*(); Fix getMetricBoundsFU()
* Graph: TextRegionUtil: Make addStringToRegion(..) versatile/usable w/ ↵Sven Gothel2023-02-151-21/+48
| | | | optional AffineTransform (see Label0)
* Graph: RegionRenderer: Offer borrowing current viewport w/o copySven Gothel2023-02-151-0/+4
|
* Graph TextRegionUtil: Move ShapeVisitor to OutlineShape.Visitor and ↵Sven Gothel2023-02-155-103/+96
| | | | | | | | | | 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 RegionRenderer: Expose int[4] viewport for convenienceSven Gothel2023-02-141-11/+18
|
* Graph Font: getGlyph(char symbol -> int glyph_id), add kerning to ↵Sven Gothel2023-02-142-4/+4
| | | | getPointsBoundsFU(); Glyph: Drop getSymbol()
* Graph OutlineShape: Path2F alike sub-path ctor: Add z coordinate for custom ↵Sven Gothel2023-02-141-12/+19
| | | | plane.
* Graph Type Rendering: Drop pixelSize and use font em-size [0..1] throughout ↵Sven Gothel2023-02-132-97/+76
| | | | | | | | | 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-122-43/+48
| | | | | | | | | 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-103-122/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-069-557/+940
| | | | | | Add Path2F addPath(..), emphasize required Winding.CW GPURegionGLListener01 used by TestRegionRendererNEWT01 covers Path2F CCW and CW (reverse add) methods.
* Graph: OutlineShape: Add positional addVertex() variants for component based ↵Sven Gothel2023-02-051-7/+53
| | | | addVertex methods
* Graph: Path2D: Remove redundant accessors, comment on append(..)Sven Gothel2023-02-051-7/+11
|
* Graph: OutlineShape: Make class final, getOutlineNumber() -> getOutlineCount()Sven Gothel2023-02-051-18/+17
|
* Graph; Path2D[Iterator]: Add 'fast path' access to points array reference ↵Sven Gothel2023-02-042-80/+113
| | | | and index etc, used to avoid arraycopy (efficancy)
* Graph: Complete move jogamp.graph.plane to public com.jogamp.graph.planeSven Gothel2023-02-0412-17/+12
|
* Graph: Move jogamp.graph.plane to public com.jogamp.graph.planeSven Gothel2023-02-046-0/+2041
|
* Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged()Sven Gothel2023-01-141-3/+3
|
* Bug 1237: Adopt GlueGen's clarification of IOUtil.getResource(..), commit ↵Sven Gothel2015-10-031-1/+1
| | | | | | | | d78bb1be0a6290cb94918b21865a023c01825048 - Skip relative lookup for IOUtil.ClassResources using 'asset' only (from JAR file) - Tested w/ jar file and build-dir, see scripts/tests.sh 'USE_BUILDDIR'
* Bug 682 - Relocating javax.media.opengl.* -> com.jogamp.opengl.* (Part 1)Sven Gothel2015-02-025-14/+14
| | | | | | | | | sed -i 's/javax\.media\.opengl/com\.jogamp\.opengl/g' `grep -Rl "javax\.media\.opengl" src` sed -i 's/javax\.media\.nativewindow/com\.jogamp\.nativewindow/g' `grep -Rl "javax\.media\.nativewindow" src` sed -i 's/javax\/media\//com\/jogamp\//g' `grep -Rl "javax/media/" src` sed -i 's/javax\/media\//com\/jogamp\//g' `grep -Rl "javax/media/" doc` Manually edited all occurences within make/**
* Graph/Math: Fix minor apidoc issuesSven Gothel2014-10-092-3/+14
|
* Graph: Fix minor apidoc issuesSven Gothel2014-10-092-3/+7
|
* FontFactory: Fix SecurityException as regression of commit ↵Sven Gothel2014-10-091-1/+6
| | | | | | bd24599b21f9787ac989e65b44dc1ba762162f22 - add missing PrivilegedAction around tempFile[0].delete()
* Refine Graph/Font InputStream Capabilities (commit ↵Sven Gothel2014-09-301-12/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 628509b39ea7c16210315d191860511d6be4aa69) FontFactory Remove: - Font get(final URLConnection conn) - Font get(final InputStream stream) FontFactory Add: - [1] Font get(final InputStream stream, final int streamLen, final boolean closeStream) - Direct usage of font InputStream w/ determined length, may instantiate BufferedInputStream in case given stream doesn't support mark/reset! - [2] Font get(final InputStream stream, final boolean closeStream) - Copy font InputStream w/o determined length, resulting in BufferedInputStream supporting mark/reset! Security Related: - Only perform priviledged code on determine InputStream, _not_ when parsing the font stream itself! - Hence PrivilegedAction only happens in FontFactory's InputStream preparation. Misc: - Use Uri class
* Merge remote-tracking branch 'picoworm/master'Sven Gothel2014-09-241-0/+5
|\
| * Added possibility to load font using InputStream parameterRoman2014-07-241-0/+5
| |
* | graph/font: Use 'pixelSize' var-name, remove redundanciesSven Gothel2014-08-281-4/+39
| |
* | Fix commit b5910f18f0b82a8a1f6f6252dc19971d5e487f39 for toString(): Call ↵Sven Gothel2014-08-282-0/+11
|/ | | | super.hashCode(), due to InternalError("hashCode not designed")
* Bug 801: Add Graph pass-2 shader for VBAA 'odd' sample countSven Gothel2014-07-091-16/+27
|
* Findbugs: Add comments that FB warnings are of no concern ..Sven Gothel2014-07-081-1/+1
|
* Findbugs: Remove dead-code / unused [temp] storage and it's assignmentSven Gothel2014-07-081-1/+1
|