/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import e from"../../core/Logger.js";import{makeScheduleFunction as r}from"../3d/layers/support/makeScheduleFunction.js";import{TextureCompressionWorkerHandle as o}from"./TextureCompressionWorkerHandle.js";import t from"../webgl/Texture.js";const n=new Set,s=()=>e.getLogger("esri/views/support/TextureCompressionHelper");function i(e,i){return t.compressionWorkerHandle??=new o(r(i)),n.has(e)?s().warn("Repeated texture compression worker initialization by the same view."):n.add(e),t.compressionWorkerHandle}function p(e){const r=t.compressionWorkerHandle;r&&(n.delete(e)||s().warn("Unknown view attempted to destroy the texture compression worker."),n.size||(r.destroyWorkerAndSelf(),t.compressionWorkerHandle=null))}export{p as destroyTextureCompressionWorker,i as initializeTextureCompressionWorker};
