Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
c9199ea8
Commit
c9199ea8
authored
Jul 25, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed high contrast mode in OpenGL. Split display settings loading into more appropriate places.
parent
4076f993
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
47 deletions
+69
-47
gpu_manager.cpp
common/gal/opengl/gpu_manager.cpp
+1
-1
vertex_manager.cpp
common/gal/opengl/vertex_manager.cpp
+8
-4
vertex_container.h
include/gal/opengl/vertex_container.h
+11
-1
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+30
-39
initpcb.cpp
pcbnew/initpcb.cpp
+7
-1
pcbframe.cpp
pcbnew/pcbframe.cpp
+12
-1
No files found.
common/gal/opengl/gpu_manager.cpp
View file @
c9199ea8
...
...
@@ -111,7 +111,7 @@ void GPU_CACHED_MANAGER::BeginDrawing()
{
wxASSERT
(
!
m_isDrawing
);
if
(
m_container
->
i
sDirty
()
)
if
(
m_container
->
I
sDirty
()
)
uploadToGpu
();
// Number of vertices to be drawn in the EndDrawing()
...
...
common/gal/opengl/vertex_manager.cpp
View file @
c9199ea8
...
...
@@ -101,12 +101,14 @@ void VERTEX_MANAGER::ChangeItemColor( const VERTEX_ITEM& aItem, const COLOR4D& a
VERTEX
*
vertex
=
m_container
->
GetVertices
(
offset
);
for
(
unsigned
int
i
=
0
;
i
<
size
;
++
i
)
{
vertex
->
r
=
aColor
.
r
;
vertex
->
g
=
aColor
.
g
;
vertex
->
b
=
aColor
.
b
;
vertex
->
a
=
aColor
.
a
;
vertex
->
r
=
aColor
.
r
*
255.0
;
vertex
->
g
=
aColor
.
g
*
255.0
;
vertex
->
b
=
aColor
.
b
*
255.0
;
vertex
->
a
=
aColor
.
a
*
255.0
;
vertex
++
;
}
m_container
->
SetDirty
();
}
...
...
@@ -121,6 +123,8 @@ void VERTEX_MANAGER::ChangeItemDepth( const VERTEX_ITEM& aItem, GLfloat aDepth )
vertex
->
z
=
aDepth
;
vertex
++
;
}
m_container
->
SetDirty
();
}
...
...
include/gal/opengl/vertex_container.h
View file @
c9199ea8
...
...
@@ -111,7 +111,7 @@ public:
* returns information about container cache state. Clears the flag after calling the function.
* @return true in case the vertices have to be reuploaded.
*/
inline
bool
i
sDirty
()
inline
bool
I
sDirty
()
{
bool
state
=
m_dirty
;
...
...
@@ -120,6 +120,16 @@ public:
return
state
;
}
/**
* Function SetDirty()
* sets the dirty flag, so vertices in the container are going to be reuploaded to the GPU on
* the next frame.
*/
inline
void
SetDirty
()
{
m_dirty
=
true
;
}
protected
:
VERTEX_CONTAINER
(
unsigned
int
aSize
=
defaultInitSize
);
...
...
pcbnew/basepcbframe.cpp
View file @
c9199ea8
...
...
@@ -182,45 +182,6 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard )
view
->
Add
(
zone
);
}
// Apply layer coloring scheme & display options
if
(
view
->
GetPainter
()
)
{
KiGfx
::
PCB_RENDER_SETTINGS
*
settings
=
new
KiGfx
::
PCB_RENDER_SETTINGS
();
// Load layers' colors from PCB data
settings
->
ImportLegacyColors
(
m_Pcb
->
GetColorsSettings
()
);
view
->
GetPainter
()
->
ApplySettings
(
settings
);
// Load display options (such as filled/outline display of items)
settings
->
LoadDisplayOptions
(
DisplayOpt
);
}
// Set rendering order of layers
for
(
LAYER_NUM
i
=
0
;
i
<
sizeof
(
GalLayerOrder
)
/
sizeof
(
LAYER_NUM
);
++
i
)
{
wxASSERT
(
i
<
KiGfx
::
VIEW
::
VIEW_MAX_LAYERS
);
view
->
SetLayerOrder
(
GalLayerOrder
[
i
],
i
);
}
// Netnames are drawn only when scale is sufficient (level of details)
// so there is no point in caching them
for
(
LAYER_NUM
layer
=
FIRST_NETNAME_LAYER
;
layer
<=
LAST_NETNAME_LAYER
;
++
layer
)
{
view
->
SetLayerTarget
(
layer
,
KiGfx
::
TARGET_NONCACHED
);
}
// Load layer & elements visibility settings
for
(
LAYER_NUM
i
=
0
;
i
<
NB_LAYERS
;
++
i
)
{
view
->
SetLayerVisible
(
i
,
m_Pcb
->
IsLayerVisible
(
i
)
);
}
for
(
LAYER_NUM
i
=
0
;
i
<
END_PCB_VISIBLE_LIST
;
++
i
)
{
view
->
SetLayerVisible
(
ITEM_GAL_LAYER
(
i
),
m_Pcb
->
IsElementVisible
(
i
)
);
}
view
->
RecacheAllItems
(
true
);
if
(
m_galCanvasActive
)
m_galCanvas
->
Refresh
();
...
...
@@ -827,6 +788,36 @@ void PCB_BASE_FRAME::LoadSettings()
if
(
m_DisplayModText
<
LINE
||
m_DisplayModText
>
SKETCH
)
m_DisplayModText
=
FILLED
;
// Apply display settings for GAL
KiGfx
::
VIEW
*
view
=
m_galCanvas
->
GetView
();
// Set rendering order of layers
for
(
LAYER_NUM
i
=
0
;
i
<
sizeof
(
GalLayerOrder
)
/
sizeof
(
LAYER_NUM
);
++
i
)
{
wxASSERT
(
i
<
KiGfx
::
VIEW
::
VIEW_MAX_LAYERS
);
view
->
SetLayerOrder
(
GalLayerOrder
[
i
],
i
);
}
// Netnames are drawn only when scale is sufficient (level of details)
// so there is no point in caching them
for
(
LAYER_NUM
layer
=
FIRST_NETNAME_LAYER
;
layer
<=
LAST_NETNAME_LAYER
;
++
layer
)
{
view
->
SetLayerTarget
(
layer
,
KiGfx
::
TARGET_NONCACHED
);
}
// Apply layer coloring scheme & display options
if
(
view
->
GetPainter
()
)
{
KiGfx
::
PCB_RENDER_SETTINGS
*
settings
=
new
KiGfx
::
PCB_RENDER_SETTINGS
();
// Load layers' colors from PCB data
settings
->
ImportLegacyColors
(
m_Pcb
->
GetColorsSettings
()
);
view
->
GetPainter
()
->
ApplySettings
(
settings
);
// Load display options (such as filled/outline display of items)
settings
->
LoadDisplayOptions
(
DisplayOpt
);
}
// WxWidgets 2.9.1 seems call setlocale( LC_NUMERIC, "" )
// when reading doubles in config,
// but forget to back to current locale. So we call SetLocaleTo_Default
...
...
pcbnew/initpcb.cpp
View file @
c9199ea8
...
...
@@ -4,6 +4,9 @@
#include <fctsys.h>
#include <class_drawpanel.h>
#include <class_drawpanel_gal.h>
#include <view/view.h>
#include <pcb_painter.h>
#include <confirm.h>
#include <wxPcbStruct.h>
...
...
@@ -67,9 +70,12 @@ bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery )
// Default copper layers count set to 2: double layer board
GetBoard
()
->
SetCopperLayerCount
(
2
);
// Update display
:
// Update display
GetBoard
()
->
SetVisibleLayers
(
ALL_LAYERS
);
// Set currently selected layer to be shown in high contrast mode, when enabled`
setHighContrastLayer
(
GetScreen
()
->
m_Active_Layer
);
ReFillLayerWidget
();
Zoom_Automatique
(
false
);
...
...
pcbnew/pcbframe.cpp
View file @
c9199ea8
...
...
@@ -472,7 +472,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( wxWindow* parent, const wxString& title,
DisplayError
(
this
,
msg
);
}
}
}
...
...
@@ -813,6 +812,18 @@ void PCB_EDIT_FRAME::syncRenderStates()
void
PCB_EDIT_FRAME
::
syncLayerVisibilities
()
{
m_Layers
->
SyncLayerVisibilities
();
KiGfx
::
VIEW
*
view
=
m_galCanvas
->
GetView
();
// Load layer & elements visibility settings
for
(
LAYER_NUM
i
=
0
;
i
<
NB_LAYERS
;
++
i
)
{
view
->
SetLayerVisible
(
i
,
m_Pcb
->
IsLayerVisible
(
i
)
);
}
for
(
LAYER_NUM
i
=
0
;
i
<
END_PCB_VISIBLE_LIST
;
++
i
)
{
view
->
SetLayerVisible
(
ITEM_GAL_LAYER
(
i
),
m_Pcb
->
IsElementVisible
(
i
)
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment