On Friday, 4. May 2012 18:01:47 Igor Stasenko wrote: > hard to say.. apparently every morph should be drawn only once per step. > probably you mixing stepping and drawing/updating? > > during stepping you should change some state, like advance the > counters, do some calculations etc.. > and then _just_ invalidate morphs which need to be redrawn, but do not > draw them directly.
Except for a few lines I don't draw anything myself. I just intercepted drawOn: in myMorphs so I could count the calls. Assuming each Morph is drawn once per step, the counts I get are plausible and I see that don't get redraws for morphs which are invisible. I just don't know if 0.2 msec for drawing a single morph is as good as its gets. It is several hundred thousand CPU cycles per Morph. Even when you assume 100 pixels per Morph, it is still a few thousand clock cycles for a single pixel. I made another test, where I just move 100 Morphs inside a Rectangle around. I got comparable speed, i.e. morphic was not always able to catch up with the screen refresh rate. In this case the movement was a lot faster when there was nothing else on the screen, when it moved over a Browser it slowed down quite a bit, which is understandable. My scrolling thingy however does not move across the whole screen, so morphic should have a bit less work. Invalidating: Do I invalide the Morph itself or its parent? If a Morph moves, the space it occupied before the move has to be redrawn too. Or do I invalidate it before and after the move? @Hilaire >And what about using PasteUpMorph with an unique step in the message >taking care of the update of the submorphs? What would be the advantage of doing this? Doesn't the "World" take care of updates well enough? -- Martin
