RenderWebGL methods that test drawable touching should call
updateMatrix and updateSilhouette before calling drwaable.isTouching.
These methods are called by RenderWebGL instead of isTouching because
isTouching can be called repeatedly in quick succession. Calling update
methods in isTouching would waste a lot of cycles.
* 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
* Allow 'isTouching' and 'pick' to still work on invisible drawables.
* Always ignore visibility for isTouching on drawable
* Filter invisble drawbles in isTouchingDrawable per rules of collision
* polish up some docs/get logic 👍
* leftover line from deleted comment
* revert to ghosted pick behavior
* Add clientSpaceToScratchBounds method
* fix lint
* add some pick tests
Downstream webpack will need any dependencies src/ depends on so it can
successfully build. Also if multiple packages being built into a larger
script share a common dependency version range, they can share the
dependency instead of duplicating it. This will save built file size,
execution time, and memory.
We used to write the user string directly into the svg string, but now we are setting the `.textContent` of an actual dom node, which does the escaping for us.