Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: xfa/src/fxgraphics/src/fx_graphics.cpp

Issue 1727793002: Remove FXSYS_Div. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/src/fxgraphics/src/fx_graphics.cpp
diff --git a/xfa/src/fxgraphics/src/fx_graphics.cpp b/xfa/src/fxgraphics/src/fx_graphics.cpp
index 2ad7cd5d0ceaec78210e97e0bb401154bf024ae5..792f517a09cd7482700d3baa29e375ceb3aea9bd 100644
--- a/xfa/src/fxgraphics/src/fx_graphics.cpp
+++ b/xfa/src/fxgraphics/src/fx_graphics.cpp
@@ -978,8 +978,8 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path,
FX_FLOAT x = (FX_FLOAT)(column);
FX_FLOAT y = (FX_FLOAT)(row);
FX_FLOAT scale =
- FXSYS_Div(((x - start_x) * x_span) + ((y - start_y) * y_span),
- axis_len_square);
+ (((x - start_x) * x_span) + ((y - start_y) * y_span)) /
+ axis_len_square;
if (scale < 0) {
if (!_info._fillColor->_shading->_isExtendedBegin) {
continue;
@@ -1016,7 +1016,7 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path,
((y - start_y) * (y - start_y)) - (start_r * start_r);
FX_FLOAT s;
if (a == 0) {
- s = (FXSYS_Div(-c, b));
+ s = -c / b;
} else {
FX_FLOAT b2_4ac = (b * b) - 4 * (a * c);
if (b2_4ac < 0) {
@@ -1025,11 +1025,11 @@ FX_ERR CFX_Graphics::FillPathWithShading(CFX_Path* path,
FX_FLOAT root = (FXSYS_sqrt(b2_4ac));
FX_FLOAT s1, s2;
if (a > 0) {
- s1 = FXSYS_Div(-b - root, 2 * a);
- s2 = FXSYS_Div(-b + root, 2 * a);
+ s1 = (-b - root) / (2 * a);
+ s2 = (-b + root) / (2 * a);
} else {
- s2 = FXSYS_Div(-b - root, 2 * a);
- s1 = FXSYS_Div(-b + root, 2 * a);
+ s2 = (-b - root) / (2 * a);
+ s1 = (-b + root) / (2 * a);
}
if (s2 <= 1.0f || _info._fillColor->_shading->_isExtendedEnd) {
s = (s2);

Powered by Google App Engine
This is Rietveld 408576698