mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #26147 - jdm:linewidth, r=nox
Avoid GL errors with LineWidth commands - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #26139
This commit is contained in:
commit
23deec8c39
1 changed files with 7 additions and 1 deletions
|
@ -1167,7 +1167,13 @@ impl WebGLImpl {
|
||||||
gl.enable_vertex_attrib_array(attrib_id)
|
gl.enable_vertex_attrib_array(attrib_id)
|
||||||
},
|
},
|
||||||
WebGLCommand::Hint(name, val) => gl.hint(name, val),
|
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::PixelStorei(name, val) => gl.pixel_store_i(name, val),
|
||||||
WebGLCommand::PolygonOffset(factor, units) => gl.polygon_offset(factor, units),
|
WebGLCommand::PolygonOffset(factor, units) => gl.polygon_offset(factor, units),
|
||||||
WebGLCommand::ReadPixels(rect, format, pixel_type, ref sender) => {
|
WebGLCommand::ReadPixels(rect, format, pixel_type, ref sender) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue