| 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 6139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6150 if (framebuffer == framebuffer_state_.bound_draw_framebuffer.get()) { | 6150 if (framebuffer == framebuffer_state_.bound_draw_framebuffer.get()) { |
| 6151 framebuffer_state_.clear_state_dirty = true; | 6151 framebuffer_state_.clear_state_dirty = true; |
| 6152 } | 6152 } |
| 6153 OnFboChanged(); | 6153 OnFboChanged(); |
| 6154 } | 6154 } |
| 6155 | 6155 |
| 6156 void GLES2DecoderImpl::DoDisable(GLenum cap) { | 6156 void GLES2DecoderImpl::DoDisable(GLenum cap) { |
| 6157 if (SetCapabilityState(cap, false)) { | 6157 if (SetCapabilityState(cap, false)) { |
| 6158 glDisable(cap); | 6158 glDisable(cap); |
| 6159 } | 6159 } |
| 6160 if (cap == GL_PRIMITIVE_RESTART_FIXED_INDEX) { |
| 6161 buffer_manager()->SetPrimitiveRestartState(false); |
| 6162 } |
| 6160 } | 6163 } |
| 6161 | 6164 |
| 6162 void GLES2DecoderImpl::DoEnable(GLenum cap) { | 6165 void GLES2DecoderImpl::DoEnable(GLenum cap) { |
| 6163 if (SetCapabilityState(cap, true)) { | 6166 if (SetCapabilityState(cap, true)) { |
| 6164 glEnable(cap); | 6167 glEnable(cap); |
| 6165 } | 6168 } |
| 6169 if (cap == GL_PRIMITIVE_RESTART_FIXED_INDEX) { |
| 6170 buffer_manager()->SetPrimitiveRestartState(true); |
| 6171 } |
| 6166 } | 6172 } |
| 6167 | 6173 |
| 6168 void GLES2DecoderImpl::DoDepthRangef(GLclampf znear, GLclampf zfar) { | 6174 void GLES2DecoderImpl::DoDepthRangef(GLclampf znear, GLclampf zfar) { |
| 6169 state_.z_near = std::min(1.0f, std::max(0.0f, znear)); | 6175 state_.z_near = std::min(1.0f, std::max(0.0f, znear)); |
| 6170 state_.z_far = std::min(1.0f, std::max(0.0f, zfar)); | 6176 state_.z_far = std::min(1.0f, std::max(0.0f, zfar)); |
| 6171 glDepthRange(znear, zfar); | 6177 glDepthRange(znear, zfar); |
| 6172 } | 6178 } |
| 6173 | 6179 |
| 6174 void GLES2DecoderImpl::DoSampleCoverage(GLclampf value, GLboolean invert) { | 6180 void GLES2DecoderImpl::DoSampleCoverage(GLclampf value, GLboolean invert) { |
| 6175 state_.sample_coverage_value = std::min(1.0f, std::max(0.0f, value)); | 6181 state_.sample_coverage_value = std::min(1.0f, std::max(0.0f, value)); |
| (...skipping 9952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16128 } | 16134 } |
| 16129 | 16135 |
| 16130 // Include the auto-generated part of this file. We split this because it means | 16136 // Include the auto-generated part of this file. We split this because it means |
| 16131 // we can easily edit the non-auto generated parts right here in this file | 16137 // we can easily edit the non-auto generated parts right here in this file |
| 16132 // instead of having to edit some template or the code generator. | 16138 // instead of having to edit some template or the code generator. |
| 16133 #include "base/macros.h" | 16139 #include "base/macros.h" |
| 16134 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 16140 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 16135 | 16141 |
| 16136 } // namespace gles2 | 16142 } // namespace gles2 |
| 16137 } // namespace gpu | 16143 } // namespace gpu |
| OLD | NEW |