Commit Graph

262 Commits

Author SHA1 Message Date
jean-pierre charras 7418deb454 Pcbnew: fix issues with 360 deg angle arcs.
Fixes: lp:1725943
https://bugs.launchpad.net/kicad/+bug/1725943
2017-10-23 15:35:03 +02:00
jean-pierre charras d8ade988ce workaround for a minor and strange issue: size of chars '-' and '_' are incorrect in msdf_atlasgen fonte. the size of 'x' char is used instead. 2017-09-19 18:56:33 +02:00
Jon Evans 93de82f0b2 Fix scrollbars in macOS GAL canvases 2017-09-15 11:29:49 +02:00
Maciej Suminski 262fcc91af Fixes for video cards unable to use gl{Un,}MapBuffer correctly
Fixes: lp:1685335
* https://bugs.launchpad.net/kicad/+bug/1685335

Fixes: lp:1683041
* https://bugs.launchpad.net/kicad/+bug/1683041
2017-08-08 14:26:05 +02:00
Maciej Suminski 46b5575c51 OpenGL driver debug routines 2017-08-08 09:31:57 +02:00
Tomasz Włostowski 32185ddcd3 Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
- support for background color setting
    - removed several global config settings (such as g_Drc_On)
    - wrapped most of global config settings in PCB_GENERAL_SETTINGS class
    - reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas
    - new GAL feature for legacy users: double-click (or E) to change track width available as an option.

Fixes: lp:1530543
* https://bugs.launchpad.net/kicad/+bug/1530543

Fixes: lp:1707145
* https://bugs.launchpad.net/kicad/+bug/1707145
2017-08-04 16:06:57 +02:00
Maciej Suminski 7399759b3b Fixed polygon DRAWSEGMENT rendering in OpenGL GAL
Fixes: lp:1704542
* https://bugs.launchpad.net/kicad/+bug/1704542
2017-07-28 10:34:47 +02:00
jean-pierre charras d3b382c281 GAL mode: the grid don't fill the full screen when moving the grid origin to negative values.
Fixes: lp:1703330
https://bugs.launchpad.net/kicad/+bug/1703330
2017-07-14 20:18:37 +02:00
jean-pierre charras a92ea8c75b Fixes: lp:1687014 Footpring editor disappearing axes crosshair
https://bugs.launchpad.net/kicad/+bug/1687014
2017-04-29 11:43:02 +02:00
John Beard 0799d9e45c OPENGL_GAL: Init currentTarget
The currentTarget member of OPENGL_GAL is not initialised, but the
currentManager member is.

This commit uses SetTarget to initialise both target and manager to a
consistent state at construction.
2017-03-23 14:08:26 +01:00
John Beard b8edecc10f Move cursor shape flag into GAL settings
The motivation here is to concentrate display options in the GAL display
settings, ready for removal of legacy canvases. Instead of having the
property as a member of the DRAW_FRAME, with the GAL canvas retreiving
it from there, it is now in the GAL_DISPLAY_OPTIONS struct, and both GAL
and legacy get it from there.

The options for setting cursor shape are then moved out of the general
options dialog, and into the GAL display options widget, where they can
be used in all GAL-aware programs.

GAL cursor shape works on GAL, but not legacy, so the option is now
available on OSX (but only affects GAL, and is labelled as such).
2017-03-22 10:24:48 +01:00
John Beard 01c733bdb5 Dim GAL cursor when forced but no interactive tool
This makes it clearer when a tool is active, otherwise interactive tool
effects like auto-pan can come as a surprise when the cursor is forced
to display all the time.
2017-03-22 10:24:48 +01:00
jean-pierre charras c20cf4a3e0 Fix incorrect calculations in GAL DrawGrid() methods, that create very long calculation time when the grid origin is not 0 2017-03-21 13:09:24 +01:00
Maciej Suminski 11f8e53e27 Smoother arc rendering in OpenGL GAL
Fixes: lp:1496114
* https://bugs.launchpad.net/kicad/+bug/1496114
2017-03-10 14:08:59 +01:00
Jon Evans 3208d24ad4 Add DrawArcSegment() GAL method, to support drawing outlined arcs 2017-03-10 14:08:59 +01:00
Maciej Suminski 62235348d1 Use GAL axes instead of a ORIGIN_VIEWITEM in module editor 2017-03-08 10:35:51 +01:00
Jon Evans 2513f0b002 Add setting to have GAL draw axes on the grid 2017-03-08 09:37:40 +01:00
John Beard c86773462f GAL: Respect SHAPE_LINE_CHAIN closed setting
When drawing polylines using SHAPE_LINE_CHAIN, the polyline is always
was drawn closed in GAL and open in Cairo, regardless of the state of
SHAPE_LINE_CHAIN.
2017-03-07 13:28:14 +01:00
Maciej Suminski e6cfb6af52 Revert "Fix setting the background color in OPENGL_GAL"
Causes flickering on some GPUs.
This reverts commit ca985791bc.
2017-03-04 08:51:35 +01:00
Maciej Suminski ca985791bc Fix setting the background color in OPENGL_GAL
Fixes: lp:1669098
* https://bugs.launchpad.net/kicad/+bug/1669098
2017-03-02 09:32:10 +01:00
jean-pierre charras 1cffcafe2d GAL mode: Add small cross option to grid style (now: options are Dots, Grid, Small cross) 2017-03-01 10:29:19 +01:00
John Beard 0bf3a19967 Add user control for grid minimum spacing in GAL
This allows the user to set a thicker grid line without causing the
grid lines to become over dense, or just make the grid denser according
to preference.

