| 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 // This file is auto-generated from | 5 // This file is auto-generated from |
| 6 // gpu/command_buffer/build_gles2_cmd_buffer.py | 6 // gpu/command_buffer/build_gles2_cmd_buffer.py |
| 7 // DO NOT EDIT! | 7 // DO NOT EDIT! |
| 8 | 8 |
| 9 // It is included by gles2_cmd_decoder.cc | 9 // It is included by gles2_cmd_decoder.cc |
| 10 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ | 10 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 GLuint shader = c.shader; | 23 GLuint shader = c.shader; |
| 24 DoAttachShader(program, shader); | 24 DoAttachShader(program, shader); |
| 25 return error::kNoError; | 25 return error::kNoError; |
| 26 } | 26 } |
| 27 | 27 |
| 28 error::Error GLES2DecoderImpl::HandleBindBuffer( | 28 error::Error GLES2DecoderImpl::HandleBindBuffer( |
| 29 uint32 immediate_data_size, const gles2::BindBuffer& c) { | 29 uint32 immediate_data_size, const gles2::BindBuffer& c) { |
| 30 GLenum target = static_cast<GLenum>(c.target); | 30 GLenum target = static_cast<GLenum>(c.target); |
| 31 GLuint buffer = c.buffer; | 31 GLuint buffer = c.buffer; |
| 32 if (!validators_->buffer_target.IsValid(target)) { | 32 if (!validators_->buffer_target.IsValid(target)) { |
| 33 SetGLError(GL_INVALID_ENUM, "glBindBuffer", "target GL_INVALID_ENUM"); | 33 SetGLErrorInvalidEnum("glBindBuffer", target, "target"); |
| 34 return error::kNoError; | 34 return error::kNoError; |
| 35 } | 35 } |
| 36 DoBindBuffer(target, buffer); | 36 DoBindBuffer(target, buffer); |
| 37 return error::kNoError; | 37 return error::kNoError; |
| 38 } | 38 } |
| 39 | 39 |
| 40 error::Error GLES2DecoderImpl::HandleBindFramebuffer( | 40 error::Error GLES2DecoderImpl::HandleBindFramebuffer( |
| 41 uint32 immediate_data_size, const gles2::BindFramebuffer& c) { | 41 uint32 immediate_data_size, const gles2::BindFramebuffer& c) { |
| 42 GLenum target = static_cast<GLenum>(c.target); | 42 GLenum target = static_cast<GLenum>(c.target); |
| 43 GLuint framebuffer = c.framebuffer; | 43 GLuint framebuffer = c.framebuffer; |
| 44 if (!validators_->frame_buffer_target.IsValid(target)) { | 44 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 45 SetGLError(GL_INVALID_ENUM, "glBindFramebuffer", "target GL_INVALID_ENUM"); | 45 SetGLErrorInvalidEnum("glBindFramebuffer", target, "target"); |
| 46 return error::kNoError; | 46 return error::kNoError; |
| 47 } | 47 } |
| 48 DoBindFramebuffer(target, framebuffer); | 48 DoBindFramebuffer(target, framebuffer); |
| 49 return error::kNoError; | 49 return error::kNoError; |
| 50 } | 50 } |
| 51 | 51 |
| 52 error::Error GLES2DecoderImpl::HandleBindRenderbuffer( | 52 error::Error GLES2DecoderImpl::HandleBindRenderbuffer( |
| 53 uint32 immediate_data_size, const gles2::BindRenderbuffer& c) { | 53 uint32 immediate_data_size, const gles2::BindRenderbuffer& c) { |
| 54 GLenum target = static_cast<GLenum>(c.target); | 54 GLenum target = static_cast<GLenum>(c.target); |
| 55 GLuint renderbuffer = c.renderbuffer; | 55 GLuint renderbuffer = c.renderbuffer; |
| 56 if (!validators_->render_buffer_target.IsValid(target)) { | 56 if (!validators_->render_buffer_target.IsValid(target)) { |
| 57 SetGLError( | 57 SetGLErrorInvalidEnum("glBindRenderbuffer", target, "target"); |
| 58 GL_INVALID_ENUM, "glBindRenderbuffer", "target GL_INVALID_ENUM"); | |
| 59 return error::kNoError; | 58 return error::kNoError; |
| 60 } | 59 } |
| 61 DoBindRenderbuffer(target, renderbuffer); | 60 DoBindRenderbuffer(target, renderbuffer); |
| 62 return error::kNoError; | 61 return error::kNoError; |
| 63 } | 62 } |
| 64 | 63 |
| 65 error::Error GLES2DecoderImpl::HandleBindTexture( | 64 error::Error GLES2DecoderImpl::HandleBindTexture( |
| 66 uint32 immediate_data_size, const gles2::BindTexture& c) { | 65 uint32 immediate_data_size, const gles2::BindTexture& c) { |
| 67 GLenum target = static_cast<GLenum>(c.target); | 66 GLenum target = static_cast<GLenum>(c.target); |
| 68 GLuint texture = c.texture; | 67 GLuint texture = c.texture; |
| 69 if (!validators_->texture_bind_target.IsValid(target)) { | 68 if (!validators_->texture_bind_target.IsValid(target)) { |
| 70 SetGLError(GL_INVALID_ENUM, "glBindTexture", "target GL_INVALID_ENUM"); | 69 SetGLErrorInvalidEnum("glBindTexture", target, "target"); |
| 71 return error::kNoError; | 70 return error::kNoError; |
| 72 } | 71 } |
| 73 DoBindTexture(target, texture); | 72 DoBindTexture(target, texture); |
| 74 return error::kNoError; | 73 return error::kNoError; |
| 75 } | 74 } |
| 76 | 75 |
| 77 error::Error GLES2DecoderImpl::HandleBlendColor( | 76 error::Error GLES2DecoderImpl::HandleBlendColor( |
| 78 uint32 immediate_data_size, const gles2::BlendColor& c) { | 77 uint32 immediate_data_size, const gles2::BlendColor& c) { |
| 79 GLclampf red = static_cast<GLclampf>(c.red); | 78 GLclampf red = static_cast<GLclampf>(c.red); |
| 80 GLclampf green = static_cast<GLclampf>(c.green); | 79 GLclampf green = static_cast<GLclampf>(c.green); |
| 81 GLclampf blue = static_cast<GLclampf>(c.blue); | 80 GLclampf blue = static_cast<GLclampf>(c.blue); |
| 82 GLclampf alpha = static_cast<GLclampf>(c.alpha); | 81 GLclampf alpha = static_cast<GLclampf>(c.alpha); |
| 83 glBlendColor(red, green, blue, alpha); | 82 glBlendColor(red, green, blue, alpha); |
| 84 return error::kNoError; | 83 return error::kNoError; |
| 85 } | 84 } |
| 86 | 85 |
| 87 error::Error GLES2DecoderImpl::HandleBlendEquation( | 86 error::Error GLES2DecoderImpl::HandleBlendEquation( |
| 88 uint32 immediate_data_size, const gles2::BlendEquation& c) { | 87 uint32 immediate_data_size, const gles2::BlendEquation& c) { |
| 89 GLenum mode = static_cast<GLenum>(c.mode); | 88 GLenum mode = static_cast<GLenum>(c.mode); |
| 90 if (!validators_->equation.IsValid(mode)) { | 89 if (!validators_->equation.IsValid(mode)) { |
| 91 SetGLError(GL_INVALID_ENUM, "glBlendEquation", "mode GL_INVALID_ENUM"); | 90 SetGLErrorInvalidEnum("glBlendEquation", mode, "mode"); |
| 92 return error::kNoError; | 91 return error::kNoError; |
| 93 } | 92 } |
| 94 glBlendEquation(mode); | 93 glBlendEquation(mode); |
| 95 return error::kNoError; | 94 return error::kNoError; |
| 96 } | 95 } |
| 97 | 96 |
| 98 error::Error GLES2DecoderImpl::HandleBlendEquationSeparate( | 97 error::Error GLES2DecoderImpl::HandleBlendEquationSeparate( |
| 99 uint32 immediate_data_size, const gles2::BlendEquationSeparate& c) { | 98 uint32 immediate_data_size, const gles2::BlendEquationSeparate& c) { |
| 100 GLenum modeRGB = static_cast<GLenum>(c.modeRGB); | 99 GLenum modeRGB = static_cast<GLenum>(c.modeRGB); |
| 101 GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha); | 100 GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha); |
| 102 if (!validators_->equation.IsValid(modeRGB)) { | 101 if (!validators_->equation.IsValid(modeRGB)) { |
| 103 SetGLError( | 102 SetGLErrorInvalidEnum("glBlendEquationSeparate", modeRGB, "modeRGB"); |
| 104 GL_INVALID_ENUM, "glBlendEquationSeparate", "modeRGB GL_INVALID_ENUM"); | |
| 105 return error::kNoError; | 103 return error::kNoError; |
| 106 } | 104 } |
| 107 if (!validators_->equation.IsValid(modeAlpha)) { | 105 if (!validators_->equation.IsValid(modeAlpha)) { |
| 108 SetGLError( | 106 SetGLErrorInvalidEnum("glBlendEquationSeparate", modeAlpha, "modeAlpha"); |
| 109 GL_INVALID_ENUM, "glBlendEquationSeparate", "modeAlpha GL_INVALID_ENUM")
; // NOLINT | |
| 110 return error::kNoError; | 107 return error::kNoError; |
| 111 } | 108 } |
| 112 glBlendEquationSeparate(modeRGB, modeAlpha); | 109 glBlendEquationSeparate(modeRGB, modeAlpha); |
| 113 return error::kNoError; | 110 return error::kNoError; |
| 114 } | 111 } |
| 115 | 112 |
| 116 error::Error GLES2DecoderImpl::HandleBlendFunc( | 113 error::Error GLES2DecoderImpl::HandleBlendFunc( |
| 117 uint32 immediate_data_size, const gles2::BlendFunc& c) { | 114 uint32 immediate_data_size, const gles2::BlendFunc& c) { |
| 118 GLenum sfactor = static_cast<GLenum>(c.sfactor); | 115 GLenum sfactor = static_cast<GLenum>(c.sfactor); |
| 119 GLenum dfactor = static_cast<GLenum>(c.dfactor); | 116 GLenum dfactor = static_cast<GLenum>(c.dfactor); |
| 120 if (!validators_->src_blend_factor.IsValid(sfactor)) { | 117 if (!validators_->src_blend_factor.IsValid(sfactor)) { |
| 121 SetGLError(GL_INVALID_ENUM, "glBlendFunc", "sfactor GL_INVALID_ENUM"); | 118 SetGLErrorInvalidEnum("glBlendFunc", sfactor, "sfactor"); |
| 122 return error::kNoError; | 119 return error::kNoError; |
| 123 } | 120 } |
| 124 if (!validators_->dst_blend_factor.IsValid(dfactor)) { | 121 if (!validators_->dst_blend_factor.IsValid(dfactor)) { |
| 125 SetGLError(GL_INVALID_ENUM, "glBlendFunc", "dfactor GL_INVALID_ENUM"); | 122 SetGLErrorInvalidEnum("glBlendFunc", dfactor, "dfactor"); |
| 126 return error::kNoError; | 123 return error::kNoError; |
| 127 } | 124 } |
| 128 glBlendFunc(sfactor, dfactor); | 125 glBlendFunc(sfactor, dfactor); |
| 129 return error::kNoError; | 126 return error::kNoError; |
| 130 } | 127 } |
| 131 | 128 |
| 132 error::Error GLES2DecoderImpl::HandleBlendFuncSeparate( | 129 error::Error GLES2DecoderImpl::HandleBlendFuncSeparate( |
| 133 uint32 immediate_data_size, const gles2::BlendFuncSeparate& c) { | 130 uint32 immediate_data_size, const gles2::BlendFuncSeparate& c) { |
| 134 GLenum srcRGB = static_cast<GLenum>(c.srcRGB); | 131 GLenum srcRGB = static_cast<GLenum>(c.srcRGB); |
| 135 GLenum dstRGB = static_cast<GLenum>(c.dstRGB); | 132 GLenum dstRGB = static_cast<GLenum>(c.dstRGB); |
| 136 GLenum srcAlpha = static_cast<GLenum>(c.srcAlpha); | 133 GLenum srcAlpha = static_cast<GLenum>(c.srcAlpha); |
| 137 GLenum dstAlpha = static_cast<GLenum>(c.dstAlpha); | 134 GLenum dstAlpha = static_cast<GLenum>(c.dstAlpha); |
| 138 if (!validators_->src_blend_factor.IsValid(srcRGB)) { | 135 if (!validators_->src_blend_factor.IsValid(srcRGB)) { |
| 139 SetGLError( | 136 SetGLErrorInvalidEnum("glBlendFuncSeparate", srcRGB, "srcRGB"); |
| 140 GL_INVALID_ENUM, "glBlendFuncSeparate", "srcRGB GL_INVALID_ENUM"); | |
| 141 return error::kNoError; | 137 return error::kNoError; |
| 142 } | 138 } |
| 143 if (!validators_->dst_blend_factor.IsValid(dstRGB)) { | 139 if (!validators_->dst_blend_factor.IsValid(dstRGB)) { |
| 144 SetGLError( | 140 SetGLErrorInvalidEnum("glBlendFuncSeparate", dstRGB, "dstRGB"); |
| 145 GL_INVALID_ENUM, "glBlendFuncSeparate", "dstRGB GL_INVALID_ENUM"); | |
| 146 return error::kNoError; | 141 return error::kNoError; |
| 147 } | 142 } |
| 148 if (!validators_->src_blend_factor.IsValid(srcAlpha)) { | 143 if (!validators_->src_blend_factor.IsValid(srcAlpha)) { |
| 149 SetGLError( | 144 SetGLErrorInvalidEnum("glBlendFuncSeparate", srcAlpha, "srcAlpha"); |
| 150 GL_INVALID_ENUM, "glBlendFuncSeparate", "srcAlpha GL_INVALID_ENUM"); | |
| 151 return error::kNoError; | 145 return error::kNoError; |
| 152 } | 146 } |
| 153 if (!validators_->dst_blend_factor.IsValid(dstAlpha)) { | 147 if (!validators_->dst_blend_factor.IsValid(dstAlpha)) { |
| 154 SetGLError( | 148 SetGLErrorInvalidEnum("glBlendFuncSeparate", dstAlpha, "dstAlpha"); |
| 155 GL_INVALID_ENUM, "glBlendFuncSeparate", "dstAlpha GL_INVALID_ENUM"); | |
| 156 return error::kNoError; | 149 return error::kNoError; |
| 157 } | 150 } |
| 158 glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); | 151 glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
| 159 return error::kNoError; | 152 return error::kNoError; |
| 160 } | 153 } |
| 161 | 154 |
| 162 error::Error GLES2DecoderImpl::HandleBufferSubData( | 155 error::Error GLES2DecoderImpl::HandleBufferSubData( |
| 163 uint32 immediate_data_size, const gles2::BufferSubData& c) { | 156 uint32 immediate_data_size, const gles2::BufferSubData& c) { |
| 164 GLenum target = static_cast<GLenum>(c.target); | 157 GLenum target = static_cast<GLenum>(c.target); |
| 165 GLintptr offset = static_cast<GLintptr>(c.offset); | 158 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 166 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 159 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 167 uint32 data_size = size; | 160 uint32 data_size = size; |
| 168 const void* data = GetSharedMemoryAs<const void*>( | 161 const void* data = GetSharedMemoryAs<const void*>( |
| 169 c.data_shm_id, c.data_shm_offset, data_size); | 162 c.data_shm_id, c.data_shm_offset, data_size); |
| 170 if (!validators_->buffer_target.IsValid(target)) { | 163 if (!validators_->buffer_target.IsValid(target)) { |
| 171 SetGLError(GL_INVALID_ENUM, "glBufferSubData", "target GL_INVALID_ENUM"); | 164 SetGLErrorInvalidEnum("glBufferSubData", target, "target"); |
| 172 return error::kNoError; | 165 return error::kNoError; |
| 173 } | 166 } |
| 174 if (size < 0) { | 167 if (size < 0) { |
| 175 SetGLError(GL_INVALID_VALUE, "glBufferSubData", "size < 0"); | 168 SetGLError(GL_INVALID_VALUE, "glBufferSubData", "size < 0"); |
| 176 return error::kNoError; | 169 return error::kNoError; |
| 177 } | 170 } |
| 178 if (data == NULL) { | 171 if (data == NULL) { |
| 179 return error::kOutOfBounds; | 172 return error::kOutOfBounds; |
| 180 } | 173 } |
| 181 DoBufferSubData(target, offset, size, data); | 174 DoBufferSubData(target, offset, size, data); |
| 182 return error::kNoError; | 175 return error::kNoError; |
| 183 } | 176 } |
| 184 | 177 |
| 185 error::Error GLES2DecoderImpl::HandleBufferSubDataImmediate( | 178 error::Error GLES2DecoderImpl::HandleBufferSubDataImmediate( |
| 186 uint32 immediate_data_size, const gles2::BufferSubDataImmediate& c) { | 179 uint32 immediate_data_size, const gles2::BufferSubDataImmediate& c) { |
| 187 GLenum target = static_cast<GLenum>(c.target); | 180 GLenum target = static_cast<GLenum>(c.target); |
| 188 GLintptr offset = static_cast<GLintptr>(c.offset); | 181 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 189 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 182 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 190 uint32 data_size = size; | 183 uint32 data_size = size; |
| 191 const void* data = GetImmediateDataAs<const void*>( | 184 const void* data = GetImmediateDataAs<const void*>( |
| 192 c, data_size, immediate_data_size); | 185 c, data_size, immediate_data_size); |
| 193 if (!validators_->buffer_target.IsValid(target)) { | 186 if (!validators_->buffer_target.IsValid(target)) { |
| 194 SetGLError(GL_INVALID_ENUM, "glBufferSubData", "target GL_INVALID_ENUM"); | 187 SetGLErrorInvalidEnum("glBufferSubData", target, "target"); |
| 195 return error::kNoError; | 188 return error::kNoError; |
| 196 } | 189 } |
| 197 if (size < 0) { | 190 if (size < 0) { |
| 198 SetGLError(GL_INVALID_VALUE, "glBufferSubData", "size < 0"); | 191 SetGLError(GL_INVALID_VALUE, "glBufferSubData", "size < 0"); |
| 199 return error::kNoError; | 192 return error::kNoError; |
| 200 } | 193 } |
| 201 if (data == NULL) { | 194 if (data == NULL) { |
| 202 return error::kOutOfBounds; | 195 return error::kOutOfBounds; |
| 203 } | 196 } |
| 204 DoBufferSubData(target, offset, size, data); | 197 DoBufferSubData(target, offset, size, data); |
| 205 return error::kNoError; | 198 return error::kNoError; |
| 206 } | 199 } |
| 207 | 200 |
| 208 error::Error GLES2DecoderImpl::HandleCheckFramebufferStatus( | 201 error::Error GLES2DecoderImpl::HandleCheckFramebufferStatus( |
| 209 uint32 immediate_data_size, const gles2::CheckFramebufferStatus& c) { | 202 uint32 immediate_data_size, const gles2::CheckFramebufferStatus& c) { |
| 210 GLenum target = static_cast<GLenum>(c.target); | 203 GLenum target = static_cast<GLenum>(c.target); |
| 211 typedef CheckFramebufferStatus::Result Result; | 204 typedef CheckFramebufferStatus::Result Result; |
| 212 Result* result_dst = GetSharedMemoryAs<Result*>( | 205 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 213 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 206 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 214 if (!result_dst) { | 207 if (!result_dst) { |
| 215 return error::kOutOfBounds; | 208 return error::kOutOfBounds; |
| 216 } | 209 } |
| 217 if (!validators_->frame_buffer_target.IsValid(target)) { | 210 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 218 SetGLError( | 211 SetGLErrorInvalidEnum("glCheckFramebufferStatus", target, "target"); |
| 219 GL_INVALID_ENUM, "glCheckFramebufferStatus", "target GL_INVALID_ENUM"); | |
| 220 return error::kNoError; | 212 return error::kNoError; |
| 221 } | 213 } |
| 222 *result_dst = DoCheckFramebufferStatus(target); | 214 *result_dst = DoCheckFramebufferStatus(target); |
| 223 return error::kNoError; | 215 return error::kNoError; |
| 224 } | 216 } |
| 225 | 217 |
| 226 error::Error GLES2DecoderImpl::HandleClearColor( | 218 error::Error GLES2DecoderImpl::HandleClearColor( |
| 227 uint32 immediate_data_size, const gles2::ClearColor& c) { | 219 uint32 immediate_data_size, const gles2::ClearColor& c) { |
| 228 GLclampf red = static_cast<GLclampf>(c.red); | 220 GLclampf red = static_cast<GLclampf>(c.red); |
| 229 GLclampf green = static_cast<GLclampf>(c.green); | 221 GLclampf green = static_cast<GLclampf>(c.green); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 GLint xoffset = static_cast<GLint>(c.xoffset); | 263 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 272 GLint yoffset = static_cast<GLint>(c.yoffset); | 264 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 273 GLsizei width = static_cast<GLsizei>(c.width); | 265 GLsizei width = static_cast<GLsizei>(c.width); |
| 274 GLsizei height = static_cast<GLsizei>(c.height); | 266 GLsizei height = static_cast<GLsizei>(c.height); |
| 275 GLenum format = static_cast<GLenum>(c.format); | 267 GLenum format = static_cast<GLenum>(c.format); |
| 276 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); | 268 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); |
| 277 uint32 data_size = imageSize; | 269 uint32 data_size = imageSize; |
| 278 const void* data = GetSharedMemoryAs<const void*>( | 270 const void* data = GetSharedMemoryAs<const void*>( |
| 279 c.data_shm_id, c.data_shm_offset, data_size); | 271 c.data_shm_id, c.data_shm_offset, data_size); |
| 280 if (!validators_->texture_target.IsValid(target)) { | 272 if (!validators_->texture_target.IsValid(target)) { |
| 281 SetGLError( | 273 SetGLErrorInvalidEnum("glCompressedTexSubImage2D", target, "target"); |
| 282 GL_INVALID_ENUM, "glCompressedTexSubImage2D", "target GL_INVALID_ENUM"); | |
| 283 return error::kNoError; | 274 return error::kNoError; |
| 284 } | 275 } |
| 285 if (width < 0) { | 276 if (width < 0) { |
| 286 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "width < 0"); | 277 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "width < 0"); |
| 287 return error::kNoError; | 278 return error::kNoError; |
| 288 } | 279 } |
| 289 if (height < 0) { | 280 if (height < 0) { |
| 290 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "height < 0"); | 281 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "height < 0"); |
| 291 return error::kNoError; | 282 return error::kNoError; |
| 292 } | 283 } |
| 293 if (!validators_->compressed_texture_format.IsValid(format)) { | 284 if (!validators_->compressed_texture_format.IsValid(format)) { |
| 294 SetGLError( | 285 SetGLErrorInvalidEnum("glCompressedTexSubImage2D", format, "format"); |
| 295 GL_INVALID_ENUM, "glCompressedTexSubImage2D", "format GL_INVALID_ENUM"); | |
| 296 return error::kNoError; | 286 return error::kNoError; |
| 297 } | 287 } |
| 298 if (imageSize < 0) { | 288 if (imageSize < 0) { |
| 299 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "imageSize < 0"); | 289 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "imageSize < 0"); |
| 300 return error::kNoError; | 290 return error::kNoError; |
| 301 } | 291 } |
| 302 if (data == NULL) { | 292 if (data == NULL) { |
| 303 return error::kOutOfBounds; | 293 return error::kOutOfBounds; |
| 304 } | 294 } |
| 305 DoCompressedTexSubImage2D( | 295 DoCompressedTexSubImage2D( |
| 306 target, level, xoffset, yoffset, width, height, format, imageSize, data); | 296 target, level, xoffset, yoffset, width, height, format, imageSize, data); |
| 307 return error::kNoError; | 297 return error::kNoError; |
| 308 } | 298 } |
| 309 | 299 |
| 310 error::Error GLES2DecoderImpl::HandleCompressedTexSubImage2DImmediate( | 300 error::Error GLES2DecoderImpl::HandleCompressedTexSubImage2DImmediate( |
| 311 uint32 immediate_data_size, | 301 uint32 immediate_data_size, |
| 312 const gles2::CompressedTexSubImage2DImmediate& c) { | 302 const gles2::CompressedTexSubImage2DImmediate& c) { |
| 313 GLenum target = static_cast<GLenum>(c.target); | 303 GLenum target = static_cast<GLenum>(c.target); |
| 314 GLint level = static_cast<GLint>(c.level); | 304 GLint level = static_cast<GLint>(c.level); |
| 315 GLint xoffset = static_cast<GLint>(c.xoffset); | 305 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 316 GLint yoffset = static_cast<GLint>(c.yoffset); | 306 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 317 GLsizei width = static_cast<GLsizei>(c.width); | 307 GLsizei width = static_cast<GLsizei>(c.width); |
| 318 GLsizei height = static_cast<GLsizei>(c.height); | 308 GLsizei height = static_cast<GLsizei>(c.height); |
| 319 GLenum format = static_cast<GLenum>(c.format); | 309 GLenum format = static_cast<GLenum>(c.format); |
| 320 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); | 310 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); |
| 321 uint32 data_size = imageSize; | 311 uint32 data_size = imageSize; |
| 322 const void* data = GetImmediateDataAs<const void*>( | 312 const void* data = GetImmediateDataAs<const void*>( |
| 323 c, data_size, immediate_data_size); | 313 c, data_size, immediate_data_size); |
| 324 if (!validators_->texture_target.IsValid(target)) { | 314 if (!validators_->texture_target.IsValid(target)) { |
| 325 SetGLError( | 315 SetGLErrorInvalidEnum("glCompressedTexSubImage2D", target, "target"); |
| 326 GL_INVALID_ENUM, "glCompressedTexSubImage2D", "target GL_INVALID_ENUM"); | |
| 327 return error::kNoError; | 316 return error::kNoError; |
| 328 } | 317 } |
| 329 if (width < 0) { | 318 if (width < 0) { |
| 330 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "width < 0"); | 319 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "width < 0"); |
| 331 return error::kNoError; | 320 return error::kNoError; |
| 332 } | 321 } |
| 333 if (height < 0) { | 322 if (height < 0) { |
| 334 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "height < 0"); | 323 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "height < 0"); |
| 335 return error::kNoError; | 324 return error::kNoError; |
| 336 } | 325 } |
| 337 if (!validators_->compressed_texture_format.IsValid(format)) { | 326 if (!validators_->compressed_texture_format.IsValid(format)) { |
| 338 SetGLError( | 327 SetGLErrorInvalidEnum("glCompressedTexSubImage2D", format, "format"); |
| 339 GL_INVALID_ENUM, "glCompressedTexSubImage2D", "format GL_INVALID_ENUM"); | |
| 340 return error::kNoError; | 328 return error::kNoError; |
| 341 } | 329 } |
| 342 if (imageSize < 0) { | 330 if (imageSize < 0) { |
| 343 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "imageSize < 0"); | 331 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D", "imageSize < 0"); |
| 344 return error::kNoError; | 332 return error::kNoError; |
| 345 } | 333 } |
| 346 if (data == NULL) { | 334 if (data == NULL) { |
| 347 return error::kOutOfBounds; | 335 return error::kOutOfBounds; |
| 348 } | 336 } |
| 349 DoCompressedTexSubImage2D( | 337 DoCompressedTexSubImage2D( |
| 350 target, level, xoffset, yoffset, width, height, format, imageSize, data); | 338 target, level, xoffset, yoffset, width, height, format, imageSize, data); |
| 351 return error::kNoError; | 339 return error::kNoError; |
| 352 } | 340 } |
| 353 | 341 |
| 354 error::Error GLES2DecoderImpl::HandleCopyTexImage2D( | 342 error::Error GLES2DecoderImpl::HandleCopyTexImage2D( |
| 355 uint32 immediate_data_size, const gles2::CopyTexImage2D& c) { | 343 uint32 immediate_data_size, const gles2::CopyTexImage2D& c) { |
| 356 GLenum target = static_cast<GLenum>(c.target); | 344 GLenum target = static_cast<GLenum>(c.target); |
| 357 GLint level = static_cast<GLint>(c.level); | 345 GLint level = static_cast<GLint>(c.level); |
| 358 GLenum internalformat = static_cast<GLenum>(c.internalformat); | 346 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 359 GLint x = static_cast<GLint>(c.x); | 347 GLint x = static_cast<GLint>(c.x); |
| 360 GLint y = static_cast<GLint>(c.y); | 348 GLint y = static_cast<GLint>(c.y); |
| 361 GLsizei width = static_cast<GLsizei>(c.width); | 349 GLsizei width = static_cast<GLsizei>(c.width); |
| 362 GLsizei height = static_cast<GLsizei>(c.height); | 350 GLsizei height = static_cast<GLsizei>(c.height); |
| 363 GLint border = static_cast<GLint>(c.border); | 351 GLint border = static_cast<GLint>(c.border); |
| 364 if (!validators_->texture_target.IsValid(target)) { | 352 if (!validators_->texture_target.IsValid(target)) { |
| 365 SetGLError(GL_INVALID_ENUM, "glCopyTexImage2D", "target GL_INVALID_ENUM"); | 353 SetGLErrorInvalidEnum("glCopyTexImage2D", target, "target"); |
| 366 return error::kNoError; | 354 return error::kNoError; |
| 367 } | 355 } |
| 368 if (!validators_->texture_internal_format.IsValid(internalformat)) { | 356 if (!validators_->texture_internal_format.IsValid(internalformat)) { |
| 369 SetGLError( | 357 SetGLErrorInvalidEnum("glCopyTexImage2D", internalformat, |
| 370 GL_INVALID_ENUM, "glCopyTexImage2D", "internalformat GL_INVALID_ENUM"); | 358 "internalformat"); |
| 371 return error::kNoError; | 359 return error::kNoError; |
| 372 } | 360 } |
| 373 if (width < 0) { | 361 if (width < 0) { |
| 374 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D", "width < 0"); | 362 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D", "width < 0"); |
| 375 return error::kNoError; | 363 return error::kNoError; |
| 376 } | 364 } |
| 377 if (height < 0) { | 365 if (height < 0) { |
| 378 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D", "height < 0"); | 366 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D", "height < 0"); |
| 379 return error::kNoError; | 367 return error::kNoError; |
| 380 } | 368 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 391 uint32 immediate_data_size, const gles2::CopyTexSubImage2D& c) { | 379 uint32 immediate_data_size, const gles2::CopyTexSubImage2D& c) { |
| 392 GLenum target = static_cast<GLenum>(c.target); | 380 GLenum target = static_cast<GLenum>(c.target); |
| 393 GLint level = static_cast<GLint>(c.level); | 381 GLint level = static_cast<GLint>(c.level); |
| 394 GLint xoffset = static_cast<GLint>(c.xoffset); | 382 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 395 GLint yoffset = static_cast<GLint>(c.yoffset); | 383 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 396 GLint x = static_cast<GLint>(c.x); | 384 GLint x = static_cast<GLint>(c.x); |
| 397 GLint y = static_cast<GLint>(c.y); | 385 GLint y = static_cast<GLint>(c.y); |
| 398 GLsizei width = static_cast<GLsizei>(c.width); | 386 GLsizei width = static_cast<GLsizei>(c.width); |
| 399 GLsizei height = static_cast<GLsizei>(c.height); | 387 GLsizei height = static_cast<GLsizei>(c.height); |
| 400 if (!validators_->texture_target.IsValid(target)) { | 388 if (!validators_->texture_target.IsValid(target)) { |
| 401 SetGLError( | 389 SetGLErrorInvalidEnum("glCopyTexSubImage2D", target, "target"); |
| 402 GL_INVALID_ENUM, "glCopyTexSubImage2D", "target GL_INVALID_ENUM"); | |
| 403 return error::kNoError; | 390 return error::kNoError; |
| 404 } | 391 } |
| 405 if (width < 0) { | 392 if (width < 0) { |
| 406 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D", "width < 0"); | 393 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D", "width < 0"); |
| 407 return error::kNoError; | 394 return error::kNoError; |
| 408 } | 395 } |
| 409 if (height < 0) { | 396 if (height < 0) { |
| 410 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D", "height < 0"); | 397 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D", "height < 0"); |
| 411 return error::kNoError; | 398 return error::kNoError; |
| 412 } | 399 } |
| 413 DoCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); | 400 DoCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); |
| 414 return error::kNoError; | 401 return error::kNoError; |
| 415 } | 402 } |
| 416 | 403 |
| 417 error::Error GLES2DecoderImpl::HandleCreateProgram( | 404 error::Error GLES2DecoderImpl::HandleCreateProgram( |
| 418 uint32 immediate_data_size, const gles2::CreateProgram& c) { | 405 uint32 immediate_data_size, const gles2::CreateProgram& c) { |
| 419 uint32 client_id = c.client_id; | 406 uint32 client_id = c.client_id; |
| 420 if (!CreateProgramHelper(client_id)) { | 407 if (!CreateProgramHelper(client_id)) { |
| 421 return error::kInvalidArguments; | 408 return error::kInvalidArguments; |
| 422 } | 409 } |
| 423 return error::kNoError; | 410 return error::kNoError; |
| 424 } | 411 } |
| 425 | 412 |
| 426 error::Error GLES2DecoderImpl::HandleCreateShader( | 413 error::Error GLES2DecoderImpl::HandleCreateShader( |
| 427 uint32 immediate_data_size, const gles2::CreateShader& c) { | 414 uint32 immediate_data_size, const gles2::CreateShader& c) { |
| 428 GLenum type = static_cast<GLenum>(c.type); | 415 GLenum type = static_cast<GLenum>(c.type); |
| 429 if (!validators_->shader_type.IsValid(type)) { | 416 if (!validators_->shader_type.IsValid(type)) { |
| 430 SetGLError(GL_INVALID_ENUM, "glCreateShader", "type GL_INVALID_ENUM"); | 417 SetGLErrorInvalidEnum("glCreateShader", type, "type"); |
| 431 return error::kNoError; | 418 return error::kNoError; |
| 432 } | 419 } |
| 433 uint32 client_id = c.client_id; | 420 uint32 client_id = c.client_id; |
| 434 if (!CreateShaderHelper(type, client_id)) { | 421 if (!CreateShaderHelper(type, client_id)) { |
| 435 return error::kInvalidArguments; | 422 return error::kInvalidArguments; |
| 436 } | 423 } |
| 437 return error::kNoError; | 424 return error::kNoError; |
| 438 } | 425 } |
| 439 | 426 |
| 440 error::Error GLES2DecoderImpl::HandleCullFace( | 427 error::Error GLES2DecoderImpl::HandleCullFace( |
| 441 uint32 immediate_data_size, const gles2::CullFace& c) { | 428 uint32 immediate_data_size, const gles2::CullFace& c) { |
| 442 GLenum mode = static_cast<GLenum>(c.mode); | 429 GLenum mode = static_cast<GLenum>(c.mode); |
| 443 if (!validators_->face_type.IsValid(mode)) { | 430 if (!validators_->face_type.IsValid(mode)) { |
| 444 SetGLError(GL_INVALID_ENUM, "glCullFace", "mode GL_INVALID_ENUM"); | 431 SetGLErrorInvalidEnum("glCullFace", mode, "mode"); |
| 445 return error::kNoError; | 432 return error::kNoError; |
| 446 } | 433 } |
| 447 glCullFace(mode); | 434 glCullFace(mode); |
| 448 return error::kNoError; | 435 return error::kNoError; |
| 449 } | 436 } |
| 450 | 437 |
| 451 error::Error GLES2DecoderImpl::HandleDeleteBuffers( | 438 error::Error GLES2DecoderImpl::HandleDeleteBuffers( |
| 452 uint32 immediate_data_size, const gles2::DeleteBuffers& c) { | 439 uint32 immediate_data_size, const gles2::DeleteBuffers& c) { |
| 453 GLsizei n = static_cast<GLsizei>(c.n); | 440 GLsizei n = static_cast<GLsizei>(c.n); |
| 454 uint32 data_size; | 441 uint32 data_size; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 return error::kOutOfBounds; | 560 return error::kOutOfBounds; |
| 574 } | 561 } |
| 575 DeleteTexturesHelper(n, textures); | 562 DeleteTexturesHelper(n, textures); |
| 576 return error::kNoError; | 563 return error::kNoError; |
| 577 } | 564 } |
| 578 | 565 |
| 579 error::Error GLES2DecoderImpl::HandleDepthFunc( | 566 error::Error GLES2DecoderImpl::HandleDepthFunc( |
| 580 uint32 immediate_data_size, const gles2::DepthFunc& c) { | 567 uint32 immediate_data_size, const gles2::DepthFunc& c) { |
| 581 GLenum func = static_cast<GLenum>(c.func); | 568 GLenum func = static_cast<GLenum>(c.func); |
| 582 if (!validators_->cmp_function.IsValid(func)) { | 569 if (!validators_->cmp_function.IsValid(func)) { |
| 583 SetGLError(GL_INVALID_ENUM, "glDepthFunc", "func GL_INVALID_ENUM"); | 570 SetGLErrorInvalidEnum("glDepthFunc", func, "func"); |
| 584 return error::kNoError; | 571 return error::kNoError; |
| 585 } | 572 } |
| 586 glDepthFunc(func); | 573 glDepthFunc(func); |
| 587 return error::kNoError; | 574 return error::kNoError; |
| 588 } | 575 } |
| 589 | 576 |
| 590 error::Error GLES2DecoderImpl::HandleDepthMask( | 577 error::Error GLES2DecoderImpl::HandleDepthMask( |
| 591 uint32 immediate_data_size, const gles2::DepthMask& c) { | 578 uint32 immediate_data_size, const gles2::DepthMask& c) { |
| 592 GLboolean flag = static_cast<GLboolean>(c.flag); | 579 GLboolean flag = static_cast<GLboolean>(c.flag); |
| 593 DoDepthMask(flag); | 580 DoDepthMask(flag); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 607 GLuint program = c.program; | 594 GLuint program = c.program; |
| 608 GLuint shader = c.shader; | 595 GLuint shader = c.shader; |
| 609 DoDetachShader(program, shader); | 596 DoDetachShader(program, shader); |
| 610 return error::kNoError; | 597 return error::kNoError; |
| 611 } | 598 } |
| 612 | 599 |
| 613 error::Error GLES2DecoderImpl::HandleDisable( | 600 error::Error GLES2DecoderImpl::HandleDisable( |
| 614 uint32 immediate_data_size, const gles2::Disable& c) { | 601 uint32 immediate_data_size, const gles2::Disable& c) { |
| 615 GLenum cap = static_cast<GLenum>(c.cap); | 602 GLenum cap = static_cast<GLenum>(c.cap); |
| 616 if (!validators_->capability.IsValid(cap)) { | 603 if (!validators_->capability.IsValid(cap)) { |
| 617 SetGLError(GL_INVALID_ENUM, "glDisable", "cap GL_INVALID_ENUM"); | 604 SetGLErrorInvalidEnum("glDisable", cap, "cap"); |
| 618 return error::kNoError; | 605 return error::kNoError; |
| 619 } | 606 } |
| 620 DoDisable(cap); | 607 DoDisable(cap); |
| 621 return error::kNoError; | 608 return error::kNoError; |
| 622 } | 609 } |
| 623 | 610 |
| 624 error::Error GLES2DecoderImpl::HandleDisableVertexAttribArray( | 611 error::Error GLES2DecoderImpl::HandleDisableVertexAttribArray( |
| 625 uint32 immediate_data_size, const gles2::DisableVertexAttribArray& c) { | 612 uint32 immediate_data_size, const gles2::DisableVertexAttribArray& c) { |
| 626 GLuint index = static_cast<GLuint>(c.index); | 613 GLuint index = static_cast<GLuint>(c.index); |
| 627 DoDisableVertexAttribArray(index); | 614 DoDisableVertexAttribArray(index); |
| 628 return error::kNoError; | 615 return error::kNoError; |
| 629 } | 616 } |
| 630 | 617 |
| 631 error::Error GLES2DecoderImpl::HandleEnable( | 618 error::Error GLES2DecoderImpl::HandleEnable( |
| 632 uint32 immediate_data_size, const gles2::Enable& c) { | 619 uint32 immediate_data_size, const gles2::Enable& c) { |
| 633 GLenum cap = static_cast<GLenum>(c.cap); | 620 GLenum cap = static_cast<GLenum>(c.cap); |
| 634 if (!validators_->capability.IsValid(cap)) { | 621 if (!validators_->capability.IsValid(cap)) { |
| 635 SetGLError(GL_INVALID_ENUM, "glEnable", "cap GL_INVALID_ENUM"); | 622 SetGLErrorInvalidEnum("glEnable", cap, "cap"); |
| 636 return error::kNoError; | 623 return error::kNoError; |
| 637 } | 624 } |
| 638 DoEnable(cap); | 625 DoEnable(cap); |
| 639 return error::kNoError; | 626 return error::kNoError; |
| 640 } | 627 } |
| 641 | 628 |
| 642 error::Error GLES2DecoderImpl::HandleEnableVertexAttribArray( | 629 error::Error GLES2DecoderImpl::HandleEnableVertexAttribArray( |
| 643 uint32 immediate_data_size, const gles2::EnableVertexAttribArray& c) { | 630 uint32 immediate_data_size, const gles2::EnableVertexAttribArray& c) { |
| 644 GLuint index = static_cast<GLuint>(c.index); | 631 GLuint index = static_cast<GLuint>(c.index); |
| 645 DoEnableVertexAttribArray(index); | 632 DoEnableVertexAttribArray(index); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 658 return error::kNoError; | 645 return error::kNoError; |
| 659 } | 646 } |
| 660 | 647 |
| 661 error::Error GLES2DecoderImpl::HandleFramebufferRenderbuffer( | 648 error::Error GLES2DecoderImpl::HandleFramebufferRenderbuffer( |
| 662 uint32 immediate_data_size, const gles2::FramebufferRenderbuffer& c) { | 649 uint32 immediate_data_size, const gles2::FramebufferRenderbuffer& c) { |
| 663 GLenum target = static_cast<GLenum>(c.target); | 650 GLenum target = static_cast<GLenum>(c.target); |
| 664 GLenum attachment = static_cast<GLenum>(c.attachment); | 651 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 665 GLenum renderbuffertarget = static_cast<GLenum>(c.renderbuffertarget); | 652 GLenum renderbuffertarget = static_cast<GLenum>(c.renderbuffertarget); |
| 666 GLuint renderbuffer = c.renderbuffer; | 653 GLuint renderbuffer = c.renderbuffer; |
| 667 if (!validators_->frame_buffer_target.IsValid(target)) { | 654 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 668 SetGLError( | 655 SetGLErrorInvalidEnum("glFramebufferRenderbuffer", target, "target"); |
| 669 GL_INVALID_ENUM, "glFramebufferRenderbuffer", "target GL_INVALID_ENUM"); | |
| 670 return error::kNoError; | 656 return error::kNoError; |
| 671 } | 657 } |
| 672 if (!validators_->attachment.IsValid(attachment)) { | 658 if (!validators_->attachment.IsValid(attachment)) { |
| 673 SetGLError( | 659 SetGLErrorInvalidEnum("glFramebufferRenderbuffer", attachment, |
| 674 GL_INVALID_ENUM, "glFramebufferRenderbuffer", "attachment GL_INVALID_ENU
M"); // NOLINT | 660 "attachment"); |
| 675 return error::kNoError; | 661 return error::kNoError; |
| 676 } | 662 } |
| 677 if (!validators_->render_buffer_target.IsValid(renderbuffertarget)) { | 663 if (!validators_->render_buffer_target.IsValid(renderbuffertarget)) { |
| 678 SetGLError( | 664 SetGLErrorInvalidEnum("glFramebufferRenderbuffer", renderbuffertarget, |
| 679 GL_INVALID_ENUM, "glFramebufferRenderbuffer", "renderbuffertarget GL_INV
ALID_ENUM"); // NOLINT | 665 "renderbuffertarget"); |
| 680 return error::kNoError; | 666 return error::kNoError; |
| 681 } | 667 } |
| 682 DoFramebufferRenderbuffer( | 668 DoFramebufferRenderbuffer( |
| 683 target, attachment, renderbuffertarget, renderbuffer); | 669 target, attachment, renderbuffertarget, renderbuffer); |
| 684 return error::kNoError; | 670 return error::kNoError; |
| 685 } | 671 } |
| 686 | 672 |
| 687 error::Error GLES2DecoderImpl::HandleFramebufferTexture2D( | 673 error::Error GLES2DecoderImpl::HandleFramebufferTexture2D( |
| 688 uint32 immediate_data_size, const gles2::FramebufferTexture2D& c) { | 674 uint32 immediate_data_size, const gles2::FramebufferTexture2D& c) { |
| 689 GLenum target = static_cast<GLenum>(c.target); | 675 GLenum target = static_cast<GLenum>(c.target); |
| 690 GLenum attachment = static_cast<GLenum>(c.attachment); | 676 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 691 GLenum textarget = static_cast<GLenum>(c.textarget); | 677 GLenum textarget = static_cast<GLenum>(c.textarget); |
| 692 GLuint texture = c.texture; | 678 GLuint texture = c.texture; |
| 693 GLint level = static_cast<GLint>(c.level); | 679 GLint level = static_cast<GLint>(c.level); |
| 694 if (!validators_->frame_buffer_target.IsValid(target)) { | 680 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 695 SetGLError( | 681 SetGLErrorInvalidEnum("glFramebufferTexture2D", target, "target"); |
| 696 GL_INVALID_ENUM, "glFramebufferTexture2D", "target GL_INVALID_ENUM"); | |
| 697 return error::kNoError; | 682 return error::kNoError; |
| 698 } | 683 } |
| 699 if (!validators_->attachment.IsValid(attachment)) { | 684 if (!validators_->attachment.IsValid(attachment)) { |
| 700 SetGLError( | 685 SetGLErrorInvalidEnum("glFramebufferTexture2D", attachment, "attachment"); |
| 701 GL_INVALID_ENUM, "glFramebufferTexture2D", "attachment GL_INVALID_ENUM")
; // NOLINT | |
| 702 return error::kNoError; | 686 return error::kNoError; |
| 703 } | 687 } |
| 704 if (!validators_->texture_target.IsValid(textarget)) { | 688 if (!validators_->texture_target.IsValid(textarget)) { |
| 705 SetGLError( | 689 SetGLErrorInvalidEnum("glFramebufferTexture2D", textarget, "textarget"); |
| 706 GL_INVALID_ENUM, "glFramebufferTexture2D", "textarget GL_INVALID_ENUM"); | |
| 707 return error::kNoError; | 690 return error::kNoError; |
| 708 } | 691 } |
| 709 if (!validators_->zero_only.IsValid(level)) { | 692 if (!validators_->zero_only.IsValid(level)) { |
| 710 SetGLError( | 693 SetGLError( |
| 711 GL_INVALID_VALUE, "glFramebufferTexture2D", "level GL_INVALID_VALUE"); | 694 GL_INVALID_VALUE, "glFramebufferTexture2D", "level GL_INVALID_VALUE"); |
| 712 return error::kNoError; | 695 return error::kNoError; |
| 713 } | 696 } |
| 714 DoFramebufferTexture2D(target, attachment, textarget, texture, level); | 697 DoFramebufferTexture2D(target, attachment, textarget, texture, level); |
| 715 return error::kNoError; | 698 return error::kNoError; |
| 716 } | 699 } |
| 717 | 700 |
| 718 error::Error GLES2DecoderImpl::HandleFrontFace( | 701 error::Error GLES2DecoderImpl::HandleFrontFace( |
| 719 uint32 immediate_data_size, const gles2::FrontFace& c) { | 702 uint32 immediate_data_size, const gles2::FrontFace& c) { |
| 720 GLenum mode = static_cast<GLenum>(c.mode); | 703 GLenum mode = static_cast<GLenum>(c.mode); |
| 721 if (!validators_->face_mode.IsValid(mode)) { | 704 if (!validators_->face_mode.IsValid(mode)) { |
| 722 SetGLError(GL_INVALID_ENUM, "glFrontFace", "mode GL_INVALID_ENUM"); | 705 SetGLErrorInvalidEnum("glFrontFace", mode, "mode"); |
| 723 return error::kNoError; | 706 return error::kNoError; |
| 724 } | 707 } |
| 725 glFrontFace(mode); | 708 glFrontFace(mode); |
| 726 return error::kNoError; | 709 return error::kNoError; |
| 727 } | 710 } |
| 728 | 711 |
| 729 error::Error GLES2DecoderImpl::HandleGenBuffers( | 712 error::Error GLES2DecoderImpl::HandleGenBuffers( |
| 730 uint32 immediate_data_size, const gles2::GenBuffers& c) { | 713 uint32 immediate_data_size, const gles2::GenBuffers& c) { |
| 731 GLsizei n = static_cast<GLsizei>(c.n); | 714 GLsizei n = static_cast<GLsizei>(c.n); |
| 732 uint32 data_size; | 715 uint32 data_size; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 759 if (!GenBuffersHelper(n, buffers)) { | 742 if (!GenBuffersHelper(n, buffers)) { |
| 760 return error::kInvalidArguments; | 743 return error::kInvalidArguments; |
| 761 } | 744 } |
| 762 return error::kNoError; | 745 return error::kNoError; |
| 763 } | 746 } |
| 764 | 747 |
| 765 error::Error GLES2DecoderImpl::HandleGenerateMipmap( | 748 error::Error GLES2DecoderImpl::HandleGenerateMipmap( |
| 766 uint32 immediate_data_size, const gles2::GenerateMipmap& c) { | 749 uint32 immediate_data_size, const gles2::GenerateMipmap& c) { |
| 767 GLenum target = static_cast<GLenum>(c.target); | 750 GLenum target = static_cast<GLenum>(c.target); |
| 768 if (!validators_->texture_bind_target.IsValid(target)) { | 751 if (!validators_->texture_bind_target.IsValid(target)) { |
| 769 SetGLError(GL_INVALID_ENUM, "glGenerateMipmap", "target GL_INVALID_ENUM"); | 752 SetGLErrorInvalidEnum("glGenerateMipmap", target, "target"); |
| 770 return error::kNoError; | 753 return error::kNoError; |
| 771 } | 754 } |
| 772 DoGenerateMipmap(target); | 755 DoGenerateMipmap(target); |
| 773 return error::kNoError; | 756 return error::kNoError; |
| 774 } | 757 } |
| 775 | 758 |
| 776 error::Error GLES2DecoderImpl::HandleGenFramebuffers( | 759 error::Error GLES2DecoderImpl::HandleGenFramebuffers( |
| 777 uint32 immediate_data_size, const gles2::GenFramebuffers& c) { | 760 uint32 immediate_data_size, const gles2::GenFramebuffers& c) { |
| 778 GLsizei n = static_cast<GLsizei>(c.n); | 761 GLsizei n = static_cast<GLsizei>(c.n); |
| 779 uint32 data_size; | 762 uint32 data_size; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 error::Error GLES2DecoderImpl::HandleGetBooleanv( | 867 error::Error GLES2DecoderImpl::HandleGetBooleanv( |
| 885 uint32 immediate_data_size, const gles2::GetBooleanv& c) { | 868 uint32 immediate_data_size, const gles2::GetBooleanv& c) { |
| 886 GLenum pname = static_cast<GLenum>(c.pname); | 869 GLenum pname = static_cast<GLenum>(c.pname); |
| 887 typedef GetBooleanv::Result Result; | 870 typedef GetBooleanv::Result Result; |
| 888 GLsizei num_values = 0; | 871 GLsizei num_values = 0; |
| 889 GetNumValuesReturnedForGLGet(pname, &num_values); | 872 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 890 Result* result = GetSharedMemoryAs<Result*>( | 873 Result* result = GetSharedMemoryAs<Result*>( |
| 891 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 874 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 892 GLboolean* params = result ? result->GetData() : NULL; | 875 GLboolean* params = result ? result->GetData() : NULL; |
| 893 if (!validators_->g_l_state.IsValid(pname)) { | 876 if (!validators_->g_l_state.IsValid(pname)) { |
| 894 SetGLError(GL_INVALID_ENUM, "glGetBooleanv", "pname GL_INVALID_ENUM"); | 877 SetGLErrorInvalidEnum("glGetBooleanv", pname, "pname"); |
| 895 return error::kNoError; | 878 return error::kNoError; |
| 896 } | 879 } |
| 897 if (params == NULL) { | 880 if (params == NULL) { |
| 898 return error::kOutOfBounds; | 881 return error::kOutOfBounds; |
| 899 } | 882 } |
| 900 // Check that the client initialized the result. | 883 // Check that the client initialized the result. |
| 901 if (result->size != 0) { | 884 if (result->size != 0) { |
| 902 return error::kInvalidArguments; | 885 return error::kInvalidArguments; |
| 903 } | 886 } |
| 904 CopyRealGLErrorsToWrapper(); | 887 CopyRealGLErrorsToWrapper(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 916 uint32 immediate_data_size, const gles2::GetBufferParameteriv& c) { | 899 uint32 immediate_data_size, const gles2::GetBufferParameteriv& c) { |
| 917 GLenum target = static_cast<GLenum>(c.target); | 900 GLenum target = static_cast<GLenum>(c.target); |
| 918 GLenum pname = static_cast<GLenum>(c.pname); | 901 GLenum pname = static_cast<GLenum>(c.pname); |
| 919 typedef GetBufferParameteriv::Result Result; | 902 typedef GetBufferParameteriv::Result Result; |
| 920 GLsizei num_values = 0; | 903 GLsizei num_values = 0; |
| 921 GetNumValuesReturnedForGLGet(pname, &num_values); | 904 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 922 Result* result = GetSharedMemoryAs<Result*>( | 905 Result* result = GetSharedMemoryAs<Result*>( |
| 923 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 906 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 924 GLint* params = result ? result->GetData() : NULL; | 907 GLint* params = result ? result->GetData() : NULL; |
| 925 if (!validators_->buffer_target.IsValid(target)) { | 908 if (!validators_->buffer_target.IsValid(target)) { |
| 926 SetGLError( | 909 SetGLErrorInvalidEnum("glGetBufferParameteriv", target, "target"); |
| 927 GL_INVALID_ENUM, "glGetBufferParameteriv", "target GL_INVALID_ENUM"); | |
| 928 return error::kNoError; | 910 return error::kNoError; |
| 929 } | 911 } |
| 930 if (!validators_->buffer_parameter.IsValid(pname)) { | 912 if (!validators_->buffer_parameter.IsValid(pname)) { |
| 931 SetGLError( | 913 SetGLErrorInvalidEnum("glGetBufferParameteriv", pname, "pname"); |
| 932 GL_INVALID_ENUM, "glGetBufferParameteriv", "pname GL_INVALID_ENUM"); | |
| 933 return error::kNoError; | 914 return error::kNoError; |
| 934 } | 915 } |
| 935 if (params == NULL) { | 916 if (params == NULL) { |
| 936 return error::kOutOfBounds; | 917 return error::kOutOfBounds; |
| 937 } | 918 } |
| 938 // Check that the client initialized the result. | 919 // Check that the client initialized the result. |
| 939 if (result->size != 0) { | 920 if (result->size != 0) { |
| 940 return error::kInvalidArguments; | 921 return error::kInvalidArguments; |
| 941 } | 922 } |
| 942 CopyRealGLErrorsToWrapper(); | 923 CopyRealGLErrorsToWrapper(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 965 error::Error GLES2DecoderImpl::HandleGetFloatv( | 946 error::Error GLES2DecoderImpl::HandleGetFloatv( |
| 966 uint32 immediate_data_size, const gles2::GetFloatv& c) { | 947 uint32 immediate_data_size, const gles2::GetFloatv& c) { |
| 967 GLenum pname = static_cast<GLenum>(c.pname); | 948 GLenum pname = static_cast<GLenum>(c.pname); |
| 968 typedef GetFloatv::Result Result; | 949 typedef GetFloatv::Result Result; |
| 969 GLsizei num_values = 0; | 950 GLsizei num_values = 0; |
| 970 GetNumValuesReturnedForGLGet(pname, &num_values); | 951 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 971 Result* result = GetSharedMemoryAs<Result*>( | 952 Result* result = GetSharedMemoryAs<Result*>( |
| 972 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 953 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 973 GLfloat* params = result ? result->GetData() : NULL; | 954 GLfloat* params = result ? result->GetData() : NULL; |
| 974 if (!validators_->g_l_state.IsValid(pname)) { | 955 if (!validators_->g_l_state.IsValid(pname)) { |
| 975 SetGLError(GL_INVALID_ENUM, "glGetFloatv", "pname GL_INVALID_ENUM"); | 956 SetGLErrorInvalidEnum("glGetFloatv", pname, "pname"); |
| 976 return error::kNoError; | 957 return error::kNoError; |
| 977 } | 958 } |
| 978 if (params == NULL) { | 959 if (params == NULL) { |
| 979 return error::kOutOfBounds; | 960 return error::kOutOfBounds; |
| 980 } | 961 } |
| 981 // Check that the client initialized the result. | 962 // Check that the client initialized the result. |
| 982 if (result->size != 0) { | 963 if (result->size != 0) { |
| 983 return error::kInvalidArguments; | 964 return error::kInvalidArguments; |
| 984 } | 965 } |
| 985 CopyRealGLErrorsToWrapper(); | 966 CopyRealGLErrorsToWrapper(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 999 GLenum target = static_cast<GLenum>(c.target); | 980 GLenum target = static_cast<GLenum>(c.target); |
| 1000 GLenum attachment = static_cast<GLenum>(c.attachment); | 981 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 1001 GLenum pname = static_cast<GLenum>(c.pname); | 982 GLenum pname = static_cast<GLenum>(c.pname); |
| 1002 typedef GetFramebufferAttachmentParameteriv::Result Result; | 983 typedef GetFramebufferAttachmentParameteriv::Result Result; |
| 1003 GLsizei num_values = 0; | 984 GLsizei num_values = 0; |
| 1004 GetNumValuesReturnedForGLGet(pname, &num_values); | 985 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1005 Result* result = GetSharedMemoryAs<Result*>( | 986 Result* result = GetSharedMemoryAs<Result*>( |
| 1006 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 987 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1007 GLint* params = result ? result->GetData() : NULL; | 988 GLint* params = result ? result->GetData() : NULL; |
| 1008 if (!validators_->frame_buffer_target.IsValid(target)) { | 989 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 1009 SetGLError( | 990 SetGLErrorInvalidEnum("glGetFramebufferAttachmentParameteriv", target, |
| 1010 GL_INVALID_ENUM, "glGetFramebufferAttachmentParameteriv", "target GL_INV
ALID_ENUM"); // NOLINT | 991 "target"); |
| 1011 return error::kNoError; | 992 return error::kNoError; |
| 1012 } | 993 } |
| 1013 if (!validators_->attachment.IsValid(attachment)) { | 994 if (!validators_->attachment.IsValid(attachment)) { |
| 1014 SetGLError( | 995 SetGLErrorInvalidEnum("glGetFramebufferAttachmentParameteriv", attachment, |
| 1015 GL_INVALID_ENUM, "glGetFramebufferAttachmentParameteriv", "attachment GL
_INVALID_ENUM"); // NOLINT | 996 "attachment"); |
| 1016 return error::kNoError; | 997 return error::kNoError; |
| 1017 } | 998 } |
| 1018 if (!validators_->frame_buffer_parameter.IsValid(pname)) { | 999 if (!validators_->frame_buffer_parameter.IsValid(pname)) { |
| 1019 SetGLError( | 1000 SetGLErrorInvalidEnum("glGetFramebufferAttachmentParameteriv", pname, |
| 1020 GL_INVALID_ENUM, "glGetFramebufferAttachmentParameteriv", "pname GL_INVA
LID_ENUM"); // NOLINT | 1001 "pname"); |
| 1021 return error::kNoError; | 1002 return error::kNoError; |
| 1022 } | 1003 } |
| 1023 if (params == NULL) { | 1004 if (params == NULL) { |
| 1024 return error::kOutOfBounds; | 1005 return error::kOutOfBounds; |
| 1025 } | 1006 } |
| 1026 // Check that the client initialized the result. | 1007 // Check that the client initialized the result. |
| 1027 if (result->size != 0) { | 1008 if (result->size != 0) { |
| 1028 return error::kInvalidArguments; | 1009 return error::kInvalidArguments; |
| 1029 } | 1010 } |
| 1030 CopyRealGLErrorsToWrapper(); | 1011 CopyRealGLErrorsToWrapper(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1041 error::Error GLES2DecoderImpl::HandleGetIntegerv( | 1022 error::Error GLES2DecoderImpl::HandleGetIntegerv( |
| 1042 uint32 immediate_data_size, const gles2::GetIntegerv& c) { | 1023 uint32 immediate_data_size, const gles2::GetIntegerv& c) { |
| 1043 GLenum pname = static_cast<GLenum>(c.pname); | 1024 GLenum pname = static_cast<GLenum>(c.pname); |
| 1044 typedef GetIntegerv::Result Result; | 1025 typedef GetIntegerv::Result Result; |
| 1045 GLsizei num_values = 0; | 1026 GLsizei num_values = 0; |
| 1046 GetNumValuesReturnedForGLGet(pname, &num_values); | 1027 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1047 Result* result = GetSharedMemoryAs<Result*>( | 1028 Result* result = GetSharedMemoryAs<Result*>( |
| 1048 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1029 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1049 GLint* params = result ? result->GetData() : NULL; | 1030 GLint* params = result ? result->GetData() : NULL; |
| 1050 if (!validators_->g_l_state.IsValid(pname)) { | 1031 if (!validators_->g_l_state.IsValid(pname)) { |
| 1051 SetGLError(GL_INVALID_ENUM, "glGetIntegerv", "pname GL_INVALID_ENUM"); | 1032 SetGLErrorInvalidEnum("glGetIntegerv", pname, "pname"); |
| 1052 return error::kNoError; | 1033 return error::kNoError; |
| 1053 } | 1034 } |
| 1054 if (params == NULL) { | 1035 if (params == NULL) { |
| 1055 return error::kOutOfBounds; | 1036 return error::kOutOfBounds; |
| 1056 } | 1037 } |
| 1057 // Check that the client initialized the result. | 1038 // Check that the client initialized the result. |
| 1058 if (result->size != 0) { | 1039 if (result->size != 0) { |
| 1059 return error::kInvalidArguments; | 1040 return error::kInvalidArguments; |
| 1060 } | 1041 } |
| 1061 CopyRealGLErrorsToWrapper(); | 1042 CopyRealGLErrorsToWrapper(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1073 uint32 immediate_data_size, const gles2::GetProgramiv& c) { | 1054 uint32 immediate_data_size, const gles2::GetProgramiv& c) { |
| 1074 GLuint program = c.program; | 1055 GLuint program = c.program; |
| 1075 GLenum pname = static_cast<GLenum>(c.pname); | 1056 GLenum pname = static_cast<GLenum>(c.pname); |
| 1076 typedef GetProgramiv::Result Result; | 1057 typedef GetProgramiv::Result Result; |
| 1077 GLsizei num_values = 0; | 1058 GLsizei num_values = 0; |
| 1078 GetNumValuesReturnedForGLGet(pname, &num_values); | 1059 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1079 Result* result = GetSharedMemoryAs<Result*>( | 1060 Result* result = GetSharedMemoryAs<Result*>( |
| 1080 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1061 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1081 GLint* params = result ? result->GetData() : NULL; | 1062 GLint* params = result ? result->GetData() : NULL; |
| 1082 if (!validators_->program_parameter.IsValid(pname)) { | 1063 if (!validators_->program_parameter.IsValid(pname)) { |
| 1083 SetGLError(GL_INVALID_ENUM, "glGetProgramiv", "pname GL_INVALID_ENUM"); | 1064 SetGLErrorInvalidEnum("glGetProgramiv", pname, "pname"); |
| 1084 return error::kNoError; | 1065 return error::kNoError; |
| 1085 } | 1066 } |
| 1086 if (params == NULL) { | 1067 if (params == NULL) { |
| 1087 return error::kOutOfBounds; | 1068 return error::kOutOfBounds; |
| 1088 } | 1069 } |
| 1089 // Check that the client initialized the result. | 1070 // Check that the client initialized the result. |
| 1090 if (result->size != 0) { | 1071 if (result->size != 0) { |
| 1091 return error::kInvalidArguments; | 1072 return error::kInvalidArguments; |
| 1092 } | 1073 } |
| 1093 CopyRealGLErrorsToWrapper(); | 1074 CopyRealGLErrorsToWrapper(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1105 uint32 immediate_data_size, const gles2::GetRenderbufferParameteriv& c) { | 1086 uint32 immediate_data_size, const gles2::GetRenderbufferParameteriv& c) { |
| 1106 GLenum target = static_cast<GLenum>(c.target); | 1087 GLenum target = static_cast<GLenum>(c.target); |
| 1107 GLenum pname = static_cast<GLenum>(c.pname); | 1088 GLenum pname = static_cast<GLenum>(c.pname); |
| 1108 typedef GetRenderbufferParameteriv::Result Result; | 1089 typedef GetRenderbufferParameteriv::Result Result; |
| 1109 GLsizei num_values = 0; | 1090 GLsizei num_values = 0; |
| 1110 GetNumValuesReturnedForGLGet(pname, &num_values); | 1091 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1111 Result* result = GetSharedMemoryAs<Result*>( | 1092 Result* result = GetSharedMemoryAs<Result*>( |
| 1112 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1093 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1113 GLint* params = result ? result->GetData() : NULL; | 1094 GLint* params = result ? result->GetData() : NULL; |
| 1114 if (!validators_->render_buffer_target.IsValid(target)) { | 1095 if (!validators_->render_buffer_target.IsValid(target)) { |
| 1115 SetGLError( | 1096 SetGLErrorInvalidEnum("glGetRenderbufferParameteriv", target, "target"); |
| 1116 GL_INVALID_ENUM, "glGetRenderbufferParameteriv", "target GL_INVALID_ENUM
"); // NOLINT | |
| 1117 return error::kNoError; | 1097 return error::kNoError; |
| 1118 } | 1098 } |
| 1119 if (!validators_->render_buffer_parameter.IsValid(pname)) { | 1099 if (!validators_->render_buffer_parameter.IsValid(pname)) { |
| 1120 SetGLError( | 1100 SetGLErrorInvalidEnum("glGetRenderbufferParameteriv", pname, "pname"); |
| 1121 GL_INVALID_ENUM, "glGetRenderbufferParameteriv", "pname GL_INVALID_ENUM"
); // NOLINT | |
| 1122 return error::kNoError; | 1101 return error::kNoError; |
| 1123 } | 1102 } |
| 1124 if (params == NULL) { | 1103 if (params == NULL) { |
| 1125 return error::kOutOfBounds; | 1104 return error::kOutOfBounds; |
| 1126 } | 1105 } |
| 1127 // Check that the client initialized the result. | 1106 // Check that the client initialized the result. |
| 1128 if (result->size != 0) { | 1107 if (result->size != 0) { |
| 1129 return error::kInvalidArguments; | 1108 return error::kInvalidArguments; |
| 1130 } | 1109 } |
| 1131 CopyRealGLErrorsToWrapper(); | 1110 CopyRealGLErrorsToWrapper(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1143 uint32 immediate_data_size, const gles2::GetShaderiv& c) { | 1122 uint32 immediate_data_size, const gles2::GetShaderiv& c) { |
| 1144 GLuint shader = c.shader; | 1123 GLuint shader = c.shader; |
| 1145 GLenum pname = static_cast<GLenum>(c.pname); | 1124 GLenum pname = static_cast<GLenum>(c.pname); |
| 1146 typedef GetShaderiv::Result Result; | 1125 typedef GetShaderiv::Result Result; |
| 1147 GLsizei num_values = 0; | 1126 GLsizei num_values = 0; |
| 1148 GetNumValuesReturnedForGLGet(pname, &num_values); | 1127 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1149 Result* result = GetSharedMemoryAs<Result*>( | 1128 Result* result = GetSharedMemoryAs<Result*>( |
| 1150 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1129 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1151 GLint* params = result ? result->GetData() : NULL; | 1130 GLint* params = result ? result->GetData() : NULL; |
| 1152 if (!validators_->shader_parameter.IsValid(pname)) { | 1131 if (!validators_->shader_parameter.IsValid(pname)) { |
| 1153 SetGLError(GL_INVALID_ENUM, "glGetShaderiv", "pname GL_INVALID_ENUM"); | 1132 SetGLErrorInvalidEnum("glGetShaderiv", pname, "pname"); |
| 1154 return error::kNoError; | 1133 return error::kNoError; |
| 1155 } | 1134 } |
| 1156 if (params == NULL) { | 1135 if (params == NULL) { |
| 1157 return error::kOutOfBounds; | 1136 return error::kOutOfBounds; |
| 1158 } | 1137 } |
| 1159 // Check that the client initialized the result. | 1138 // Check that the client initialized the result. |
| 1160 if (result->size != 0) { | 1139 if (result->size != 0) { |
| 1161 return error::kInvalidArguments; | 1140 return error::kInvalidArguments; |
| 1162 } | 1141 } |
| 1163 CopyRealGLErrorsToWrapper(); | 1142 CopyRealGLErrorsToWrapper(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1175 uint32 immediate_data_size, const gles2::GetTexParameterfv& c) { | 1154 uint32 immediate_data_size, const gles2::GetTexParameterfv& c) { |
| 1176 GLenum target = static_cast<GLenum>(c.target); | 1155 GLenum target = static_cast<GLenum>(c.target); |
| 1177 GLenum pname = static_cast<GLenum>(c.pname); | 1156 GLenum pname = static_cast<GLenum>(c.pname); |
| 1178 typedef GetTexParameterfv::Result Result; | 1157 typedef GetTexParameterfv::Result Result; |
| 1179 GLsizei num_values = 0; | 1158 GLsizei num_values = 0; |
| 1180 GetNumValuesReturnedForGLGet(pname, &num_values); | 1159 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1181 Result* result = GetSharedMemoryAs<Result*>( | 1160 Result* result = GetSharedMemoryAs<Result*>( |
| 1182 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1161 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1183 GLfloat* params = result ? result->GetData() : NULL; | 1162 GLfloat* params = result ? result->GetData() : NULL; |
| 1184 if (!validators_->get_tex_param_target.IsValid(target)) { | 1163 if (!validators_->get_tex_param_target.IsValid(target)) { |
| 1185 SetGLError( | 1164 SetGLErrorInvalidEnum("glGetTexParameterfv", target, "target"); |
| 1186 GL_INVALID_ENUM, "glGetTexParameterfv", "target GL_INVALID_ENUM"); | |
| 1187 return error::kNoError; | 1165 return error::kNoError; |
| 1188 } | 1166 } |
| 1189 if (!validators_->texture_parameter.IsValid(pname)) { | 1167 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1190 SetGLError( | 1168 SetGLErrorInvalidEnum("glGetTexParameterfv", pname, "pname"); |
| 1191 GL_INVALID_ENUM, "glGetTexParameterfv", "pname GL_INVALID_ENUM"); | |
| 1192 return error::kNoError; | 1169 return error::kNoError; |
| 1193 } | 1170 } |
| 1194 if (params == NULL) { | 1171 if (params == NULL) { |
| 1195 return error::kOutOfBounds; | 1172 return error::kOutOfBounds; |
| 1196 } | 1173 } |
| 1197 // Check that the client initialized the result. | 1174 // Check that the client initialized the result. |
| 1198 if (result->size != 0) { | 1175 if (result->size != 0) { |
| 1199 return error::kInvalidArguments; | 1176 return error::kInvalidArguments; |
| 1200 } | 1177 } |
| 1201 CopyRealGLErrorsToWrapper(); | 1178 CopyRealGLErrorsToWrapper(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1213 uint32 immediate_data_size, const gles2::GetTexParameteriv& c) { | 1190 uint32 immediate_data_size, const gles2::GetTexParameteriv& c) { |
| 1214 GLenum target = static_cast<GLenum>(c.target); | 1191 GLenum target = static_cast<GLenum>(c.target); |
| 1215 GLenum pname = static_cast<GLenum>(c.pname); | 1192 GLenum pname = static_cast<GLenum>(c.pname); |
| 1216 typedef GetTexParameteriv::Result Result; | 1193 typedef GetTexParameteriv::Result Result; |
| 1217 GLsizei num_values = 0; | 1194 GLsizei num_values = 0; |
| 1218 GetNumValuesReturnedForGLGet(pname, &num_values); | 1195 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1219 Result* result = GetSharedMemoryAs<Result*>( | 1196 Result* result = GetSharedMemoryAs<Result*>( |
| 1220 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1197 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1221 GLint* params = result ? result->GetData() : NULL; | 1198 GLint* params = result ? result->GetData() : NULL; |
| 1222 if (!validators_->get_tex_param_target.IsValid(target)) { | 1199 if (!validators_->get_tex_param_target.IsValid(target)) { |
| 1223 SetGLError( | 1200 SetGLErrorInvalidEnum("glGetTexParameteriv", target, "target"); |
| 1224 GL_INVALID_ENUM, "glGetTexParameteriv", "target GL_INVALID_ENUM"); | |
| 1225 return error::kNoError; | 1201 return error::kNoError; |
| 1226 } | 1202 } |
| 1227 if (!validators_->texture_parameter.IsValid(pname)) { | 1203 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1228 SetGLError( | 1204 SetGLErrorInvalidEnum("glGetTexParameteriv", pname, "pname"); |
| 1229 GL_INVALID_ENUM, "glGetTexParameteriv", "pname GL_INVALID_ENUM"); | |
| 1230 return error::kNoError; | 1205 return error::kNoError; |
| 1231 } | 1206 } |
| 1232 if (params == NULL) { | 1207 if (params == NULL) { |
| 1233 return error::kOutOfBounds; | 1208 return error::kOutOfBounds; |
| 1234 } | 1209 } |
| 1235 // Check that the client initialized the result. | 1210 // Check that the client initialized the result. |
| 1236 if (result->size != 0) { | 1211 if (result->size != 0) { |
| 1237 return error::kInvalidArguments; | 1212 return error::kInvalidArguments; |
| 1238 } | 1213 } |
| 1239 CopyRealGLErrorsToWrapper(); | 1214 CopyRealGLErrorsToWrapper(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1251 uint32 immediate_data_size, const gles2::GetVertexAttribfv& c) { | 1226 uint32 immediate_data_size, const gles2::GetVertexAttribfv& c) { |
| 1252 GLuint index = static_cast<GLuint>(c.index); | 1227 GLuint index = static_cast<GLuint>(c.index); |
| 1253 GLenum pname = static_cast<GLenum>(c.pname); | 1228 GLenum pname = static_cast<GLenum>(c.pname); |
| 1254 typedef GetVertexAttribfv::Result Result; | 1229 typedef GetVertexAttribfv::Result Result; |
| 1255 GLsizei num_values = 0; | 1230 GLsizei num_values = 0; |
| 1256 GetNumValuesReturnedForGLGet(pname, &num_values); | 1231 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1257 Result* result = GetSharedMemoryAs<Result*>( | 1232 Result* result = GetSharedMemoryAs<Result*>( |
| 1258 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1233 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1259 GLfloat* params = result ? result->GetData() : NULL; | 1234 GLfloat* params = result ? result->GetData() : NULL; |
| 1260 if (!validators_->vertex_attribute.IsValid(pname)) { | 1235 if (!validators_->vertex_attribute.IsValid(pname)) { |
| 1261 SetGLError( | 1236 SetGLErrorInvalidEnum("glGetVertexAttribfv", pname, "pname"); |
| 1262 GL_INVALID_ENUM, "glGetVertexAttribfv", "pname GL_INVALID_ENUM"); | |
| 1263 return error::kNoError; | 1237 return error::kNoError; |
| 1264 } | 1238 } |
| 1265 if (params == NULL) { | 1239 if (params == NULL) { |
| 1266 return error::kOutOfBounds; | 1240 return error::kOutOfBounds; |
| 1267 } | 1241 } |
| 1268 // Check that the client initialized the result. | 1242 // Check that the client initialized the result. |
| 1269 if (result->size != 0) { | 1243 if (result->size != 0) { |
| 1270 return error::kInvalidArguments; | 1244 return error::kInvalidArguments; |
| 1271 } | 1245 } |
| 1272 CopyRealGLErrorsToWrapper(); | 1246 CopyRealGLErrorsToWrapper(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1284 uint32 immediate_data_size, const gles2::GetVertexAttribiv& c) { | 1258 uint32 immediate_data_size, const gles2::GetVertexAttribiv& c) { |
| 1285 GLuint index = static_cast<GLuint>(c.index); | 1259 GLuint index = static_cast<GLuint>(c.index); |
| 1286 GLenum pname = static_cast<GLenum>(c.pname); | 1260 GLenum pname = static_cast<GLenum>(c.pname); |
| 1287 typedef GetVertexAttribiv::Result Result; | 1261 typedef GetVertexAttribiv::Result Result; |
| 1288 GLsizei num_values = 0; | 1262 GLsizei num_values = 0; |
| 1289 GetNumValuesReturnedForGLGet(pname, &num_values); | 1263 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1290 Result* result = GetSharedMemoryAs<Result*>( | 1264 Result* result = GetSharedMemoryAs<Result*>( |
| 1291 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1265 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1292 GLint* params = result ? result->GetData() : NULL; | 1266 GLint* params = result ? result->GetData() : NULL; |
| 1293 if (!validators_->vertex_attribute.IsValid(pname)) { | 1267 if (!validators_->vertex_attribute.IsValid(pname)) { |
| 1294 SetGLError( | 1268 SetGLErrorInvalidEnum("glGetVertexAttribiv", pname, "pname"); |
| 1295 GL_INVALID_ENUM, "glGetVertexAttribiv", "pname GL_INVALID_ENUM"); | |
| 1296 return error::kNoError; | 1269 return error::kNoError; |
| 1297 } | 1270 } |
| 1298 if (params == NULL) { | 1271 if (params == NULL) { |
| 1299 return error::kOutOfBounds; | 1272 return error::kOutOfBounds; |
| 1300 } | 1273 } |
| 1301 // Check that the client initialized the result. | 1274 // Check that the client initialized the result. |
| 1302 if (result->size != 0) { | 1275 if (result->size != 0) { |
| 1303 return error::kInvalidArguments; | 1276 return error::kInvalidArguments; |
| 1304 } | 1277 } |
| 1305 CopyRealGLErrorsToWrapper(); | 1278 CopyRealGLErrorsToWrapper(); |
| 1306 DoGetVertexAttribiv(index, pname, params); | 1279 DoGetVertexAttribiv(index, pname, params); |
| 1307 GLenum error = glGetError(); | 1280 GLenum error = glGetError(); |
| 1308 if (error == GL_NO_ERROR) { | 1281 if (error == GL_NO_ERROR) { |
| 1309 result->SetNumResults(num_values); | 1282 result->SetNumResults(num_values); |
| 1310 } else { | 1283 } else { |
| 1311 SetGLError(error, "", ""); | 1284 SetGLError(error, "", ""); |
| 1312 } | 1285 } |
| 1313 return error::kNoError; | 1286 return error::kNoError; |
| 1314 } | 1287 } |
| 1315 | 1288 |
| 1316 error::Error GLES2DecoderImpl::HandleHint( | 1289 error::Error GLES2DecoderImpl::HandleHint( |
| 1317 uint32 immediate_data_size, const gles2::Hint& c) { | 1290 uint32 immediate_data_size, const gles2::Hint& c) { |
| 1318 GLenum target = static_cast<GLenum>(c.target); | 1291 GLenum target = static_cast<GLenum>(c.target); |
| 1319 GLenum mode = static_cast<GLenum>(c.mode); | 1292 GLenum mode = static_cast<GLenum>(c.mode); |
| 1320 if (!validators_->hint_target.IsValid(target)) { | 1293 if (!validators_->hint_target.IsValid(target)) { |
| 1321 SetGLError(GL_INVALID_ENUM, "glHint", "target GL_INVALID_ENUM"); | 1294 SetGLErrorInvalidEnum("glHint", target, "target"); |
| 1322 return error::kNoError; | 1295 return error::kNoError; |
| 1323 } | 1296 } |
| 1324 if (!validators_->hint_mode.IsValid(mode)) { | 1297 if (!validators_->hint_mode.IsValid(mode)) { |
| 1325 SetGLError(GL_INVALID_ENUM, "glHint", "mode GL_INVALID_ENUM"); | 1298 SetGLErrorInvalidEnum("glHint", mode, "mode"); |
| 1326 return error::kNoError; | 1299 return error::kNoError; |
| 1327 } | 1300 } |
| 1328 glHint(target, mode); | 1301 glHint(target, mode); |
| 1329 return error::kNoError; | 1302 return error::kNoError; |
| 1330 } | 1303 } |
| 1331 | 1304 |
| 1332 error::Error GLES2DecoderImpl::HandleIsBuffer( | 1305 error::Error GLES2DecoderImpl::HandleIsBuffer( |
| 1333 uint32 immediate_data_size, const gles2::IsBuffer& c) { | 1306 uint32 immediate_data_size, const gles2::IsBuffer& c) { |
| 1334 GLuint buffer = c.buffer; | 1307 GLuint buffer = c.buffer; |
| 1335 typedef IsBuffer::Result Result; | 1308 typedef IsBuffer::Result Result; |
| 1336 Result* result_dst = GetSharedMemoryAs<Result*>( | 1309 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 1337 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 1310 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 1338 if (!result_dst) { | 1311 if (!result_dst) { |
| 1339 return error::kOutOfBounds; | 1312 return error::kOutOfBounds; |
| 1340 } | 1313 } |
| 1341 *result_dst = DoIsBuffer(buffer); | 1314 *result_dst = DoIsBuffer(buffer); |
| 1342 return error::kNoError; | 1315 return error::kNoError; |
| 1343 } | 1316 } |
| 1344 | 1317 |
| 1345 error::Error GLES2DecoderImpl::HandleIsEnabled( | 1318 error::Error GLES2DecoderImpl::HandleIsEnabled( |
| 1346 uint32 immediate_data_size, const gles2::IsEnabled& c) { | 1319 uint32 immediate_data_size, const gles2::IsEnabled& c) { |
| 1347 GLenum cap = static_cast<GLenum>(c.cap); | 1320 GLenum cap = static_cast<GLenum>(c.cap); |
| 1348 typedef IsEnabled::Result Result; | 1321 typedef IsEnabled::Result Result; |
| 1349 Result* result_dst = GetSharedMemoryAs<Result*>( | 1322 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 1350 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 1323 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 1351 if (!result_dst) { | 1324 if (!result_dst) { |
| 1352 return error::kOutOfBounds; | 1325 return error::kOutOfBounds; |
| 1353 } | 1326 } |
| 1354 if (!validators_->capability.IsValid(cap)) { | 1327 if (!validators_->capability.IsValid(cap)) { |
| 1355 SetGLError(GL_INVALID_ENUM, "glIsEnabled", "cap GL_INVALID_ENUM"); | 1328 SetGLErrorInvalidEnum("glIsEnabled", cap, "cap"); |
| 1356 return error::kNoError; | 1329 return error::kNoError; |
| 1357 } | 1330 } |
| 1358 *result_dst = DoIsEnabled(cap); | 1331 *result_dst = DoIsEnabled(cap); |
| 1359 return error::kNoError; | 1332 return error::kNoError; |
| 1360 } | 1333 } |
| 1361 | 1334 |
| 1362 error::Error GLES2DecoderImpl::HandleIsFramebuffer( | 1335 error::Error GLES2DecoderImpl::HandleIsFramebuffer( |
| 1363 uint32 immediate_data_size, const gles2::IsFramebuffer& c) { | 1336 uint32 immediate_data_size, const gles2::IsFramebuffer& c) { |
| 1364 GLuint framebuffer = c.framebuffer; | 1337 GLuint framebuffer = c.framebuffer; |
| 1365 typedef IsFramebuffer::Result Result; | 1338 typedef IsFramebuffer::Result Result; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 return error::kNoError; | 1425 return error::kNoError; |
| 1453 } | 1426 } |
| 1454 | 1427 |
| 1455 error::Error GLES2DecoderImpl::HandleRenderbufferStorage( | 1428 error::Error GLES2DecoderImpl::HandleRenderbufferStorage( |
| 1456 uint32 immediate_data_size, const gles2::RenderbufferStorage& c) { | 1429 uint32 immediate_data_size, const gles2::RenderbufferStorage& c) { |
| 1457 GLenum target = static_cast<GLenum>(c.target); | 1430 GLenum target = static_cast<GLenum>(c.target); |
| 1458 GLenum internalformat = static_cast<GLenum>(c.internalformat); | 1431 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 1459 GLsizei width = static_cast<GLsizei>(c.width); | 1432 GLsizei width = static_cast<GLsizei>(c.width); |
| 1460 GLsizei height = static_cast<GLsizei>(c.height); | 1433 GLsizei height = static_cast<GLsizei>(c.height); |
| 1461 if (!validators_->render_buffer_target.IsValid(target)) { | 1434 if (!validators_->render_buffer_target.IsValid(target)) { |
| 1462 SetGLError( | 1435 SetGLErrorInvalidEnum("glRenderbufferStorage", target, "target"); |
| 1463 GL_INVALID_ENUM, "glRenderbufferStorage", "target GL_INVALID_ENUM"); | |
| 1464 return error::kNoError; | 1436 return error::kNoError; |
| 1465 } | 1437 } |
| 1466 if (!validators_->render_buffer_format.IsValid(internalformat)) { | 1438 if (!validators_->render_buffer_format.IsValid(internalformat)) { |
| 1467 SetGLError( | 1439 SetGLErrorInvalidEnum("glRenderbufferStorage", internalformat, |
| 1468 GL_INVALID_ENUM, "glRenderbufferStorage", "internalformat GL_INVALID_ENU
M"); // NOLINT | 1440 "internalformat"); |
| 1469 return error::kNoError; | 1441 return error::kNoError; |
| 1470 } | 1442 } |
| 1471 if (width < 0) { | 1443 if (width < 0) { |
| 1472 SetGLError(GL_INVALID_VALUE, "glRenderbufferStorage", "width < 0"); | 1444 SetGLError(GL_INVALID_VALUE, "glRenderbufferStorage", "width < 0"); |
| 1473 return error::kNoError; | 1445 return error::kNoError; |
| 1474 } | 1446 } |
| 1475 if (height < 0) { | 1447 if (height < 0) { |
| 1476 SetGLError(GL_INVALID_VALUE, "glRenderbufferStorage", "height < 0"); | 1448 SetGLError(GL_INVALID_VALUE, "glRenderbufferStorage", "height < 0"); |
| 1477 return error::kNoError; | 1449 return error::kNoError; |
| 1478 } | 1450 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1505 glScissor(x, y, width, height); | 1477 glScissor(x, y, width, height); |
| 1506 return error::kNoError; | 1478 return error::kNoError; |
| 1507 } | 1479 } |
| 1508 | 1480 |
| 1509 error::Error GLES2DecoderImpl::HandleStencilFunc( | 1481 error::Error GLES2DecoderImpl::HandleStencilFunc( |
| 1510 uint32 immediate_data_size, const gles2::StencilFunc& c) { | 1482 uint32 immediate_data_size, const gles2::StencilFunc& c) { |
| 1511 GLenum func = static_cast<GLenum>(c.func); | 1483 GLenum func = static_cast<GLenum>(c.func); |
| 1512 GLint ref = static_cast<GLint>(c.ref); | 1484 GLint ref = static_cast<GLint>(c.ref); |
| 1513 GLuint mask = static_cast<GLuint>(c.mask); | 1485 GLuint mask = static_cast<GLuint>(c.mask); |
| 1514 if (!validators_->cmp_function.IsValid(func)) { | 1486 if (!validators_->cmp_function.IsValid(func)) { |
| 1515 SetGLError(GL_INVALID_ENUM, "glStencilFunc", "func GL_INVALID_ENUM"); | 1487 SetGLErrorInvalidEnum("glStencilFunc", func, "func"); |
| 1516 return error::kNoError; | 1488 return error::kNoError; |
| 1517 } | 1489 } |
| 1518 glStencilFunc(func, ref, mask); | 1490 glStencilFunc(func, ref, mask); |
| 1519 return error::kNoError; | 1491 return error::kNoError; |
| 1520 } | 1492 } |
| 1521 | 1493 |
| 1522 error::Error GLES2DecoderImpl::HandleStencilFuncSeparate( | 1494 error::Error GLES2DecoderImpl::HandleStencilFuncSeparate( |
| 1523 uint32 immediate_data_size, const gles2::StencilFuncSeparate& c) { | 1495 uint32 immediate_data_size, const gles2::StencilFuncSeparate& c) { |
| 1524 GLenum face = static_cast<GLenum>(c.face); | 1496 GLenum face = static_cast<GLenum>(c.face); |
| 1525 GLenum func = static_cast<GLenum>(c.func); | 1497 GLenum func = static_cast<GLenum>(c.func); |
| 1526 GLint ref = static_cast<GLint>(c.ref); | 1498 GLint ref = static_cast<GLint>(c.ref); |
| 1527 GLuint mask = static_cast<GLuint>(c.mask); | 1499 GLuint mask = static_cast<GLuint>(c.mask); |
| 1528 if (!validators_->face_type.IsValid(face)) { | 1500 if (!validators_->face_type.IsValid(face)) { |
| 1529 SetGLError( | 1501 SetGLErrorInvalidEnum("glStencilFuncSeparate", face, "face"); |
| 1530 GL_INVALID_ENUM, "glStencilFuncSeparate", "face GL_INVALID_ENUM"); | |
| 1531 return error::kNoError; | 1502 return error::kNoError; |
| 1532 } | 1503 } |
| 1533 if (!validators_->cmp_function.IsValid(func)) { | 1504 if (!validators_->cmp_function.IsValid(func)) { |
| 1534 SetGLError( | 1505 SetGLErrorInvalidEnum("glStencilFuncSeparate", func, "func"); |
| 1535 GL_INVALID_ENUM, "glStencilFuncSeparate", "func GL_INVALID_ENUM"); | |
| 1536 return error::kNoError; | 1506 return error::kNoError; |
| 1537 } | 1507 } |
| 1538 glStencilFuncSeparate(face, func, ref, mask); | 1508 glStencilFuncSeparate(face, func, ref, mask); |
| 1539 return error::kNoError; | 1509 return error::kNoError; |
| 1540 } | 1510 } |
| 1541 | 1511 |
| 1542 error::Error GLES2DecoderImpl::HandleStencilMask( | 1512 error::Error GLES2DecoderImpl::HandleStencilMask( |
| 1543 uint32 immediate_data_size, const gles2::StencilMask& c) { | 1513 uint32 immediate_data_size, const gles2::StencilMask& c) { |
| 1544 GLuint mask = static_cast<GLuint>(c.mask); | 1514 GLuint mask = static_cast<GLuint>(c.mask); |
| 1545 DoStencilMask(mask); | 1515 DoStencilMask(mask); |
| 1546 return error::kNoError; | 1516 return error::kNoError; |
| 1547 } | 1517 } |
| 1548 | 1518 |
| 1549 error::Error GLES2DecoderImpl::HandleStencilMaskSeparate( | 1519 error::Error GLES2DecoderImpl::HandleStencilMaskSeparate( |
| 1550 uint32 immediate_data_size, const gles2::StencilMaskSeparate& c) { | 1520 uint32 immediate_data_size, const gles2::StencilMaskSeparate& c) { |
| 1551 GLenum face = static_cast<GLenum>(c.face); | 1521 GLenum face = static_cast<GLenum>(c.face); |
| 1552 GLuint mask = static_cast<GLuint>(c.mask); | 1522 GLuint mask = static_cast<GLuint>(c.mask); |
| 1553 if (!validators_->face_type.IsValid(face)) { | 1523 if (!validators_->face_type.IsValid(face)) { |
| 1554 SetGLError( | 1524 SetGLErrorInvalidEnum("glStencilMaskSeparate", face, "face"); |
| 1555 GL_INVALID_ENUM, "glStencilMaskSeparate", "face GL_INVALID_ENUM"); | |
| 1556 return error::kNoError; | 1525 return error::kNoError; |
| 1557 } | 1526 } |
| 1558 DoStencilMaskSeparate(face, mask); | 1527 DoStencilMaskSeparate(face, mask); |
| 1559 return error::kNoError; | 1528 return error::kNoError; |
| 1560 } | 1529 } |
| 1561 | 1530 |
| 1562 error::Error GLES2DecoderImpl::HandleStencilOp( | 1531 error::Error GLES2DecoderImpl::HandleStencilOp( |
| 1563 uint32 immediate_data_size, const gles2::StencilOp& c) { | 1532 uint32 immediate_data_size, const gles2::StencilOp& c) { |
| 1564 GLenum fail = static_cast<GLenum>(c.fail); | 1533 GLenum fail = static_cast<GLenum>(c.fail); |
| 1565 GLenum zfail = static_cast<GLenum>(c.zfail); | 1534 GLenum zfail = static_cast<GLenum>(c.zfail); |
| 1566 GLenum zpass = static_cast<GLenum>(c.zpass); | 1535 GLenum zpass = static_cast<GLenum>(c.zpass); |
| 1567 if (!validators_->stencil_op.IsValid(fail)) { | 1536 if (!validators_->stencil_op.IsValid(fail)) { |
| 1568 SetGLError(GL_INVALID_ENUM, "glStencilOp", "fail GL_INVALID_ENUM"); | 1537 SetGLErrorInvalidEnum("glStencilOp", fail, "fail"); |
| 1569 return error::kNoError; | 1538 return error::kNoError; |
| 1570 } | 1539 } |
| 1571 if (!validators_->stencil_op.IsValid(zfail)) { | 1540 if (!validators_->stencil_op.IsValid(zfail)) { |
| 1572 SetGLError(GL_INVALID_ENUM, "glStencilOp", "zfail GL_INVALID_ENUM"); | 1541 SetGLErrorInvalidEnum("glStencilOp", zfail, "zfail"); |
| 1573 return error::kNoError; | 1542 return error::kNoError; |
| 1574 } | 1543 } |
| 1575 if (!validators_->stencil_op.IsValid(zpass)) { | 1544 if (!validators_->stencil_op.IsValid(zpass)) { |
| 1576 SetGLError(GL_INVALID_ENUM, "glStencilOp", "zpass GL_INVALID_ENUM"); | 1545 SetGLErrorInvalidEnum("glStencilOp", zpass, "zpass"); |
| 1577 return error::kNoError; | 1546 return error::kNoError; |
| 1578 } | 1547 } |
| 1579 glStencilOp(fail, zfail, zpass); | 1548 glStencilOp(fail, zfail, zpass); |
| 1580 return error::kNoError; | 1549 return error::kNoError; |
| 1581 } | 1550 } |
| 1582 | 1551 |
| 1583 error::Error GLES2DecoderImpl::HandleStencilOpSeparate( | 1552 error::Error GLES2DecoderImpl::HandleStencilOpSeparate( |
| 1584 uint32 immediate_data_size, const gles2::StencilOpSeparate& c) { | 1553 uint32 immediate_data_size, const gles2::StencilOpSeparate& c) { |
| 1585 GLenum face = static_cast<GLenum>(c.face); | 1554 GLenum face = static_cast<GLenum>(c.face); |
| 1586 GLenum fail = static_cast<GLenum>(c.fail); | 1555 GLenum fail = static_cast<GLenum>(c.fail); |
| 1587 GLenum zfail = static_cast<GLenum>(c.zfail); | 1556 GLenum zfail = static_cast<GLenum>(c.zfail); |
| 1588 GLenum zpass = static_cast<GLenum>(c.zpass); | 1557 GLenum zpass = static_cast<GLenum>(c.zpass); |
| 1589 if (!validators_->face_type.IsValid(face)) { | 1558 if (!validators_->face_type.IsValid(face)) { |
| 1590 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate", "face GL_INVALID_ENUM"); | 1559 SetGLErrorInvalidEnum("glStencilOpSeparate", face, "face"); |
| 1591 return error::kNoError; | 1560 return error::kNoError; |
| 1592 } | 1561 } |
| 1593 if (!validators_->stencil_op.IsValid(fail)) { | 1562 if (!validators_->stencil_op.IsValid(fail)) { |
| 1594 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate", "fail GL_INVALID_ENUM"); | 1563 SetGLErrorInvalidEnum("glStencilOpSeparate", fail, "fail"); |
| 1595 return error::kNoError; | 1564 return error::kNoError; |
| 1596 } | 1565 } |
| 1597 if (!validators_->stencil_op.IsValid(zfail)) { | 1566 if (!validators_->stencil_op.IsValid(zfail)) { |
| 1598 SetGLError( | 1567 SetGLErrorInvalidEnum("glStencilOpSeparate", zfail, "zfail"); |
| 1599 GL_INVALID_ENUM, "glStencilOpSeparate", "zfail GL_INVALID_ENUM"); | |
| 1600 return error::kNoError; | 1568 return error::kNoError; |
| 1601 } | 1569 } |
| 1602 if (!validators_->stencil_op.IsValid(zpass)) { | 1570 if (!validators_->stencil_op.IsValid(zpass)) { |
| 1603 SetGLError( | 1571 SetGLErrorInvalidEnum("glStencilOpSeparate", zpass, "zpass"); |
| 1604 GL_INVALID_ENUM, "glStencilOpSeparate", "zpass GL_INVALID_ENUM"); | |
| 1605 return error::kNoError; | 1572 return error::kNoError; |
| 1606 } | 1573 } |
| 1607 glStencilOpSeparate(face, fail, zfail, zpass); | 1574 glStencilOpSeparate(face, fail, zfail, zpass); |
| 1608 return error::kNoError; | 1575 return error::kNoError; |
| 1609 } | 1576 } |
| 1610 | 1577 |
| 1611 error::Error GLES2DecoderImpl::HandleTexParameterf( | 1578 error::Error GLES2DecoderImpl::HandleTexParameterf( |
| 1612 uint32 immediate_data_size, const gles2::TexParameterf& c) { | 1579 uint32 immediate_data_size, const gles2::TexParameterf& c) { |
| 1613 GLenum target = static_cast<GLenum>(c.target); | 1580 GLenum target = static_cast<GLenum>(c.target); |
| 1614 GLenum pname = static_cast<GLenum>(c.pname); | 1581 GLenum pname = static_cast<GLenum>(c.pname); |
| 1615 GLfloat param = static_cast<GLfloat>(c.param); | 1582 GLfloat param = static_cast<GLfloat>(c.param); |
| 1616 if (!validators_->texture_bind_target.IsValid(target)) { | 1583 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1617 SetGLError(GL_INVALID_ENUM, "glTexParameterf", "target GL_INVALID_ENUM"); | 1584 SetGLErrorInvalidEnum("glTexParameterf", target, "target"); |
| 1618 return error::kNoError; | 1585 return error::kNoError; |
| 1619 } | 1586 } |
| 1620 if (!validators_->texture_parameter.IsValid(pname)) { | 1587 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1621 SetGLError(GL_INVALID_ENUM, "glTexParameterf", "pname GL_INVALID_ENUM"); | 1588 SetGLErrorInvalidEnum("glTexParameterf", pname, "pname"); |
| 1622 return error::kNoError; | 1589 return error::kNoError; |
| 1623 } | 1590 } |
| 1624 DoTexParameterf(target, pname, param); | 1591 DoTexParameterf(target, pname, param); |
| 1625 return error::kNoError; | 1592 return error::kNoError; |
| 1626 } | 1593 } |
| 1627 | 1594 |
| 1628 error::Error GLES2DecoderImpl::HandleTexParameterfv( | 1595 error::Error GLES2DecoderImpl::HandleTexParameterfv( |
| 1629 uint32 immediate_data_size, const gles2::TexParameterfv& c) { | 1596 uint32 immediate_data_size, const gles2::TexParameterfv& c) { |
| 1630 GLenum target = static_cast<GLenum>(c.target); | 1597 GLenum target = static_cast<GLenum>(c.target); |
| 1631 GLenum pname = static_cast<GLenum>(c.pname); | 1598 GLenum pname = static_cast<GLenum>(c.pname); |
| 1632 uint32 data_size; | 1599 uint32 data_size; |
| 1633 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | 1600 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { |
| 1634 return error::kOutOfBounds; | 1601 return error::kOutOfBounds; |
| 1635 } | 1602 } |
| 1636 const GLfloat* params = GetSharedMemoryAs<const GLfloat*>( | 1603 const GLfloat* params = GetSharedMemoryAs<const GLfloat*>( |
| 1637 c.params_shm_id, c.params_shm_offset, data_size); | 1604 c.params_shm_id, c.params_shm_offset, data_size); |
| 1638 if (!validators_->texture_bind_target.IsValid(target)) { | 1605 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1639 SetGLError(GL_INVALID_ENUM, "glTexParameterfv", "target GL_INVALID_ENUM"); | 1606 SetGLErrorInvalidEnum("glTexParameterfv", target, "target"); |
| 1640 return error::kNoError; | 1607 return error::kNoError; |
| 1641 } | 1608 } |
| 1642 if (!validators_->texture_parameter.IsValid(pname)) { | 1609 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1643 SetGLError(GL_INVALID_ENUM, "glTexParameterfv", "pname GL_INVALID_ENUM"); | 1610 SetGLErrorInvalidEnum("glTexParameterfv", pname, "pname"); |
| 1644 return error::kNoError; | 1611 return error::kNoError; |
| 1645 } | 1612 } |
| 1646 if (params == NULL) { | 1613 if (params == NULL) { |
| 1647 return error::kOutOfBounds; | 1614 return error::kOutOfBounds; |
| 1648 } | 1615 } |
| 1649 DoTexParameterfv(target, pname, params); | 1616 DoTexParameterfv(target, pname, params); |
| 1650 return error::kNoError; | 1617 return error::kNoError; |
| 1651 } | 1618 } |
| 1652 | 1619 |
| 1653 error::Error GLES2DecoderImpl::HandleTexParameterfvImmediate( | 1620 error::Error GLES2DecoderImpl::HandleTexParameterfvImmediate( |
| 1654 uint32 immediate_data_size, const gles2::TexParameterfvImmediate& c) { | 1621 uint32 immediate_data_size, const gles2::TexParameterfvImmediate& c) { |
| 1655 GLenum target = static_cast<GLenum>(c.target); | 1622 GLenum target = static_cast<GLenum>(c.target); |
| 1656 GLenum pname = static_cast<GLenum>(c.pname); | 1623 GLenum pname = static_cast<GLenum>(c.pname); |
| 1657 uint32 data_size; | 1624 uint32 data_size; |
| 1658 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | 1625 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { |
| 1659 return error::kOutOfBounds; | 1626 return error::kOutOfBounds; |
| 1660 } | 1627 } |
| 1661 if (data_size > immediate_data_size) { | 1628 if (data_size > immediate_data_size) { |
| 1662 return error::kOutOfBounds; | 1629 return error::kOutOfBounds; |
| 1663 } | 1630 } |
| 1664 const GLfloat* params = GetImmediateDataAs<const GLfloat*>( | 1631 const GLfloat* params = GetImmediateDataAs<const GLfloat*>( |
| 1665 c, data_size, immediate_data_size); | 1632 c, data_size, immediate_data_size); |
| 1666 if (!validators_->texture_bind_target.IsValid(target)) { | 1633 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1667 SetGLError(GL_INVALID_ENUM, "glTexParameterfv", "target GL_INVALID_ENUM"); | 1634 SetGLErrorInvalidEnum("glTexParameterfv", target, "target"); |
| 1668 return error::kNoError; | 1635 return error::kNoError; |
| 1669 } | 1636 } |
| 1670 if (!validators_->texture_parameter.IsValid(pname)) { | 1637 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1671 SetGLError(GL_INVALID_ENUM, "glTexParameterfv", "pname GL_INVALID_ENUM"); | 1638 SetGLErrorInvalidEnum("glTexParameterfv", pname, "pname"); |
| 1672 return error::kNoError; | 1639 return error::kNoError; |
| 1673 } | 1640 } |
| 1674 if (params == NULL) { | 1641 if (params == NULL) { |
| 1675 return error::kOutOfBounds; | 1642 return error::kOutOfBounds; |
| 1676 } | 1643 } |
| 1677 DoTexParameterfv(target, pname, params); | 1644 DoTexParameterfv(target, pname, params); |
| 1678 return error::kNoError; | 1645 return error::kNoError; |
| 1679 } | 1646 } |
| 1680 | 1647 |
| 1681 error::Error GLES2DecoderImpl::HandleTexParameteri( | 1648 error::Error GLES2DecoderImpl::HandleTexParameteri( |
| 1682 uint32 immediate_data_size, const gles2::TexParameteri& c) { | 1649 uint32 immediate_data_size, const gles2::TexParameteri& c) { |
| 1683 GLenum target = static_cast<GLenum>(c.target); | 1650 GLenum target = static_cast<GLenum>(c.target); |
| 1684 GLenum pname = static_cast<GLenum>(c.pname); | 1651 GLenum pname = static_cast<GLenum>(c.pname); |
| 1685 GLint param = static_cast<GLint>(c.param); | 1652 GLint param = static_cast<GLint>(c.param); |
| 1686 if (!validators_->texture_bind_target.IsValid(target)) { | 1653 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1687 SetGLError(GL_INVALID_ENUM, "glTexParameteri", "target GL_INVALID_ENUM"); | 1654 SetGLErrorInvalidEnum("glTexParameteri", target, "target"); |
| 1688 return error::kNoError; | 1655 return error::kNoError; |
| 1689 } | 1656 } |
| 1690 if (!validators_->texture_parameter.IsValid(pname)) { | 1657 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1691 SetGLError(GL_INVALID_ENUM, "glTexParameteri", "pname GL_INVALID_ENUM"); | 1658 SetGLErrorInvalidEnum("glTexParameteri", pname, "pname"); |
| 1692 return error::kNoError; | 1659 return error::kNoError; |
| 1693 } | 1660 } |
| 1694 DoTexParameteri(target, pname, param); | 1661 DoTexParameteri(target, pname, param); |
| 1695 return error::kNoError; | 1662 return error::kNoError; |
| 1696 } | 1663 } |
| 1697 | 1664 |
| 1698 error::Error GLES2DecoderImpl::HandleTexParameteriv( | 1665 error::Error GLES2DecoderImpl::HandleTexParameteriv( |
| 1699 uint32 immediate_data_size, const gles2::TexParameteriv& c) { | 1666 uint32 immediate_data_size, const gles2::TexParameteriv& c) { |
| 1700 GLenum target = static_cast<GLenum>(c.target); | 1667 GLenum target = static_cast<GLenum>(c.target); |
| 1701 GLenum pname = static_cast<GLenum>(c.pname); | 1668 GLenum pname = static_cast<GLenum>(c.pname); |
| 1702 uint32 data_size; | 1669 uint32 data_size; |
| 1703 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { | 1670 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { |
| 1704 return error::kOutOfBounds; | 1671 return error::kOutOfBounds; |
| 1705 } | 1672 } |
| 1706 const GLint* params = GetSharedMemoryAs<const GLint*>( | 1673 const GLint* params = GetSharedMemoryAs<const GLint*>( |
| 1707 c.params_shm_id, c.params_shm_offset, data_size); | 1674 c.params_shm_id, c.params_shm_offset, data_size); |
| 1708 if (!validators_->texture_bind_target.IsValid(target)) { | 1675 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1709 SetGLError(GL_INVALID_ENUM, "glTexParameteriv", "target GL_INVALID_ENUM"); | 1676 SetGLErrorInvalidEnum("glTexParameteriv", target, "target"); |
| 1710 return error::kNoError; | 1677 return error::kNoError; |
| 1711 } | 1678 } |
| 1712 if (!validators_->texture_parameter.IsValid(pname)) { | 1679 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1713 SetGLError(GL_INVALID_ENUM, "glTexParameteriv", "pname GL_INVALID_ENUM"); | 1680 SetGLErrorInvalidEnum("glTexParameteriv", pname, "pname"); |
| 1714 return error::kNoError; | 1681 return error::kNoError; |
| 1715 } | 1682 } |
| 1716 if (params == NULL) { | 1683 if (params == NULL) { |
| 1717 return error::kOutOfBounds; | 1684 return error::kOutOfBounds; |
| 1718 } | 1685 } |
| 1719 DoTexParameteriv(target, pname, params); | 1686 DoTexParameteriv(target, pname, params); |
| 1720 return error::kNoError; | 1687 return error::kNoError; |
| 1721 } | 1688 } |
| 1722 | 1689 |
| 1723 error::Error GLES2DecoderImpl::HandleTexParameterivImmediate( | 1690 error::Error GLES2DecoderImpl::HandleTexParameterivImmediate( |
| 1724 uint32 immediate_data_size, const gles2::TexParameterivImmediate& c) { | 1691 uint32 immediate_data_size, const gles2::TexParameterivImmediate& c) { |
| 1725 GLenum target = static_cast<GLenum>(c.target); | 1692 GLenum target = static_cast<GLenum>(c.target); |
| 1726 GLenum pname = static_cast<GLenum>(c.pname); | 1693 GLenum pname = static_cast<GLenum>(c.pname); |
| 1727 uint32 data_size; | 1694 uint32 data_size; |
| 1728 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { | 1695 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { |
| 1729 return error::kOutOfBounds; | 1696 return error::kOutOfBounds; |
| 1730 } | 1697 } |
| 1731 if (data_size > immediate_data_size) { | 1698 if (data_size > immediate_data_size) { |
| 1732 return error::kOutOfBounds; | 1699 return error::kOutOfBounds; |
| 1733 } | 1700 } |
| 1734 const GLint* params = GetImmediateDataAs<const GLint*>( | 1701 const GLint* params = GetImmediateDataAs<const GLint*>( |
| 1735 c, data_size, immediate_data_size); | 1702 c, data_size, immediate_data_size); |
| 1736 if (!validators_->texture_bind_target.IsValid(target)) { | 1703 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1737 SetGLError(GL_INVALID_ENUM, "glTexParameteriv", "target GL_INVALID_ENUM"); | 1704 SetGLErrorInvalidEnum("glTexParameteriv", target, "target"); |
| 1738 return error::kNoError; | 1705 return error::kNoError; |
| 1739 } | 1706 } |
| 1740 if (!validators_->texture_parameter.IsValid(pname)) { | 1707 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1741 SetGLError(GL_INVALID_ENUM, "glTexParameteriv", "pname GL_INVALID_ENUM"); | 1708 SetGLErrorInvalidEnum("glTexParameteriv", pname, "pname"); |
| 1742 return error::kNoError; | 1709 return error::kNoError; |
| 1743 } | 1710 } |
| 1744 if (params == NULL) { | 1711 if (params == NULL) { |
| 1745 return error::kOutOfBounds; | 1712 return error::kOutOfBounds; |
| 1746 } | 1713 } |
| 1747 DoTexParameteriv(target, pname, params); | 1714 DoTexParameteriv(target, pname, params); |
| 1748 return error::kNoError; | 1715 return error::kNoError; |
| 1749 } | 1716 } |
| 1750 | 1717 |
| 1751 error::Error GLES2DecoderImpl::HandleUniform1f( | 1718 error::Error GLES2DecoderImpl::HandleUniform1f( |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2490 GLint srcY0 = static_cast<GLint>(c.srcY0); | 2457 GLint srcY0 = static_cast<GLint>(c.srcY0); |
| 2491 GLint srcX1 = static_cast<GLint>(c.srcX1); | 2458 GLint srcX1 = static_cast<GLint>(c.srcX1); |
| 2492 GLint srcY1 = static_cast<GLint>(c.srcY1); | 2459 GLint srcY1 = static_cast<GLint>(c.srcY1); |
| 2493 GLint dstX0 = static_cast<GLint>(c.dstX0); | 2460 GLint dstX0 = static_cast<GLint>(c.dstX0); |
| 2494 GLint dstY0 = static_cast<GLint>(c.dstY0); | 2461 GLint dstY0 = static_cast<GLint>(c.dstY0); |
| 2495 GLint dstX1 = static_cast<GLint>(c.dstX1); | 2462 GLint dstX1 = static_cast<GLint>(c.dstX1); |
| 2496 GLint dstY1 = static_cast<GLint>(c.dstY1); | 2463 GLint dstY1 = static_cast<GLint>(c.dstY1); |
| 2497 GLbitfield mask = static_cast<GLbitfield>(c.mask); | 2464 GLbitfield mask = static_cast<GLbitfield>(c.mask); |
| 2498 GLenum filter = static_cast<GLenum>(c.filter); | 2465 GLenum filter = static_cast<GLenum>(c.filter); |
| 2499 if (!validators_->blit_filter.IsValid(filter)) { | 2466 if (!validators_->blit_filter.IsValid(filter)) { |
| 2500 SetGLError( | 2467 SetGLErrorInvalidEnum("glBlitFramebufferEXT", filter, "filter"); |
| 2501 GL_INVALID_ENUM, "glBlitFramebufferEXT", "filter GL_INVALID_ENUM"); | |
| 2502 return error::kNoError; | 2468 return error::kNoError; |
| 2503 } | 2469 } |
| 2504 DoBlitFramebufferEXT( | 2470 DoBlitFramebufferEXT( |
| 2505 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); | 2471 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); |
| 2506 return error::kNoError; | 2472 return error::kNoError; |
| 2507 } | 2473 } |
| 2508 | 2474 |
| 2509 error::Error GLES2DecoderImpl::HandleRenderbufferStorageMultisampleEXT( | 2475 error::Error GLES2DecoderImpl::HandleRenderbufferStorageMultisampleEXT( |
| 2510 uint32 immediate_data_size, | 2476 uint32 immediate_data_size, |
| 2511 const gles2::RenderbufferStorageMultisampleEXT& c) { | 2477 const gles2::RenderbufferStorageMultisampleEXT& c) { |
| 2512 GLenum target = static_cast<GLenum>(c.target); | 2478 GLenum target = static_cast<GLenum>(c.target); |
| 2513 GLsizei samples = static_cast<GLsizei>(c.samples); | 2479 GLsizei samples = static_cast<GLsizei>(c.samples); |
| 2514 GLenum internalformat = static_cast<GLenum>(c.internalformat); | 2480 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 2515 GLsizei width = static_cast<GLsizei>(c.width); | 2481 GLsizei width = static_cast<GLsizei>(c.width); |
| 2516 GLsizei height = static_cast<GLsizei>(c.height); | 2482 GLsizei height = static_cast<GLsizei>(c.height); |
| 2517 if (!validators_->render_buffer_target.IsValid(target)) { | 2483 if (!validators_->render_buffer_target.IsValid(target)) { |
| 2518 SetGLError( | 2484 SetGLErrorInvalidEnum("glRenderbufferStorageMultisampleEXT", target, |
| 2519 GL_INVALID_ENUM, "glRenderbufferStorageMultisampleEXT", "target GL_INVAL
ID_ENUM"); // NOLINT | 2485 "target"); |
| 2520 return error::kNoError; | 2486 return error::kNoError; |
| 2521 } | 2487 } |
| 2522 if (samples < 0) { | 2488 if (samples < 0) { |
| 2523 SetGLError( | 2489 SetGLError( |
| 2524 GL_INVALID_VALUE, "glRenderbufferStorageMultisampleEXT", "samples < 0"); | 2490 GL_INVALID_VALUE, "glRenderbufferStorageMultisampleEXT", "samples < 0"); |
| 2525 return error::kNoError; | 2491 return error::kNoError; |
| 2526 } | 2492 } |
| 2527 if (!validators_->render_buffer_format.IsValid(internalformat)) { | 2493 if (!validators_->render_buffer_format.IsValid(internalformat)) { |
| 2528 SetGLError( | 2494 SetGLErrorInvalidEnum("glRenderbufferStorageMultisampleEXT", internalformat, |
| 2529 GL_INVALID_ENUM, "glRenderbufferStorageMultisampleEXT", "internalformat
GL_INVALID_ENUM"); // NOLINT | 2495 "internalformat"); |
| 2530 return error::kNoError; | 2496 return error::kNoError; |
| 2531 } | 2497 } |
| 2532 if (width < 0) { | 2498 if (width < 0) { |
| 2533 SetGLError( | 2499 SetGLError( |
| 2534 GL_INVALID_VALUE, "glRenderbufferStorageMultisampleEXT", "width < 0"); | 2500 GL_INVALID_VALUE, "glRenderbufferStorageMultisampleEXT", "width < 0"); |
| 2535 return error::kNoError; | 2501 return error::kNoError; |
| 2536 } | 2502 } |
| 2537 if (height < 0) { | 2503 if (height < 0) { |
| 2538 SetGLError( | 2504 SetGLError( |
| 2539 GL_INVALID_VALUE, "glRenderbufferStorageMultisampleEXT", "height < 0"); | 2505 GL_INVALID_VALUE, "glRenderbufferStorageMultisampleEXT", "height < 0"); |
| 2540 return error::kNoError; | 2506 return error::kNoError; |
| 2541 } | 2507 } |
| 2542 DoRenderbufferStorageMultisample( | 2508 DoRenderbufferStorageMultisample( |
| 2543 target, samples, internalformat, width, height); | 2509 target, samples, internalformat, width, height); |
| 2544 return error::kNoError; | 2510 return error::kNoError; |
| 2545 } | 2511 } |
| 2546 | 2512 |
| 2547 error::Error GLES2DecoderImpl::HandleTexStorage2DEXT( | 2513 error::Error GLES2DecoderImpl::HandleTexStorage2DEXT( |
| 2548 uint32 immediate_data_size, const gles2::TexStorage2DEXT& c) { | 2514 uint32 immediate_data_size, const gles2::TexStorage2DEXT& c) { |
| 2549 GLenum target = static_cast<GLenum>(c.target); | 2515 GLenum target = static_cast<GLenum>(c.target); |
| 2550 GLsizei levels = static_cast<GLsizei>(c.levels); | 2516 GLsizei levels = static_cast<GLsizei>(c.levels); |
| 2551 GLenum internalFormat = static_cast<GLenum>(c.internalFormat); | 2517 GLenum internalFormat = static_cast<GLenum>(c.internalFormat); |
| 2552 GLsizei width = static_cast<GLsizei>(c.width); | 2518 GLsizei width = static_cast<GLsizei>(c.width); |
| 2553 GLsizei height = static_cast<GLsizei>(c.height); | 2519 GLsizei height = static_cast<GLsizei>(c.height); |
| 2554 if (!validators_->texture_target.IsValid(target)) { | 2520 if (!validators_->texture_target.IsValid(target)) { |
| 2555 SetGLError(GL_INVALID_ENUM, "glTexStorage2DEXT", "target GL_INVALID_ENUM"); | 2521 SetGLErrorInvalidEnum("glTexStorage2DEXT", target, "target"); |
| 2556 return error::kNoError; | 2522 return error::kNoError; |
| 2557 } | 2523 } |
| 2558 if (levels < 0) { | 2524 if (levels < 0) { |
| 2559 SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT", "levels < 0"); | 2525 SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT", "levels < 0"); |
| 2560 return error::kNoError; | 2526 return error::kNoError; |
| 2561 } | 2527 } |
| 2562 if (!validators_->texture_internal_format_storage.IsValid(internalFormat)) { | 2528 if (!validators_->texture_internal_format_storage.IsValid(internalFormat)) { |
| 2563 SetGLError( | 2529 SetGLErrorInvalidEnum("glTexStorage2DEXT", internalFormat, |
| 2564 GL_INVALID_ENUM, "glTexStorage2DEXT", "internalFormat GL_INVALID_ENUM"); | 2530 "internalFormat"); |
| 2565 return error::kNoError; | 2531 return error::kNoError; |
| 2566 } | 2532 } |
| 2567 if (width < 0) { | 2533 if (width < 0) { |
| 2568 SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT", "width < 0"); | 2534 SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT", "width < 0"); |
| 2569 return error::kNoError; | 2535 return error::kNoError; |
| 2570 } | 2536 } |
| 2571 if (height < 0) { | 2537 if (height < 0) { |
| 2572 SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT", "height < 0"); | 2538 SetGLError(GL_INVALID_VALUE, "glTexStorage2DEXT", "height < 0"); |
| 2573 return error::kNoError; | 2539 return error::kNoError; |
| 2574 } | 2540 } |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2690 Result* result_dst = GetSharedMemoryAs<Result*>( | 2656 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 2691 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 2657 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 2692 if (!result_dst) { | 2658 if (!result_dst) { |
| 2693 return error::kOutOfBounds; | 2659 return error::kOutOfBounds; |
| 2694 } | 2660 } |
| 2695 if (count < 0) { | 2661 if (count < 0) { |
| 2696 SetGLError(GL_INVALID_VALUE, "glGetMaxValueInBufferCHROMIUM", "count < 0"); | 2662 SetGLError(GL_INVALID_VALUE, "glGetMaxValueInBufferCHROMIUM", "count < 0"); |
| 2697 return error::kNoError; | 2663 return error::kNoError; |
| 2698 } | 2664 } |
| 2699 if (!validators_->get_max_index_type.IsValid(type)) { | 2665 if (!validators_->get_max_index_type.IsValid(type)) { |
| 2700 SetGLError( | 2666 SetGLErrorInvalidEnum("glGetMaxValueInBufferCHROMIUM", type, "type"); |
| 2701 GL_INVALID_ENUM, "glGetMaxValueInBufferCHROMIUM", "type GL_INVALID_ENUM"
); // NOLINT | |
| 2702 return error::kNoError; | 2667 return error::kNoError; |
| 2703 } | 2668 } |
| 2704 *result_dst = DoGetMaxValueInBufferCHROMIUM(buffer_id, count, type, offset); | 2669 *result_dst = DoGetMaxValueInBufferCHROMIUM(buffer_id, count, type, offset); |
| 2705 return error::kNoError; | 2670 return error::kNoError; |
| 2706 } | 2671 } |
| 2707 | 2672 |
| 2708 error::Error GLES2DecoderImpl::HandleTexImageIOSurface2DCHROMIUM( | 2673 error::Error GLES2DecoderImpl::HandleTexImageIOSurface2DCHROMIUM( |
| 2709 uint32 immediate_data_size, const gles2::TexImageIOSurface2DCHROMIUM& c) { | 2674 uint32 immediate_data_size, const gles2::TexImageIOSurface2DCHROMIUM& c) { |
| 2710 GLenum target = static_cast<GLenum>(c.target); | 2675 GLenum target = static_cast<GLenum>(c.target); |
| 2711 GLsizei width = static_cast<GLsizei>(c.width); | 2676 GLsizei width = static_cast<GLsizei>(c.width); |
| 2712 GLsizei height = static_cast<GLsizei>(c.height); | 2677 GLsizei height = static_cast<GLsizei>(c.height); |
| 2713 GLuint ioSurfaceId = static_cast<GLuint>(c.ioSurfaceId); | 2678 GLuint ioSurfaceId = static_cast<GLuint>(c.ioSurfaceId); |
| 2714 GLuint plane = static_cast<GLuint>(c.plane); | 2679 GLuint plane = static_cast<GLuint>(c.plane); |
| 2715 if (!validators_->texture_bind_target.IsValid(target)) { | 2680 if (!validators_->texture_bind_target.IsValid(target)) { |
| 2716 SetGLError( | 2681 SetGLErrorInvalidEnum("glTexImageIOSurface2DCHROMIUM", target, "target"); |
| 2717 GL_INVALID_ENUM, "glTexImageIOSurface2DCHROMIUM", "target GL_INVALID_ENU
M"); // NOLINT | |
| 2718 return error::kNoError; | 2682 return error::kNoError; |
| 2719 } | 2683 } |
| 2720 if (width < 0) { | 2684 if (width < 0) { |
| 2721 SetGLError(GL_INVALID_VALUE, "glTexImageIOSurface2DCHROMIUM", "width < 0"); | 2685 SetGLError(GL_INVALID_VALUE, "glTexImageIOSurface2DCHROMIUM", "width < 0"); |
| 2722 return error::kNoError; | 2686 return error::kNoError; |
| 2723 } | 2687 } |
| 2724 if (height < 0) { | 2688 if (height < 0) { |
| 2725 SetGLError( | 2689 SetGLError( |
| 2726 GL_INVALID_VALUE, "glTexImageIOSurface2DCHROMIUM", "height < 0"); | 2690 GL_INVALID_VALUE, "glTexImageIOSurface2DCHROMIUM", "height < 0"); |
| 2727 return error::kNoError; | 2691 return error::kNoError; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2749 error::Error GLES2DecoderImpl::HandleProduceTextureCHROMIUM( | 2713 error::Error GLES2DecoderImpl::HandleProduceTextureCHROMIUM( |
| 2750 uint32 immediate_data_size, const gles2::ProduceTextureCHROMIUM& c) { | 2714 uint32 immediate_data_size, const gles2::ProduceTextureCHROMIUM& c) { |
| 2751 GLenum target = static_cast<GLenum>(c.target); | 2715 GLenum target = static_cast<GLenum>(c.target); |
| 2752 uint32 data_size; | 2716 uint32 data_size; |
| 2753 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | 2717 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { |
| 2754 return error::kOutOfBounds; | 2718 return error::kOutOfBounds; |
| 2755 } | 2719 } |
| 2756 const GLbyte* mailbox = GetSharedMemoryAs<const GLbyte*>( | 2720 const GLbyte* mailbox = GetSharedMemoryAs<const GLbyte*>( |
| 2757 c.mailbox_shm_id, c.mailbox_shm_offset, data_size); | 2721 c.mailbox_shm_id, c.mailbox_shm_offset, data_size); |
| 2758 if (!validators_->texture_target.IsValid(target)) { | 2722 if (!validators_->texture_target.IsValid(target)) { |
| 2759 SetGLError( | 2723 SetGLErrorInvalidEnum("glProduceTextureCHROMIUM", target, "target"); |
| 2760 GL_INVALID_ENUM, "glProduceTextureCHROMIUM", "target GL_INVALID_ENUM"); | |
| 2761 return error::kNoError; | 2724 return error::kNoError; |
| 2762 } | 2725 } |
| 2763 if (mailbox == NULL) { | 2726 if (mailbox == NULL) { |
| 2764 return error::kOutOfBounds; | 2727 return error::kOutOfBounds; |
| 2765 } | 2728 } |
| 2766 DoProduceTextureCHROMIUM(target, mailbox); | 2729 DoProduceTextureCHROMIUM(target, mailbox); |
| 2767 return error::kNoError; | 2730 return error::kNoError; |
| 2768 } | 2731 } |
| 2769 | 2732 |
| 2770 error::Error GLES2DecoderImpl::HandleProduceTextureCHROMIUMImmediate( | 2733 error::Error GLES2DecoderImpl::HandleProduceTextureCHROMIUMImmediate( |
| 2771 uint32 immediate_data_size, | 2734 uint32 immediate_data_size, |
| 2772 const gles2::ProduceTextureCHROMIUMImmediate& c) { | 2735 const gles2::ProduceTextureCHROMIUMImmediate& c) { |
| 2773 GLenum target = static_cast<GLenum>(c.target); | 2736 GLenum target = static_cast<GLenum>(c.target); |
| 2774 uint32 data_size; | 2737 uint32 data_size; |
| 2775 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | 2738 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { |
| 2776 return error::kOutOfBounds; | 2739 return error::kOutOfBounds; |
| 2777 } | 2740 } |
| 2778 if (data_size > immediate_data_size) { | 2741 if (data_size > immediate_data_size) { |
| 2779 return error::kOutOfBounds; | 2742 return error::kOutOfBounds; |
| 2780 } | 2743 } |
| 2781 const GLbyte* mailbox = GetImmediateDataAs<const GLbyte*>( | 2744 const GLbyte* mailbox = GetImmediateDataAs<const GLbyte*>( |
| 2782 c, data_size, immediate_data_size); | 2745 c, data_size, immediate_data_size); |
| 2783 if (!validators_->texture_target.IsValid(target)) { | 2746 if (!validators_->texture_target.IsValid(target)) { |
| 2784 SetGLError( | 2747 SetGLErrorInvalidEnum("glProduceTextureCHROMIUM", target, "target"); |
| 2785 GL_INVALID_ENUM, "glProduceTextureCHROMIUM", "target GL_INVALID_ENUM"); | |
| 2786 return error::kNoError; | 2748 return error::kNoError; |
| 2787 } | 2749 } |
| 2788 if (mailbox == NULL) { | 2750 if (mailbox == NULL) { |
| 2789 return error::kOutOfBounds; | 2751 return error::kOutOfBounds; |
| 2790 } | 2752 } |
| 2791 DoProduceTextureCHROMIUM(target, mailbox); | 2753 DoProduceTextureCHROMIUM(target, mailbox); |
| 2792 return error::kNoError; | 2754 return error::kNoError; |
| 2793 } | 2755 } |
| 2794 | 2756 |
| 2795 error::Error GLES2DecoderImpl::HandleConsumeTextureCHROMIUM( | 2757 error::Error GLES2DecoderImpl::HandleConsumeTextureCHROMIUM( |
| 2796 uint32 immediate_data_size, const gles2::ConsumeTextureCHROMIUM& c) { | 2758 uint32 immediate_data_size, const gles2::ConsumeTextureCHROMIUM& c) { |
| 2797 GLenum target = static_cast<GLenum>(c.target); | 2759 GLenum target = static_cast<GLenum>(c.target); |
| 2798 uint32 data_size; | 2760 uint32 data_size; |
| 2799 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | 2761 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { |
| 2800 return error::kOutOfBounds; | 2762 return error::kOutOfBounds; |
| 2801 } | 2763 } |
| 2802 const GLbyte* mailbox = GetSharedMemoryAs<const GLbyte*>( | 2764 const GLbyte* mailbox = GetSharedMemoryAs<const GLbyte*>( |
| 2803 c.mailbox_shm_id, c.mailbox_shm_offset, data_size); | 2765 c.mailbox_shm_id, c.mailbox_shm_offset, data_size); |
| 2804 if (!validators_->texture_target.IsValid(target)) { | 2766 if (!validators_->texture_target.IsValid(target)) { |
| 2805 SetGLError( | 2767 SetGLErrorInvalidEnum("glConsumeTextureCHROMIUM", target, "target"); |
| 2806 GL_INVALID_ENUM, "glConsumeTextureCHROMIUM", "target GL_INVALID_ENUM"); | |
| 2807 return error::kNoError; | 2768 return error::kNoError; |
| 2808 } | 2769 } |
| 2809 if (mailbox == NULL) { | 2770 if (mailbox == NULL) { |
| 2810 return error::kOutOfBounds; | 2771 return error::kOutOfBounds; |
| 2811 } | 2772 } |
| 2812 DoConsumeTextureCHROMIUM(target, mailbox); | 2773 DoConsumeTextureCHROMIUM(target, mailbox); |
| 2813 return error::kNoError; | 2774 return error::kNoError; |
| 2814 } | 2775 } |
| 2815 | 2776 |
| 2816 error::Error GLES2DecoderImpl::HandleConsumeTextureCHROMIUMImmediate( | 2777 error::Error GLES2DecoderImpl::HandleConsumeTextureCHROMIUMImmediate( |
| 2817 uint32 immediate_data_size, | 2778 uint32 immediate_data_size, |
| 2818 const gles2::ConsumeTextureCHROMIUMImmediate& c) { | 2779 const gles2::ConsumeTextureCHROMIUMImmediate& c) { |
| 2819 GLenum target = static_cast<GLenum>(c.target); | 2780 GLenum target = static_cast<GLenum>(c.target); |
| 2820 uint32 data_size; | 2781 uint32 data_size; |
| 2821 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { | 2782 if (!ComputeDataSize(1, sizeof(GLbyte), 64, &data_size)) { |
| 2822 return error::kOutOfBounds; | 2783 return error::kOutOfBounds; |
| 2823 } | 2784 } |
| 2824 if (data_size > immediate_data_size) { | 2785 if (data_size > immediate_data_size) { |
| 2825 return error::kOutOfBounds; | 2786 return error::kOutOfBounds; |
| 2826 } | 2787 } |
| 2827 const GLbyte* mailbox = GetImmediateDataAs<const GLbyte*>( | 2788 const GLbyte* mailbox = GetImmediateDataAs<const GLbyte*>( |
| 2828 c, data_size, immediate_data_size); | 2789 c, data_size, immediate_data_size); |
| 2829 if (!validators_->texture_target.IsValid(target)) { | 2790 if (!validators_->texture_target.IsValid(target)) { |
| 2830 SetGLError( | 2791 SetGLErrorInvalidEnum("glConsumeTextureCHROMIUM", target, "target"); |
| 2831 GL_INVALID_ENUM, "glConsumeTextureCHROMIUM", "target GL_INVALID_ENUM"); | |
| 2832 return error::kNoError; | 2792 return error::kNoError; |
| 2833 } | 2793 } |
| 2834 if (mailbox == NULL) { | 2794 if (mailbox == NULL) { |
| 2835 return error::kOutOfBounds; | 2795 return error::kOutOfBounds; |
| 2836 } | 2796 } |
| 2837 DoConsumeTextureCHROMIUM(target, mailbox); | 2797 DoConsumeTextureCHROMIUM(target, mailbox); |
| 2838 return error::kNoError; | 2798 return error::kNoError; |
| 2839 } | 2799 } |
| 2840 | 2800 |
| 2841 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ | 2801 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ |
| 2842 | 2802 |
| OLD | NEW |