MCPcopy Index your code
hub / github.com/codeaashu/claude-code / constructor

Method constructor

src/server/web/public/terminal.js:6833–6867  ·  view source on GitHub ↗
(e3, t3, i3, o2)

Source from the content-addressed store, hash-verified

6831 var e = { 965: (e2, t2, i2) => {
6832 Object.defineProperty(t2, "__esModule", { value: true }), t2.GlyphRenderer = void 0;
6833 const s2 = i2(374), r = i2(509), o = i2(855), n = i2(859), a = i2(381), h = 11, l = h * Float32Array.BYTES_PER_ELEMENT;
6834 let c, d = 0, _ = 0, u = 0;
6835 class g extends n.Disposable {
6836 constructor(e3, t3, i3, o2) {
6837 super(), this._terminal = e3, this._gl = t3, this._dimensions = i3, this._optionsService = o2, this._activeBuffer = 0, this._vertices = { count: 0, attributes: new Float32Array(0), attributesBuffers: [new Float32Array(0), new Float32Array(0)] };
6838 const h2 = this._gl;
6839 void 0 === r.TextureAtlas.maxAtlasPages && (r.TextureAtlas.maxAtlasPages = Math.min(32, (0, s2.throwIfFalsy)(h2.getParameter(h2.MAX_TEXTURE_IMAGE_UNITS))), r.TextureAtlas.maxTextureSize = (0, s2.throwIfFalsy)(h2.getParameter(h2.MAX_TEXTURE_SIZE))), this._program = (0, s2.throwIfFalsy)((0, a.createProgram)(h2, "#version 300 es\nlayout (location = 0) in vec2 a_unitquad;\nlayout (location = 1) in vec2 a_cellpos;\nlayout (location = 2) in vec2 a_offset;\nlayout (location = 3) in vec2 a_size;\nlayout (location = 4) in float a_texpage;\nlayout (location = 5) in vec2 a_texcoord;\nlayout (location = 6) in vec2 a_texsize;\n\nuniform mat4 u_projection;\nuniform vec2 u_resolution;\n\nout vec2 v_texcoord;\nflat out int v_texpage;\n\nvoid main() {\n vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_texpage = int(a_texpage);\n v_texcoord = a_texcoord + a_unitquad * a_texsize;\n}", (function(e4) {
6840 let t4 = "";
6841 for (let i4 = 1; i4 < e4; i4++) t4 += ` else if (v_texpage == ${i4}) { outColor = texture(u_texture[${i4}], v_texcoord); }`;
6842 return `#version 300 es
6843precision lowp float;
6844
6845in vec2 v_texcoord;
6846flat in int v_texpage;
6847
6848uniform sampler2D u_texture[${e4}];
6849
6850out vec4 outColor;
6851
6852void main() {
6853 if (v_texpage == 0) {
6854 outColor = texture(u_texture[0], v_texcoord);
6855 } ${t4}
6856}`;
6857 })(r.TextureAtlas.maxAtlasPages))), this.register((0, n.toDisposable)((() => h2.deleteProgram(this._program)))), this._projectionLocation = (0, s2.throwIfFalsy)(h2.getUniformLocation(this._program, "u_projection")), this._resolutionLocation = (0, s2.throwIfFalsy)(h2.getUniformLocation(this._program, "u_resolution")), this._textureLocation = (0, s2.throwIfFalsy)(h2.getUniformLocation(this._program, "u_texture")), this._vertexArrayObject = h2.createVertexArray(), h2.bindVertexArray(this._vertexArrayObject);
6858 const c2 = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), d2 = h2.createBuffer();
6859 this.register((0, n.toDisposable)((() => h2.deleteBuffer(d2)))), h2.bindBuffer(h2.ARRAY_BUFFER, d2), h2.bufferData(h2.ARRAY_BUFFER, c2, h2.STATIC_DRAW), h2.enableVertexAttribArray(0), h2.vertexAttribPointer(0, 2, this._gl.FLOAT, false, 0, 0);
6860 const _2 = new Uint8Array([0, 1, 2, 3]), u2 = h2.createBuffer();
6861 this.register((0, n.toDisposable)((() => h2.deleteBuffer(u2)))), h2.bindBuffer(h2.ELEMENT_ARRAY_BUFFER, u2), h2.bufferData(h2.ELEMENT_ARRAY_BUFFER, _2, h2.STATIC_DRAW), this._attributesBuffer = (0, s2.throwIfFalsy)(h2.createBuffer()), this.register((0, n.toDisposable)((() => h2.deleteBuffer(this._attributesBuffer)))), h2.bindBuffer(h2.ARRAY_BUFFER, this._attributesBuffer), h2.enableVertexAttribArray(2), h2.vertexAttribPointer(2, 2, h2.FLOAT, false, l, 0), h2.vertexAttribDivisor(2, 1), h2.enableVertexAttribArray(3), h2.vertexAttribPointer(3, 2, h2.FLOAT, false, l, 2 * Float32Array.BYTES_PER_ELEMENT), h2.vertexAttribDivisor(3, 1), h2.enableVertexAttribArray(4), h2.vertexAttribPointer(4, 1, h2.FLOAT, false, l, 4 * Float32Array.BYTES_PER_ELEMENT), h2.vertexAttribDivisor(4, 1), h2.enableVertexAttribArray(5), h2.vertexAttribPointer(5, 2, h2.FLOAT, false, l, 5 * Float32Array.BYTES_PER_ELEMENT), h2.vertexAttribDivisor(5, 1), h2.enableVertexAttribArray(6), h2.vertexAttribPointer(6, 2, h2.FLOAT, false, l, 7 * Float32Array.BYTES_PER_ELEMENT), h2.vertexAttribDivisor(6, 1), h2.enableVertexAttribArray(1), h2.vertexAttribPointer(1, 2, h2.FLOAT, false, l, 9 * Float32Array.BYTES_PER_ELEMENT), h2.vertexAttribDivisor(1, 1), h2.useProgram(this._program);
6862 const g2 = new Int32Array(r.TextureAtlas.maxAtlasPages);
6863 for (let e4 = 0; e4 < r.TextureAtlas.maxAtlasPages; e4++) g2[e4] = e4;
6864 h2.uniform1iv(this._textureLocation, g2), h2.uniformMatrix4fv(this._projectionLocation, false, a.PROJECTION_MATRIX), this._atlasTextures = [];
6865 for (let e4 = 0; e4 < r.TextureAtlas.maxAtlasPages; e4++) {
6866 const t4 = new a.GLTexture((0, s2.throwIfFalsy)(h2.createTexture()));
6867 this.register((0, n.toDisposable)((() => h2.deleteTexture(t4.texture)))), h2.activeTexture(h2.TEXTURE0 + e4), h2.bindTexture(h2.TEXTURE_2D, t4.texture), h2.texParameteri(h2.TEXTURE_2D, h2.TEXTURE_WRAP_S, h2.CLAMP_TO_EDGE), h2.texParameteri(h2.TEXTURE_2D, h2.TEXTURE_WRAP_T, h2.CLAMP_TO_EDGE), h2.texImage2D(h2.TEXTURE_2D, 0, h2.RGBA, 1, 1, 0, h2.RGBA, h2.UNSIGNED_BYTE, new Uint8Array([255, 0, 0, 255])), this._atlasTextures[e4] = t4;
6868 }
6869 h2.enable(h2.BLEND), h2.blendFunc(h2.SRC_ALPHA, h2.ONE_MINUS_SRC_ALPHA), this.handleResize();
6870 }

Callers

nothing calls this directly

Calls 5

handleResizeMethod · 0.95
_createNewPageMethod · 0.95
pFunction · 0.85
registerMethod · 0.45
enableMethod · 0.45

Tested by

no test coverage detected