Skip to content

Commit 113e8cd

Browse files
committed
fix: cleanup function conditional textures
1 parent ffca100 commit 113e8cd

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/vgl/texture.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ vgl.texture = function () {
8282
renderState.m_context.pixelStorei(vgl.GL.UNPACK_FLIP_Y_WEBGL, true);
8383

8484
this.updateDimensions();
85-
this.computeInternalFormatUsingImage();
8685
renderState.m_context.texImage2D(vgl.GL.TEXTURE_2D, 0, this.m_internalFormat,
8786
this.m_texture.width, this.m_texture.height, 0,
8887
this.m_pixelFormat, this.m_pixelDataType, this.m_texture.data);
@@ -260,11 +259,9 @@ vgl.texture = function () {
260259
// };
261260

262261
// TODO Fix this
263-
if (!this.m_internalFormat || !this.m_pixelFormat || !this.m_pixelDataType) {
264-
this.m_internalFormat = vgl.GL.RGBA;
265-
this.m_pixelFormat = vgl.GL.RGBA;
266-
this.m_pixelDataType = vgl.GL.UNSIGNED_BYTE;
267-
}
262+
this.m_internalFormat = vgl.GL.RGBA;
263+
this.m_pixelFormat = vgl.GL.RGBA;
264+
this.m_pixelDataType = vgl.GL.UNSIGNED_BYTE;
268265
};
269266

270267
/**

src/webgl/quadFeature.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,12 +525,16 @@ var webgl_quadFeature = function (arg) {
525525
}
526526
m_imgposbuf = undefined;
527527
m_clrposbuf = undefined;
528-
Object.keys(m_glBuffers).forEach(function (key) { delete m_glBuffers[key]; });
528+
if (m_glBuffers) {
529+
Object.keys(m_glBuffers).forEach(function (key) { delete m_glBuffers[key]; });
530+
}
529531
if (m_quads && m_quads.imgQuads) {
530532
m_quads.imgQuads.forEach(function (quad) {
531533
if (quad.texture) {
532534
delete quad.texture;
533-
delete quad.image._texture;
535+
if (quad.image && quad.image._texture) {
536+
delete quad.image._texture;
537+
}
534538
}
535539
if (quad.imageTexture) {
536540
delete quad.imageTexture._texture;

0 commit comments

Comments
 (0)