mirror of
https://github.com/thead-yocto-mirror/skia
synced 2026-06-21 08:52:36 +02:00
6.5 KiB
6.5 KiB
CanvasKit Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
Changed
MakeSkVerticesuses a builder to save a copy.
[0.6.0] - 2019-05-06
Added
SkSurface.grContextnow exposed.GrContexthas new methods for monitoring/setting the cache limits; tweaking these may lead to better performance in some cases.getResourceCacheLimitBytes,setResourceCacheLimitBytes,getResourceCacheUsageBytesSkCanvas.drawAtlasfor efficiently drawing multiple sprites from a sprite sheet with a set of transforms, color blends, etc.SkColorBuilder,RSXFormBuilder,SkRectBuilderwhich increase performance by reducing the amount of malloc/free calls per frame, given that the array size is fixed.- Basic
SkPicturesupport.SkSurface.captureFrameAsSkPictureis a helper function to capture anSkPicture, which can be dumped to disk (for debugging) withSkPicture.DEBUGONLY_saveAsFile. SkImage.readPixels, which returns a TypedArray of pixel values (safe to use anywhere, doesn't need a delete()).
Changed
- Better
GrGLCapssupport for WebGL - this shouldn't have any impacts on APIs or correctness, except by perhaps fixing a few bugs in various surface types. - Use unsigned ints for SkColor on the JS side - this shouldn't have any impacts unless clients have pre-computed colors, in which case, they will need to re-compute them.
- [breaking] Moved
CanvasKit.MakeImageShadertoSkImage.makeShader- removed clampUnpremul as argument.
[0.5.1] - 2019-03-21
Added
SkPathMeasure,RSXFormBuilder,SkFont.getWidths,SkTextBlob.MakeFromRSXformwhich were needed to add the helper functionSkTextBlob.MakeOnPath.SkSurface.requestAnimationFrame- wrapper around window.requestAnimationFrame that takes care of the setup/tear down required to use CanvasKit optimally. The callback has anSkCanvasas the first parameter - callers should draw on that.
Changed
- Location in Skia Git repo now
modules/canvaskit(wasexperimental/canvaskit)
Fixed
- Extern bug in
CanvasKit.SkMatrix.invert - Fallback to CPU now properly refreshes the canvas to get access to the CanvasRenderingContext2D.
- Compile flags for better WebGL1 support for some graphics cards.
- Antialias bug on large oval paths https://crbug.com/skia/8873
Deprecated
SkCanvas.flushwill be removed soon - client should only callSkSurface.flush
[0.5.0] - 2019-03-08
Added
- isVolitile option to
CanvasKit.MakeSkVertices. The previous (and current default) behavior was for this to be true; some applications may go faster if set to false. SkCanvas.saveLayer(rect, paint)SkCanvas.restoreToCount(int)which can be used with the output of .save() and .saveLayer().- Optional particles library from modules/particles.
See CanvasKit.MakeParticles(json); - More public APIs for working with Surfaces/Contexts
GetWebGLContext,MakeGrContext,MakeOnScreenGLSurface,MakeRenderTarget. SkSurface.getSurface()andSkCanvas.getSurface()for making compatible surfaces (typically used as a workspace and then "saved" withsurface.makeImageSnapshot())
Breaking
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 theSkSurfacethemselves withGetWebGLContext->MakeGrContext->MakeOnScreenGLSurface.
[0.4.1] - 2019-03-01
Added
- Optional arguments to
MakeManagedAnimationfor supplying external assets (like images, fonts).
[0.4.0] - 2019-02-25
Added
SkPath.addRoundRect,SkPath.reset,SkPath.rewindexposed.SkCanvas.drawArc,SkCanvas.drawLine,SkCanvas.drawOval,SkCanvas.drawRoundRectexposed.- Can import/export a SkPath to an array of commands. See
CanvasKit.MakePathFromCmdsandSkPath.toCmds. SkCanvas.drawTextBlob()andSkCanvas.SkTextBlob.MakeFromText()to draw text to a canvas.CanvasKit.TextEncodingenum. For use withSkTextBlob.- Text shaping with
ShapedTextobject andSkCanvas.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).
Changed
SkCanvas.drawText()now requires anSkFontobject for raw strings.
Removed
SkPaint.setTextSize(),SkPaint.getTextSize(),SkPaint.setTypeface()which should be replaced by usingSkFont.- Deprecated
CanvasKitInit().then()interface (see 0.3.1 notes)
Fixed
- Potential bug in
ready()if already loaded.
[0.3.1] - 2019-01-04
Added
SkFontnow exposed.MakeCanvasSurfacecan now take a canvas element directly.MakeWebGLCanvasSurfacecan now take a WebGL context as an integer and use it directly.
Changed
CanvasKitInit(...).then()is no longer the recommended way to initialize things. It will be removed in 0.4.0. UseCanvasKitInit(...).ready(), which returns a real Promise.
Removed
SkPaint.measureText- useSkFont.measureTextinstead.
[0.3.0] - 2018-12-18
Added
- Add Canvas2D JS layer. This mirrors the HTML Canvas API. This may be omitted at compile time
it by adding
no_canvasto thecompile.shinvocation. CanvasKit.FontMgr.DefaultRef()andfontmgr.MakeTypefaceFromDatato load fonts.- Exposed
SkPath.setVolatile. Some animations see performance improvements by setting their paths' volatility to true.
Fixed
SkPath.addRectnow correctly draws counter-clockwise vs clockwise.
Changed
CanvasKit.MakeImageShaderno longer takes encoded bytes, but anSkImage, created fromCanvasKit.MakeImageFromEncoded. Additionally, the optional parametersclampIfUnpremulandlocalMatrixhave been exposed.SkPath.arcTonow takesstartAngle,sweepAngle,forceMoveToas additional parameters.SkPath.strokehas a new optionprecisionIt defaults to 1.0.- CanvasKit comes with one font (NotoMono) instead of the Skia TestTypeface. Clients are encouraged
to use the new
fontmgr.MakeTypefaceFromDatafor more font variety.
Removed
CanvasKit.initFonts()- no longer needed.
[0.2.1] - 2018-11-20
Beginning of Changelog history