Skip to content

Conversation

@chiefcll
Copy link
Contributor

Phase 2 - after #726

Removes RenderOps and leaves it on CoreNode. Cleanup property differences between SDF & CoreNode

bindRenderOp(renderOp: WebGlRenderOp) {
this.bindBufferCollection(renderOp.buffers);
this.bindTextures(renderOp.textures);
const isCoreNode = renderOp instanceof CoreNode;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This instanceof check is a bit expensive since there a lot to check in CoreNode. This needs to be replaced by a simpler check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

return (this.stage.renderer as WebGlRenderer).quadBufferCollection;
}

get width(): number {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need these, use get w if you really must, but if its for internal use, avoid using getters and just use props.w / props.h

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a lot of overhead. With the change to w / h it wasn't done throughout the code base. So now we face w => width and vice versa and same with height. That requires if statements in a lot of places. If you and the team want to spend the time to make it consistent through out the code base that would allow removing this.

return this.textureCoords || this.stage.renderer.defaultTextureCoords;
}

get quadBufferCollection(): BufferCollection {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very WebGl specific, handle this in WebGLRenderer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CoreNodes are now renderOps.

return this.props.texture || this.stage.defaultTexture;
}

get renderTextureCoords(): TextureCoords | undefined {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very WebGl specific, handle this in WebGLRenderer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Canvas renderer needs this as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants