# This file contains the matplotlib 1.5.1 modifications wrt. r103 of the SVN # repo @sourceforge, i.e. between # https://sourceforge.net/p/agg/svn/103/tree/ and # https://github.com/matplotlib/matplotlib/tree/v1.5.1 diff -bur agg-2.4.103/include/agg_rasterizer_cells_aa.h agg24-svn/include/agg_rasterizer_cells_aa.h --- agg-2.4.103/include/agg_rasterizer_cells_aa.h 2016-03-01 02:31:24.938399149 +0100 +++ agg24-svn/include/agg_rasterizer_cells_aa.h 2016-01-04 04:45:22.000000000 +0100 @@ -29,6 +29,7 @@ #ifndef AGG_RASTERIZER_CELLS_AA_INCLUDED #define AGG_RASTERIZER_CELLS_AA_INCLUDED +#include #include #include #include "agg_math.h" @@ -48,8 +49,7 @@ cell_block_shift = 12, cell_block_size = 1 << cell_block_shift, cell_block_mask = cell_block_size - 1, - cell_block_pool = 256, - cell_block_limit = 1024 + cell_block_pool = 256 }; struct sorted_y @@ -63,7 +63,7 @@ typedef rasterizer_cells_aa self_type; ~rasterizer_cells_aa(); - rasterizer_cells_aa(); + rasterizer_cells_aa(unsigned cell_block_limit=1024); void reset(); void style(const cell_type& style_cell); @@ -107,6 +107,7 @@ unsigned m_max_blocks; unsigned m_curr_block; unsigned m_num_cells; + unsigned m_cell_block_limit; cell_type** m_cells; cell_type* m_curr_cell_ptr; pod_vector m_sorted_cells; @@ -141,11 +142,12 @@ //------------------------------------------------------------------------ template - rasterizer_cells_aa::rasterizer_cells_aa() : + rasterizer_cells_aa::rasterizer_cells_aa(unsigned cell_block_limit) : m_num_blocks(0), m_max_blocks(0), m_curr_block(0), m_num_cells(0), + m_cell_block_limit(cell_block_limit), m_cells(0), m_curr_cell_ptr(0), m_sorted_cells(), @@ -183,7 +185,9 @@ { if((m_num_cells & cell_block_mask) == 0) { - if(m_num_blocks >= cell_block_limit) return; + if(m_num_blocks >= m_cell_block_limit) { + throw std::overflow_error("Exceeded cell block limit"); + } allocate_block(); } *m_curr_cell_ptr++ = m_curr_cell; diff -bur agg-2.4.103/include/agg_rasterizer_compound_aa.h agg24-svn/include/agg_rasterizer_compound_aa.h --- agg-2.4.103/include/agg_rasterizer_compound_aa.h 2016-03-01 02:31:15.336254986 +0100 +++ agg24-svn/include/agg_rasterizer_compound_aa.h 2016-01-04 04:45:22.000000000 +0100 @@ -109,8 +109,8 @@ }; //-------------------------------------------------------------------- - rasterizer_compound_aa() : - m_outline(), + rasterizer_compound_aa(unsigned cell_block_limit=1024) : + m_outline(cell_block_limit), m_clipper(), m_filling_rule(fill_non_zero), m_layer_order(layer_direct), diff -bur agg-2.4.103/include/agg_rasterizer_scanline_aa.h agg24-svn/include/agg_rasterizer_scanline_aa.h --- agg-2.4.103/include/agg_rasterizer_scanline_aa.h 2016-03-01 02:31:21.404494861 +0100 +++ agg24-svn/include/agg_rasterizer_scanline_aa.h 2016-01-04 04:45:22.000000000 +0100 @@ -93,8 +93,8 @@ }; //-------------------------------------------------------------------- - rasterizer_scanline_aa() : - m_outline(), + rasterizer_scanline_aa(unsigned cell_block_limit=1024) : + m_outline(cell_block_limit), m_clipper(), m_filling_rule(fill_non_zero), m_auto_close(true), @@ -108,8 +108,8 @@ //-------------------------------------------------------------------- template - rasterizer_scanline_aa(const GammaF& gamma_function) : - m_outline(), + rasterizer_scanline_aa(const GammaF& gamma_function, unsigned cell_block_limit) : + m_outline(cell_block_limit), m_clipper(m_outline), m_filling_rule(fill_non_zero), m_auto_close(true), diff -bur agg-2.4.103/include/agg_rasterizer_scanline_aa_nogamma.h agg24-svn/include/agg_rasterizer_scanline_aa_nogamma.h --- agg-2.4.103/include/agg_rasterizer_scanline_aa_nogamma.h 2016-03-01 02:31:17.365718390 +0100 +++ agg24-svn/include/agg_rasterizer_scanline_aa_nogamma.h 2016-01-04 04:45:22.000000000 +0100 @@ -121,8 +121,8 @@ }; //-------------------------------------------------------------------- - rasterizer_scanline_aa_nogamma() : - m_outline(), + rasterizer_scanline_aa_nogamma(unsigned cell_block_limit=1024) : + m_outline(cell_block_limit), m_clipper(), m_filling_rule(fill_non_zero), m_auto_close(true),