I think it’s nuts too, but in both cases there is no clipping (other than that in the component client area). Not sure exactly what other stuff could slow it down. Additionally, when I use the default Oversampling_4times setting in JUCE, AGG is still up to 5 times faster (but then I tried 100 segments) with much better anti-alias quality.
Anyway, here’s the code I used so you can check if there’s something else I might have done wrong:
[code]Path path;
Agg2D agg(g, getWidth(), getHeight());
agg.lineColor(AggColourConverter(g.getCurrentColour()));
agg.lineWidth(1.5);
Random rnd(Time::currentTimeMillis());
for (int i = 0; i < 20; ++i)
{
double x1 = rnd.nextDouble() * getWidth()/2;
double x2 = x1 + getWidth()/2;
double y = rnd.nextDouble() * getHeight();
if (i == 0)
{
path.startNewSubPath(x1, y);
agg.moveTo(x2, y);
}
else
{
path.lineTo(x1, y);
agg.lineTo(x2, y);
}
}
int64 juceStart = Time::getHighResolutionTicks();
g.strokePath(path, PathStrokeType(1.5f));
int64 juceTime = Time::getHighResolutionTicks() - juceStart;
int64 aggStart = Time::getHighResolutionTicks();
agg.drawPath(Agg2D::StrokeOnly);
int64 aggTime = Time::getHighResolutionTicks() - aggStart;
Logger::outputDebugPrintf(JUCE_T(“Juce: %lf s, AGG: %lf s”), Time::highResolutionTicksToSeconds(juceTime), Time::highResolutionTicksToSeconds(aggTime));[/code]
Note that the path adding part is not timed, I figured it would be negligible. Also, I’ve patched Agg2D to take a Graphics object (and in it I create an Image, attach it to a AGG rendering buffer, then on destruction I draw the Image into the Graphics object).