2018-12-07 13:29:52 +00:00
|
|
|
# CanvasKit Changelog
|
|
|
|
All notable changes to this project will be documented in this file.
|
|
|
|
|
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
|
|
|
|
|
## [Unreleased]
|
2019-01-04 19:16:19 +00:00
|
|
|
|
2019-03-22 19:41:36 +00:00
|
|
|
### Added
|
|
|
|
- `SkSurface.grContext` now exposed. `GrContext` has new methods for monitoring/setting
|
|
|
|
the cache limits; tweaking these may lead to better performance in some cases.
|
|
|
|
`getResourceCacheLimitBytes`, `setResourceCacheLimitBytes`, `getResourceCacheUsageBytes`
|
2019-03-29 14:39:52 +00:00
|
|
|
- `SkCanvas.drawAtlas` for efficiently drawing multiple sprites from a sprite sheet with
|
|
|
|
a set of transforms, color blends, etc.
|
|
|
|
- `SkColorBuilder`, `RSXFormBuilder`, `SkRectBuilder` which increase performance by
|
|
|
|
reducing the amount of malloc/free calls per frame, given that the array size is fixed.
|
2019-04-05 17:00:01 +00:00
|
|
|
- Basic `SkPicture` support. `SkSurface.captureFrameAsSkPicture` is a helper function to
|
|
|
|
capture an `SkPicture`, which can be dumped to disk (for debugging) with
|
|
|
|
`SkPicture.DEBUGONLY_saveAsFile`.
|
2019-03-22 19:41:36 +00:00
|
|
|
|
2019-03-28 16:46:40 +00:00
|
|
|
### Changed
|
|
|
|
- Better `GrGLCaps` support for WebGL - this shouldn't have any impacts on APIs or
|
|
|
|
correctness, except by perhaps fixing a few bugs in various surface types.
|
2019-03-29 14:39:52 +00:00
|
|
|
- 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.
|
2019-04-04 13:28:53 +00:00
|
|
|
- [breaking] Moved `CanvasKit.MakeImageShader` to `SkImage.makeShader` - removed clampUnpremul
|
|
|
|
as argument.
|
2019-03-28 16:46:40 +00:00
|
|
|
|
2019-03-21 18:18:37 +00:00
|
|
|
## [0.5.1] - 2019-03-21
|
|
|
|
|
2019-03-15 19:36:29 +00:00
|
|
|
### Added
|
|
|
|
- `SkPathMeasure`, `RSXFormBuilder`, `SkFont.getWidths`, `SkTextBlob.MakeFromRSXform`
|
|
|
|
which were needed to add the helper function `SkTextBlob.MakeOnPath`.
|
2019-03-19 13:34:37 +00:00
|
|
|
- `SkSurface.requestAnimationFrame` - wrapper around window.requestAnimationFrame that
|
|
|
|
takes care of the setup/tear down required to use CanvasKit optimally. The callback
|
|
|
|
has an `SkCanvas` as the first parameter - callers should draw on that.
|
2019-03-15 19:36:29 +00:00
|
|
|
|
2019-03-11 20:11:58 +00:00
|
|
|
### Changed
|
|
|
|
- Location in Skia Git repo now `modules/canvaskit` (was `experimental/canvaskit`)
|
2019-03-08 18:24:58 +00:00
|
|
|
|
2019-03-14 14:55:10 +00:00
|
|
|
### Fixed
|
|
|
|
- Extern bug in `CanvasKit.SkMatrix.invert`
|
2019-03-14 15:25:57 +00:00
|
|
|
- Fallback to CPU now properly refreshes the canvas to get access to the
|
|
|
|
CanvasRenderingContext2D.
|
2019-03-18 15:20:53 +00:00
|
|
|
- Compile flags for better WebGL1 support for some graphics cards.
|
2019-03-21 18:18:37 +00:00
|
|
|
- Antialias bug on large oval paths <https://crbug.com/skia/8873>
|
2019-03-18 15:20:53 +00:00
|
|
|
|
|
|
|
### Deprecated
|
|
|
|
- `SkCanvas.flush` will be removed soon - client should only call `SkSurface.flush`
|
|
|
|
|
2019-03-14 14:55:10 +00:00
|
|
|
|
2019-03-08 18:24:58 +00:00
|
|
|
## [0.5.0] - 2019-03-08
|
|
|
|
|
2019-03-06 13:25:36 +00:00
|
|
|
### 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().
|
2019-03-06 14:32:55 +00:00
|
|
|
- Optional particles library from modules/particles. `See CanvasKit.MakeParticles(json)`;
|
2019-03-08 15:04:28 +00:00
|
|
|
- More public APIs for working with Surfaces/Contexts `GetWebGLContext`,
|
|
|
|
`MakeGrContext`, `MakeOnScreenGLSurface`, `MakeRenderTarget`.
|
|
|
|
- `SkSurface.getSurface()` and `SkCanvas.getSurface()` for making compatible surfaces (typically
|
|
|
|
used as a workspace and then "saved" with `surface.makeImageSnapshot()`)
|
|
|
|
|
|
|
|
### Breaking
|
|
|
|
- `CanvasKit.MakeWebGLCanvasSurface` no 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 `SkSurface` themselves with `GetWebGLContext` -> `MakeGrContext` ->
|
|
|
|
`MakeOnScreenGLSurface`.
|
2019-03-01 16:23:49 +00:00
|
|
|
|
|
|
|
## [0.4.1] - 2019-03-01
|
|
|
|
|
2019-02-28 15:06:18 +00:00
|
|
|
### Added
|
2019-02-28 21:05:09 +00:00
|
|
|
- Optional arguments to `MakeManagedAnimation` for supplying external assets (like images, fonts).
|
2019-02-25 21:04:02 +00:00
|
|
|
|
|
|
|
## [0.4.0] - 2019-02-25
|
|
|
|
|
2019-01-07 16:08:55 +00:00
|
|
|
### Added
|
|
|
|
- `SkPath.addRoundRect`, `SkPath.reset`, `SkPath.rewind` exposed.
|
|
|
|
- `SkCanvas.drawArc`, `SkCanvas.drawLine`, `SkCanvas.drawOval`, `SkCanvas.drawRoundRect` exposed.
|
|
|
|
- Can import/export a SkPath to an array of commands. See `CanvasKit.MakePathFromCmds` and
|
|
|
|
`SkPath.toCmds`.
|
2019-01-14 13:36:08 +00:00
|
|
|
- `SkCanvas.drawTextBlob()` and `SkCanvas.SkTextBlob.MakeFromText()` to draw text to a canvas.
|
|
|
|
- `CanvasKit.TextEncoding` enum. For use with `SkTextBlob`.
|
2019-02-22 15:04:06 +00:00
|
|
|
- Text shaping with `ShapedText` object and `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).
|
2019-01-14 13:36:08 +00:00
|
|
|
|
|
|
|
### Changed
|
2019-02-22 15:04:06 +00:00
|
|
|
- `SkCanvas.drawText()` now requires an `SkFont` object for raw strings.
|
|
|
|
|
2019-01-14 13:36:08 +00:00
|
|
|
|
|
|
|
### Removed
|
|
|
|
- `SkPaint.setTextSize()`, `SkPaint.getTextSize()`, `SkPaint.setTypeface()`
|
|
|
|
which should be replaced by using `SkFont`.
|
2019-02-25 21:04:02 +00:00
|
|
|
- Deprecated `CanvasKitInit().then()` interface (see 0.3.1 notes)
|
2019-01-14 13:36:08 +00:00
|
|
|
|
2019-01-07 16:08:55 +00:00
|
|
|
|
2019-01-07 03:27:54 +00:00
|
|
|
### Fixed
|
|
|
|
- Potential bug in `ready()` if already loaded.
|
2019-01-04 19:16:19 +00:00
|
|
|
|
|
|
|
## [0.3.1] - 2019-01-04
|
2019-01-02 20:13:57 +00:00
|
|
|
### Added
|
|
|
|
- `SkFont` now exposed.
|
2019-01-03 21:20:04 +00:00
|
|
|
- `MakeCanvasSurface` can now take a canvas element directly.
|
|
|
|
- `MakeWebGLCanvasSurface` can now take a WebGL context as an integer and use it directly.
|
2019-01-02 20:13:57 +00:00
|
|
|
|
2019-01-04 19:16:19 +00:00
|
|
|
### Changed
|
|
|
|
- `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.
|
|
|
|
|
2019-01-02 20:13:57 +00:00
|
|
|
### Removed
|
|
|
|
- `SkPaint.measureText` - use `SkFont.measureText` instead.
|
2018-12-07 13:29:52 +00:00
|
|
|
|
2018-12-18 12:43:02 +00:00
|
|
|
## [0.3.0] - 2018-12-18
|
|
|
|
|
2018-12-07 13:29:52 +00:00
|
|
|
### Added
|
|
|
|
- Add Canvas2D JS layer. This mirrors the HTML Canvas API. This may be omitted at compile time
|
|
|
|
it by adding `no_canvas` to the `compile.sh` invocation.
|
2018-12-12 15:35:13 +00:00
|
|
|
- `CanvasKit.FontMgr.DefaultRef()` and `fontmgr.MakeTypefaceFromData` to load fonts.
|
2018-12-14 21:10:38 +00:00
|
|
|
- Exposed `SkPath.setVolatile`. Some animations see performance improvements by setting
|
|
|
|
their paths' volatility to true.
|
2018-12-07 13:29:52 +00:00
|
|
|
|
2018-12-07 18:03:08 +00:00
|
|
|
### Fixed
|
|
|
|
- `SkPath.addRect` now correctly draws counter-clockwise vs clockwise.
|
|
|
|
|
2018-12-07 13:29:52 +00:00
|
|
|
### Changed
|
2018-12-18 12:43:02 +00:00
|
|
|
- `CanvasKit.MakeImageShader` no longer takes encoded bytes, but an `SkImage`, created from
|
2018-12-07 13:29:52 +00:00
|
|
|
`CanvasKit.MakeImageFromEncoded`. Additionally, the optional parameters `clampIfUnpremul`
|
|
|
|
and `localMatrix` have been exposed.
|
2018-12-07 18:03:08 +00:00
|
|
|
- `SkPath.arcTo` now takes `startAngle`, `sweepAngle`, `forceMoveTo` as additional parameters.
|
|
|
|
- `SkPath.stroke` has a new option `precision` It defaults to 1.0.
|
2018-12-12 15:35:13 +00:00
|
|
|
- CanvasKit comes with one font (NotoMono) instead of the Skia TestTypeface. Clients are encouraged
|
|
|
|
to use the new `fontmgr.MakeTypefaceFromData` for more font variety.
|
|
|
|
|
|
|
|
### Removed
|
|
|
|
- `CanvasKit.initFonts()` - no longer needed.
|
2018-12-07 13:29:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
## [0.2.1] - 2018-11-20
|
2019-03-06 13:25:36 +00:00
|
|
|
Beginning of Changelog history
|