The term "density" is modified to "minimum grid spacing", which is
the pixel spacing between adjacent grid lines.

The spacing settings now comes in along, with other GAL display settings,
as part of GAL_DISPLAY_OPTIONS observer functionality. To this end, the
setter in GAL interface is removed, as an external user should be
setting this parameter via the GAL_DISPLAY_OPTIONS interface.
2017-02-20 10:52:34 +01:00
John Beard 970e4f8eb4 Add grid line thickness control to Display Options Dialog
This adds a user-settable control for the grid line thickness on GAL
canvases to the display options dialog.

The thickness settings now comes in, along with other GAL display
settings, as part of GAL_DISPLAY_OPTIONS observer functionality. To this
end, the setter in GAL interface is removed, as an external user should
be setting this parameter via the GAL_DISPLAY_OPTIONS interface.

Fixes: lp:1662482
* https://bugs.launchpad.net/kicad/+bug/1662482
2017-02-20 10:52:34 +01:00
John Beard ff3bfaf82b Make KIGFX::GRID_STYLE an enum class
This provides stronger typing to these values.
2017-02-20 10:52:34 +01:00
John Beard ddded86a06 Give all GAL canvases access to a GAL_DISPLAY_OPTIONS structure instance
Also loads the gal options when loading a canvas, as the canvas
otherwise might not register the initial settings.
2017-02-20 10:52:34 +01:00
Maciej Suminski 80956ef1e6 Added GAL::DrawPolygon(SHAPE_POLY_SET) & GAL::DrawPolyLine(SHAPE_LINE_CHAIN) 2017-01-27 19:08:32 +01:00
Maciej Suminski 196c5aca83 Fixed 'unreferenced local variable' warning in OPENGL_GAL. 2017-01-18 14:23:06 +01:00
Maciej Suminski 7eacd1b15d Restored cursor in OpenGL canvas (still an issue with subpixel AA) 2017-01-13 17:10:16 +01:00
Maciej Suminski 88eb648cbb Alternative way of handling OpenGL initialization & errors
Some faults could result in a crash, as they were not properly
handled. Now the rendering loop is wrapped with try..catch block
which will revert to Cairo in case of an error and display an
error message.

