v1.0.0
Deprecation Warning
This version can no longer be installed via
npm
due to the unsustainable expense of hosting the library on S3. You can still install it directly from this GitHub release via the commands below. Find the section for your OS and machine type and copy/paste the correspondingnpm install …
command into your terminal.Installation commands
Mac (Apple Silicon)
npm install https://github.com/samizdatco/skia-canvas/releases/download/v1.0.0/skia-canvas-v1.0.0-darwin-arm64.tar.gz
Mac (Intel)
npm install https://github.com/samizdatco/skia-canvas/releases/download/v1.0.0/skia-canvas-v1.0.0-darwin-x64.tar.gz
Windows (Intel)
npm install https://github.com/samizdatco/skia-canvas/releases/download/v1.0.0/skia-canvas-v1.0.0-win32-x64.tar.gz
Linux (Intel/AMD; glibc)
npm install https://github.com/samizdatco/skia-canvas/releases/download/v1.0.0/skia-canvas-v1.0.0-linux-x64-glibc.tar.gz
Linux (Intel/AMD; musl C library)
npm install https://github.com/samizdatco/skia-canvas/releases/download/v1.0.0/skia-canvas-v1.0.0-linux-x64-musl.tar.gz
Linux (ARM-64; glibc)
npm install https://github.com/samizdatco/skia-canvas/releases/download/v1.0.0/skia-canvas-v1.0.0-linux-arm64-glibc.tar.gz
Linux (ARM-64; musl C library)
npm install https://github.com/samizdatco/skia-canvas/releases/download/v1.0.0/skia-canvas-v1.0.0-linux-arm64-musl.tar.gz
Linux (ARM-32; glibc)
npm install https://github.com/samizdatco/skia-canvas/releases/download/v1.0.0/skia-canvas-v1.0.0-linux-arm-glibc.tar.gz
New Features
- The new Window class can display a Canvas on screen, respond to mouse and keyboard input, and fluidly animate by calling user-defined event handlers.
- Bitmap rendering now occurs on the GPU by default and can be configured using the Canvas's
.gpu
property. If the platform supports hardware-accelerated rendering (using Metal on macOS and Vulkan on Linux & Windows), the property will betrue
by default and can be set tofalse
to use the software renderer. - Added support for recent Chrome features:
- the
reset()
context method which erases the canvas, resets the transformation state, and clears the current path - the
roundRect()
method on contexts and Path2D objects which adds a rounded rectangle using 1–4 corner radii (provided as a single value or an array of numbers and/or DOMPoint objects)
- the
Bugfixes
- The
FontLibrary.reset()
method didn't actually remove previously installed fonts that had already been drawn with (and thus cached). It now clears those caches, which also means previously used fonts can now be replaced by calling.use()
again with the same family name. - The
.drawCanvas()
routine now applies filter effects and shadows consistent with the current resolution and transformation state.
Misc. Improvements
- The
.filter
property's"blur(…)"
and"drop-shadow(…)"
effects now match browser behavior much more closely and scale appropriately with thedensity
export option. - Antialiasing is smoother, particularly when down-scaling images, thanks to the use of mipmaps rather than Skia's (apparently buggy?) implementation of bicubic interpolation.
- Calling
clearRect()
with dimensions that fully enclose the canvas will now discard all the vector objects that have been drawn so far (rather than simply covering them up). - Upgraded Skia to milestone 103