summaryrefslogtreecommitdiff
path: root/third_party/agg23/agg_clip_liang_barsky.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-14 14:43:42 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 19:05:58 +0000
commit05df075154a832fcb476e1dfcfb865722d0ea898 (patch)
treeb8b771b62adae74d5d5ee561db75d10de3a848bf /third_party/agg23/agg_clip_liang_barsky.h
parent6b94f01d1c8ad386d497428c7397b1a99614aeba (diff)
downloadpdfium-05df075154a832fcb476e1dfcfb865722d0ea898.tar.xz
Replace FX_FLOAT with underlying float type.
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56 Reviewed-on: https://pdfium-review.googlesource.com/3031 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'third_party/agg23/agg_clip_liang_barsky.h')
-rw-r--r--third_party/agg23/agg_clip_liang_barsky.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/third_party/agg23/agg_clip_liang_barsky.h b/third_party/agg23/agg_clip_liang_barsky.h
index 5b1261f004..31b35fe96e 100644
--- a/third_party/agg23/agg_clip_liang_barsky.h
+++ b/third_party/agg23/agg_clip_liang_barsky.h
@@ -36,45 +36,45 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
const rect_base<T>& clip_box,
T* x, T* y)
{
- const FX_FLOAT nearzero = 1e-30f;
+ const float nearzero = 1e-30f;
- pdfium::base::CheckedNumeric<FX_FLOAT> width = x2;
+ pdfium::base::CheckedNumeric<float> width = x2;
width -= x1;
if (!width.IsValid())
return 0;
- pdfium::base::CheckedNumeric<FX_FLOAT> height = y2;
+ pdfium::base::CheckedNumeric<float> height = y2;
height -= y1;
if (!height.IsValid())
return 0;
- FX_FLOAT deltax = width.ValueOrDefault(0);
- FX_FLOAT deltay = height.ValueOrDefault(0);
+ float deltax = width.ValueOrDefault(0);
+ float deltay = height.ValueOrDefault(0);
unsigned np = 0;
if(deltax == 0) {
deltax = (x1 > clip_box.x1) ? -nearzero : nearzero;
}
- FX_FLOAT xin, xout;
+ float xin, xout;
if(deltax > 0) {
- xin = (FX_FLOAT)clip_box.x1;
- xout = (FX_FLOAT)clip_box.x2;
+ xin = (float)clip_box.x1;
+ xout = (float)clip_box.x2;
} else {
- xin = (FX_FLOAT)clip_box.x2;
- xout = (FX_FLOAT)clip_box.x1;
+ xin = (float)clip_box.x2;
+ xout = (float)clip_box.x1;
}
- FX_FLOAT tinx = (xin - x1) / deltax;
+ float tinx = (xin - x1) / deltax;
if(deltay == 0) {
deltay = (y1 > clip_box.y1) ? -nearzero : nearzero;
}
- FX_FLOAT yin, yout;
+ float yin, yout;
if(deltay > 0) {
- yin = (FX_FLOAT)clip_box.y1;
- yout = (FX_FLOAT)clip_box.y2;
+ yin = (float)clip_box.y1;
+ yout = (float)clip_box.y2;
} else {
- yin = (FX_FLOAT)clip_box.y2;
- yout = (FX_FLOAT)clip_box.y1;
+ yin = (float)clip_box.y2;
+ yout = (float)clip_box.y1;
}
- FX_FLOAT tiny = (yin - y1) / deltay;
- FX_FLOAT tin1, tin2;
+ float tiny = (yin - y1) / deltay;
+ float tin1, tin2;
if (tinx < tiny) {
tin1 = tinx;
tin2 = tiny;
@@ -89,9 +89,9 @@ inline unsigned clip_liang_barsky(T x1, T y1, T x2, T y2,
++np;
}
if(tin2 <= 1.0f) {
- FX_FLOAT toutx = (xout - x1) / deltax;
- FX_FLOAT touty = (yout - y1) / deltay;
- FX_FLOAT tout1 = (toutx < touty) ? toutx : touty;
+ float toutx = (xout - x1) / deltax;
+ float touty = (yout - y1) / deltay;
+ float tout1 = (toutx < touty) ? toutx : touty;
if (tin2 > 0 || tout1 > 0) {
if(tin2 <= tout1) {
if(tin2 > 0) {