Skip to content
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

How to destroy the canvas? (Bug when using together with omxplayer) #19

Open
diogoviannaaraujo opened this issue Jul 5, 2014 · 6 comments

Comments

@diogoviannaaraujo
Copy link

Hi,

I have been using your library intensively in the last days, i have noticed a problem that only happens in a case:

  • node openvg-canvas app running
  • some stuff already drawn on the context
  • omxplayer video playing on top

omxplayer gets some strange flickerings, when i close node it stops, if vgSwapBuffer is called sometimes it happens more, if i only get the context and don't draw anything it does not happen.
I ve tried so many ways to delete the canvas object and the context but it still keeps happening.
It there a right way to release the openvg canvas?
Does anyone might know what may cause this?

@eendeego
Copy link
Owner

eendeego commented Jul 5, 2014

I don't know if this makes any sense in your use case, but, can you try calling openvg's shutdown function ?

var vg = require('openvg');
vg.shutdown();

@diogoviannaaraujo
Copy link
Author

I did that yesterday night, but since i did not have the openvg package i edited openvg-canvas to attach the vg object to the canvas object, like canvas.vg. Is that worse for performance? is there a way to use load the openvg inside node openvg-canvas?

And about the problem, doing vg.finish stopped the problem with omxplayer, after the video is played i just instance a new canvas and start from there.
Is better for i use shutdown() instead of finish()?

Thanks a lot

@eendeego
Copy link
Owner

eendeego commented Jul 5, 2014

I think you can just add openvg to your project and require it directly. Everyone will be using the same module.

Currently vg.finish just calls shutdown (https://github.com/luismreis/node-openvg/blob/master/openvg.js#L747). But you should actually be using it instead of shutdown (my bad), because I'm planning to move mode initialization/shutdown from C++ space to JS, thus, eventually, the proper shutdown code will be there.

@diogoviannaaraujo
Copy link
Author

Nice! Thank u very much!

@diogoviannaaraujo
Copy link
Author

hey @luismreis, one more question, after i do vg.finish and recreate the canvas, i can draw shapes on it but i can't draw text, do you know why?

@eendeego
Copy link
Owner

eendeego commented Jul 6, 2014

I'd have to investigate a bit. There's no obvious reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants