From 4b220c600e570b79d6dead2009fae47cf4c9340d Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 17 May 2018 17:18:12 +0000 Subject: 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 Commit-Queue: Lei Zhang --- core/fxge/dib/cfx_imagetransformer.cpp | 4 ++-- 1 file 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(val.first / kBase); *y1 = pdfium::base::saturated_cast(val.second / kBase); - *res_x = static_cast(fmodf(val.first, kBase)); - *res_y = static_cast(fmodf(val.second, kBase)); + *res_x = static_cast(val.first) % kBase; + *res_y = static_cast(val.second) % kBase; if (*res_x < 0 && *res_x > -kBase) *res_x = kBase + *res_x; if (*res_y < 0 && *res_y > -kBase) -- cgit v1.2.3