fix(library): optimize image scanning, fast raw preview extraction and lazy thumbnail loading
This commit is contained in:
@@ -102,7 +102,16 @@ function rasterSurface(w: number, h: number) {
|
||||
let grContext: any = null;
|
||||
|
||||
function ensureGrContext(): any {
|
||||
if (grContext) return grContext;
|
||||
if (grContext) {
|
||||
if (typeof grContext.isContextLost === 'function' && grContext.isContextLost()) {
|
||||
try {
|
||||
if (typeof grContext.delete === 'function') grContext.delete();
|
||||
} catch {}
|
||||
grContext = null;
|
||||
} else {
|
||||
return grContext;
|
||||
}
|
||||
}
|
||||
if (typeof OffscreenCanvas === 'undefined') return null;
|
||||
try {
|
||||
grContext = CK.MakeWebGLContext(CK.GetWebGLContext(new OffscreenCanvas(8, 8)));
|
||||
|
||||
Reference in New Issue
Block a user