We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4794944 + cd31e89 commit 084ecf3Copy full SHA for 084ecf3
Sources/Rendering/OpenGL/RenderWindow/index.js
@@ -732,9 +732,18 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
732
});
733
};
734
735
+ let hardwareMaximumLineWidth;
736
publicAPI.getHardwareMaximumLineWidth = () => {
737
+ // We cache the result of this function because `getParameter` is slow
738
+ if (hardwareMaximumLineWidth != null) {
739
+ return hardwareMaximumLineWidth;
740
+ }
741
+
742
const gl = publicAPI.get3DContext();
743
const lineWidthRange = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE);
744
745
+ hardwareMaximumLineWidth = lineWidthRange[1];
746
747
return lineWidthRange[1];
748
749
0 commit comments