All notable changes to this project will be documented in this file.
GrContexthas new methods for monitoring/setting the cache limits; tweaking these may lead to better performance in some cases.
SkCanvas.drawAtlasfor efficiently drawing multiple sprites from a sprite sheet with a set of transforms, color blends, etc.
SkRectBuilderwhich increase performance by reducing the amount of malloc/free calls per frame, given that the array size is fixed.
SkSurface.captureFrameAsSkPictureis a helper function to capture an
SkPicture, which can be dumped to disk (for debugging) with
GrGLCapssupport for WebGL - this shouldn't have any impacts on APIs or correctness, except by perhaps fixing a few bugs in various surface types.
SkImage.makeShader- removed clampUnpremul as argument.
SkTextBlob.MakeFromRSXformwhich were needed to add the helper function
SkSurface.requestAnimationFrame- wrapper around window.requestAnimationFrame that takes care of the setup/tear down required to use CanvasKit optimally. The callback has an
SkCanvasas the first parameter - callers should draw on that.
SkCanvas.flushwill be removed soon - client should only call
CanvasKit.MakeSkVertices. The previous (and current default) behavior was for this to be true; some applications may go faster if set to false.
SkCanvas.restoreToCount(int)which can be used with the output of .save() and .saveLayer().
SkCanvas.getSurface()for making compatible surfaces (typically used as a workspace and then “saved” with
CanvasKit.MakeWebGLCanvasSurfaceno longer takes a webgl context as a first arg, only a canvas or an id of a canvas. If users want to manage their own GL contexts, they should build the
MakeManagedAnimationfor supplying external assets (like images, fonts).
SkCanvas.SkTextBlob.MakeFromText()to draw text to a canvas.
CanvasKit.TextEncodingenum. For use with
SkCanvas.drawText. At compile time, one can choose between using Harfbuzz/ICU (default) or a primitive one (“primitive_shaper”) which just does line breaking. Using Harfbuzz/ICU substantially increases code size (4.3 MB to 6.4 MB).
SkCanvas.drawText()now requires an
SkFontobject for raw strings.
SkPaint.setTypeface()which should be replaced by using
CanvasKitInit().then()interface (see 0.3.1 notes)
ready()if already loaded.
MakeCanvasSurfacecan now take a canvas element directly.
MakeWebGLCanvasSurfacecan now take a WebGL context as an integer and use it directly.
CanvasKitInit(...).then()is no longer the recommended way to initialize things. It will be removed in 0.4.0. Use
CanvasKitInit(...).ready(), which returns a real Promise.
fontmgr.MakeTypefaceFromDatato load fonts.
SkPath.setVolatile. Some animations see performance improvements by setting their paths' volatility to true.
SkPath.addRectnow correctly draws counter-clockwise vs clockwise.
CanvasKit.MakeImageShaderno longer takes encoded bytes, but an
SkImage, created from
CanvasKit.MakeImageFromEncoded. Additionally, the optional parameters
localMatrixhave been exposed.
forceMoveToas additional parameters.
SkPath.strokehas a new option
precisionIt defaults to 1.0.
fontmgr.MakeTypefaceFromDatafor more font variety.
CanvasKit.initFonts()- no longer needed.
Beginning of Changelog history