From 2ca8fcbc8a7a3ef6adfac154c47068c1696205d0 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 16 Jun 2015 16:29:44 -0700 Subject: Separate agg-authored code from fx-authored code. Creates a separate library so we can apply less-strict warnings to the code we can't change from upstream vs. the code we can change, reducing noise in the standalone build. Remove needless foo.{cpp,h} files that merely perform indirection via #include "some_other_path/foo.{cpp,h}". BUG=pdfium:166 R=brucedawson@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1152743007. --- core/src/fxge/agg/agg23/agg_math.h | 63 -------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 core/src/fxge/agg/agg23/agg_math.h (limited to 'core/src/fxge/agg/agg23/agg_math.h') diff --git a/core/src/fxge/agg/agg23/agg_math.h b/core/src/fxge/agg/agg23/agg_math.h deleted file mode 100644 index 31e0daf3bb..0000000000 --- a/core/src/fxge/agg/agg23/agg_math.h +++ /dev/null @@ -1,63 +0,0 @@ - -//---------------------------------------------------------------------------- -// Anti-Grain Geometry - Version 2.3 -// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) -// -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. -// This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// -//---------------------------------------------------------------------------- -// Contact: mcseem@antigrain.com -// mcseemagg@yahoo.com -// http://www.antigrain.com -//---------------------------------------------------------------------------- -// Bessel function (besj) was adapted for use in AGG library by Andy Wilk -// Contact: castor.vulgaris@gmail.com -//---------------------------------------------------------------------------- -#ifndef AGG_MATH_INCLUDED -#define AGG_MATH_INCLUDED -#include "agg_basics.h" -namespace agg -{ -const FX_FLOAT intersection_epsilon = 1.0e-30f; -AGG_INLINE FX_FLOAT calc_point_location(FX_FLOAT x1, FX_FLOAT y1, - FX_FLOAT x2, FX_FLOAT y2, - FX_FLOAT x, FX_FLOAT y) -{ - return FXSYS_Mul(x - x2, y2 - y1) - FXSYS_Mul(y - y2, x2 - x1); -} -AGG_INLINE FX_FLOAT calc_distance(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2) -{ - FX_FLOAT dx = x2 - x1; - FX_FLOAT dy = y2 - y1; - return FXSYS_sqrt2(dx, dy); -} -AGG_INLINE FX_FLOAT calc_line_point_distance(FX_FLOAT x1, FX_FLOAT y1, - FX_FLOAT x2, FX_FLOAT y2, - FX_FLOAT x, FX_FLOAT y) -{ - FX_FLOAT dx = x2 - x1; - FX_FLOAT dy = y2 - y1; - FX_FLOAT d = FXSYS_sqrt2(dx, dy); - if(d < intersection_epsilon) { - return calc_distance(x1, y1, x, y); - } - return FXSYS_MulDiv(x - x2, dy, d) - FXSYS_MulDiv(y - y2, dx, d); -} -AGG_INLINE bool calc_intersection(FX_FLOAT ax, FX_FLOAT ay, FX_FLOAT bx, FX_FLOAT by, - FX_FLOAT cx, FX_FLOAT cy, FX_FLOAT dx, FX_FLOAT dy, - FX_FLOAT* x, FX_FLOAT* y) -{ - FX_FLOAT num = FXSYS_Mul(ay - cy, dx - cx) - FXSYS_Mul(ax - cx, dy - cy); - FX_FLOAT den = FXSYS_Mul(bx - ax, dy - cy) - FXSYS_Mul(by - ay, dx - cx); - if (FXSYS_fabs(den) < intersection_epsilon) { - return false; - } - *x = ax + FXSYS_MulDiv(bx - ax, num, den); - *y = ay + FXSYS_MulDiv(by - ay, num, den); - return true; -} -} -#endif -- cgit v1.2.3