* draw pen skin lines and stamps to a framebuffer
* skip reading pixels and draw stamp to framebuffer
* update silhouette with readPixels
* draw pen canvas to buffer when its dirty
Composite lines and stamps on browser preferred side (cpu/gpu) until
the export texture is needed. Then blend the canvas with the current
buffer contents.
Updating this way invalidates useProgram optimization and the renderer
currently does not have a way to know this.
* draw lines on framebuffer through fragment shader
* optimize draw regions and pen skin matrix creation
* control draw regions
* mobile gpus need high precision floats for line drawing
* optimize cpu pen line math
* sampled pen line caps
* sampleless pen skin lines, lint, document pen skin buffer ops
* add PenSkin._canvasDirty to constructor
* remove DRAW_MODE_line
* comment PenSkin reused memory, use memory in drawRectangle
* turn draw region id's into optional method handlers
A region ID object may have an enter and exit method on it that are
used by default when entering and exiting that region.
* remove old DRAW_MODE_line precision setting
* standardize vert lines on 4 spaces
* fixup! turn draw region id's into optional method handlers
* do not draw when updating pen skin silhouette
* do not premultiply stamp colors by alpha
* fixup! do not draw when updating pen skin silhouette
* do not premultiply line color
* add a small rim around the line for aliasing
* variable pen line alias amount
* reverse offset pen line on y axis by relative alias amount
Reverse the offset to keep small line overlap to a minimum.
* fixup! reverse offset pen line on y axis by relative alias amount
* medium precision gpu floats
Use bilinear filtering unless the Drawable is angled by a multiple of 90
degrees and is either a raster image (like a BitmapSkin) or is around
its native resoluion. This makes both bitmaps and vectors look better in
most cases. This is roughly the same logic that Scratch 2.0 used; we may
want to tweak it over time to see if we can make it even better.
Fix any broken JSDoc syntax. Unfortunately there is no way to document tuples like `{[int, int]}` for a `[width, height]` array. We could possibly fix this and make the code more readable with `{width: number, height: number}` instead of tuples.
Remove single `@fileoverview` from Rectangle.js, since it was the only file with one and was weird to have that one module show up on the docs home page.
Add a `docs` script to `package.json`, run it from `npm test`, so invalid docs will cause tests to fail (eventually we may want to start using eslint-plugin-jsdoc to catch these errors with the linter alone).
I wasn't so clever with this - I'm sorry. Now that I have managed to
link up my local render & vm projects I am able to fix the issue
properly. Many appologies!
Also clean up the code around our calls to `readPixels`:
- Use `Uint8Array` instead of `Buffer` to hold the pixels
- Use `ImageData.data.set` instead of a `for` loop when copying pixels
to a canvas