* long overdue update to AGG 2.4

* removed the useless parts of AGG (which are only needed for the
  interactive examples)
* make sure to jam -a libagg.a to solve any linking issues


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17838 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2006-06-14 14:30:17 +00:00
parent a58450492a
commit e39da397f5
229 changed files with 23117 additions and 18461 deletions
+15 -26
View File
@@ -1,6 +1,6 @@
//----------------------------------------------------------------------------
// Anti-Grain Geometry - Version 2.2
// Copyright (C) 2002-2004 Maxim Shemanarev (http://www.antigrain.com)
// Anti-Grain Geometry - Version 2.4
// 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.
@@ -27,7 +27,6 @@
#include <math.h>
#include "agg_basics.h"
#include "agg_array.h"
#include "agg_vertex_iterator.h"
extern "C"
{
@@ -63,8 +62,8 @@ namespace agg
gpc_vertex* vertices;
};
typedef pod_deque<gpc_vertex, 8> vertex_array_type;
typedef pod_deque<contour_header_type, 6> contour_header_array_type;
typedef pod_bvector<gpc_vertex, 8> vertex_array_type;
typedef pod_bvector<contour_header_type, 6> contour_header_array_type;
public:
@@ -90,20 +89,15 @@ namespace agg
memset(&m_result, 0, sizeof(m_result));
}
void set_source1(VSA& source) { m_src_a = &source; }
void set_source2(VSB& source) { m_src_b = &source; }
void attach1(VSA& source) { m_src_a = &source; }
void attach2(VSB& source) { m_src_b = &source; }
void operation(gpc_op_e v) { m_operation = v; }
// Vertex Source Interface
void rewind(unsigned id);
void rewind(unsigned path_id);
unsigned vertex(double* x, double* y);
// Iterator
typedef vertex_iterator<self_type> iterator;
iterator begin(unsigned id) { return iterator(*this, id); }
iterator end() { return iterator(path_cmd_stop); }
private:
conv_gpc(const conv_gpc<VSA, VSB>&);
const conv_gpc<VSA, VSB>& operator = (const conv_gpc<VSA, VSB>&);
@@ -197,10 +191,10 @@ namespace agg
int i;
for(i = 0; i < p.num_contours; i++)
{
delete [] p.contour[i].vertex;
pod_allocator<gpc_vertex>::deallocate(p.contour[i].vertex,
p.contour[i].num_vertices);
}
delete [] p.hole;
delete [] p.contour;
pod_allocator<gpc_vertex_list>::deallocate(p.contour, p.num_contours);
memset(&p, 0, sizeof(gpc_polygon));
}
@@ -266,7 +260,7 @@ namespace agg
// TO DO: Clarify the "holes"
//if(is_cw(orientation)) h.hole_flag = 1;
h.vertices = new gpc_vertex [h.num_vertices];
h.vertices = pod_allocator<gpc_vertex>::allocate(h.num_vertices);
gpc_vertex* d = h.vertices;
int i;
for(i = 0; i < h.num_vertices; i++)
@@ -294,19 +288,14 @@ namespace agg
{
p.num_contours = m_contour_accumulator.size();
// TO DO: Clarify the "holes"
//p.hole = new int[p.num_contours];
p.hole = 0;
p.contour = new gpc_vertex_list[p.num_contours];
p.contour = pod_allocator<gpc_vertex_list>::allocate(p.num_contours);
int i;
//int* ph = p.hole;
gpc_vertex_list* pv = p.contour;
for(i = 0; i < p.num_contours; i++)
{
const contour_header_type& h = m_contour_accumulator[i];
// *ph++ = h.hole_flag;
pv->num_vertices = h.num_vertices;
pv->vertex = h.vertices;
++pv;
@@ -356,11 +345,11 @@ namespace agg
//------------------------------------------------------------------------
template<class VSA, class VSB>
void conv_gpc<VSA, VSB>::rewind(unsigned id)
void conv_gpc<VSA, VSB>::rewind(unsigned path_id)
{
free_result();
m_src_a->rewind(id);
m_src_b->rewind(id);
m_src_a->rewind(path_id);
m_src_b->rewind(path_id);
add(*m_src_a, m_poly_a);
add(*m_src_b, m_poly_b);
switch(m_operation)