Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| index a5946fab874cafdcba455ea0d5bcfa4bb081ef31..e212df442fa72fa8e11a69b8cf15b96e7f65f387 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -1666,7 +1666,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient { |
| bool DoIsPathCHROMIUM(GLuint client_id); |
| bool DoIsSync(GLuint client_id); |
| - void DoLineWidth(GLfloat width); |
| + GLfloat DoLineWidth(GLfloat width); |
| // Wrapper for glLinkProgram |
| void DoLinkProgram(GLuint program); |
| @@ -8455,9 +8455,27 @@ void GLES2DecoderImpl::DoRenderbufferStorage( |
| } |
| } |
| -void GLES2DecoderImpl::DoLineWidth(GLfloat width) { |
| - glLineWidth( |
| - std::min(std::max(width, line_width_range_[0]), line_width_range_[1])); |
| +error::Error GLES2DecoderImpl::HandleLineWidth(uint32_t immediate_data_size, |
| + const volatile void* cmd_data) { |
| + const volatile gles2::cmds::LineWidth& c = |
| + *static_cast<const volatile gles2::cmds::LineWidth*>(cmd_data); |
| + GLfloat width = static_cast<GLfloat>(c.width); |
| + if (width <= 0.0f || std::isnan(width)) { |
| + LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "LineWidth", "width out of range"); |
| + return error::kNoError; |
| + } |
| + if (state_.line_width != width) { |
| + // Save adjusted line width. |
| + state_.line_width = DoLineWidth(width); |
|
piman
2016/11/07 19:38:01
This is incorrect, though, because it means the va
|
| + } |
| + return error::kNoError; |
| +} |
| + |
| +GLfloat GLES2DecoderImpl::DoLineWidth(GLfloat width) { |
| + GLfloat real_width = |
| + std::min(std::max(width, line_width_range_[0]), line_width_range_[1]); |
| + glLineWidth(real_width); |
| + return real_width; |
| } |
| void GLES2DecoderImpl::DoLinkProgram(GLuint program_id) { |