Commit 55261a2d authored by Albert Astals Cid's avatar Albert Astals Cid

replace floor with a cast to int for numbers > 0

bug-poppler13487.pdf gets a 15% faster rendering
parent 28df9fb3
......@@ -4,6 +4,20 @@
//
//========================================================================
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
//
//========================================================================
#ifndef SPLASHMATH_H
#define SPLASHMATH_H
......@@ -26,7 +40,8 @@ static inline int splashFloor(SplashCoord x) {
#if USE_FIXEDPOINT
return FixedPoint::floor(x);
#else
return (int)floor(x);
if (x > 0) return (int)x;
else return (int)floor(x);
#endif
}
......@@ -42,7 +57,7 @@ static inline int splashRound(SplashCoord x) {
#if USE_FIXEDPOINT
return FixedPoint::round(x);
#else
return (int)floor(x + 0.5);
return (int)splashFloor(x + 0.5);
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment