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

Unified Diff: third_party/agg23/agg_clip_liang_barsky.h

Issue 1727793002: Remove FXSYS_Div. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master 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
« no previous file with comments | « core/src/fxge/win32/fx_win32_print.cpp ('k') | third_party/agg23/agg_math_stroke.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/agg23/agg_clip_liang_barsky.h
diff --git a/third_party/agg23/agg_clip_liang_barsky.h b/third_party/agg23/agg_clip_liang_barsky.h
index 13e4ab9e308e085b228c245a31cc4f2780853088..db6ca97505ad449788b9375ba21c5219c8b67a40 100644
--- a/third_party/agg23/agg_clip_liang_barsky.h
+++ b/third_party/agg23/agg_clip_liang_barsky.h
@@ -50,7 +50,7 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
xin = (FX_FLOAT)clip_box.x2;
xout = (FX_FLOAT)clip_box.x1;
}
- FX_FLOAT tinx = FXSYS_Div(xin - x1, deltax);
+ FX_FLOAT tinx = (xin - x1) / deltax;
if(deltay == 0) {
deltay = (y1 > clip_box.y1) ? -nearzero : nearzero;
}
@@ -62,7 +62,7 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
yin = (FX_FLOAT)clip_box.y2;
yout = (FX_FLOAT)clip_box.y1;
}
- FX_FLOAT tiny = FXSYS_Div(yin - y1, deltay);
+ FX_FLOAT tiny = (yin - y1) / deltay;
FX_FLOAT tin1, tin2;
if (tinx < tiny) {
tin1 = tinx;
@@ -78,10 +78,10 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
++np;
}
if(tin2 <= 1.0f) {
- FX_FLOAT toutx = FXSYS_Div(xout - x1, deltax);
- FX_FLOAT touty = FXSYS_Div(yout - y1, deltay);
- FX_FLOAT tout1 = (toutx < touty) ? toutx : touty;
- if(tin2 > 0 || tout1 > 0) {
+ FX_FLOAT toutx = (xout - x1) / deltax;
+ FX_FLOAT touty = (yout - y1) / deltay;
+ FX_FLOAT tout1 = (toutx < touty) ? toutx : touty;
+ if (tin2 > 0 || tout1 > 0) {
if(tin2 <= tout1) {
if(tin2 > 0) {
if(tinx > tiny) {
@@ -116,7 +116,7 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
}
++np;
}
- }
+ }
}
}
return np;
« no previous file with comments | « core/src/fxge/win32/fx_win32_print.cpp ('k') | third_party/agg23/agg_math_stroke.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698