455 Commits

Author SHA1 Message Date
Addo White
843eea259d Fix for Cursor rendering on Linux+EGL+Nvidia in accelerated graphics mode
EGL/NVidia can sometimes clip the cursor based on its plane regardless of the depth mask.  This avoids the issue by forcing the cursor up over the existing plane.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12183
2025-08-25 14:35:33 -07:00
Seth Hillbrand
3ef862f7b6 Specialize the pad wall drawing
Avoids slowdown when zoom/pan with many THTs as everything remains
cached.  Still slow in Cairo but this is expected

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20506
2025-08-24 11:25:50 -07:00
Seth Hillbrand
71a6d26054 Disable depth testing for cursor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12183
2025-08-24 09:45:00 -07:00
Seth Hillbrand
26f0c03e61 ADDED: support for 45 degree crosshairs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6047
2025-08-23 06:20:00 -07:00
Seth Hillbrand
d02358da2f Make fullscreen cursor actually fullscreen
Very wide screens could see the edge of the cursor :)
2025-08-23 06:20:00 -07:00
Seth Hillbrand
66f37beff7 Move canvas selection to common
Makes all canvases obey the same rendering parameter.  Also keeps the
canvas selection with the anti-alias selection, which makes logical
sense.  Reduce the antialias selection to a single choice rather than
two different choices for different canvases
2025-07-27 20:22:59 -07:00
Jeff Young
8dc62e1db5 Don't choke on degenerate polygons.
It's a bit late to be asserting during drawing.
We'd need to know how the object was created to
do anything about it.
2025-07-02 23:10:10 -06:00
Alex Shvartzkop
d928e3c4fe Support wxCursorBundle on wx 3.3+
See https://gitlab.com/kicad/code/kicad/-/issues/16231
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16224
2025-06-15 10:24:49 +03:00
Seth Hillbrand
8e97a98fef Fix small segment render
Small segments, not just zero-length ones need to be drawn as circles to
avoid being dropped

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21083
2025-06-06 15:54:50 -07:00
Michal Suchanek
8110347844 Define GL_SILENCE_DEPRECATION globally on OS X 2025-05-11 15:50:10 +00:00
Seth Hillbrand
e75076ab41 Revert "Replace glew with epoxy"
This reverts merge request !2217
2025-04-22 15:16:58 -07:00
Michal Suchánek
0c36e16292 Replace glew with epoxy
Glew has the problem that it has to be selected at build time if GLX or
EGL is supported by the library, and this in not encoded in the library
name, nor ABI, nor anything.

Then it's easy to get into the situation that a binary is built but
cannot run because glew supports an API different from the one used by
wxWidgets, or the binary fails to link in the end after all objects are
compiled.

epoxy can support both with the same library avoiding this problem.

epoxy is not initialized explicitly, replaced initialization with
version check where one was not done already.

It seems to be available as vcpkg https://vcpkg.link/ports/libepoxy

There are problems related to GL context switching on Windows which does
not seem to be used in kicad
https://github.com/anholt/libepoxy#known-issues-when-running-on-windows
There is also a problem related to multithreaded rendering on Windows
https://github.com/anholt/libepoxy/pull/265 It's harder to tell if
threading is used for rendering but it does not look like kicad is doing
anything complex enough to warrant using multiple rendering threads.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20630
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12543
2025-04-22 12:54:39 -07:00
Wayne Stambaugh
5c8f4697ca Common folder housekeeping part 1. 2025-01-12 12:06:45 -05:00
Seth Hillbrand
09e30adbb1 Move GL_CONTEXT_MGR into PGM_BASE singleton
This is the second try at 5326c36a5f.  The difference here is that we
have moved GL_CONTEXT_MGR into kicommon first which will hopefully
address some of the Windows linkage issues

The GL context lock needs to be shared across kifaces.  Otherwise, we
can end up blocking the lock from one kiface.  Unfortunately, I can't
find the issue in GitLab right now for where the footprint viewer shows
a blank screen after opening too many contexts.  But that's what this
fixes.
2025-01-09 09:03:08 -08:00
Seth Hillbrand
452e69de85 Move thread pool into true singleton
Thread pool needs to be stored in a single location for all of KiCad
otherwise each kiface will spin up its own pool of persistent threads
2025-01-09 09:03:08 -08:00
Seth Hillbrand
074e6df3bc Revert "Move thread pool to singleton class"
This reverts commit 361f61a02380881efb59b1cebfdc3e73322b3d3c.
2025-01-03 21:22:44 -08:00
Seth Hillbrand
f38e661a02 Revert "Move GL Context into Singleton class"
This reverts commit 5326c36a5ff8a3a465d386cc31172aa90847a9e9.
2025-01-03 21:22:37 -08:00
Seth Hillbrand
5326c36a5f Move GL Context into Singleton class
The GL context lock needs to be shared across kifaces.  Otherwise, we
can end up blocking the lock from one kiface.  Unfortunately, I can't
find the issue in GitLab right now for where the footprint viewer shows
a blank screen after opening too many contexts.  But that's what this
fixes.
2025-01-03 17:26:23 -08:00
Seth Hillbrand
361f61a023 Move thread pool to singleton class
Having thread pool as its own singleton in the library meant that each
kiface had its own threadpool, leading to many multiples of the threads
being started.  Placing a singleton class in PGM_BASE ensures that all
kifaces use the same thread pool.

