summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-17 17:18:12 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-17 17:18:12 +0000
commit4b220c600e570b79d6dead2009fae47cf4c9340d (patch)
tree93f51746f10911382aa3623f94a55d7e2f3ee888 /core/fxge
parent512509a5bb48cbd13fba80fbb5bd1a455f6d248d (diff)
downloadpdfium-4b220c600e570b79d6dead2009fae47cf4c9340d.tar.xz
Avoid fmodf() in CFX_BilinearMatrix.
This class is used heavily by CFX_ImageTransformer and fmodf() calculations are expensive. Change-Id: If2b9037eb2e90ae377ffb490483a7e7e4faf63b2 Reviewed-on: https://pdfium-review.googlesource.com/23176 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/dib/cfx_imagetransformer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index 6f3ab86996..5067de4710 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -188,8 +188,8 @@ class CFX_BilinearMatrix : public CPDF_FixedMatrix {
*x1 = pdfium::base::saturated_cast<int>(val.first / kBase);
*y1 = pdfium::base::saturated_cast<int>(val.second / kBase);
- *res_x = static_cast<int>(fmodf(val.first, kBase));
- *res_y = static_cast<int>(fmodf(val.second, kBase));
+ *res_x = static_cast<int>(val.first) % kBase;
+ *res_y = static_cast<int>(val.second) % kBase;
if (*res_x < 0 && *res_x > -kBase)
*res_x = kBase + *res_x;
if (*res_y < 0 && *res_y > -kBase)