diff options
author | Josh Matthews <josh@joshmatthews.net> | 2020-04-08 12:54:12 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2020-04-08 12:54:12 -0400 |
commit | 16d67b1283c214cc898b1dca25318522cf45ecf1 (patch) | |
tree | 1bf249d39fd39d70078e0c49f6d1b6b80b0722b9 /components/canvas/webgl_thread.rs | |
parent | 2128bf1e05bfb6adac343047310d7117b80c0068 (diff) | |
download | servo-16d67b1283c214cc898b1dca25318522cf45ecf1.tar.gz servo-16d67b1283c214cc898b1dca25318522cf45ecf1.zip |
webgl: Avoid GL errors with LineWidth commands.
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-rw-r--r-- | components/canvas/webgl_thread.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs index 8d63b6973f0..28c5bb7240b 100644 --- a/components/canvas/webgl_thread.rs +++ b/components/canvas/webgl_thread.rs @@ -1184,7 +1184,13 @@ impl WebGLImpl { gl.enable_vertex_attrib_array(attrib_id) }, WebGLCommand::Hint(name, val) => gl.hint(name, val), - WebGLCommand::LineWidth(width) => gl.line_width(width), + WebGLCommand::LineWidth(width) => { + gl.line_width(width); + // In OpenGL Core Profile >3.2, any non-1.0 value will generate INVALID_VALUE. + if width != 1.0 { + let _ = gl.get_error(); + } + }, WebGLCommand::PixelStorei(name, val) => gl.pixel_store_i(name, val), WebGLCommand::PolygonOffset(factor, units) => gl.polygon_offset(factor, units), WebGLCommand::ReadPixels(rect, format, pixel_type, ref sender) => { |