58f553a9ca
requires that cache be layer-sensitive.
Fixes https://gitlab.com/kicad/code/kicad/issues/11814
This commit is contained in:
parent
b56917210d
commit
5e80e2a421
|
@ -1071,16 +1071,16 @@ public:
|
|||
};
|
||||
|
||||
// ------------ Run-time caches -------------
|
||||
std::mutex m_CachesMutex;
|
||||
std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, bool > m_InsideCourtyardCache;
|
||||
std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, bool > m_InsideFCourtyardCache;
|
||||
std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, bool > m_InsideBCourtyardCache;
|
||||
std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, bool > m_InsideAreaCache;
|
||||
std::map< wxString, LSET > m_LayerExpressionCache;
|
||||
std::mutex m_CachesMutex;
|
||||
std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, bool > m_InsideCourtyardCache;
|
||||
std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, bool > m_InsideFCourtyardCache;
|
||||
std::map< std::pair<BOARD_ITEM*, BOARD_ITEM*>, bool > m_InsideBCourtyardCache;
|
||||
std::map< std::tuple<BOARD_ITEM*, BOARD_ITEM*, PCB_LAYER_ID>, bool > m_InsideAreaCache;
|
||||
std::map< wxString, LSET > m_LayerExpressionCache;
|
||||
|
||||
std::map< ZONE*, std::unique_ptr<DRC_RTREE> > m_CopperZoneRTrees;
|
||||
std::map< ZONE*, std::unique_ptr<DRC_RTREE> > m_CopperZoneRTrees;
|
||||
|
||||
ZONE* m_SolderMask;
|
||||
ZONE* m_SolderMask;
|
||||
|
||||
private:
|
||||
// The default copy constructor & operator= are inadequate,
|
||||
|
|
|
@ -154,11 +154,15 @@ bool DRC_TEST_PROVIDER_DISALLOW::Run()
|
|||
if( m_drcEngine->IsCancelled() )
|
||||
break;
|
||||
|
||||
std::pair<BOARD_ITEM*, BOARD_ITEM*> key( ruleArea, copperZone );
|
||||
std::tuple<BOARD_ITEM*, BOARD_ITEM*, PCB_LAYER_ID> key( ruleArea,
|
||||
copperZone,
|
||||
UNDEFINED_LAYER );
|
||||
|
||||
{
|
||||
std::unique_lock<std::mutex> cacheLock( board->m_CachesMutex );
|
||||
board->m_InsideAreaCache[ key ] = isInside;
|
||||
}
|
||||
|
||||
done.fetch_add( 1 );
|
||||
}
|
||||
|
||||
|
|
|
@ -584,10 +584,11 @@ bool isInsideArea( BOARD_ITEM* aItem, const EDA_RECT& aItemBBox, PCB_EXPR_CONTEX
|
|||
if( !aArea || aArea == aItem || aArea->GetParent() == aItem )
|
||||
return false;
|
||||
|
||||
BOARD* board = aArea->GetBoard();
|
||||
std::unique_lock<std::mutex> cacheLock( board->m_CachesMutex );
|
||||
std::pair<BOARD_ITEM*, BOARD_ITEM*> key( aArea, aItem );
|
||||
auto i = board->m_InsideAreaCache.find( key );
|
||||
BOARD* board = aArea->GetBoard();
|
||||
std::unique_lock<std::mutex> cacheLock( board->m_CachesMutex );
|
||||
PCB_LAYER_ID layer = aCtx->GetLayer();
|
||||
std::tuple<BOARD_ITEM*, BOARD_ITEM*, PCB_LAYER_ID> key( aArea, aItem, layer );
|
||||
auto i = board->m_InsideAreaCache.find( key );
|
||||
|
||||
if( i != board->m_InsideAreaCache.end() )
|
||||
return i->second;
|
||||
|
|
Loading…
Reference in New Issue