Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1659 bool DoIsProgram(GLuint client_id); | 1659 bool DoIsProgram(GLuint client_id); |
| 1660 bool DoIsRenderbuffer(GLuint client_id); | 1660 bool DoIsRenderbuffer(GLuint client_id); |
| 1661 bool DoIsShader(GLuint client_id); | 1661 bool DoIsShader(GLuint client_id); |
| 1662 bool DoIsTexture(GLuint client_id); | 1662 bool DoIsTexture(GLuint client_id); |
| 1663 bool DoIsSampler(GLuint client_id); | 1663 bool DoIsSampler(GLuint client_id); |
| 1664 bool DoIsTransformFeedback(GLuint client_id); | 1664 bool DoIsTransformFeedback(GLuint client_id); |
| 1665 bool DoIsVertexArrayOES(GLuint client_id); | 1665 bool DoIsVertexArrayOES(GLuint client_id); |
| 1666 bool DoIsPathCHROMIUM(GLuint client_id); | 1666 bool DoIsPathCHROMIUM(GLuint client_id); |
| 1667 bool DoIsSync(GLuint client_id); | 1667 bool DoIsSync(GLuint client_id); |
| 1668 | 1668 |
| 1669 void DoLineWidth(GLfloat width); | 1669 GLfloat DoLineWidth(GLfloat width); |
| 1670 | 1670 |
| 1671 // Wrapper for glLinkProgram | 1671 // Wrapper for glLinkProgram |
| 1672 void DoLinkProgram(GLuint program); | 1672 void DoLinkProgram(GLuint program); |
| 1673 | 1673 |
| 1674 // Wrapper for glReadBuffer | 1674 // Wrapper for glReadBuffer |
| 1675 void DoReadBuffer(GLenum src); | 1675 void DoReadBuffer(GLenum src); |
| 1676 | 1676 |
| 1677 // Wrapper for glRenderbufferStorage. | 1677 // Wrapper for glRenderbufferStorage. |
| 1678 void DoRenderbufferStorage( | 1678 void DoRenderbufferStorage( |
| 1679 GLenum target, GLenum internalformat, GLsizei width, GLsizei height); | 1679 GLenum target, GLenum internalformat, GLsizei width, GLsizei height); |
| (...skipping 6768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8448 GLenum error = LOCAL_PEEK_GL_ERROR("glRenderbufferStorage"); | 8448 GLenum error = LOCAL_PEEK_GL_ERROR("glRenderbufferStorage"); |
| 8449 if (error == GL_NO_ERROR) { | 8449 if (error == GL_NO_ERROR) { |
| 8450 // TODO(gman): If tetxures tracked which framebuffers they were attached to | 8450 // TODO(gman): If tetxures tracked which framebuffers they were attached to |
| 8451 // we could just mark those framebuffers as not complete. | 8451 // we could just mark those framebuffers as not complete. |
| 8452 framebuffer_manager()->IncFramebufferStateChangeCount(); | 8452 framebuffer_manager()->IncFramebufferStateChangeCount(); |
| 8453 renderbuffer_manager()->SetInfo( | 8453 renderbuffer_manager()->SetInfo( |
| 8454 renderbuffer, 0, internalformat, width, height); | 8454 renderbuffer, 0, internalformat, width, height); |
| 8455 } | 8455 } |
| 8456 } | 8456 } |
| 8457 | 8457 |
| 8458 void GLES2DecoderImpl::DoLineWidth(GLfloat width) { | 8458 error::Error GLES2DecoderImpl::HandleLineWidth(uint32_t immediate_data_size, |
| 8459 glLineWidth( | 8459 const volatile void* cmd_data) { |
| 8460 std::min(std::max(width, line_width_range_[0]), line_width_range_[1])); | 8460 const volatile gles2::cmds::LineWidth& c = |
| 8461 *static_cast<const volatile gles2::cmds::LineWidth*>(cmd_data); | |
| 8462 GLfloat width = static_cast<GLfloat>(c.width); | |
| 8463 if (width <= 0.0f || std::isnan(width)) { | |
| 8464 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "LineWidth", "width out of range"); | |
| 8465 return error::kNoError; | |
| 8466 } | |
| 8467 if (state_.line_width != width) { | |
| 8468 // Save adjusted line width. | |
| 8469 state_.line_width = DoLineWidth(width); | |
|
piman
2016/11/07 19:38:01
This is incorrect, though, because it means the va
| |
| 8470 } | |
| 8471 return error::kNoError; | |
| 8472 } | |
| 8473 | |
| 8474 GLfloat GLES2DecoderImpl::DoLineWidth(GLfloat width) { | |
| 8475 GLfloat real_width = | |
| 8476 std::min(std::max(width, line_width_range_[0]), line_width_range_[1]); | |
| 8477 glLineWidth(real_width); | |
| 8478 return real_width; | |
| 8461 } | 8479 } |
| 8462 | 8480 |
| 8463 void GLES2DecoderImpl::DoLinkProgram(GLuint program_id) { | 8481 void GLES2DecoderImpl::DoLinkProgram(GLuint program_id) { |
| 8464 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoLinkProgram"); | 8482 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoLinkProgram"); |
| 8465 SCOPED_UMA_HISTOGRAM_TIMER("GPU.DoLinkProgramTime"); | 8483 SCOPED_UMA_HISTOGRAM_TIMER("GPU.DoLinkProgramTime"); |
| 8466 Program* program = GetProgramInfoNotShader( | 8484 Program* program = GetProgramInfoNotShader( |
| 8467 program_id, "glLinkProgram"); | 8485 program_id, "glLinkProgram"); |
| 8468 if (!program) { | 8486 if (!program) { |
| 8469 return; | 8487 return; |
| 8470 } | 8488 } |
| (...skipping 10315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 18786 } | 18804 } |
| 18787 | 18805 |
| 18788 // Include the auto-generated part of this file. We split this because it means | 18806 // Include the auto-generated part of this file. We split this because it means |
| 18789 // we can easily edit the non-auto generated parts right here in this file | 18807 // we can easily edit the non-auto generated parts right here in this file |
| 18790 // instead of having to edit some template or the code generator. | 18808 // instead of having to edit some template or the code generator. |
| 18791 #include "base/macros.h" | 18809 #include "base/macros.h" |
| 18792 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18810 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 18793 | 18811 |
| 18794 } // namespace gles2 | 18812 } // namespace gles2 |
| 18795 } // namespace gpu | 18813 } // namespace gpu |
| OLD | NEW |