//---------------------------------------------------------------------------- // XYQ: 2006-01-22 Copied from AGG project. // This file uses only integer data, so it's suitable for all platforms. //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // 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. // //---------------------------------------------------------------------------- // // The author gratefully acknowleges the support of David Turner, // Robert Wilhelm, and Werner Lemberg - the authors of the FreeType // libray - in producing this work. See http://www.freetype.org for details. // //---------------------------------------------------------------------------- // Contact: [email protected] // [email protected] // http://www.antigrain.com //---------------------------------------------------------------------------- // // Adaptation for 32-bit screen coordinates has been sponsored by // Liberty Technology Systems, Inc., visit http://lib-sys.com // // Liberty Technology Systems, Inc. is the provider of // PostScript and PDF technology for software developers. // //---------------------------------------------------------------------------- // // Class outline_aa - implementation. // // Initially the rendering algorithm was designed by David Turner and the // other authors of the FreeType library - see the above notice. I nearly // created a similar renderer, but still I was far from David's work. // I completely redesigned the original code and adapted it for Anti-Grain // ideas. Two functions - render_line and render_hline are the core of // the algorithm - they calculate the exact coverage of each pixel cell // of the polygon. I left these functions almost as is, because there's // no way to improve the perfection - hats off to David and his group! // // All other code is very different from the original. // //---------------------------------------------------------------------------- #include <limits.h> #include "agg_rasterizer_scanline_aa.h" #include "core/fxcrt/numerics/safe_math.h" namespace pdfium { namespace agg { AGG_INLINE void cell_aa::set_cover(int c, int a) { … } AGG_INLINE void cell_aa::add_cover(int c, int a) { … } AGG_INLINE void cell_aa::set_coord(int cx, int cy) { … } AGG_INLINE void cell_aa::set(int cx, int cy, int c, int a) { … } outline_aa::~outline_aa() { … } outline_aa::outline_aa() : … { … } void outline_aa::reset() { … } void outline_aa::allocate_block() { … } AGG_INLINE void outline_aa::add_cur_cell() { … } AGG_INLINE void outline_aa::set_cur_cell(int x, int y) { … } AGG_INLINE void outline_aa::render_hline(int ey, int x1, int y1, int x2, int y2) { … } void outline_aa::render_line(int x1, int y1, int x2, int y2) { … } void outline_aa::move_to(int x, int y) { … } void outline_aa::line_to(int x, int y) { … } template <class T> static AGG_INLINE void swap_cells(T* a, T* b) { … } enum { … }; static void qsort_cells(cell_aa** start, unsigned num) { … } void outline_aa::sort_cells() { … } // static int rasterizer_scanline_aa::calculate_area(int cover, int shift) { … } // static bool rasterizer_scanline_aa::safe_add(int* op1, int op2) { … } } } // namespace pdfium