Fixes: lp:1655766
* https://bugs.launchpad.net/kicad/+bug/1655766
2017-01-13 16:50:36 +01:00
Maciej Suminski 5a7604cbb4 More code formatting 2017-01-13 10:36:59 +01:00
Maciej Suminski da00d64877 OpenGL antialising code clean up & formatting 2017-01-11 16:20:37 +01:00
decimad 77138e3702 Add UI control to set up gal opengl antialiasing and load/store the settings 2017-01-11 16:20:37 +01:00
decimad afacee5d96 Add supersampling (2x/4x) antialiasing 2017-01-11 16:20:37 +01:00
decimad 02bb410cdb Refactor COMPOSITOR/OPENGL_COMPOSITOR to enable customization of scene rendering and presentation 2017-01-11 16:20:35 +01:00
decimad 77f9cd0cb0 remove custom shader header generation build-step in favor of c++11 raw string literals
rework shader loading code to handle an arbitrary amount of to-be-concatenated strings
2017-01-11 16:20:34 +01:00
decimad 047f52e7cb Move builtin font resources out of opengl_gal translation unit 2017-01-11 16:20:33 +01:00
jean-pierre charras d56a49d218 Performance counter rework: More comments, code cleaning, and move GetRunningMicroSecs() prototype from common.h to profile.h.
profile.h should now contain all info for profiling.
2017-01-02 13:49:36 +01:00
Simon Richter ac9f858813 Performance counter rework 2016-12-31 12:57:42 +01:00
Maciej Suminski 89055c4425 Code formatting 2016-12-12 16:45:52 +01:00
Tomasz Włostowski daf103d7e4 GAL: fix grid origin and grid rendering in flipped view mode 2016-12-12 16:45:52 +01:00
Tomasz Włostowski da28e163d2 Optimizations/fixes to the VIEW/GAL classes:
- much faster Cairo rendering (outperforms legacy)
- improvements in VIEW update handling
- fixed issue with grid rendering in flip view mode
2016-12-12 16:45:52 +01:00
Tomasz Włostowski c661c30f68 pcbnew: added flip view mode 2016-12-12 16:45:52 +01:00
jean-pierre charras 30df041de6 fix shadowed local variables 2016-11-25 18:17:34 +01:00
decimad 402f53a302 update font code along with the changes done in the msdf atlas tool (use codepoint spans and refined char placement)
add font coordinate system clarification drawing (svg)
2016-10-20 14:31:09 +02:00
decimad d9a8aac96c transfer font texture width to the fragment shader via uniform variable 2016-10-20 14:31:09 +02:00
Chris Pavlina 71263c32e8 Dismiss signed index warning in opengl_gal.cpp 2016-09-30 22:32:24 -04:00
Maciej Suminski 7a5f72c948 Fixed a crash when drawing a single point polyline 2016-09-29 15:34:08 +02:00
decimad f78721b451 Multichannel Signed Distance Field text rendering for OpenGL GAL 2016-09-14 10:00:49 +02:00
Maciej Suminski 9f5f0ab31b Minor OpenGL GAL code changes 2016-08-08 14:17:40 +02:00
Maciej Suminski c9a41be774 Added licence for the GAL bitmap font 2016-08-03 17:02:43 +02:00
Simon Richter da5699de0a Replace boost::shared_ptr with std::shared_ptr. 2016-06-29 11:09:55 -04:00
Michael Steinberg fde12ebd25 Replace boost::function and boost::bind with their std:: counterparts 2016-06-29 12:23:11 +02:00
Maciej Suminski b82ccc3b4e Reverted 6912 with minor changes (LockCtx requires to specify canvas that locks a context). 2016-06-13 16:43:33 +02:00
Maciej Suminski 57d4e8d51d Fixed OpenGL crash on canvas switch. 2016-06-13 09:35:36 +02:00
Maciej Suminski b7ec4ea160 Corrected the last instance check in OPENGL_GAL. 2016-06-10 17:07:12 +02:00
Simon Richter 2928cb7419 Replace unshared boost::shared_array with std::unique_ptr 2016-06-08 09:43:07 +02:00
Maciej Suminski 3fcae6b120 Fixes for OpenGL resources handling. 2016-06-07 14:42:42 +02:00
Maciej Suminski b4ad18a3ea Do not rebuild shaders on each OPENGL_GAL construction. 2016-06-03 15:46:13 +02:00
Maciej Suminski b83c148e10 Delete OpenGL context on GLCanvas subclasses destruction. 2016-06-03 15:46:13 +02:00
Maciej Suminski 68b6da57c0 Removed OPENGL_GAL::instanceCounter. 2016-06-03 15:46:12 +02:00
Maciej Suminski 01f32dd52c GL_CONTEXT_MANAGER class to avoid unexpected GL context switches. 2016-06-03 15:46:12 +02:00
Maciej Suminski 4f7bb4c0f7 Simplified error checking in OPENGL_GAL test. 2016-06-03 15:46:11 +02:00
jean-pierre charras 3e2cae946c Corrected wxDC objects used by EDA_DRAW_PANEL_GAL & OPENGL_GAL. 2016-06-03 15:46:11 +02:00
jean-pierre charras 1ae9175671 A few minor fixes for compil warnings (shadowed variables and deprecated auto_ptr) 2016-05-29 17:02:34 +02:00
jean-pierre charras ca0113ab65 Fix my previous commit: I committed the wrong file 2016-05-28 21:51:35 +02:00
jean-pierre charras b7f863dc4c Fix the commit 6838 (Fix non optimal position of net name and pad name in GAL mode), broken. 2016-05-28 21:46:13 +02:00
Maciej Suminski a42cb0ef8c OpenGL GAL: Set context in destructor when possible (under Linux the window has to be visible). 2016-05-09 18:00:34 +02:00
Maciej Suminski d9f4877c94 Fixed a crash when starting pcbnew with OpenGL GAL. 2016-05-09 17:23:01 +02:00
Maciej Suminski cca36d355a Remove unnecessary debug messages (OpenGL GAL). 2016-05-04 10:10:15 +02:00
Maciej Suminski 22c4e4d240 Set OpenGL context only when the parent window is visible. 2016-05-03 16:39:58 +02:00
Maciej Suminski 55976e39ef Fixed crash occuring when a vertex buffer is mapped in invalid OpenGL context. 2016-05-03 16:16:59 +02:00
Maciej Suminski a62d2b5412 Bigger net labels (GAL). 2016-05-03 15:15:08 +02:00
Maciej Suminski 8d952f35c6 Fixed text vertical alignment for bitmap font (OpenGL). 2016-05-03 11:58:48 +02:00
Maciej Suminski 58ed0c8cce Improved grid drawing routine (OpenGL). 2016-05-02 16:15:24 +02:00
Maciej Suminski fff3abc9a0 Support for overbars in bitmap fonts (OpenGL GAL). 2016-05-02 16:12:18 +02:00
Maciej Suminski c506d2b16c Set OpenGL context before freeing video resources. 2016-05-02 16:12:18 +02:00
Maciej Suminski 59fe8df269 Split bitmap text drawing routine into smaller functions (GAL). 2016-05-02 16:12:18 +02:00
Maciej Suminski 702be4903f Vertices are stored in GPU memory (OpenGL GAL). 2016-05-02 16:12:16 +02:00
Maciej Suminski b32fdd97d9 Changed shading model to flat. 2016-05-02 16:12:15 +02:00
Maciej Suminski e2c8e07344 Enabled mipmapping for bitmap fonts. 2016-05-02 16:12:14 +02:00
Maciej Suminski 928d4e0404 SwapBuffers() contain an implicit glFlush() 2016-05-02 16:08:50 +02:00
Maciej Suminski bda3011519 Initial support for bitmap fonts (OpenGL GAL). 2016-05-02 16:04:45 +02:00
Maciej Suminski 431e343201 Switch to direct rendering before clearing the screen (OpenGL GAL). 2016-05-02 15:56:19 +02:00
Maciej Suminski 5ba84dda0a OpenGL capabilities test is run only once. 2016-05-02 15:56:19 +02:00
Maciej Suminski 36dd6eb6b3 GAL profiling output is enabled with WXTRACE env variable. 2016-05-02 15:56:17 +02:00
Maciej Suminski c0465e5519 Instance counter for OPENGL_GAL to avoid double freeing. 2016-05-02 15:56:16 +02:00
Maciej Suminski 4262915b38 Code formatting. 2016-05-02 15:56:10 +02:00
Maciej Suminski 0cfa360390 Added VERTEX_MANAGER::Reserve() function. 2016-05-02 15:56:10 +02:00
Bernhard Stegmaier 3e2b4244f9 OSX: add support for wxMagnifyEvent on OSX builds using wxWidgets 3.1.0 or greater. 2016-01-24 19:18:29 -05:00
Maciej Suminski 4951285a67 GAL::DrawPolygon() and GAL::DrawPolyline() variants that work with VECTOR2D array. 2016-01-20 15:16:39 +01:00
Maciej Suminski 9b4d12653e FIxed the drawing layer for arcs (GAL). 2015-12-03 15:05:53 +01:00
unknown c1b46e6ed8 Fix bug Bug #1519590 (gal cannot start on surface book) 2015-11-29 07:50:25 +01:00
Maciej Suminski 247f018075 FIxed rendering artifacts in OpenGL canvas. 2015-09-09 10:49:25 +02:00
Maciej Suminski 0386a4df94 Bulletproof canvas switching. 2015-08-21 10:33:36 +02:00
jean-pierre charras 1c9115ee91 opengl_gal: fix a strange but already encountered issue on Ubuntu/Unity when switching to GAL: the dialog which test the opengl version was never raised, and the Pcb editor frame partially no more responding to menu events.
Also fix a bug: this test dialog was never destroyed.
2015-07-13 10:46:05 +02:00
Maciej Suminski 51c0ae3480 Fixed cursor offset in GAL. 2015-07-01 03:46:42 +02:00
Maciej Suminski d3c7b45438 Corrected GAL canvases screen size, so they do not include scroll bars. 2015-06-30 14:08:35 +02:00
Garth Corral 6eaf029a0e Pinch to zoom for OS X. 2015-05-21 22:54:29 +02:00
Maciej Suminski 48a74dba37 Added missing 'def' 2015-05-21 00:47:53 +02:00
Maciej Suminski 420c1d1bcd Changed the patch to support full resolution on Retina screens to be more bulletproof. 2015-05-21 00:42:46 +02:00