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
5d704c96
Commit
5d704c96
authored
Apr 18, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turned on group recaching on GAL change.
parent
a96c5379
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
view.cpp
common/view/view.cpp
+31
-8
view.h
include/view/view.h
+4
-0
No files found.
common/view/view.cpp
View file @
5d704c96
...
...
@@ -143,7 +143,7 @@ VIEW::VIEW( bool aIsDynamic, bool aUseGroups ) :
m_dynamic
(
aIsDynamic
),
m_useGroups
(
aUseGroups
)
{
// By default there is no
t
layer on the top
// By default there is no layer on the top
m_topLayer
.
enabled
=
false
;
}
...
...
@@ -201,6 +201,10 @@ void VIEW::SetGAL( GAL* aGal )
{
m_gal
=
aGal
;
// items need to be recached after changing GAL
if
(
m_useGroups
)
itemsRecache
();
// force the new GAL to display the current viewport.
SetCenter
(
m_center
);
SetScale
(
m_scale
);
...
...
@@ -374,19 +378,14 @@ struct VIEW::drawItem
{
group
=
gal
->
BeginGroup
();
aItem
->
m_cachedGroup
=
group
;
aItem
->
ViewDraw
(
0
,
gal
,
tmp
);
view
->
m_painter
->
Draw
(
static_cast
<
EDA_ITEM
*>
(
aItem
),
currentLayer
);
gal
->
EndGroup
();
gal
->
DrawGroup
(
group
);
}
}
else
if
(
aItem
->
ViewIsVisible
()
)
{
if
(
!
(
view
->
m_painter
&&
view
->
m_painter
->
Draw
(
static_cast
<
EDA_ITEM
*>
(
aItem
),
currentLayer
)
)
)
{
// Fallback, if there is no painter or painter does not know how to draw aItem
aItem
->
ViewDraw
(
currentLayer
,
gal
,
tmp
);
}
view
->
m_painter
->
Draw
(
static_cast
<
EDA_ITEM
*>
(
aItem
),
currentLayer
);
}
time
+=
rdtsc
()
-
ts
;
...
...
@@ -445,6 +444,15 @@ struct VIEW::unlinkItem
};
struct
VIEW
::
recacheItem
{
void
operator
()(
VIEW_ITEM
*
aItem
)
{
aItem
->
m_cachedGroup
=
-
1
;
}
};
void
VIEW
::
Clear
()
{
BOX2I
r
;
...
...
@@ -544,3 +552,18 @@ void VIEW::clearGroupCache()
l
->
items
->
Query
(
r
,
visitor
);
};
}
void
VIEW
::
itemsRecache
()
{
BOX2I
r
;
r
.
SetMaximum
();
for
(
LayerMapIter
i
=
m_layers
.
begin
();
i
!=
m_layers
.
end
();
++
i
)
{
VIEW_LAYER
*
l
=
&
(
(
*
i
).
second
);
recacheItem
visitor
;
l
->
items
->
Query
(
r
,
visitor
);
};
}
include/view/view.h
View file @
5d704c96
...
...
@@ -328,6 +328,7 @@ private:
// Function objects that need to access VIEW/VIEW_ITEM private/protected members
struct
clearItemCache
;
struct
unlinkItem
;
struct
recacheItem
;
struct
drawItem
;
///* Saves current top layer settings in order to restore it when it's not top anymore
...
...
@@ -349,6 +350,9 @@ private:
///* Clears cached GAL display lists
void
clearGroupCache
();
///* Rebuilds GAL display lists
void
itemsRecache
();
/// Determines rendering order of layers. Used in display order sorting function.
static
bool
compareRenderingOrder
(
VIEW_LAYER
*
i
,
VIEW_LAYER
*
j
)
{
...
...
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