You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The BoxMorph is interesting because it requires the use of a further clipping mask (8 lines of code) and the rewriting of the hit test method (currently named isTransparentAt, 27 lines of code that can be refactored into a third of that size).
The advantage of having a displaylist-based redraw is a) reduced memory usage (just the desktop itself, in retina display and 800x600 , would need a backing buffer of 7.5MB) and b) it works better with affine transforms than the buffer-based method.
Note that the PenMorph can only be used on a dedicated CanvasMorph now - which exposes its "raster" nature - other morphs won't expose their buffer. I could have put a different mechanism in place where Morphs switch from one redraw mode to the other in case a Pen is attached to them but I was happy with this solution...
Some refactoring and renaming will follow, and more Morphs will be moved over to the new system.
The text was updated successfully, but these errors were encountered:
Good idea, Davide! I've done it in my Starlings game via a display list called requests in StarlingsManagerMorph.prototype.step().
The display list is a list of 9-tuples.
Element #
Function
0
The image element to draw
1
The clipping X position
2
The clipping Y position
3
The clipping width
4
The clipping height
5
The X position on the StarlingsManagerMorph to draw the image
6
The Y position on the StarlingsManagerMorph to draw the image
each morphic.js' morph currently completely draws itself in a backing buffer, which is then blitted onto the damaged parts of the screen.
These changes below introduce a displaylist-based drawing for the FrameMorph and the BoxMorph:
davidedc/Fizzygum@f8b1dc0
davidedc/Fizzygum@73a332e
davidedc/Fizzygum@daeef2a
The BoxMorph is interesting because it requires the use of a further clipping mask (8 lines of code) and the rewriting of the hit test method (currently named isTransparentAt, 27 lines of code that can be refactored into a third of that size).
The advantage of having a displaylist-based redraw is a) reduced memory usage (just the desktop itself, in retina display and 800x600 , would need a backing buffer of 7.5MB) and b) it works better with affine transforms than the buffer-based method.
Note that the PenMorph can only be used on a dedicated CanvasMorph now - which exposes its "raster" nature - other morphs won't expose their buffer. I could have put a different mechanism in place where Morphs switch from one redraw mode to the other in case a Pen is attached to them but I was happy with this solution...
Some refactoring and renaming will follow, and more Morphs will be moved over to the new system.
The text was updated successfully, but these errors were encountered: