Commit Graph

522 Commits

Author SHA1 Message Date
Seth Hillbrand 823607796b Additional safety around wks bitmaps
Invalid files can create large problems for unloaded PNG data

Fixes https://gitlab.com/kicad/code/kicad/issues/13801
2023-02-07 12:08:39 +01:00
jean-pierre charras 23d0e6b4c0 Fix compil on msys2 (Structured Exception Handling not really supported) 2023-02-05 10:39:25 +01:00
Alex 525d0da126 Move __try into lambda. 2023-02-05 07:55:01 +03:00
Alex b913e9be1e Move more of defragment inside the __try block. 2023-02-05 07:45:03 +03:00
Alex 74a242c662 Catch access violation in defragment due to OpenGL drivers on Windows. 2023-02-05 07:03:04 +03:00
jean-pierre charras e900e472ce Fix compil and Coverity warnings 2023-01-22 09:40:09 +01:00
Jon Evans 05b578a9bb Bitmaps: use original size for caching
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13486
2023-01-11 21:15:07 -05:00
Jon Evans 8894b8e669 Implement bitmap rotation and mirroring without texture modification in opengl_gal 2023-01-04 00:26:45 +00:00
Jon Evans ac3ed02283 Rework bitmap cache and enable it
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12405
2023-01-04 00:26:45 +00:00
Seth Hillbrand 1cc9792cdb Fix snapping dist when disabling grid
The disable grid hotkey should allow the snap scale to be completely
determined by the snapSize and world scale.  This prevents snapRange
from overriding in the case where grid is disabled.

Additionally, we disallow grid snapping when the grid scale is not
visible.  This means that when zoomed out sufficiently to not show the
minor ticks, these minor ticks will not override a snap

Fixes https://gitlab.com/kicad/code/kicad/issues/12303
2022-12-21 17:47:45 -08:00
Alex dcb131c20d Improve canvas responsiveness by better swap interval management. 2022-11-18 00:32:25 +05:00
Seth Hillbrand de21eb5268 Remove errant debugging printf 2022-11-04 13:22:49 -07:00
Seth Hillbrand 685185bd68 Remove unneeded assert
Asserts should really only be used if the condition would trigger a
program error.  These just need a warning
2022-11-04 11:49:50 -07:00
dsa-t aeef215ffb gal: Pass aReserve to drawLineQuad in drawPolyline. 2022-11-01 05:02:17 +00:00
Seth Hillbrand 5be0ddca27 Draw degenerate lines as points
Rather than not drawing, which will miss some imported elements that
should be visible due to the line width, we draw a zero-length line that
appears as a point.
2022-10-31 16:18:38 -07:00
Seth Hillbrand 53fea46fed Re-order headers to avoid X11 None def
X.h helpfully defines the word "None" because surely no one would ever
use that as a token, right?  Right?
2022-10-19 20:04:00 -07:00
Alex dc07ab9df1 Replace PROF_COUNTER with PROF_TIMER in some conditional places. 2022-09-27 14:07:47 +00:00
Alex d0b4fb7b32 Don't fail when reserving 0 vertices. 2022-09-26 12:18:45 +03:00
Jeff Young 76a7a2b4bc Fix asserting when drawing empty line of text. 2022-09-25 22:20:51 +01:00
Alex bdf4cf51b8 Add a missing statement in segments reservation.
Also adds an assert in FinishItem.

