396 Commits

Author SHA1 Message Date
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 ca985791bcd647d380069fc56c79fe04c171e156.
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