[canvaskit] Expose releaseResourcesAndAbandonContext on GrContext
Bug: skia:9910 Change-Id: If0a6aa106d42c680f1f0f3092c4a4dbd0f04c937 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270936 Reviewed-by: Nathaniel Nifong <nifong@google.com>
This commit is contained in:
parent
cc08d9fabf
commit
9279798022
@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Experimental 4x4 matrices added in `SkM44`.
|
- Experimental 4x4 matrices added in `SkM44`.
|
||||||
- Vector math functions added in `SkVector`.
|
- Vector math functions added in `SkVector`.
|
||||||
- `SkRuntimeEffect.makeShaderWithChildren`, which can take in other shaders as fragmentProcessors.
|
- `SkRuntimeEffect.makeShaderWithChildren`, which can take in other shaders as fragmentProcessors.
|
||||||
|
- `GrContext.releaseResourcesAndAbandonContext` to free up WebGL contexts.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- We now compile/ship with Emscripten v1.39.6.
|
- We now compile/ship with Emscripten v1.39.6.
|
||||||
|
@ -900,6 +900,7 @@ EMSCRIPTEN_BINDINGS(Skia) {
|
|||||||
self.getResourceCacheUsage(&usedResources, &currUsage);
|
self.getResourceCacheUsage(&usedResources, &currUsage);
|
||||||
return currUsage;
|
return currUsage;
|
||||||
}))
|
}))
|
||||||
|
.function("releaseResourcesAndAbandonContext", &GrContext::releaseResourcesAndAbandonContext)
|
||||||
.function("setResourceCacheLimitBytes", optional_override([](GrContext& self, size_t maxResourceBytes)->void {
|
.function("setResourceCacheLimitBytes", optional_override([](GrContext& self, size_t maxResourceBytes)->void {
|
||||||
int maxResources = 0;
|
int maxResources = 0;
|
||||||
size_t currMax = 0; // ignored
|
size_t currMax = 0; // ignored
|
||||||
|
@ -105,6 +105,7 @@ var CanvasKit = {
|
|||||||
// public API (from C++ bindings)
|
// public API (from C++ bindings)
|
||||||
getResourceCacheLimitBytes: function() {},
|
getResourceCacheLimitBytes: function() {},
|
||||||
getResourceCacheUsageBytes: function() {},
|
getResourceCacheUsageBytes: function() {},
|
||||||
|
releaseResourcesAndAbandonContext: function() {},
|
||||||
setResourceCacheLimitBytes: function() {},
|
setResourceCacheLimitBytes: function() {},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user