Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2482673002: fix --show-composited-layer-borders on Mac (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698