Commit Graph

364 Commits

Author SHA1 Message Date
jean-pierre charras 83d851956c classes MARKER rework: remove duplicate code. Better HitTest code (HitTest takes in account the actual shape) 2018-12-19 19:53:27 +01:00
jean-pierre charras ffe4b745dd Opengl gal: Fix bug: segments with 0 length are not drawn. However the are equivalent to circles.
Using 0 length segments happen with oval pads having the same X and Y size, and in some other cases.

Fixes: lp:1801923
https://bugs.launchpad.net/kicad/+bug/1801923
2018-11-15 13:10:42 +01:00
Maciej Suminski 64da77538f Fix bitmap scale in printouts
Display GALs had an incorrect world unit value set. Now the world unit
value says how many internal units are in an inch, in accord with the comments
in the GAL header. Bitmap drawing code relied on the information about DPI,
so scaling worked differently for display and print GALs.
2018-10-31 19:17:30 +01:00
Maciej Suminski 47d0eaa2c6 GAL: changed line width setting to float type 2018-10-31 19:17:30 +01:00
Jeff Young 16925cc74e Implement RAII locking for GAL updating.
Fixes a crash when typing fast in the place footprint filter box.

Also adds a bunch more checking to GAL locking, including making
sure the same person unlocks as locked, and preventing piece-meal
calls (the RAII objects must be used).
2018-10-26 23:02:05 +01:00
jean-pierre charras f183b4f526 GAL, Opengl: Draw Arc: fix draw layer depth (previously, set to 0.0, which is not always the case) 2018-10-21 19:53:36 +02:00
jean-pierre charras 7be215249d OPENGL_GAL: avoid crash when esotheric unicode chars are used in netnames/pad names in Debug mode.
It happens when the char is not found in the font used to display netnames/pad names.
When happens, a wxASSERT is raised.
Unfortunately it can crash the application if it is during a paint event or some critical time.
2018-10-20 18:08:36 +02:00
Tomasz Włostowski d66e0d4f7a eeschema-gal: implemented EnableDepthTest() in GAL, fixed drawing order in eeschema 2018-10-15 00:09:59 +02:00
Jeff Young 6a5744adb1 Show compile errors and go back to GLSL V120. 2018-10-13 12:39:53 +01:00
Jeff Young 6c34fdefd7 Better exception handling and context locking for GAL.
This prevents deadlocks when exceptions are thrown and the context
ends up not getting unlocked.

It also removes an earlier hack to try and minimize this which
didn't work anyway.
2018-10-12 23:44:49 +01:00
Tomasz Włostowski a676034e36 OPENGL_GAL::DrawGrid(): flush drawing buffer after drawing small crosses grid so that it's correctly composited
Fixes: lp:1797642
* https://bugs.launchpad.net/kicad/+bug/1797642
2018-10-12 23:52:35 +02:00
Tomasz Włostowski 711b278248 gal/opengl: handle single-pixel line width clamping in hardware (new shader). Correct grid rendering in GAL for pixel-sized lines 2018-10-12 19:13:54 +02:00
jean-pierre charras 88cdce8d62 Make SYMBOL_PREVIEW_WIDGET working, and using the canvas type of the caller. Fix an issue with F3 zoom key in libedit. 2018-10-09 11:08:56 +01:00
jean-pierre charras f283667fb0 add option to switch between opengl and cairo in eeschema (step 1) 2018-10-09 11:08:56 +01:00
jean-pierre charras e55763947e Set the reight grid visibility at start. Display axis in libedit and viewlib. 2018-10-09 11:08:56 +01:00
Jeff Young 0063f2c12d Stroke rectangles after filling so fill doesn't cover 1/2 of stroke. 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski ccb594f599 eeschema-gal: support for global labels and bitmaps 2018-10-09 11:08:55 +01:00
Tomasz Wlostowski f82f310dd5 eeschema-gal: added EnableDepthTest() feature in GAL 2018-10-09 11:08:52 +01:00
jean-pierre charras 26838c6800 Pcbnew: Crash after running external plugin
Happens only in Opengl mode.
So enforce controls in 3 group function: DrawGroup, ChangeGroupColor, ChangeGroupDepth.

Fixes: lp:1795044
https://bugs.launchpad.net/kicad/+bug/1795044
2018-09-29 12:58:47 +02:00
Jeff Young 0309228276 Don't allow drawing to a zero-height or zero-width GAL canvas.
Fixes: lp:1793913
* https://bugs.launchpad.net/kicad/+bug/1793913
2018-09-22 22:06:40 +01:00
Seth Hillbrand a6325aab29 Replacing Tesselation
Replaces Poly2Tri with updated code to process polygons faster and more
robustly.  Notably, we can now handle overlapping holes in the polygons,
allowing us to cache the triangulation of complex boards
2018-09-01 19:30:50 -07:00
Tomasz Wlostowski aab40ee9e8 OPENGL_GAL: don't use glCopyBuffer() on faulty Intel GL drivers
Fixes: lp:1787221
* https://bugs.launchpad.net/kicad/+bug/1787221
2018-08-16 14:34:36 +02:00
jean-pierre charras 3a02e54411 Opengl fix: bitmaps having a width not multiple of 4 were incorrectly drawn.
This fix draws a "sub bitmap" having a width multiple of 4.
(The loss of 1 to 3 pixels in horizontal size should be not really noticeable)
2018-07-30 16:19:35 +02:00
Tomasz Wlostowski 516cf47946 OPENGL_GAL: optimized JP's bitmap drawing function to use textures 2018-07-30 00:13:37 +02:00
jean-pierre charras fefc7b8172 GAL canvases: add DrawBitmap(), using a basic brute force algo for OpenGL, and a optimized code for Cairo. In this fix the brute force means draw each pixel as a rectangle. It works fine, but could be optimized. 2018-07-30 00:13:30 +02:00
jean-pierre charras 82d492a840 Better wxASSERT message in OPENGL_GAL::computeBitmapTextSize, if the char is not found in font. 2018-07-23 13:58:13 +02:00
Jeff Young 185b524a62 Support both add-empty and add-browse for 3D models.
Also fixes a bug where the selected row and the grid cursor get
separated after a delete.

