@predy-js/render-interface 0.2.0-beta.8 → 0.2.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/dist/statistic.js +1 -1
- package/dist/types/native/RendererInternal.d.ts +12 -0
- package/package.json +1 -1
- package/types/native/RendererInternal.ts +15 -0
package/dist/statistic.js
CHANGED
@@ -29,6 +29,11 @@ export interface RendererInternalCompleteInfo {
|
|
29
29
|
frame: number;
|
30
30
|
cpuTime?: number;
|
31
31
|
}
|
32
|
+
export declare enum RendererLostReason {
|
33
|
+
unknown = 0,
|
34
|
+
removeByParent = 1,
|
35
|
+
glContextLost = 2
|
36
|
+
}
|
32
37
|
export declare abstract class RendererInternal implements ResourceInternal {
|
33
38
|
readonly isDestroyed: boolean;
|
34
39
|
readonly platform: ResourcePlatform;
|
@@ -60,6 +65,13 @@ export declare abstract class RendererInternal implements ResourceInternal {
|
|
60
65
|
abstract getResourceInfo(): InternalResInfo;
|
61
66
|
abstract requestAnimationFrame(callback: FrameRequestCallback): number;
|
62
67
|
abstract cancelAnimationFrame(id: number): void;
|
68
|
+
/**
|
69
|
+
* 当view被从客户端移除时,会触发此回调
|
70
|
+
* 如果丢失GL Context也会触发此函数
|
71
|
+
* 当此函数发生时,需要立刻销毁Renderer对象
|
72
|
+
* @param callback
|
73
|
+
*/
|
74
|
+
abstract setRendererLostCallback(callback: (reason: RendererLostReason) => void): void;
|
63
75
|
/**
|
64
76
|
* 下一帧渲染完成后的回调,在调用removeRenderCompleteCallback前,不需要重复注册
|
65
77
|
*/
|
package/package.json
CHANGED
@@ -35,6 +35,12 @@ export interface RendererInternalCompleteInfo {
|
|
35
35
|
cpuTime?: number,
|
36
36
|
}
|
37
37
|
|
38
|
+
export enum RendererLostReason {
|
39
|
+
unknown = 0,
|
40
|
+
removeByParent = 1,
|
41
|
+
glContextLost = 2,
|
42
|
+
}
|
43
|
+
|
38
44
|
export abstract class RendererInternal implements ResourceInternal {
|
39
45
|
readonly isDestroyed: boolean;
|
40
46
|
readonly platform: ResourcePlatform;
|
@@ -81,6 +87,15 @@ export abstract class RendererInternal implements ResourceInternal {
|
|
81
87
|
abstract requestAnimationFrame (callback: FrameRequestCallback): number;
|
82
88
|
|
83
89
|
abstract cancelAnimationFrame (id: number): void;
|
90
|
+
|
91
|
+
/**
|
92
|
+
* 当view被从客户端移除时,会触发此回调
|
93
|
+
* 如果丢失GL Context也会触发此函数
|
94
|
+
* 当此函数发生时,需要立刻销毁Renderer对象
|
95
|
+
* @param callback
|
96
|
+
*/
|
97
|
+
abstract setRendererLostCallback (callback: (reason: RendererLostReason) => void): void;
|
98
|
+
|
84
99
|
/**
|
85
100
|
* 下一帧渲染完成后的回调,在调用removeRenderCompleteCallback前,不需要重复注册
|
86
101
|
*/
|