-
Notifications
You must be signed in to change notification settings - Fork 120
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
Enhancing skia further #357
Conversation
- translate - rotate
PS: apply_matrix has different structure than p5.js
- background currently works only for colors, not images
- stroke_cap() - stroke_join() - Moved stroke_cap and stroke_join to style class
Comparison of a few sketches. Skia followed by vispy, results look great and we are getting results similar to web canvas. Skia is really great. skia_and_vispy.mp4 |
Tried #298 particle_skia.mp4particle_vispy.mp4 |
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.
Extra empty python file?
@@ -309,8 +355,7 @@ def end_shape(mode=""): | |||
:type mode: str | |||
|
|||
""" | |||
global is_bezier, is_curve, is_quadratic, is_contour | |||
assert not is_contour, "begin_contour called without calling end_contour" |
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.
What was the reasoning behind removing this assert?
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.
This assertion seems a bit wrong. The default value of is_contour
is False
so this assertion would raise an error even when no contour
calls are made.
Also, is_contour
indicates whether the current shape has a contour in it. So, we would have to use a different variable to indicate whether end_contour
was called or not.
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 think the default value of False
actually does not trigger this assert, since not is_contour
would evaluate to True
.
I think the original is_contour
had the function of denoting whether begin_contour
has been called without end_contour
being called. Without calling end_contour
, it doesn't make sense to call end_shape
, hence the original assert.
Under what condition did this assert trigger for you?
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.
Ahh yes, you are right. This is what really happenedend_contour
resets the value to False
after begin_contour
in the old code. I have removed that in the current code because we need to know whether is_contour
was called or not to be passed onto renderer.end_shape
. So now the assert is_contour
will throw an error because the value was not set to False
in end_contour
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.
Ah I see. I think the old is_contour
is still useful as a variable that indicates whether we are in a contour, thus providing us a way to nudge users to not call end_shape
without calling end_contour
after every begin_contour
. I think the use case you've mentioned sounds like that a new variable named has_contour
might be more appropriate. What do you think?
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.
Yes, that sounds right. I have done that. Thanks!
Great work! I left some comments, but majority of them are requests for clarification. |
Looking great @tushar5526 . Have we done any performance comparison for this renderer? We can compare the FPS of skia renderer with old renderer and p5js as well. I am sure this is great performance improvement. But it will be helpful for users to know these benchmarks. |
Does skia renderer solve Retina display issues? I remember this was a major issue for many Mac users. #131 |
Yes, I configured glfw to support retina displays as well. But, I was not able to test it locally because I don't have a MAC with me. Mark has probably tested it locally so I think the pixel Density issues is not there. |
I can use the current profiling to show the improvements in the release notes. I am open to any other ideas as to how we could measure the performance. |
Hey @ziyaointl I am thinking of starting with the new text and image APIs only after getting this one merged, followed by a release. I think it will take some time for me to get the access to make a release. So I would be glad if you could make the release on pypi |
@parsoyaarihant I've been running vispy on a mac retina screen for a while now and it seems to work normally, so the issue probably has been fixed at some point in the past. I haven't been able to test skia on mac though due to a segfault. I'll probably have to install the skia library with debug symbols to find out what is causing that. @tushar5526 Yes! Let me know when everything else in #360 has been finished, and I'll publish the 0.8.0 tag to pypi. |
2843477
to
99a4aa2
Compare
This PR is good to go. @ziyaointl you can review and merge it :) |
99a4aa2
to
127f283
Compare
Transform
Settings
Attributes
Vertex