Performance fixes relating to floating point constants

This replaces unnecessary double-precision soft-float operations with
single-precision floating-point operations, mainly by casting.

In a couple places I also replace a function call with a constant.
This commit is contained in:
Neven Sajko
2020-02-21 19:02:49 +00:00
committed by LeaNumworks
parent 068325d151
commit c92b770112
26 changed files with 46 additions and 44 deletions

View File

@@ -69,8 +69,8 @@ void FunctionGraphView::reloadBetweenBounds(float start, float end) {
if (start == end) {
return;
}
float pixelLowerBound = floatToPixel(Axis::Horizontal, start)-2.0;
float pixelUpperBound = floatToPixel(Axis::Horizontal, end)+4.0;
float pixelLowerBound = floatToPixel(Axis::Horizontal, start) - 2.0f;
float pixelUpperBound = floatToPixel(Axis::Horizontal, end) + 4.0f;
/* We exclude the banner frame from the dirty zone to avoid unnecessary
* redrawing */
KDRect dirtyZone(KDRect(pixelLowerBound, 0, pixelUpperBound-pixelLowerBound,