File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/vs/editor/browser/viewParts/viewLinesGpu Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export class ViewLinesGpu extends ViewPart implements IViewLines {
40
40
41
41
private readonly canvas : HTMLCanvasElement ;
42
42
43
+ private _initViewportData ?: ViewportData [ ] ;
43
44
private _lastViewportData ?: ViewportData ;
44
45
private _lastViewLineOptions ?: ViewLineOptions ;
45
46
@@ -285,6 +286,16 @@ export class ViewLinesGpu extends ViewPart implements IViewLines {
285
286
// endregion Bind group
286
287
287
288
this . _initialized = true ;
289
+
290
+ // Render the initial viewport immediately after initialization
291
+ if ( this . _initViewportData ) {
292
+ // HACK: Rendering multiple times in the same frame like this isn't ideal, but there
293
+ // isn't an easy way to merge viewport data
294
+ for ( const viewportData of this . _initViewportData ) {
295
+ this . renderText ( viewportData ) ;
296
+ }
297
+ this . _initViewportData = undefined ;
298
+ }
288
299
}
289
300
290
301
private _updateAtlasStorageBufferAndTexture ( ) {
@@ -361,6 +372,9 @@ export class ViewLinesGpu extends ViewPart implements IViewLines {
361
372
public renderText ( viewportData : ViewportData ) : void {
362
373
if ( this . _initialized ) {
363
374
return this . _renderText ( viewportData ) ;
375
+ } else {
376
+ this . _initViewportData = this . _initViewportData ?? [ ] ;
377
+ this . _initViewportData . push ( viewportData ) ;
364
378
}
365
379
}
366
380
You can’t perform that action at this time.
0 commit comments