mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph] Activated caching for graph drawing
Added a default argument to CurveView::drawCurve : a function to initiate the memoization of continuous functions. The function is implemented in ContinuousFunctionCache and provided by GraphView. This should be invisible to other types of curves that rely on CurveView::drawCurve. Change-Id: I59aa55d67154b6d4bf9614b7ed87c48408773d86
This commit is contained in:
committed by
Émilie Feral
parent
c70b545ba1
commit
95fef86ec0
@@ -62,7 +62,8 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ContinuousFunction * f = (ContinuousFunction *)model;
|
||||
Poincare::Context * c = (Poincare::Context *)context;
|
||||
return f->evaluateXYAtParameter(t, c);
|
||||
});
|
||||
},
|
||||
&ContinuousFunctionCache::PrepareCache);
|
||||
/* Draw tangent */
|
||||
if (m_tangent && record == m_selectedRecord) {
|
||||
float tangentParameterA = f->approximateDerivative(m_curveViewCursor->x(), context());
|
||||
@@ -83,7 +84,9 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ContinuousFunction * f = (ContinuousFunction *)model;
|
||||
Poincare::Context * c = (Poincare::Context *)context;
|
||||
return f->evaluateXYAtParameter(t, c);
|
||||
}, f.operator->(), context(), false, f->color());
|
||||
}, f.operator->(), context(), false, f->color(),
|
||||
true, false, 0.0f, 0.0f, /* drawCurve's default arguments */
|
||||
&ContinuousFunctionCache::PrepareCache);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user