John Beard
567bdd9b9d
Add configuration of Hi-DPI canvas scaling in OpenGL
...
First, add automatic detection of toolkit DPI scaling options. For now, this
is, in order,
* Check the GDK_SCALE option under GTK+ (users can set this to force the scaling)
* Check the value from WX's GetContentScalingFactor(). This will start to work
correctly from WX 3.1 and GTK+ 3.10.
Then, add a user-settable override in the main prefs panel, next to the icon
scaling. This is independent of the icon scaling options.
DPI handling is performed in a standalone class, so they can be shared between
the prefs UI and the OpenGL backend easily. Also means Cairo could use the same
interface in future.
Also adjust the OpenGL grid drawing code to use the computed scale factor,
which avoids over-thick grids in scaled environments (the user can manually
thicken the grid if wanted).
Fixes: lp:1797308
* https://bugs.launchpad.net/kicad/+bug/1797308
2019-03-25 15:00:55 +00:00
jean-pierre charras
140abd3952
Pcbnew: fix missing vertical grid lines in flip board view
...
Fixes: lp:1818154
https://bugs.launchpad.net/kicad/+bug/1818154
2019-03-01 11:09:40 +01:00
Seth Hillbrand
269f420f8d
OpenGL: Create shaders for each GL
...
Fixes: lp:1817284
* https://bugs.launchpad.net/kicad/+bug/1817284
2019-02-25 09:31:42 -08:00
Seth Hillbrand
dae7b03465
gal: re-enable arc outline mode
...
Fixes: lp:1816373
* https://bugs.launchpad.net/kicad/+bug/1816373
2019-02-21 10:52:54 -08:00
Seth Hillbrand
066b1782bb
cairo: Fix grid display
...
Grid points were uneven in Cairo compared to OpenGL. This standardizes
the functions for grid types and simplifies the code
2019-02-21 10:49:56 -08:00
Seth Hillbrand
f1a60832e0
opengl: Handle stroked semi-circles
...
And filled but we don't use those yet. No pixel-alignment needed for
stroked semi-circles (I think) as we set the pixel width to be 1
regardless of the zoom level.
Fixes: lp:1816263
* https://bugs.launchpad.net/kicad/+bug/1816263
2019-02-16 19:57:23 -08:00
Tomasz Włostowski
85a7ab7795
gal: minor cleanup & formatting
2019-02-16 20:25:10 +01:00
Tomasz Włostowski
bbee30671a
gal: pixel alignment hacks, works for Retina display too now.
...
gal: pixel alignment for Cairo.
gal: pixel alignment for OpenGL
Cleanup of pixel alignment patches
gal/opengl: more pixel alignment patches:
- works on Retina displays now
- pixel alignment for circles
- correct 1-pixel strokes
- fixed unfinished 1-pixel line ends
GAL: Restore antialiasing options in Cairo
GAL: Fix arc drawing
Removes DrawArcSegment, which drew arcs whose edge was optionally
stroked (a feature that we did not use). Fixes Cairo arc drawing issue
where arcs were not visible in pcbnew.
gal: further cleanup
gal: removed unused shader parameter
2019-02-16 20:03:13 +01:00
Seth Hillbrand
5da4e18664
bitmaps: Handle mask colors
...
Some transparent bitmaps use masking colors to show the binary
opaque/transparent.
Fixes: lp:1814893
* https://bugs.launchpad.net/kicad/+bug/1814893
2019-02-07 21:27:43 -08:00
Seth Hillbrand
3a3bbbb545
GAL: Add transparency for bitmaps and Cairo draw
...
Bitmaps loaded via wx can contain alpha channels. We utilize underlying
routines to correctly map the alpha. This also standardizes the Cairo
alpha calls to ensure correct display in Fallback for partially
transparent highlights
Fixes: lp:1809845
* https://bugs.launchpad.net/kicad/+bug/1809845
2019-01-04 13:40:19 -08:00
jean-pierre charras
26a337db18
Opengl engine: temporary disable bitmaps cache, because it creates serious issues in cross-probing in hierarchies.
...
If a page layout contains bitmaps and is used in all sheets of a hierarchy, and in the board editor,
the cross-probing from pcbnew to eeschema invalidate textures associated to these shared bitmaps,
when switching active sheets.
Usually a crash happens after switching or when closing editors.
As a workaround, I disabled bitmaps (therefore associated textures) cache.
Not optimal, but at least it avoid crashes.
2018-12-30 20:30:43 +01:00
Tomasz Włostowski
3adb8d56c5
OPENGL_GAL: no need to draw line caps when drawing a polyline, the shader takes care of them already
2018-12-24 15:35:25 +01:00
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
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
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
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
Jon Evans
921e68107b
OpenGL: Make circle/arc drawing match Cairo for some edge cases
2018-03-08 22:04:33 -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
Kristoffer Ödmark
e7ddcca569
Fix some netname rendering issues
...
Fixes: lp:1739074
* https://bugs.launchpad.net/kicad/+bug/1739074
2018-01-08 10:29:50 +01:00
Jon Evans
9689200984
OpenGL: Fix background color being drawn twice in no-AA mode
...
Fixes: lp:1741363
* https://bugs.launchpad.net/kicad/+bug/1741363
2018-01-06 17:32:19 +01:00
Mark Roszko
b98cc0b937
Some coverity fixes
2018-01-05 22:51:03 -07:00
Maciej Suminski
2fc07561f1
Fix crash when drawing a polygon with empty outline
...
In theory there should be no polygons with empty outline, but as you see
there was at least one leading to a crash.
Fixes: lp:1739455
* https://bugs.launchpad.net/kicad/+bug/1739455
2017-12-21 09:51:26 +01:00
Maciej Suminski
7741b90c78
gal: Draw grid from edge to edge
...
Fixes: lp:1677211
* https://bugs.launchpad.net/kicad/+bug/1677211
2017-12-20 09:28:39 +01:00
Bernhard Stegmaier
19d7112fa2
Merge HIDPI_GL_CANVAS wrapper with OPENGL_GAL implementation.
2017-12-18 16:26:01 +01:00
Tomasz Włostowski
eed924fe45
Fixed zone filling crash & thermal stubs inconsistency
...
Fixes: lp:1737557
* https://bugs.launchpad.net/kicad/+bug/1737557
Fixes: lp:1737542
* https://bugs.launchpad.net/kicad/+bug/1737542
Fixes: lp:1737541
* https://bugs.launchpad.net/kicad/+bug/1737541
2017-12-14 01:29:08 +01:00
Andreas Buhr
6205363b50
bugfix: OPENGL_GAL::DrawPolygon did not close closed polygons
...
The polygon drawing routing in the OpenGL-GAL did
not plot polygons which are "closed", i.e. have a segment
from their last point to their first point, correctly.
That segment was omitted.
This commit fixes this bug.
2017-12-13 17:01:32 +01:00
Andreas Buhr
5572183c22
bugfix: OPENGL_GAL::drawPolygon did not respect fill settings
...
The OPENGL_GAL::drawPolygon function and all functions using it
did not respect the isFillEnabled member set by
GAL::SetIsFill. This is fixed by this patch.
2017-12-11 10:21:37 +01:00
Maciej Suminski
ef8f5db024
Handle space character in OPENGL_GAL::BitmapText()
...
Fixes: lp:1668455
* https://bugs.launchpad.net/kicad/+bug/1668455
2017-12-07 17:58:54 +01:00
Maciej Suminski
602ecf7502
Fix overbar display in OpenGL canvas
...
Moved the code handling text overbars to a single function
(ProcessOverbars()) to replace similar pieces of code trying to do the
same thing.
Fixes: lp:1735906
* https://bugs.launchpad.net/kicad/+bug/1735906
2017-12-07 17:58:54 +01:00
Tomasz Włostowski
8df299a6bc
pcbnew: Optimized zone filling algorithm: code cleanup
2017-12-05 14:54:57 +01:00
Tomasz Włostowski
316ddadec1
pcbnew: Optimized zone filling algorithm.
2017-12-05 14:54:57 +01:00
Maciej Suminski
5eb56dd8b0
Coverity fixes
...
CIDs:
102571
168696
168701
168704
168706
168708
168710
168713
168716
168717
2017-11-01 10:24:26 +01:00
jean-pierre charras
3407c6cf27
Gerbview: add icons in a context menu.
...
gal: remove a forgotten debug line.
2017-10-23 16:53:42 +02:00
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
Maciej Suminski
6fc59f9acd
Full resolution in OpenGL canvas on Retina displays
2015-05-18 13:48:12 +02:00
Maciej Suminski
709697ea40
Better way to determine supported OpenGL version and extensions.
2015-04-20 14:16:41 +02:00
Maciej Suminski
7480bcf1ae
Yet another desperate trial to fix the depth buffer issues.
2015-04-17 12:15:25 +02:00
Maciej Suminski
4dae107dab
Alternative depth range in OpenGL GAL.
2015-03-30 22:14:37 +02:00
Maciej Suminski
9e8719d3ff
Fixed overlapping segment endings in OpenGL view.
2015-03-30 14:09:56 +02:00
Eldar Khayrullin
5d8f7ba0e6
bugfix: cannot draw 180 degree arc in OpenGL canvas
2015-03-09 10:26:29 +01:00
jean-pierre charras
39497b109e
Pcbnew: fix Bug #1422093 (pcbnew crashes after editing a footprint cominng from the board with the fp editor and saving it on a librray and trying to load it to the board)
...
Some other very minor fixes.
2015-02-17 17:32:47 +01:00
Maciej Suminski
b1ace1607b
Reworked GAL switching.
...
Now OpenGL can report its problems instead of shutting down the application.
2015-02-15 02:18:35 +01:00
jean-pierre charras
d4e04dcc97
Fix bugs detected by Cppcheck.
2015-01-19 20:03:50 +01:00
Maciej Suminski
490a73b62a
Fixed filled arcs drawing (GAL).
2014-08-06 13:51:46 +02:00
Maciej Suminski
a57f7ae8cd
Fix OpenGL canvas freeze under Windows.
2014-07-20 21:14:42 +02:00
Maciej Suminski
0fc93666c6
Rework to support multiple views with OpenGL GAL canvas.
2014-07-09 11:22:42 +02:00
Maciej Suminski
d27ea7895d
Moved background color settings from GAL to RENDER_SETTINGS. Added RENDER_SETTINGS::TranslateColor() to convert between EDA_COLOR_T and COLOR4D.
2014-05-14 10:35:12 +02:00
Maciej Suminski
23392ce8c9
Upstream merge.
2014-04-02 15:38:59 +02:00
Maciej Suminski
dbc4a8f292
GAL zooms in and out using the default hot keys (F1/F2).
...
Screen size is saved in VECTOR2I instead of VECTOR2D.
2014-03-20 08:47:31 +01:00
maciej.
898ed7445f
GAL: fix zooming using mouse wheel with wxWidgets 3.0.
2014-03-19 21:07:49 +01:00
Maciej Suminski
e1ce30d89d
Fixed mouse wheel handling for GAL canvases with wx3.0.
2014-03-19 11:57:59 +01:00
Orson
59a0ced0a6
Corrected the error message about required OpenGL version for GAL. Fixed pcb_calculator .desktop file.
2014-03-14 21:32:25 +01:00
Maciej Suminski
c5a3c1082a
Removed a few RecacheAllItems() calls, some of them changed to specific type recaching (using TYPE_COLLECTOR & VIEW_ITEM::ViewUpdate() ).
...
Removed OPENGL_GAL::SetStrokeColor().
2014-02-25 14:28:09 +01:00
Maciej Suminski
597e98dbf4
Cursor is in world coordinates.
2014-02-13 20:23:28 +01:00
Maciej Suminski
f9f0b46b63
Small GAL refactorization, mostly correcting constness.
2014-02-13 19:31:27 +01:00
Maciej Suminski
e43b5f7c0f
Small fix for crippled polylines containing 0 points.
2014-02-11 15:01:49 +01:00
Maciej Suminski
c21ae6efca
Double click support for the Tool Framework.
2013-11-28 15:19:50 +01:00
Maciej Suminski
fc4f9195b6
Fixed wx2.8 strings compatibility.
2013-11-13 15:52:06 +01:00
Maciej Suminski
5235d7e5eb
Modified error handling for OpenGL backend, now error messages should be visible.
2013-11-11 10:48:49 +01:00
Maciej Suminski
edc43c19cd
Fix colorized framebuffer output on some GPUs.
2013-10-29 17:53:47 +01:00
Maciej Suminski
f615c462a2
Changed the used framebuffer object extension from ARB_framebuffer_object to EXT_framebuffer_object (compatibility reasons).
2013-10-29 17:28:29 +01:00
Maciej Suminski
c7bc1e151c
GAL is not activated by default. Late OpenGL backend initializatization.
2013-10-28 16:51:56 +01:00
Maciej Suminski
bc305859b2
Mainly case changes.
2013-10-14 20:40:36 +02:00
Maciej Suminski
0ac3e1fbf2
Namespace KiGfx->KIGFX.
...
template<> -> template <>
Some more reformatting according to uncrustify results.
2013-10-14 16:13:35 +02:00
Maciej Suminski
22045b61ea
Converted tabs to spaces. Removed trailing whitespaces.
2013-10-14 13:43:57 +02:00