Fixes https://gitlab.com/kicad/code/kicad/issues/12448
2022-09-19 02:36:21 +00:00
dsa-t bd8b737c44 GAL: Do better job at reserving vertices. 2022-09-14 16:07:47 +00:00
jean-pierre charras df35576cf9 fix my previous commit (c0661468) broken. 2022-09-09 19:00:47 +02:00
jean-pierre charras c06614689e OPENGL_GAL: disable bitmap image caching due to serious issues (memory leak)
It was re-enabled by commit cbc3bfbf.
The current code to handle cached bitmaps is no longer compatible with the
current code.
Many cached items are created because a lot of clones are used to manage bitmap images.
Cached items are never cleaned, so a lot of memory is never freed after
using these temporary clones
And caching items do not significantly speedup drawings.
2022-09-09 18:37:30 +02:00
jean-pierre charras c13b938a4b Free memory when unused, forgotten in my commit d4feb59e 2022-09-08 13:07:36 +02:00
jean-pierre charras d4feb59ed9 OPENGL_GAL, draw bitmap: Rebuild the bitmap cache if the bitmap itself was rotated.
Fixes #12378
https://gitlab.com/kicad/code/kicad/issues/12378
Fix also a Coverity warning.
2022-09-08 12:00:43 +02:00
Mike Williams 3669cb4673 PCB Editor: Add User Background Images 2022-07-14 11:23:23 +00:00
Mike Williams cbc3bfbf08 GAL: Re-enable OpenGL bitmap cache
Might still have issues, re-enabling for wider test.
2022-07-14 11:23:23 +00:00
Mike Williams 3e80963482 GAL: Delete no-effect target changes 2022-07-14 11:23:23 +00:00
dsa-t 3a76435eda OpenGL: Use glGetProgramiv instead of the extension function. 2022-06-09 19:37:42 +00:00
Mike Williams 857990a883 Hierarchy: turn into a left side pane
Drop auto-closing option as well.
2022-06-02 21:56:17 +00:00
Marek Roszko 417f2f357c Cleanup naming of shader params/uniforms 2022-05-19 07:49:24 -04:00
Jeff Young 38e5faf21b Overhaul bitmap text for performance.
Also adjusts metrics to better match stroke font.

Also removes text-halo highlighting as it's too expensive to re-render
when the zoom changes.

Fixes https://gitlab.com/kicad/code/kicad/issues/11460
2022-05-14 20:09:54 +01:00
Marek Roszko 8288f24264 Move all the shaders to glsl files (and fix the processor more) 2022-05-12 23:37:44 -04:00
Marek Roszko 6188f632b9 Initial implementation of shader translation to cpp at build time 2022-05-12 23:37:44 -04:00
Jeff Young a8d2dd8dc7 Bitmap text can't yet handle multi-line text. 2022-03-06 16:59:18 +00:00
Jeff Young a29968fa91 Make sure bitmap fallback is only used for non-cached text.
Also fixes backwards vertical justification for bitmap text.

Fixes https://gitlab.com/kicad/code/kicad/issues/10956
2022-02-24 18:16:45 +00:00
Wayne Stambaugh 8426ffa238 Fix wxWidgets invalid string specifier assertion.
(cherry picked from commit ab184ba9f3)
2022-01-24 15:50:40 -05:00
Jeff Young c8a50d9b50 Remove unit-less angles from VECTOR2I/D APIs. 2022-01-20 23:58:20 +00:00
Jeff Young e84c574830 Some more EDA_ANGLE cleanup. 2022-01-16 19:16:18 +00:00
Marek Roszko 8fe16690b7 Add array deleter 2022-01-14 22:04:47 -05:00
Jeff Young 07013d00e1 More EDA_ANGLE. 2022-01-14 16:08:19 +00:00
Jeff Young 33338aa0f2 Formatting. 2022-01-11 14:34:16 +00:00
Jeff Young 8f7d2dd06a More VECTOR2D -> VECTOR2I and wxPoint cleanup. 2022-01-11 14:20:14 +00:00
Jeff Young 7d032f9c2f Outline font rendering for Cairo, plotter, printer and 3D viewer.
Fixes https://gitlab.com/kicad/code/kicad/issues/10319
2022-01-10 01:54:28 +00:00
Jeff Young 04c76f10e9 Performance enhancements for fonts. 2022-01-08 16:47:45 +00:00
Ola Rinta-Koski 9b406c1da4 Outline font support. 2022-01-08 16:47:45 +00:00
Jeff Young 8e4a4306c7 Go back to using inter-character spacing from the stroke font.
Fixes https://gitlab.com/kicad/code/kicad/issues/1078
2022-01-04 00:46:08 +00:00
Mike Williams 404659d275 Gerbview: Fix diff mode issues with OpenGL transparency
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10121
2022-01-02 23:15:36 +00:00
Jeff Young 89c0f8e297 Move to new font engine. 2022-01-02 14:57:03 +00:00
Jeff Young 86cb57f4a7 Cherry-pick TEXT_ATTRIBUTES and EDA_ANGLE from rockola/kicad-strokefont 2021-12-28 22:15:20 +00:00