function clearTexture(precision, mode) { const gpu = new GPU({ mode }); function makeTexture() { return (gpu.createKernel(function() { return this.thread.x; }, { output: [5], pipeline: true, precision }))(); } const texture = makeTexture(); assert.deepEqual(texture.toArray(), new Float32Array([0,1,2,3,4])); texture.clear(); const texture2 = makeTexture(); // put another texture in the way assert.deepEqual(texture.toArray(), new Float32Array([0,0,0,0,0])); assert.deepEqual(texture2.toArray(), new Float32Array([0,1,2,3,4])); gpu.destroy(); }
@action.bound globalToggle() { if (this.globalIsChecked()) { this.items.clear(); } else { this.listStore.items.forEach((item) => { const index = this.findItemIndex(item); if (index >= 0) return; this.toggle(item); }); } }
unselectAll() { this.items.clear(); }
clear() { for (let id of this.timeoutIds) { clearTimeout(id) } this.timeoutIds.clear() }
function logout() { queryCache.clear(); window.localStorage.removeItem(localStorageKey); }
@action.bound globalToggle() { if (this.globalIsChecked()) { this.items.clear(); } else { this.listStore.items.forEach((item) => { const index = this.findItemIndex(item); if (index >= 0) return; this.toggle(item); }); } }
unselectAll() { this.items.clear(); }