Fixes: lp:1782747
* https://bugs.launchpad.net/kicad/+bug/1782747
2018-07-23 01:09:47 +01:00
Carsten Schoenert e81faa2d5f fix misspelled 'allow to' -> 'allow one to' 2018-07-11 10:35:14 -04:00
Carsten Schoenert 9f7109826d fix misspelled 'allows to' -> 'allows one to'
Fixup small grammar issues around used 'allows to ...' almost in
code comments.
2018-07-11 10:35:03 -04:00
Maciej Suminski 73a8d2a9d5 OPENGL GAL: Fixed the iteration condition when drawing triangulated polyset
The loop used an incorrect variable size as the loop limit,
occasionally causing out of bounds accesses.

Fixes: lp:1778288
* https://bugs.launchpad.net/kicad/+bug/1778288
2018-06-23 02:05:21 +02:00
Maciej Suminski 1751e4631c Code formatting 2018-06-23 01:59:49 +02:00
Maciej Suminski 813c1a2ba2 Dealing with inconsistent wxGLCanvas::IsDisplaySupported()
wxGLCanvas::IsDisplaySupported() handles wxGL_{MINOR,MAJOR}_VERSION
attributes only in 3.0.4. Since 3.1.0 the attributes are apparently not
supported, so instead wxGLContext::IsOK() is used (introduced in 3.1.0).

Fixes: lp:1775995
* https://bugs.launchpad.net/kicad/+bug/1775995
2018-06-11 12:26:59 +02:00
Maciej Suminski 6bd708621b Early check of supported OpenGL version 2018-06-04 12:17:58 +02:00
jean-pierre charras 8f984c2899 OpenGL, DrawGrid(): use grid and axis alpha color value setting, instead of the fixed 1.0
In Cairo mode, this function uses already the alpha color value setting.
Now for low alpha values (usually they are low, as said in many GAL comments),
Cairo mode and OpenGL mode should have a similar look.
2018-06-01 18:29:04 +02:00
Carsten Schoenert 77b3a662fc fix misspelled 'Allows to' -> 'Allows one to' 2018-04-08 13:24:30 -04:00
Carsten Schoenert 1f32f7c55b fix misspelled 'allows to' -> 'allows one to' 2018-04-08 13:24:18 -04:00
Jon Evans 081c77f6bd OPENGL_GAL::DrawSegment(): Enforce nonzero width to match Cairo
Fixes: lp:1759958
* https://bugs.launchpad.net/kicad/+bug/1759958
2018-03-29 22:13:46 -04:00
Maciej Suminski 6331f94544 OpenGL GAL: safer error handling
Replaced assert() with wxCHECK(), so in case of problems methods return
instead of continuing with invalid state/data, wherever possible.
2018-03-22 18:20:02 +01:00
Jon Evans 921e68107b OpenGL: Make circle/arc drawing match Cairo for some edge cases 2018-03-08 22:04:33 -05:00
Carsten Schoenert 9679bd55c1 fix misspelled 'streching' -> stretching 2018-02-25 17:10:10 -05:00
Carsten Schoenert cb14742442 fix misspelled 'accesing' -> 'accessing' 2018-02-25 17:10:10 -05:00
Maciej Suminski 5c8accef8e Enable GL debug output only if available 2018-02-14 08:52:08 +01:00
jean-pierre charras 5ecfd32654 OpenGl fix: call enableGlDebug( true ) only in Kicad debug build, and only on Linux
(Because we have crashes on OSX and some Window installs)
2018-02-10 11:57:22 +01:00
Maciej Suminski 8a68a21570 Enable OpenGL debug output in debug builds 2018-02-09 16:20:38 +01:00
Tomasz Włostowski 271363f822 router: support for board outline 2018-02-06 09:43:56 +01:00
Tomasz Włostowski 2faf1a1ed3 Initial support for keepout zones in the P&S router. 2018-02-06 09:43:56 +01:00
jean-pierre charras 2fd00b1d23 Revert "Ensure DrawRectangle() stroke outline will always be visible"
This reverts commit 74d47d8173 because
it breaks DrawRectangle in outline mode because it modify line width.
2018-01-21 10:14:02 +01:00
Jon Evans 74d47d8173 Ensure DrawRectangle() stroke outline will always be visible
Fixes: lp:1743242
* https://bugs.launchpad.net/kicad/+bug/1743242
2018-01-16 09:20:02 +01:00
Camille 9ff66a5274 Fix unnecessary value parameter detected by clang-tidy. - Replace value parameter by const reference parameter or move-assignement in some cases 2018-01-09 18:55:51 -05:00
Maciej Suminski 4ec24badb9 Enlarge OpenGL glyphs to match Cairo and legacy text size 2018-01-08 10:46:27 +01:00