File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
source/SkiaSharp.Views.Uno/SkiaSharp.Views.Uno.WinUI.Wasm/WasmScripts Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 106106 this . currentRequest = window . requestAnimationFrame ( ( ) => {
107107
108108 if ( this . requestRender ) {
109+ // make current for this canvas instance
110+ GL . makeContextCurrent ( this . glCtx ) ;
111+
109112 this . requestRender ( ) ;
110113 }
111114
178181 throw `No <canvas> with id ${ canvasOrCanvasId } was found` ;
179182 }
180183
181- var ctx = SKSwapChainPanel . createWebGLContext ( canvas ) ;
182- if ( ! ctx || ctx < 0 )
184+ this . glCtx = SKSwapChainPanel . createWebGLContext ( canvas ) ;
185+ if ( ! this . glCtx || this . glCtx < 0 )
183186 throw `Failed to create WebGL context: err ${ ctx } ` ;
184187
185188 // make current
186- GL . makeContextCurrent ( ctx ) ;
189+ GL . makeContextCurrent ( this . glCtx ) ;
187190
188191 // Starting from .NET 7 the GLctx is defined in an inaccessible scope
189192 // when the current GL context changes. We need to pick it up from the
196199 // read values
197200 this . canvas = canvas ;
198201 return {
199- ctx : ctx ,
202+ ctx : this . glCtx ,
200203 fbo : currentGLctx . getParameter ( currentGLctx . FRAMEBUFFER_BINDING ) ,
201204 stencil : currentGLctx . getParameter ( currentGLctx . STENCIL_BITS ) ,
202205 sample : 0 , // TODO: currentGLctx.getParameter(GLctx.SAMPLES)
You can’t perform that action at this time.
0 commit comments