-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix #347: Faster text rendering in Agg #5361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Note to reviewers: because of the indentation change, the github diff is big, but you can see the effective diff with
|
for (int xi = text.x1; xi < text.x2; ++xi) { | ||
typename ImageArray::value_type pixel = image( | ||
yi - (y - image.dim(0)), xi - x); | ||
pixFmt.blend_pixel(xi, yi, gc.color, pixel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an agg expert, but it seems that blend_color_hspan could be even faster.
http://sourceforge.net/p/vector-agg/mailman/message/5116797/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll play with that. blend_color_hspan
doesn't take as inputs exactly the same thing that we have, so there may be overhead in creating that first negating any wins. Only benchmarking will tell.
You can also add |
I've updated this to use |
When the text isn't rotated, we can skip a lot of machinery by just doing a direct blending of text pixels onto the output buffer.
I'm remilestoning to 2.0, since this will affect image comparison tests (for the better). |
Fix #347: Faster text rendering in Agg
Fix #347: Faster text rendering in Agg
cherry picked to v2.0.x as a340827 |
When the text isn't rotated, we can skip a lot of machinery by just doing a direct blending of text pixels onto the output buffer.
With the
simple_plot_fps
demo, I get about 6fps after, 5fps before this change.Cc: @Tillsten: would you be willing to kick the tires on this one?