From: <he...@co...> - 2015-03-26 19:47:11
|
Dietmar,<br><br>It seems strange that plinit is so slow. What you're doing in your application is very similar to what I'm doing in my windows app - main difference is that my repaints are due to zoom operations. I do call plinit each repaint, and that all happens pretty fast - at least subjectively. I'd say its less than 1/2 second to update the buffer and BLT to screen. Maybe your perception that its slow is also considering the drawing time - which I would think would be constant even if you find a way to avoid calling plinit. Having stepped through plinit for debugging purposes before, it seems pretty short.<br><br>Aaron<br><br>Sent from XFINITY Connect Mobile App<br>-----Original Message-----<br><br>From: po...@di...<br>To: plp...@li...<br>Cc: <br>Sent: 2015-03-26 13:19:31 GMT<br>Subject: [Plplot-general] plplot - mem/memcairo repeated render-to-memory?<br><br>Hello all.<br><br>After having tried quite a few different different options I feel I'm <br>running out of ideas how to achive my goal, so I decided to ask around. <br>Apologies if this is a trivial issue ...<br><br>What I'm trying to do is get plplot to render a graph into a memory <br>buffer, which is then blitted to a window whenver i) that window changes <br>in size, ii) the window needs to be updated after being invalidated or <br>iii) the data underlying the graph changes.<br><br>A small test application I prepared (platform: Windows X64) worked well <br>enough, I set the driver to "memcairo", passed a frame buffer memory <br>block via plsmem(), issued the plotting commands and then dumped the <br>buffer to inspect its contents. Right enough, it was rendered just the <br>way I need it, ready to be displayed.<br><br>But my attempts to incorporate that approach into the real application <br>failed. I was planning to have one plstream per window, created and <br>initialized upon window creation. A new memory buffer is passed in by <br>plsmem() whenever the window size changes, to reflect the current <br>drawing surface. In the window paint routine, I'm trying to simply <br>render the plot, then blit the buffer.<br><br>However that only works exactly once, all subsequent paint calls fail <br>with an access violation in a pl...() command.<br><br>The rendering commands were stripped down to<br><br>plenv0(...)<br>plline()<br><br>But that doesn't seem to make any difference. Basically any call to <br>plenv() seems to change something in an unwanted way, causing subsequent <br>calls to write to invalid memory.<br><br>Do I need to skip plenv(), and replace it with individual calls for <br>drawing a box and setting a viewport?<br><br>I played with pladv(), but to no avail.<br><br>calling plinit(...) for each render cycle to set up a new enviroment <br>seems to work, but that is so slow as to be unusable, so that's no option.<br><br>Is there anything I'm doing wrong, or are there some examples I failed <br>to notice? Help is appreciated.<br><br>TIA<br>best,<br>Dietmar<br><br><br>------------------------------------------------------------------------------<br>Dive into the World of Parallel Programming The Go Parallel Website, sponsored<br>by Intel and developed in partnership with Slashdot Media, is your hub for all<br>things parallel software development, from weekly thought leadership blogs to<br>news, videos, case studies, tutorials and more. Take a look and join the <br>conversation now. http://goparallel.sourceforge.net/<br>_______________________________________________<br>Plplot-general mailing list<br>Plp...@li...<br>https://lists.sourceforge.net/lists/listinfo/plplot-general<br> |