test(editor): add tests for turbo renderer layout cache

This commit is contained in:
Yifeng Wang
2025-04-14 11:07:48 +08:00
parent e68947c792
commit e9d04de399
2 changed files with 43 additions and 18 deletions

View File

@@ -73,20 +73,16 @@ export const TurboRendererConfigFactory =
export class ViewportTurboRendererExtension extends GfxExtension {
static override key = 'viewportTurboRenderer';
private readonly state$ = new BehaviorSubject<RenderingState>('inactive');
public readonly state$ = new BehaviorSubject<RenderingState>('inactive');
public readonly canvas: HTMLCanvasElement = document.createElement('canvas');
public layoutCacheData: ViewportLayoutTree | null = null;
private readonly worker: Worker;
private readonly disposables = new DisposableGroup();
private layoutCacheData: ViewportLayoutTree | null = null;
private layoutVersion = 0;
private bitmap: ImageBitmap | null = null;
private viewportElement: GfxViewportElement | null = null;
private readonly refresh$ = new Subject<void>();
public get currentState(): RenderingState {
return this.state$.value;
}
constructor(gfx: GfxController) {
super(gfx);