8000 added win32 agg segfault patch · matplotlib/matplotlib@54cc5fa · GitHub
[go: up one dir, main page]

Skip to content

Commit 54cc5fa

Browse files
committed
added win32 agg segfault patch
svn path=/trunk/matplotlib/; revision=1375
1 parent cc38da8 commit 54cc5fa

32 files changed

+1609
-762
lines changed

.matplotlibrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ font.monospace : Andale Mono, Bitstream Vera Sans Mono, Nimbus Mono L, Cour
123123
# http://matplotlib.sourceforge.net/matplotlib.text.html for more
124124
# information on text properties
125125
text.color : black
126-
text.usetex : False # experimental, broken
126+
text.usetex : False # experimental
127127

128128
### AXES
129129
# default face and edge color, default tick sizes,

CHANGELOG

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
New entries should be added at the top
22

3+
2005-05-27 Finally found the pesky agg bug (which Maxim was kind
4+
enough to fix withing hours) that was causing a segfault in
5+
the win32 cached marker drawing. Now windows users can get
6+
the enormouse performance benefits of caced markers w/o
7+
those occasional pesy screenshots.
8+
9+
2005-05-27 Got win32 build system working again, using a more recent
10+
version of gtk and pygtk in the win32 build, gtk 2.6 from
11+
http://www.gimp.org/~tml/gimp/win32/downloads.html (you
12+
will also need libpng12.dll to use these). I haven't
13+
tested whether this binary build of mpl for win32 will work
6D40
14+
with older gtk runtimes, so you may need to upgrade.
15+
316
2005-05-27 Fixed bug where 2nd wxapp could be started if using wxagg
417
backend. - ADS
518

MANIFEST

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ examples/barchart_demo.py
266266
examples/barh_demo.py
267267
examples/boxplot_demo.py
268268
examples/break.py
269+
examples/color_by_yvalue.py
269270
examples/color_demo.py
270271
examples/colours.py
271272
examples/contour_demo.py
@@ -278,6 +279,7 @@ examples/cursor_demo.py
278279
examples/custom_ticker1.py
279280
examples/customize_rc.py
280281
examples/dash_control.py
282+
examples/dashtick.py
281283
examples/data_helper.py
282284
examples/date_demo1.py
283285
examples/date_demo2.py
@@ -524,6 +526,7 @@ lib/dateutil/rrule.py
524526
lib/dateutil/tz.py
525527
lib/matplotlib/.cvsignore
526528
lib/matplotlib/__init__.py
529+
lib/matplotlib/__init__.py.~1.53.~
527530
lib/matplotlib/_contour.py
528531
lib/matplotlib/_image.py
529532
lib/matplotlib/_mathtext_data.py
@@ -532,13 +535,18 @@ lib/matplotlib/_transforms.py
532535
lib/matplotlib/afm.py
533536
lib/matplotlib/agg.py
534537
lib/matplotlib/artist.py
538+
lib/matplotlib/artist.py.~1.21.~
535539
lib/matplotlib/axes.py
536540
lib/matplotlib/axes.py.orig
541+
lib/matplotlib/axes.py.~1.104.~
537542
lib/matplotlib/axis.py
543+
lib/matplotlib/axis.py.~1.23.~
538544
lib/matplotlib/backend_bases.py
539545
lib/matplotlib/cbook.py
540546
lib/matplotlib/cm.py
547+
lib/matplotlib/cm.py.~1.16.~
541548
lib/matplotlib/collections.py
549+
lib/matplotlib/collections.py.~1.20.~
542550
lib/matplotlib/colors.py
543551
lib/matplotlib/contour.py
544552
lib/matplotlib/dates.py
@@ -552,16 +560,19 @@ lib/matplotlib/mathtext.py
552560
lib/matplotlib/mlab.py
553561
lib/matplotlib/patches.py
554562
lib/matplotlib/pylab.py
563+
lib/matplotlib/pylab.py.~1.63.~
555564
lib/matplotlib/pyparsing.py
556565
lib/matplotlib/table.py
557566
lib/matplotlib/texmanager.py
558567
lib/matplotlib/text.py
559568
lib/matplotlib/ticker.py
569+
lib/matplotlib/ticker.py.~1.25.~
560570
lib/matplotlib/transforms.py
561571
lib/matplotlib/windowing.py
562572
lib/matplotlib/backends/.cvsignore
563573
lib/matplotlib/backends/__init__.py
564574
lib/matplotlib/backends/backend_agg.py
575+
lib/matplotlib/backends/backend_agg.py.~1.25.~
565576
lib/matplotlib/backends/backend_agg2.py
566577
lib/matplotlib/backends/backend_cairo.py
567578
lib/matplotlib/backends/backend_fltkagg.py
@@ -570,7 +581,6 @@ lib/matplotlib/backends/backend_gdk.py
570581
lib/matplotlib/backends/backend_gtk.py
571582
lib/matplotlib/backends/backend_gtkagg.py
572583
lib/matplotlib/backends/backend_gtkcairo.py
573-
lib/matplotlib/backends/backend_latex.py
574584
lib/matplotlib/backends/backend_paint.py
575585
lib/matplotlib/backends/backend_ps.py
576586
lib/matplotlib/backends/backend_qt.py
@@ -631,6 +641,7 @@ lib/matplotlib/enthought/util/__init__.py
631641
lib/matplotlib/enthought/util/resource.py
632642
lib/matplotlib/numerix/.cvsignore
633643
lib/matplotlib/numerix/__init__.py
644+
lib/matplotlib/numerix/__init__.py.~1.2.~
634645
lib/matplotlib/numerix/_na_imports.py
635646
lib/matplotlib/numerix/_nc_imports.py
636647
lib/matplotlib/numerix/fft/__init__.py

