Commit Graph

298 Commits

Author SHA1 Message Date
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 795fd28742 Set Stroke/Fill settings for stroke font in its Draw() function. 2016-05-02 15:56:17 +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 dbff9ad786 Improved error checking in GPU_MANAGER. 2016-05-02 15:56:16 +02:00
Maciej Suminski 4cca3bc368 Minor OPENGL_COMPOSITOR refactoring. 2016-05-02 15:56:16 +02:00
Maciej Suminski 1927f3a787 Unified way of checking OpenGL errors. 2016-05-02 15:56:14 +02:00
Maciej Suminski 2a276550eb Fixed SHADER::AddParameter() function. 2016-05-02 15:56:13 +02:00
Maciej Suminski b143ce6b0f Moved text settings from STROKE_FONT to GAL. 2016-05-02 15:56:12 +02:00
Maciej Suminski da312db7a4 Fixed a wxWidgets assertion. Newer wxWidgets (3.1) display a message saying that horizontal alignment flags are ignored with wxEXPAND. 2016-05-02 15:56:12 +02:00
Maciej Suminski 113e75c5c5 VERTEX_MANAGER functions return false in case of failure. 2016-05-02 15:56:11 +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
jean-pierre charras 67982a4851 stroke font: fine adjust of text horizontal position. edat_text: fix an issue in SetOrientation: the rotation angle is now constrained between -360 and +360 degrees.
It was previously not the case, and rotated texts outside this interval created issues in dialog_pcb_text_properties which have now validators.
2016-04-19 20:35:47 +02:00
Maciej Suminski 99e7e8c983 Disabled CACHED_CONTAINER freeing memory on GAL<->legacy switch. 2016-04-04 13:54:55 +02:00
jean-pierre charras 18cb83f5c7 OpenGL mode: Disable frequent (and not very usefull) memory deallocation/reallocation to avoid "out of memory" issue due to heap fragmentation (noticeable only with large boards).
Note: there is still this issue when switching back legacy mode  and to Opengl mode because the heap is still freed and reallocated.
2016-04-04 12:41:48 +02:00
jean-pierre charras 426f7ebb2e Rework on class EDA_TEXT and related classes and draw text functions. More work: remove useless or duplicate code (from legacy graphic text plot functions). Move basic_gal code to separate files. 2016-03-25 09:33:45 +01:00
jean-pierre charras 92ce9c1193 Rework on class EDA_TEXT and related classes and draw text functions. More work: remove useless or duplicate code (from legacy graphic text plot functions). Move basic_gal code to separate files. 2016-03-25 09:26:11 +01:00
jean-pierre charras bc699c8d8f Rework on class EDA_TEXT and related classes and draw functions. More work. Eechema: in rotate texts: redraw the full screen to avoid garbage on screen. 2016-03-23 13:16:27 +01:00
jean-pierre charras 30d72045e7 Rework on class EDA_TEXT and related classes and draw functions (Note: this is a work in progress):
* remove duplicate code between  draw functions and STROKE_FONT used in GAL. Use only  STROKE_FONT methods in draw, plot and test DRC function for texts. It remove slightly different shapes between GAL and other calculations.
* fix incorrect bounding box for texts with overbar. Especially noticeable for texts with overbar inside a copper zone in Pcbnew.
* fix a few minor other bugs related to graphic texts.
2016-03-23 08:41:47 +01:00
jean-pierre charras 99e81aeb9c Fix incorrect (too small) bounding box EDA_TEXT, noticeable when chars like j or { are used in zone fill functions.
I tried to merge some constants used both in legacy mode and gal mode (which were, before this patch, separate constants).
There is still a serious work to avoid different calculation code for the same text in draw and plot functions.
Work in progress to merge these calculation functions.
2016-03-11 13:08:34 +01: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
jean-pierre charras ecad3ad235 Netlist generator: avoid changing the order of parts in libparts section each time libraries are reloaded.
pic_programmer demo: very minor fix and update netlist.
cached_container.cpp:  more info when the message "Out of memory" is displayed.
2015-11-05 17:28:31 +01:00
jean-pierre charras a23cbe052d Opengl canvas: avoid hanging when the CACHED_CONTAINER is "out of memory" (which can happen which very large boards) and the vertex manager cannot allocate an other vertex: the message "Vertex allocation error" is now shown only once.
the opengl canvas cannot show the full board, but at least the user can save the board, or switch to the legacy canvas.
2015-11-04 13:27:42 +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
Maciej Suminski 4739c54f0e Few minor updates to CACHED_CONTAINER & GPU_MANAGER classes. - Reduced the number of memory reallocations - Updated code for tests 2015-08-03 21:12:00 +02:00
unknown 40ccc0bedf replace round() with KiROUND(), our function that is used almost everywhere for rounding, and detects int overflows in debug mode. 2015-07-17 10:26:48 +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 785638a396 more fix for Cairo setting screen size. 2015-06-30 15:06:30 +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
Maciej Suminski 28a270a328 Refactored grid origin point drawing (GAL). 2015-06-18 17:51:53 +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
jean-pierre charras bb50e141f4 Pcbnew: Force visibility of items which have no option in dialogs to controle this visibility, when reading the .kicad_brd file.
these options are used in GAL mode, but the usercannot control this visibility. So if the board file does not have these visibility flags set, the GAL never show them.
Fix also a compil warning.
2015-03-26 14:20:11 +01:00
jean-pierre charras 6e8a8a6b25 Fix some coverity warnings (mainly not initialized members) 2015-03-21 10:06:04 +01:00
Chris Pavlina 1d2e2e555b Final solution for the text overbar problem in GAL. 2015-03-16 18:18:18 +01:00
Chris Pavlina e6db185f2e Adjusted text overbar height in GAL. 2015-03-16 16:42:45 +01:00
jean-pierre charras 9004ed8801 Remove a few coverity warnings. Fix some comments which were incorrect, due to the changes in code. Remove not compiled code (kept as comments), now outdated or useless
legacy plugin: better compatibility with old brd files (current track width and current vias size, stored in SETUP section, were not read from file and incorrectly set)
2015-03-13 17:48:42 +01:00
Maciej Suminski b6c5b291a2 Coverity fixes. 2015-03-11 14:17:43 +01:00
Maciej Suminski e6a10faab7 FIxed a few clang warnings. 2015-03-09 11:06:54 +01:00
Eldar Khayrullin 5d8f7ba0e6 bugfix: cannot draw 180 degree arc in OpenGL canvas 2015-03-09 10:26:29 +01:00
Alexander Golubev f2ce42ddb5 fix several -Woverloaded-virtual warnings in common/* dir
- CACHED_CONTAINER::GetVertices: removed useless and unused function
   which does nothing but tainted the API
 - SHAPE_LINE_CHAIN::Collide( const BOX2I& aBox, int aClearance ):
   removed an outdated function with assert(false)
 - SHAPE::BBox(): fix a small typo in the doc string
2015-03-06 15:26:47 +01:00
Mark Roszko 3918d3f0b2 Eeschema code cleanup and coverity fixes. 2015-02-21 09:11:58 +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
Tomasz Wlostowski 7721d02afe gal/stroke_font: made text vertical alignment follow the non-GAL renderer. 2014-11-14 19:19:08 +01:00
Maciej Suminski 90c7c72d81 Reverted missing changes. 2014-11-13 16:37:15 +01:00
Maciej Suminski 7de3aa9af2 Reverted the last commit, apparently not every GLEW contains required definitions. 2014-11-13 16:30:30 +01:00
Maciej Suminski 1f8b77697f gal: Check maximum framebuffer size (OpenGL). 2014-11-13 16:17:53 +01:00
Paulo Henrique Silva 3132690c0b Fix slow opengl canvas on Mac OS 10.9. 2014-09-13 19:31:40 +02:00
Maciej Suminski 490a73b62a Fixed filled arcs drawing (GAL). 2014-08-06 13:51:46 +02:00
Maciej Suminski 1d378cfcd1 View is automatically centered when a module editor or viewer are opened (GAL). 2014-07-23 12:06:24 +02:00
jean-pierre charras 4fc4ea6147 Make some system error messages not translatable. Better comments in some dialogs. 2014-07-23 12:48:30 +02:00
Maciej Suminski a57f7ae8cd Fix OpenGL canvas freeze under Windows. 2014-07-20 21:14:42 +02:00
Maciej Suminski 14cfd173e6 Fixed the Module viewer crash when there is no footprint loaded. 2014-07-09 16:57:01 +02:00
Maciej Suminski 65c116621d Added support for changing the cursor size. 2014-07-09 15:10:32 +02:00
Maciej Suminski b076f3fe4e Fixed grid drawing when the grid origin has negative coordinates. 2014-07-09 15:02:56 +02:00
Maciej Suminski 7645ed8601 Grid offset is recomputed only when settings are changed. 2014-07-09 11:22:43 +02:00
Maciej Suminski 0fc93666c6 Rework to support multiple views with OpenGL GAL canvas. 2014-07-09 11:22:42 +02:00
Maciej Suminski 0304598a71 Fixed vertical alignment for strings that contain a newline character at the end (GAL). 2014-07-07 13:09:44 +02:00
Bernhard Stegmaier 60a86853ec Removed a few warnings. 2014-06-05 12:40:26 +02:00
Maciej Suminski 35e343597b Grid in GAL takes into account grid offset. 2014-06-04 17:56:44 +02:00
jean-pierre charras e140f79aba Fix some compil warnings and Debug assertions. 2014-06-04 20:48:49 +02:00
jean-pierre charras f76041e956 Fix some compil warnings and Debug assertions 2014-06-04 19:34:23 +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 1c253bfba0 Some variables initialized to NULL. 2014-02-24 11:17:49 +01:00
Maciej Suminski 3ecae4fa52 GAL::GetGridPoint() returns point in world coordinates. 2014-02-14 14:16:08 +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 5c9e7d9b9b Merged the lp:~cern-kicad/kicad/selection_tool branch. 2014-02-06 12:48:18 +01:00
Maciej Suminski b9df36eca5 GAL::GetGridPoint() takes a const reference. 2014-02-06 12:38:06 +01:00
Maciej Suminski 537d82fb98 Upstream merge. 2014-01-06 10:29:31 +01:00
Dick Hollenbeck c264823731 8 bit string relief via class UTF8 2014-01-01 20:17:07 -06:00
Maciej Suminski 84c496e138 Upstream merge 2013-12-19 11:15:27 +01:00
Maciej Suminski 4a0407fb69 Removed some debug logs. 2013-12-18 12:46:18 +01:00
Maciej Suminski 60e3b01ace Fixed drawing of rotated texts that are not horizontally center aligned. 2013-12-16 10:36:33 +01:00
Dick Hollenbeck 5df7288678 complete class UTF8.cpp 2013-12-08 00:48:25 -06:00
Dick Hollenbeck 7d58d82656 common/gal/stroke_font.cpp was segfaulting in wx 2.8 when drawing multi-line string. 2013-12-07 22:47:37 -06:00
Dick Hollenbeck a2f6faf161 Switch STROKE_FONT::Draw() to take "const wxString&" rather than "wxString" by value. 2013-12-05 12:59:27 -06:00