The singleton class can be extended to provide single instance
guarantee for any element across kifaces
2025-01-03 13:51:11 -08:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Seth Hillbrand
9e72d426db Remove C macro in favor of class template 2024-11-21 18:04:23 -08:00
John Beard
dbf68a80b8 GAL: also scope layer depth push/pops
This means that an early return or an exception between
a manual Push/Pop (or an omission of the Pop) cannot
corrupt the layer stack.

It also means the GAL doesn't have to maintain its own
stack (with the in-scope GAL_SCOPED_ATTRS taking that role).

Reomve the Push/PopDepth functions, as they're only ever
used in pairs, and doing it manually needs more care.
2024-11-04 20:41:44 +08:00
Alex Shvartzkop
e5a5b59ac1 Don't try to clear empty bitmap cache.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18310
2024-07-01 18:23:19 +03:00
Alex Shvartzkop
8f8a68229c Handle touchscreen gesture events for zoom/pan. 2024-06-08 16:00:34 +03:00
Jeff Young
931de12072 Use wxWidgets to track DPI.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17981
2024-05-31 17:08:43 +01:00
Seth Hillbrand
ab0426d620 Detect if HiDPI cursors are needed
HiDPI cursors are twice as large as regular cursors, allowing them to be
more easily seen on a HiDPI system

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16231
2024-05-26 07:51:15 -07:00
Alex Shvartzkop
5e14ae9698 Add OpenGL info to About. 2024-05-05 21:30:25 +03:00
Alex Shvartzkop
b905b4eac8 Improve moving, rendering and plotting of very small angle arcs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17110
2024-04-03 00:40:18 +03:00
Yon Uriarte
77576e1a80 Responsive: OPENGL_GAL::DrawArc reserve linequads to reduce drawing time 2024-03-05 14:15:33 +00:00
Alex Shvartzkop
80457d5871 Support transparent background in 3D viewer PNG/clipboard export.
Only really works with realtime renderer currently.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12060
2024-02-29 17:11:53 +03:00
Jeff Young
e7abeb3c38 Cleanup. 2024-02-24 20:05:51 +00:00
Jeff Young
ffa6adec96 Add a cache for TrueType contours and triangulation data.
Also returns minimumSegmentLength to its former value as
it doesn't appear to be required to fix
https://gitlab.com/kicad/code/kicad/-/issues/11463.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16568
(cherry picked from commit 162e8962f7c5b429d33a84f96eeae3857f43c6f7)
2024-02-23 16:53:29 +01:00
Jeff Young
7fbeea0195 Allow smaller grid dots on Retina displays. 2024-01-19 20:37:27 +00:00
Jon Evans
e29baa75b4 Scale GAL grid with DPI 2024-01-19 12:20:13 -05:00
Alex Shvartzkop
5bd620d8f9 Support Bezier curve editing in eeschema. 2024-01-16 14:11:25 +03:00
Jeff Young
5aae8e2fd0 Code cleanup. 2024-01-04 16:13:42 +00:00
Alex Shvartzkop
965576f2c6 Enable alpha test for bitmaps in OpenGL GAL. 2023-12-31 15:05:00 +05:00
Alex Shvartzkop
e8fabb58a6 Fix bitmap Z order in OpenGL GAL.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16482
2023-12-31 14:09:28 +05:00
Jon Evans
1c895fe18c Improve rendering of tuning status popup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16304

Add dedicated UI rendering layers

Switch to screen-space rendering to avoid blurriness

Fix a bug in OpenGL GAL that causes layer
ordering to be broken when using Scale

Fix some issues with VIEW_GROUP layer ordering
2023-12-19 22:38:21 -05:00
Alex Shvartzkop
afa08b710c Support transparent cursor colors in OpenGL GAL. 2023-11-29 04:04:22 +03:00
Alex Shvartzkop
00904e8e23 Set UNPACK_ALIGNMENT properly for RGB bitmaps, 2023-10-24 06:58:46 +03:00
Alex Shvartzkop
0e4553b1fa Fix variable shadowing. 2023-10-24 04:25:31 +03:00
Alex Shvartzkop
977912dcd5 Fix up 75c758e5f4eddfed95e2ae52f6655572be2bb492 for masked images. 2023-10-24 03:59:03 +03:00
Alex Shvartzkop
71d0c7f6af OpenGL: Improve logic when bitmap cache memory is exhausted.
Don't remove the front entry, as it will likely be needed for the next bitmap.
Instead, implement neuristics based on access times.
2023-10-24 03:36:51 +03:00
Alex Shvartzkop
ccc29e9776 Improve bitmap caching performance. 2023-10-24 01:27:53 +03:00
jean-pierre charras
42384bcbd0 OPENGL_GAL: ensure 0 sized rect with thickness is shown (already shown by Cairo)
Fixes #15850
https://gitlab.com/kicad/code/kicad/-/issues/15850
2023-10-10 18:31:10 +02:00
Marek Roszko
ee91b550d8 gl_context_mgr and gl_util belong in the gal folder 2023-09-19 23:06:44 -04:00
Alex
66922b3bd2 Add hacks for EGL on Wayland 2023-09-14 03:54:01 +03:00
Alex Shvartzkop
ead44d58a0 Fix bezier curves drawing in schematic/libedit. 2023-09-09 20:28:49 +03:00
Marek Roszko
7505fd0f37 Profile can live in core 2023-09-07 07:47:01 -04:00