agg23/include/agg_array.h

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ namespace agg
3333
m_array(array), m_size(size) {}
3434

3535
unsigned size() const { return m_size; }
36-
const T& operator [] (unsigned idx) const { return m_array[idx]; }
37-
T& operator [] (unsigned idx) { return m_array[idx]; }
36+
const T& operator [] (unsigned i) const { return m_array[i]; }
37+
T& operator [] (unsigned i) { return m_array[i]; }
38+
const T& at(unsigned i) const { return m_array[i]; }
39+
T& at(unsigned i) { return m_array[i]; }
40+
T value_at(unsigned i) const { return m_array[i]; }
41+
3842
private:
3943
T* m_array;
4044
unsigned m_size;
@@ -64,6 +68,10 @@ namespace agg
6468
static unsigned size() { return Size; }
6569
const T& operator [] (unsigned i) const { return m_array[i]; }
6670
T& operator [] (unsigned i) { return m_array[i]; }
71+
const T& at(unsigned i) const { return m_array[i]; }
72+
T& at(unsigned i) { return m_array[i]; }
73+
T value_at(unsigned i) const { return m_array[i]; }
74+
6775
private:
6876
T m_array[Size];
6977
};
@@ -100,6 +108,9 @@ namespace agg
100108
unsigned size() const { return m_size; }
101109
const T& operator [] (unsigned i) const { return m_array[i]; }
102110
T& operator [] (unsigned i) { return m_array[i]; }
111+
const T& at(unsigned i) const { return m_array[i]; }
112+
T& at(unsigned i) { return m_array[i]; }
113+
T value_at(unsigned i) const { return m_array[i]; }
103114

104115
const T* data() const { return m_array; }
105116
T* data() { return m_array; }
@@ -150,8 +161,11 @@ namespace agg
150161
unsigned byte_size() const { return m_size * sizeof(T); }
151162
void serialize(int8u* ptr) const;
152163
void deserialize(const int8u* data, unsigned byte_size);
153-
const T& operator [] (unsigned idx) const { return m_array[idx]; }
154-
T& operator [] (unsigned idx) { return m_array[idx]; }
164+
const T& operator [] (unsigned i) const { return m_array[i]; }
165+
T& operator [] (unsigned i) { return m_array[i]; }
166+
const T& at(unsigned i) const { return m_array[i]; }
167+
T& at(unsigned i) { return m_array[i]; }
168+
T value_at(unsigned i) const { return m_array[i]; }
155169

156170
const T* data() const { return m_array; }
157171
T* data() { return m_array; }
@@ -312,14 +326,29 @@ namespace agg
312326

313327
unsigned size() const { return m_size; }
314328

315-
const T& operator [] (unsigned idx) const
329+
const T& operator [] (unsigned i) const
316330
{
317-
return m_blocks[idx >> block_shift][idx & block_mask];
331+
return m_blocks[i >> block_shift][i & block_mask];
318332
}
319333

320-
T& operator [] (unsigned idx)
334+
T& operator [] (unsigned i)
321335
{
322-
return m_blocks[idx >> block_shift][idx & block_mask];
336+
return m_blocks[i >> block_shift][i & block_mask];
337+
}
338+
339+
const T& at(unsigned i) const
340+
{
341+
return m_blocks[i >> block_shift][i & block_mask];
342+
}
343+
344+
T& at(unsigned i)
345+
{
346+
return m_blocks[i >> block_shift][i & block_mask];
347+
}
348+
349+
T value_at(unsigned i) const
350+
{
351+
return m_blocks[i >> block_shift][i & block_mask];
323352
}
324353

325354
const T& curr(unsigned idx) const

agg23/include/agg_basics.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
#endif
5050

5151
#ifndef AGG_INT64
52-
#if defined(_MSC_VER)
52+
#if defined(_MSC_VER) || defined(__BORLANDC__)
5353
#define AGG_INT64 signed __int64
5454
#else
5555
#define AGG_INT64 signed long long
5656
#endif
5757
#endif
5858

5959
#ifndef AGG_INT64U
60-
#if defined(_MSC_VER)
60+
#if defined(_MSC_VER) || defined(__BORLANDC__)
6161
#define AGG_INT64U unsigned __int64
6262
#else
6363
#define AGG_INT64U unsigned long long

agg23/include/agg_color_rgba.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ namespace agg
145145
static rgba from_wavelength(double wl, double gamma = 1.0);
146146

147147
//--------------------------------------------------------------------
148-
rgba(double wavelen, double gamma=1.0)
148+
explicit rgba(double wavelen, double gamma=1.0)
149149
{
150150
*this = from_wavelength(wavelen, gamma);
151151
}

agg23/include/agg_conv_curve.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace agg
3333
// and curve4. Curve3 is a conic Bezier curve with 2 endpoints and 1 control
3434
// point. Curve4 has 2 control points (4 points in total) and can be used
3535
// to interpolate more complicated curves. Curve4, unlike curve3 can be used
36-
// to approximate arcs, both curcular and elliptical. Curves are approximated
36+
// to approximate arcs, both circular and elliptical. Curves are approximated
3737
// with straight lines and one of the approaches is just to store the whole
3838
// sequence of vertices that approximate our curve. It takes additional
3939
// memory, and at the same time the consecutive vertices can be calculated

agg23/include/agg_ellipse.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ namespace agg
3030
class ellipse
3131
{
3232
public:
33-
ellipse() : m_x(0.0), m_y(0.0), m_rx(1.0), m_ry(1.0), m_num(4), m_step(0) {}
34-
ellipse(double x, double y, double rx, double ry, unsigned num_steps)
35-
: m_x(x), m_y(y), m_rx(rx), m_ry(ry), m_num(num_steps), m_step(0) {}
33+
ellipse() : m_x(0.0), m_y(0.0), m_rx(1.0), m_ry(1.0), m_num(4), m_step(0), m_cw(false) {}
34+
ellipse(double x, double y, double rx, double ry, unsigned num_steps, bool cw=false)
35+
: m_x(x), m_y(y), m_rx(rx), m_ry(ry), m_num(num_steps), m_step(0), m_cw(cw) {}
3636

37-
void init(double x, double y, double rx, double ry, unsigned num_steps);
37+
void init(double x, double y, double rx, double ry, unsigned num_steps,
38+
bool cw=false);
3839
void approximation_scale(double scale);
3940
void rewind(unsigned path_id);
4041
unsigned vertex(double* x, double* y);
@@ -46,18 +47,21 @@ namespace agg
4647
double m_ry;
4748
unsigned m_num;
4849
unsigned m_step;
50+
bool m_cw;
4951
};
5052

5153

5254
//------------------------------------------------------------------------
53-
inline void ellipse::init(double x, double y, double rx, double ry, unsigned num_steps)
55+
inline void ellipse::init(double x, double y, double rx, double ry,
56+
unsigned num_steps, bool cw)
5457
{
5558
m_x = x;
5659
m_y = y;
5760
m_rx = rx;
5861
m_ry = ry;
5962
m_num = num_steps;
6063
m_step = 0;
64+
m_cw = cw;
6165
}
6266

6367
//------------------------------------------------------------------------
@@ -83,6 +87,7 @@ namespace agg
8387
}
8488
if(m_step > m_num) return path_cmd_stop;
8589
double angle = double(m_step) / double(m_num) * 2.0 * pi;
90+
if(m_cw) angle = 2.0 * pi - angle;
8691
*x = m_x + cos(angle) * m_rx;
8792
*y = m_y + sin(angle) * m_ry;
8893
m_step++;

agg23/include/agg_math.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace agg
2323
{
2424

25-
const double intersection_epsilon = 1.0e-8;
25+
const double intersection_epsilon = 1.0e-30;
2626

2727
//------------------------------------------------------calc_point_location
2828
AGG_INLINE double calc_point_location(double x1, double y1,

0 commit comments

Comments
 (0)
0