feat: add snapshot feature for devkit, this is for android
This commit is contained in:
32
doric-web/dist/index.js
vendored
32
doric-web/dist/index.js
vendored
@@ -2400,6 +2400,8 @@ class Panel {
|
||||
this.headviews = new Map;
|
||||
this.onRenderFinishedCallback = [];
|
||||
this.__rendering__ = false;
|
||||
this.snapshotEnabled = false;
|
||||
this.renderSnapshots = [];
|
||||
}
|
||||
onCreate() { }
|
||||
onDestroy() { }
|
||||
@@ -2508,7 +2510,19 @@ class Panel {
|
||||
}
|
||||
}, undefined);
|
||||
}
|
||||
__renderSnapshotDepth__() {
|
||||
return this.renderSnapshots.length;
|
||||
}
|
||||
__restoreRenderSnapshot__(idx) {
|
||||
return [...this.renderSnapshots].slice(0, idx);
|
||||
}
|
||||
__enableSnapshot__() {
|
||||
this.snapshotEnabled = true;
|
||||
}
|
||||
nativeRender(model) {
|
||||
if (this.snapshotEnabled) {
|
||||
this.renderSnapshots.push(JSON.parse(JSON.stringify(model)));
|
||||
}
|
||||
return this.context.callNative("shader", "render", model);
|
||||
}
|
||||
hookBeforeNativeCall() {
|
||||
@@ -2640,6 +2654,24 @@ __decorate$b([
|
||||
__metadata$b("design:paramtypes", [Array, String]),
|
||||
__metadata$b("design:returntype", void 0)
|
||||
], Panel.prototype, "__response__", null);
|
||||
__decorate$b([
|
||||
NativeCall,
|
||||
__metadata$b("design:type", Function),
|
||||
__metadata$b("design:paramtypes", []),
|
||||
__metadata$b("design:returntype", void 0)
|
||||
], Panel.prototype, "__renderSnapshotDepth__", null);
|
||||
__decorate$b([
|
||||
NativeCall,
|
||||
__metadata$b("design:type", Function),
|
||||
__metadata$b("design:paramtypes", [Number]),
|
||||
__metadata$b("design:returntype", void 0)
|
||||
], Panel.prototype, "__restoreRenderSnapshot__", null);
|
||||
__decorate$b([
|
||||
NativeCall,
|
||||
__metadata$b("design:type", Function),
|
||||
__metadata$b("design:paramtypes", []),
|
||||
__metadata$b("design:returntype", void 0)
|
||||
], Panel.prototype, "__enableSnapshot__", null);
|
||||
|
||||
/*
|
||||
* Copyright [2019] [Doric.Pub]
|
||||
|
6
doric-web/dist/index.js.map
vendored
6
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user