Add gradients to benchmark suite#667
Merged
Merged
Conversation
jwiggins
approved these changes
Mar 3, 2021
Member
jwiggins
left a comment
There was a problem hiding this comment.
Just some minor comments. These are good tests for the various backends.
I think I'm going to remove the deferred imports though... They make the code kinda ugly for no benefit. We just have to be careful to only import modules and nothing else.
Comment on lines
+159
to
+162
| import numpy as np | ||
| # colors are 5 doubles: offset, red, green, blue, alpha | ||
| starting_color = np.array([0.0, 1.0, 1.0, 1.0, 1.0]) | ||
| ending_color = np.array([1.0, 0.0, 0.0, 0.0, 1.0]) |
Member
There was a problem hiding this comment.
I would move this setup of the gradient array out of __call__ and into __init__.
| y = 256 - self.font.size * 1.4 | ||
| for line in self.text: | ||
| self.gc.set_text_position(4, y) | ||
| self.gc.show_text(line) |
Member
There was a problem hiding this comment.
LOL. Nothing renders this how I would expect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #664
This PR adds 2 new benchmarks to the benchmark suite. One draws a path and fills it using
linear_gradient. The other draws some text and fills it usingradial_gradientafter setting the text drawing mode toTEXT_FILL_STROKE. I went withTEXT_FILL_STROKEinstead ofFILL_STROKEas the results seemed more sensible.Here are the results I currently see:
Details
Sorry for the very small screenshot. The backends are in the order kiva.agg, celiagg, opengl, qpainter, quartz

The discrepancy in the qpainter fill I suspect is related to #660 ?