Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c789f0f

Browse filesBrowse files
committed
Merge pull request #1846 from mdboom/agg-clip-rendering-fix
Fix the clippath renderering so that it uses no-clip unsigned chars
2 parents 00307d9 + 0fd12aa commit c789f0f
Copy full SHA for c789f0f

File tree

Expand file treeCollapse file tree

6 files changed

+48
-42
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+48
-42
lines changed
Binary file not shown.
Loading

‎lib/matplotlib/tests/baseline_images/test_axes/polar_axes.svg

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/baseline_images/test_axes/polar_axes.svg
+37-32Lines changed: 37 additions & 32 deletions
Loading

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def test_polar_annotations():
129129
fig = plt.figure()
130130
ax = fig.add_subplot( 111, polar=True )
131131
line, = ax.plot( theta, r, color='#ee8d18', lw=3 )
132+
line, = ax.plot( (0, 0), (0, 1), color="#0000ff", lw=1)
132133

133134
ind = 800
134135
thisr, thistheta = r[ind], theta[ind]

‎src/_backend_agg.cpp

Copy file name to clipboardExpand all lines: src/_backend_agg.cpp
+8-9Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,8 @@ RendererAgg::create_alpha_buffers()
422422
{
423423
if (!alphaBuffer)
424424
{
425-
unsigned stride(width*4);
426-
alphaBuffer = new agg::int8u[NUMBYTES];
427-
alphaMaskRenderingBuffer.attach(alphaBuffer, width, height, stride);
425+
alphaBuffer = new agg::int8u[width * height];
426+
alphaMaskRenderingBuffer.attach(alphaBuffer, width, height, width);
428427
rendererBaseAlphaMask.attach(pixfmtAlphaMask);
429428
rendererAlphaMask.attach(rendererBaseAlphaMask);
430429
}
@@ -1120,7 +1119,7 @@ RendererAgg::draw_image(const Py::Tuple& args)
11201119
renderer_type_alpha ri(r, sa, spans);
11211120

11221121
theRasterizer.add_path(rect2);
1123-
agg::render_scanlines(theRasterizer, slineP8, ri);
1122+
agg::render_scanlines(theRasterizer, scanlineAlphaMask, ri);
11241123
}
11251124
else
11261125
{
@@ -1178,7 +1177,7 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath,
11781177
amask_ren_type r(pfa);
11791178
amask_aa_renderer_type ren(r);
11801179
ren.color(face.second);
1181-
agg::render_scanlines(theRasterizer, slineP8, ren);
1180+
agg::render_scanlines(theRasterizer, scanlineAlphaMask, ren);
11821181
}
11831182
else
11841183
{
@@ -1194,7 +1193,7 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath,
11941193
amask_ren_type r(pfa);
11951194
amask_bin_renderer_type ren(r);
11961195
ren.color(face.second);
1197-
agg::render_scanlines(theRasterizer, slineP8, ren);
1196+
agg::render_scanlines(theRasterizer, scanlineAlphaMask, ren);
11981197
}
11991198
else
12001199
{
@@ -1304,7 +1303,7 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath,
13041303
amask_ren_type r(pfa);
13051304
amask_aa_renderer_type ren(r);
13061305
ren.color(gc.color);
1307-
agg::render_scanlines(theRasterizer, slineP8, ren);
1306+
agg::render_scanlines(theRasterizer, scanlineAlphaMask, ren);
13081307
}
13091308
else
13101309
{
@@ -1320,7 +1319,7 @@ void RendererAgg::_draw_path(path_t& path, bool has_clippath,
13201319
amask_ren_type r(pfa);
13211320
amask_bin_renderer_type ren(r);
13221321
ren.color(gc.color);
1323-
agg::render_scanlines(theRasterizer, slineP8, ren);
1322+
agg::render_scanlines(theRasterizer, scanlineAlphaMask, ren);
13241323
}
13251324
else
13261325
{
@@ -1902,7 +1901,7 @@ RendererAgg::_draw_gouraud_triangle(const double* points,
19021901
pixfmt_amask_type pfa(pixFmt, alphaMask);
19031902
amask_ren_type r(pfa);
19041903
amask_aa_renderer_type ren(r, span_alloc, span_gen);
1905-
agg::render_scanlines(theRasterizer, slineP8, ren);
1904+
agg::render_scanlines(theRasterizer, scanlineAlphaMask, ren);
19061905
}
19071906
else
19081907
{

‎src/_backend_agg.h

Copy file name to clipboardExpand all lines: src/_backend_agg.h
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ typedef agg::rasterizer_scanline_aa<agg::rasterizer_sl_clip_dbl> rasterizer;
6262
typedef agg::scanline_p8 scanline_p8;
6363
typedef agg::scanline_bin scanline_bin;
6464
typedef agg::amask_no_clip_gray8 alpha_mask_type;
65+
typedef agg::scanline_u8_am<alpha_mask_type> scanline_am;
6566

6667
typedef agg::renderer_base<agg::pixfmt_gray8> renderer_base_alpha_mask_type;
6768
typedef agg::renderer_scanline_aa_solid<renderer_base_alpha_mask_type> renderer_alpha_mask_type;
@@ -215,7 +216,7 @@ class RendererAgg: public Py::PythonExtension<RendererAgg>
215216
agg::pixfmt_gray8 pixfmtAlphaMask;
216217
renderer_base_alpha_mask_type rendererBaseAlphaMask;
217218
renderer_alpha_mask_type rendererAlphaMask;
218-
agg::scanline_p8 scanlineAlphaMask;
219+
scanline_am scanlineAlphaMask;
219220

220221
scanline_p8 slineP8;
221222
scanline_bin slineBin;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.