| OLD | NEW |
| 1 // This file is auto-generated. DO NOT EDIT! | 1 // This file is auto-generated. DO NOT EDIT! |
| 2 | 2 |
| 3 // It is included by gles2_cmd_decoder.cc | 3 // It is included by gles2_cmd_decoder.cc |
| 4 | 4 |
| 5 parse_error::ParseError GLES2DecoderImpl::HandleActiveTexture( | 5 parse_error::ParseError GLES2DecoderImpl::HandleActiveTexture( |
| 6 uint32 immediate_data_size, const gles2::ActiveTexture& c) { | 6 uint32 immediate_data_size, const gles2::ActiveTexture& c) { |
| 7 GLenum texture = static_cast<GLenum>(c.texture); | 7 GLenum texture = static_cast<GLenum>(c.texture); |
| 8 glActiveTexture(texture); | 8 glActiveTexture(texture); |
| 9 return parse_error::kParseNoError; | 9 return parse_error::kParseNoError; |
| 10 } | 10 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 parse_error::ParseError GLES2DecoderImpl::HandleBindBuffer( | 66 parse_error::ParseError GLES2DecoderImpl::HandleBindBuffer( |
| 67 uint32 immediate_data_size, const gles2::BindBuffer& c) { | 67 uint32 immediate_data_size, const gles2::BindBuffer& c) { |
| 68 GLenum target = static_cast<GLenum>(c.target); | 68 GLenum target = static_cast<GLenum>(c.target); |
| 69 GLuint buffer; | 69 GLuint buffer; |
| 70 if (!id_map_.GetServiceId(c.buffer, &buffer)) { | 70 if (!id_map_.GetServiceId(c.buffer, &buffer)) { |
| 71 SetGLError(GL_INVALID_VALUE); | 71 SetGLError(GL_INVALID_VALUE); |
| 72 return parse_error::kParseNoError; | 72 return parse_error::kParseNoError; |
| 73 } | 73 } |
| 74 if (!ValidateGLenumBufferTarget(target)) { | 74 if (!ValidateGLenumBufferTarget(target)) { |
| 75 SetGLError(GL_INVALID_VALUE); | 75 SetGLError(GL_INVALID_ENUM); |
| 76 return parse_error::kParseNoError; | 76 return parse_error::kParseNoError; |
| 77 } | 77 } |
| 78 DoBindBuffer(target, buffer); | 78 DoBindBuffer(target, buffer); |
| 79 return parse_error::kParseNoError; | 79 return parse_error::kParseNoError; |
| 80 } | 80 } |
| 81 | 81 |
| 82 parse_error::ParseError GLES2DecoderImpl::HandleBindFramebuffer( | 82 parse_error::ParseError GLES2DecoderImpl::HandleBindFramebuffer( |
| 83 uint32 immediate_data_size, const gles2::BindFramebuffer& c) { | 83 uint32 immediate_data_size, const gles2::BindFramebuffer& c) { |
| 84 GLenum target = static_cast<GLenum>(c.target); | 84 GLenum target = static_cast<GLenum>(c.target); |
| 85 GLuint framebuffer; | 85 GLuint framebuffer; |
| 86 if (!id_map_.GetServiceId(c.framebuffer, &framebuffer)) { | 86 if (!id_map_.GetServiceId(c.framebuffer, &framebuffer)) { |
| 87 SetGLError(GL_INVALID_VALUE); | 87 SetGLError(GL_INVALID_VALUE); |
| 88 return parse_error::kParseNoError; | 88 return parse_error::kParseNoError; |
| 89 } | 89 } |
| 90 if (!ValidateGLenumFrameBufferTarget(target)) { | 90 if (!ValidateGLenumFrameBufferTarget(target)) { |
| 91 SetGLError(GL_INVALID_VALUE); | 91 SetGLError(GL_INVALID_ENUM); |
| 92 return parse_error::kParseNoError; | 92 return parse_error::kParseNoError; |
| 93 } | 93 } |
| 94 glBindFramebufferEXT(target, framebuffer); | 94 glBindFramebufferEXT(target, framebuffer); |
| 95 return parse_error::kParseNoError; | 95 return parse_error::kParseNoError; |
| 96 } | 96 } |
| 97 | 97 |
| 98 parse_error::ParseError GLES2DecoderImpl::HandleBindRenderbuffer( | 98 parse_error::ParseError GLES2DecoderImpl::HandleBindRenderbuffer( |
| 99 uint32 immediate_data_size, const gles2::BindRenderbuffer& c) { | 99 uint32 immediate_data_size, const gles2::BindRenderbuffer& c) { |
| 100 GLenum target = static_cast<GLenum>(c.target); | 100 GLenum target = static_cast<GLenum>(c.target); |
| 101 GLuint renderbuffer; | 101 GLuint renderbuffer; |
| 102 if (!id_map_.GetServiceId(c.renderbuffer, &renderbuffer)) { | 102 if (!id_map_.GetServiceId(c.renderbuffer, &renderbuffer)) { |
| 103 SetGLError(GL_INVALID_VALUE); | 103 SetGLError(GL_INVALID_VALUE); |
| 104 return parse_error::kParseNoError; | 104 return parse_error::kParseNoError; |
| 105 } | 105 } |
| 106 if (!ValidateGLenumRenderBufferTarget(target)) { | 106 if (!ValidateGLenumRenderBufferTarget(target)) { |
| 107 SetGLError(GL_INVALID_VALUE); | 107 SetGLError(GL_INVALID_ENUM); |
| 108 return parse_error::kParseNoError; | 108 return parse_error::kParseNoError; |
| 109 } | 109 } |
| 110 glBindRenderbufferEXT(target, renderbuffer); | 110 glBindRenderbufferEXT(target, renderbuffer); |
| 111 return parse_error::kParseNoError; | 111 return parse_error::kParseNoError; |
| 112 } | 112 } |
| 113 | 113 |
| 114 parse_error::ParseError GLES2DecoderImpl::HandleBindTexture( | 114 parse_error::ParseError GLES2DecoderImpl::HandleBindTexture( |
| 115 uint32 immediate_data_size, const gles2::BindTexture& c) { | 115 uint32 immediate_data_size, const gles2::BindTexture& c) { |
| 116 GLenum target = static_cast<GLenum>(c.target); | 116 GLenum target = static_cast<GLenum>(c.target); |
| 117 GLuint texture; | 117 GLuint texture; |
| 118 if (!id_map_.GetServiceId(c.texture, &texture)) { | 118 if (!id_map_.GetServiceId(c.texture, &texture)) { |
| 119 SetGLError(GL_INVALID_VALUE); | 119 SetGLError(GL_INVALID_VALUE); |
| 120 return parse_error::kParseNoError; | 120 return parse_error::kParseNoError; |
| 121 } | 121 } |
| 122 if (!ValidateGLenumTextureBindTarget(target)) { | 122 if (!ValidateGLenumTextureBindTarget(target)) { |
| 123 SetGLError(GL_INVALID_VALUE); | 123 SetGLError(GL_INVALID_ENUM); |
| 124 return parse_error::kParseNoError; | 124 return parse_error::kParseNoError; |
| 125 } | 125 } |
| 126 glBindTexture(target, texture); | 126 glBindTexture(target, texture); |
| 127 return parse_error::kParseNoError; | 127 return parse_error::kParseNoError; |
| 128 } | 128 } |
| 129 | 129 |
| 130 parse_error::ParseError GLES2DecoderImpl::HandleBlendColor( | 130 parse_error::ParseError GLES2DecoderImpl::HandleBlendColor( |
| 131 uint32 immediate_data_size, const gles2::BlendColor& c) { | 131 uint32 immediate_data_size, const gles2::BlendColor& c) { |
| 132 GLclampf red = static_cast<GLclampf>(c.red); | 132 GLclampf red = static_cast<GLclampf>(c.red); |
| 133 GLclampf green = static_cast<GLclampf>(c.green); | 133 GLclampf green = static_cast<GLclampf>(c.green); |
| 134 GLclampf blue = static_cast<GLclampf>(c.blue); | 134 GLclampf blue = static_cast<GLclampf>(c.blue); |
| 135 GLclampf alpha = static_cast<GLclampf>(c.alpha); | 135 GLclampf alpha = static_cast<GLclampf>(c.alpha); |
| 136 glBlendColor(red, green, blue, alpha); | 136 glBlendColor(red, green, blue, alpha); |
| 137 return parse_error::kParseNoError; | 137 return parse_error::kParseNoError; |
| 138 } | 138 } |
| 139 | 139 |
| 140 parse_error::ParseError GLES2DecoderImpl::HandleBlendEquation( | 140 parse_error::ParseError GLES2DecoderImpl::HandleBlendEquation( |
| 141 uint32 immediate_data_size, const gles2::BlendEquation& c) { | 141 uint32 immediate_data_size, const gles2::BlendEquation& c) { |
| 142 GLenum mode = static_cast<GLenum>(c.mode); | 142 GLenum mode = static_cast<GLenum>(c.mode); |
| 143 if (!ValidateGLenumEquation(mode)) { | 143 if (!ValidateGLenumEquation(mode)) { |
| 144 SetGLError(GL_INVALID_VALUE); | 144 SetGLError(GL_INVALID_ENUM); |
| 145 return parse_error::kParseNoError; | 145 return parse_error::kParseNoError; |
| 146 } | 146 } |
| 147 glBlendEquation(mode); | 147 glBlendEquation(mode); |
| 148 return parse_error::kParseNoError; | 148 return parse_error::kParseNoError; |
| 149 } | 149 } |
| 150 | 150 |
| 151 parse_error::ParseError GLES2DecoderImpl::HandleBlendEquationSeparate( | 151 parse_error::ParseError GLES2DecoderImpl::HandleBlendEquationSeparate( |
| 152 uint32 immediate_data_size, const gles2::BlendEquationSeparate& c) { | 152 uint32 immediate_data_size, const gles2::BlendEquationSeparate& c) { |
| 153 GLenum modeRGB = static_cast<GLenum>(c.modeRGB); | 153 GLenum modeRGB = static_cast<GLenum>(c.modeRGB); |
| 154 GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha); | 154 GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha); |
| 155 if (!ValidateGLenumEquation(modeRGB)) { | 155 if (!ValidateGLenumEquation(modeRGB)) { |
| 156 SetGLError(GL_INVALID_VALUE); | 156 SetGLError(GL_INVALID_ENUM); |
| 157 return parse_error::kParseNoError; | 157 return parse_error::kParseNoError; |
| 158 } | 158 } |
| 159 if (!ValidateGLenumEquation(modeAlpha)) { | 159 if (!ValidateGLenumEquation(modeAlpha)) { |
| 160 SetGLError(GL_INVALID_VALUE); | 160 SetGLError(GL_INVALID_ENUM); |
| 161 return parse_error::kParseNoError; | 161 return parse_error::kParseNoError; |
| 162 } | 162 } |
| 163 glBlendEquationSeparate(modeRGB, modeAlpha); | 163 glBlendEquationSeparate(modeRGB, modeAlpha); |
| 164 return parse_error::kParseNoError; | 164 return parse_error::kParseNoError; |
| 165 } | 165 } |
| 166 | 166 |
| 167 parse_error::ParseError GLES2DecoderImpl::HandleBlendFunc( | 167 parse_error::ParseError GLES2DecoderImpl::HandleBlendFunc( |
| 168 uint32 immediate_data_size, const gles2::BlendFunc& c) { | 168 uint32 immediate_data_size, const gles2::BlendFunc& c) { |
| 169 GLenum sfactor = static_cast<GLenum>(c.sfactor); | 169 GLenum sfactor = static_cast<GLenum>(c.sfactor); |
| 170 GLenum dfactor = static_cast<GLenum>(c.dfactor); | 170 GLenum dfactor = static_cast<GLenum>(c.dfactor); |
| 171 if (!ValidateGLenumSrcBlendFactor(sfactor)) { | 171 if (!ValidateGLenumSrcBlendFactor(sfactor)) { |
| 172 SetGLError(GL_INVALID_VALUE); | 172 SetGLError(GL_INVALID_ENUM); |
| 173 return parse_error::kParseNoError; | 173 return parse_error::kParseNoError; |
| 174 } | 174 } |
| 175 if (!ValidateGLenumDstBlendFactor(dfactor)) { | 175 if (!ValidateGLenumDstBlendFactor(dfactor)) { |
| 176 SetGLError(GL_INVALID_VALUE); | 176 SetGLError(GL_INVALID_ENUM); |
| 177 return parse_error::kParseNoError; | 177 return parse_error::kParseNoError; |
| 178 } | 178 } |
| 179 glBlendFunc(sfactor, dfactor); | 179 glBlendFunc(sfactor, dfactor); |
| 180 return parse_error::kParseNoError; | 180 return parse_error::kParseNoError; |
| 181 } | 181 } |
| 182 | 182 |
| 183 parse_error::ParseError GLES2DecoderImpl::HandleBlendFuncSeparate( | 183 parse_error::ParseError GLES2DecoderImpl::HandleBlendFuncSeparate( |
| 184 uint32 immediate_data_size, const gles2::BlendFuncSeparate& c) { | 184 uint32 immediate_data_size, const gles2::BlendFuncSeparate& c) { |
| 185 GLenum srcRGB = static_cast<GLenum>(c.srcRGB); | 185 GLenum srcRGB = static_cast<GLenum>(c.srcRGB); |
| 186 GLenum dstRGB = static_cast<GLenum>(c.dstRGB); | 186 GLenum dstRGB = static_cast<GLenum>(c.dstRGB); |
| 187 GLenum srcAlpha = static_cast<GLenum>(c.srcAlpha); | 187 GLenum srcAlpha = static_cast<GLenum>(c.srcAlpha); |
| 188 GLenum dstAlpha = static_cast<GLenum>(c.dstAlpha); | 188 GLenum dstAlpha = static_cast<GLenum>(c.dstAlpha); |
| 189 if (!ValidateGLenumSrcBlendFactor(srcRGB)) { | 189 if (!ValidateGLenumSrcBlendFactor(srcRGB)) { |
| 190 SetGLError(GL_INVALID_VALUE); | 190 SetGLError(GL_INVALID_ENUM); |
| 191 return parse_error::kParseNoError; | 191 return parse_error::kParseNoError; |
| 192 } | 192 } |
| 193 if (!ValidateGLenumDstBlendFactor(dstRGB)) { | 193 if (!ValidateGLenumDstBlendFactor(dstRGB)) { |
| 194 SetGLError(GL_INVALID_VALUE); | 194 SetGLError(GL_INVALID_ENUM); |
| 195 return parse_error::kParseNoError; | 195 return parse_error::kParseNoError; |
| 196 } | 196 } |
| 197 if (!ValidateGLenumSrcBlendFactor(srcAlpha)) { | 197 if (!ValidateGLenumSrcBlendFactor(srcAlpha)) { |
| 198 SetGLError(GL_INVALID_VALUE); | 198 SetGLError(GL_INVALID_ENUM); |
| 199 return parse_error::kParseNoError; | 199 return parse_error::kParseNoError; |
| 200 } | 200 } |
| 201 if (!ValidateGLenumDstBlendFactor(dstAlpha)) { | 201 if (!ValidateGLenumDstBlendFactor(dstAlpha)) { |
| 202 SetGLError(GL_INVALID_VALUE); | 202 SetGLError(GL_INVALID_ENUM); |
| 203 return parse_error::kParseNoError; | 203 return parse_error::kParseNoError; |
| 204 } | 204 } |
| 205 glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); | 205 glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
| 206 return parse_error::kParseNoError; | 206 return parse_error::kParseNoError; |
| 207 } | 207 } |
| 208 | 208 |
| 209 parse_error::ParseError GLES2DecoderImpl::HandleBufferSubData( | 209 parse_error::ParseError GLES2DecoderImpl::HandleBufferSubData( |
| 210 uint32 immediate_data_size, const gles2::BufferSubData& c) { | 210 uint32 immediate_data_size, const gles2::BufferSubData& c) { |
| 211 GLenum target = static_cast<GLenum>(c.target); | 211 GLenum target = static_cast<GLenum>(c.target); |
| 212 GLintptr offset = static_cast<GLintptr>(c.offset); | 212 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 213 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 213 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 214 uint32 data_size = size; | 214 uint32 data_size = size; |
| 215 const void* data = GetSharedMemoryAs<const void*>( | 215 const void* data = GetSharedMemoryAs<const void*>( |
| 216 c.data_shm_id, c.data_shm_offset, data_size); | 216 c.data_shm_id, c.data_shm_offset, data_size); |
| 217 if (!ValidateGLenumBufferTarget(target)) { | 217 if (!ValidateGLenumBufferTarget(target)) { |
| 218 SetGLError(GL_INVALID_VALUE); | 218 SetGLError(GL_INVALID_ENUM); |
| 219 return parse_error::kParseNoError; | 219 return parse_error::kParseNoError; |
| 220 } | 220 } |
| 221 if (data == NULL) { | 221 if (data == NULL) { |
| 222 return parse_error::kParseOutOfBounds; | 222 return parse_error::kParseOutOfBounds; |
| 223 } | 223 } |
| 224 glBufferSubData(target, offset, size, data); | 224 glBufferSubData(target, offset, size, data); |
| 225 return parse_error::kParseNoError; | 225 return parse_error::kParseNoError; |
| 226 } | 226 } |
| 227 | 227 |
| 228 parse_error::ParseError GLES2DecoderImpl::HandleBufferSubDataImmediate( | 228 parse_error::ParseError GLES2DecoderImpl::HandleBufferSubDataImmediate( |
| 229 uint32 immediate_data_size, const gles2::BufferSubDataImmediate& c) { | 229 uint32 immediate_data_size, const gles2::BufferSubDataImmediate& c) { |
| 230 GLenum target = static_cast<GLenum>(c.target); | 230 GLenum target = static_cast<GLenum>(c.target); |
| 231 GLintptr offset = static_cast<GLintptr>(c.offset); | 231 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 232 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 232 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 233 uint32 data_size = size; | 233 uint32 data_size = size; |
| 234 const void* data = GetImmediateDataAs<const void*>( | 234 const void* data = GetImmediateDataAs<const void*>( |
| 235 c, data_size, immediate_data_size); | 235 c, data_size, immediate_data_size); |
| 236 if (!ValidateGLenumBufferTarget(target)) { | 236 if (!ValidateGLenumBufferTarget(target)) { |
| 237 SetGLError(GL_INVALID_VALUE); | 237 SetGLError(GL_INVALID_ENUM); |
| 238 return parse_error::kParseNoError; | 238 return parse_error::kParseNoError; |
| 239 } | 239 } |
| 240 if (data == NULL) { | 240 if (data == NULL) { |
| 241 return parse_error::kParseOutOfBounds; | 241 return parse_error::kParseOutOfBounds; |
| 242 } | 242 } |
| 243 glBufferSubData(target, offset, size, data); | 243 glBufferSubData(target, offset, size, data); |
| 244 return parse_error::kParseNoError; | 244 return parse_error::kParseNoError; |
| 245 } | 245 } |
| 246 | 246 |
| 247 parse_error::ParseError GLES2DecoderImpl::HandleCheckFramebufferStatus( | 247 parse_error::ParseError GLES2DecoderImpl::HandleCheckFramebufferStatus( |
| 248 uint32 immediate_data_size, const gles2::CheckFramebufferStatus& c) { | 248 uint32 immediate_data_size, const gles2::CheckFramebufferStatus& c) { |
| 249 GLenum target = static_cast<GLenum>(c.target); | 249 GLenum target = static_cast<GLenum>(c.target); |
| 250 if (!ValidateGLenumFrameBufferTarget(target)) { | 250 if (!ValidateGLenumFrameBufferTarget(target)) { |
| 251 SetGLError(GL_INVALID_VALUE); | 251 SetGLError(GL_INVALID_ENUM); |
| 252 return parse_error::kParseNoError; | 252 return parse_error::kParseNoError; |
| 253 } | 253 } |
| 254 glCheckFramebufferStatusEXT(target); | 254 glCheckFramebufferStatusEXT(target); |
| 255 return parse_error::kParseNoError; | 255 return parse_error::kParseNoError; |
| 256 } | 256 } |
| 257 | 257 |
| 258 parse_error::ParseError GLES2DecoderImpl::HandleClear( | 258 parse_error::ParseError GLES2DecoderImpl::HandleClear( |
| 259 uint32 immediate_data_size, const gles2::Clear& c) { | 259 uint32 immediate_data_size, const gles2::Clear& c) { |
| 260 GLbitfield mask = static_cast<GLbitfield>(c.mask); | 260 GLbitfield mask = static_cast<GLbitfield>(c.mask); |
| 261 glClear(mask); | 261 glClear(mask); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 GLint xoffset = static_cast<GLint>(c.xoffset); | 314 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 315 GLint yoffset = static_cast<GLint>(c.yoffset); | 315 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 316 GLsizei width = static_cast<GLsizei>(c.width); | 316 GLsizei width = static_cast<GLsizei>(c.width); |
| 317 GLsizei height = static_cast<GLsizei>(c.height); | 317 GLsizei height = static_cast<GLsizei>(c.height); |
| 318 GLenum format = static_cast<GLenum>(c.format); | 318 GLenum format = static_cast<GLenum>(c.format); |
| 319 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); | 319 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); |
| 320 uint32 data_size = imageSize; | 320 uint32 data_size = imageSize; |
| 321 const void* data = GetSharedMemoryAs<const void*>( | 321 const void* data = GetSharedMemoryAs<const void*>( |
| 322 c.data_shm_id, c.data_shm_offset, data_size); | 322 c.data_shm_id, c.data_shm_offset, data_size); |
| 323 if (!ValidateGLenumTextureTarget(target)) { | 323 if (!ValidateGLenumTextureTarget(target)) { |
| 324 SetGLError(GL_INVALID_VALUE); | 324 SetGLError(GL_INVALID_ENUM); |
| 325 return parse_error::kParseNoError; | 325 return parse_error::kParseNoError; |
| 326 } | 326 } |
| 327 if (data == NULL) { | 327 if (data == NULL) { |
| 328 return parse_error::kParseOutOfBounds; | 328 return parse_error::kParseOutOfBounds; |
| 329 } | 329 } |
| 330 glCompressedTexSubImage2D( | 330 glCompressedTexSubImage2D( |
| 331 target, level, xoffset, yoffset, width, height, format, imageSize, data); | 331 target, level, xoffset, yoffset, width, height, format, imageSize, data); |
| 332 return parse_error::kParseNoError; | 332 return parse_error::kParseNoError; |
| 333 } | 333 } |
| 334 | 334 |
| 335 parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexSubImage2DImmediate
( | 335 parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexSubImage2DImmediate
( |
| 336 | 336 |
| 337 uint32 immediate_data_size, | 337 uint32 immediate_data_size, |
| 338 const gles2::CompressedTexSubImage2DImmediate& c) { | 338 const gles2::CompressedTexSubImage2DImmediate& c) { |
| 339 GLenum target = static_cast<GLenum>(c.target); | 339 GLenum target = static_cast<GLenum>(c.target); |
| 340 GLint level = static_cast<GLint>(c.level); | 340 GLint level = static_cast<GLint>(c.level); |
| 341 GLint xoffset = static_cast<GLint>(c.xoffset); | 341 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 342 GLint yoffset = static_cast<GLint>(c.yoffset); | 342 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 343 GLsizei width = static_cast<GLsizei>(c.width); | 343 GLsizei width = static_cast<GLsizei>(c.width); |
| 344 GLsizei height = static_cast<GLsizei>(c.height); | 344 GLsizei height = static_cast<GLsizei>(c.height); |
| 345 GLenum format = static_cast<GLenum>(c.format); | 345 GLenum format = static_cast<GLenum>(c.format); |
| 346 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); | 346 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); |
| 347 uint32 data_size = imageSize; | 347 uint32 data_size = imageSize; |
| 348 const void* data = GetImmediateDataAs<const void*>( | 348 const void* data = GetImmediateDataAs<const void*>( |
| 349 c, data_size, immediate_data_size); | 349 c, data_size, immediate_data_size); |
| 350 if (!ValidateGLenumTextureTarget(target)) { | 350 if (!ValidateGLenumTextureTarget(target)) { |
| 351 SetGLError(GL_INVALID_VALUE); | 351 SetGLError(GL_INVALID_ENUM); |
| 352 return parse_error::kParseNoError; | 352 return parse_error::kParseNoError; |
| 353 } | 353 } |
| 354 if (data == NULL) { | 354 if (data == NULL) { |
| 355 return parse_error::kParseOutOfBounds; | 355 return parse_error::kParseOutOfBounds; |
| 356 } | 356 } |
| 357 glCompressedTexSubImage2D( | 357 glCompressedTexSubImage2D( |
| 358 target, level, xoffset, yoffset, width, height, format, imageSize, data); | 358 target, level, xoffset, yoffset, width, height, format, imageSize, data); |
| 359 return parse_error::kParseNoError; | 359 return parse_error::kParseNoError; |
| 360 } | 360 } |
| 361 | 361 |
| 362 parse_error::ParseError GLES2DecoderImpl::HandleCopyTexImage2D( | 362 parse_error::ParseError GLES2DecoderImpl::HandleCopyTexImage2D( |
| 363 uint32 immediate_data_size, const gles2::CopyTexImage2D& c) { | 363 uint32 immediate_data_size, const gles2::CopyTexImage2D& c) { |
| 364 GLenum target = static_cast<GLenum>(c.target); | 364 GLenum target = static_cast<GLenum>(c.target); |
| 365 GLint level = static_cast<GLint>(c.level); | 365 GLint level = static_cast<GLint>(c.level); |
| 366 GLenum internalformat = static_cast<GLenum>(c.internalformat); | 366 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 367 GLint x = static_cast<GLint>(c.x); | 367 GLint x = static_cast<GLint>(c.x); |
| 368 GLint y = static_cast<GLint>(c.y); | 368 GLint y = static_cast<GLint>(c.y); |
| 369 GLsizei width = static_cast<GLsizei>(c.width); | 369 GLsizei width = static_cast<GLsizei>(c.width); |
| 370 GLsizei height = static_cast<GLsizei>(c.height); | 370 GLsizei height = static_cast<GLsizei>(c.height); |
| 371 GLint border = static_cast<GLint>(c.border); | 371 GLint border = static_cast<GLint>(c.border); |
| 372 if (!ValidateGLenumTextureTarget(target)) { | 372 if (!ValidateGLenumTextureTarget(target)) { |
| 373 SetGLError(GL_INVALID_VALUE); | 373 SetGLError(GL_INVALID_ENUM); |
| 374 return parse_error::kParseNoError; | 374 return parse_error::kParseNoError; |
| 375 } | 375 } |
| 376 glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); | 376 glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); |
| 377 return parse_error::kParseNoError; | 377 return parse_error::kParseNoError; |
| 378 } | 378 } |
| 379 | 379 |
| 380 parse_error::ParseError GLES2DecoderImpl::HandleCopyTexSubImage2D( | 380 parse_error::ParseError GLES2DecoderImpl::HandleCopyTexSubImage2D( |
| 381 uint32 immediate_data_size, const gles2::CopyTexSubImage2D& c) { | 381 uint32 immediate_data_size, const gles2::CopyTexSubImage2D& c) { |
| 382 GLenum target = static_cast<GLenum>(c.target); | 382 GLenum target = static_cast<GLenum>(c.target); |
| 383 GLint level = static_cast<GLint>(c.level); | 383 GLint level = static_cast<GLint>(c.level); |
| 384 GLint xoffset = static_cast<GLint>(c.xoffset); | 384 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 385 GLint yoffset = static_cast<GLint>(c.yoffset); | 385 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 386 GLint x = static_cast<GLint>(c.x); | 386 GLint x = static_cast<GLint>(c.x); |
| 387 GLint y = static_cast<GLint>(c.y); | 387 GLint y = static_cast<GLint>(c.y); |
| 388 GLsizei width = static_cast<GLsizei>(c.width); | 388 GLsizei width = static_cast<GLsizei>(c.width); |
| 389 GLsizei height = static_cast<GLsizei>(c.height); | 389 GLsizei height = static_cast<GLsizei>(c.height); |
| 390 if (!ValidateGLenumTextureTarget(target)) { | 390 if (!ValidateGLenumTextureTarget(target)) { |
| 391 SetGLError(GL_INVALID_VALUE); | 391 SetGLError(GL_INVALID_ENUM); |
| 392 return parse_error::kParseNoError; | 392 return parse_error::kParseNoError; |
| 393 } | 393 } |
| 394 glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); | 394 glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); |
| 395 return parse_error::kParseNoError; | 395 return parse_error::kParseNoError; |
| 396 } | 396 } |
| 397 | 397 |
| 398 parse_error::ParseError GLES2DecoderImpl::HandleCreateProgram( | 398 parse_error::ParseError GLES2DecoderImpl::HandleCreateProgram( |
| 399 uint32 immediate_data_size, const gles2::CreateProgram& c) { | 399 uint32 immediate_data_size, const gles2::CreateProgram& c) { |
| 400 uint32 client_id = c.client_id; | 400 uint32 client_id = c.client_id; |
| 401 CreateProgramHelper(client_id); | 401 CreateProgramHelper(client_id); |
| 402 return parse_error::kParseNoError; | 402 return parse_error::kParseNoError; |
| 403 } | 403 } |
| 404 | 404 |
| 405 parse_error::ParseError GLES2DecoderImpl::HandleCreateShader( | 405 parse_error::ParseError GLES2DecoderImpl::HandleCreateShader( |
| 406 uint32 immediate_data_size, const gles2::CreateShader& c) { | 406 uint32 immediate_data_size, const gles2::CreateShader& c) { |
| 407 GLenum type = static_cast<GLenum>(c.type); | 407 GLenum type = static_cast<GLenum>(c.type); |
| 408 if (!ValidateGLenumShaderType(type)) { | 408 if (!ValidateGLenumShaderType(type)) { |
| 409 SetGLError(GL_INVALID_VALUE); | 409 SetGLError(GL_INVALID_ENUM); |
| 410 return parse_error::kParseNoError; | 410 return parse_error::kParseNoError; |
| 411 } | 411 } |
| 412 uint32 client_id = c.client_id; | 412 uint32 client_id = c.client_id; |
| 413 CreateShaderHelper(type, client_id); | 413 CreateShaderHelper(type, client_id); |
| 414 return parse_error::kParseNoError; | 414 return parse_error::kParseNoError; |
| 415 } | 415 } |
| 416 | 416 |
| 417 parse_error::ParseError GLES2DecoderImpl::HandleCullFace( | 417 parse_error::ParseError GLES2DecoderImpl::HandleCullFace( |
| 418 uint32 immediate_data_size, const gles2::CullFace& c) { | 418 uint32 immediate_data_size, const gles2::CullFace& c) { |
| 419 GLenum mode = static_cast<GLenum>(c.mode); | 419 GLenum mode = static_cast<GLenum>(c.mode); |
| 420 if (!ValidateGLenumFaceType(mode)) { | 420 if (!ValidateGLenumFaceType(mode)) { |
| 421 SetGLError(GL_INVALID_VALUE); | 421 SetGLError(GL_INVALID_ENUM); |
| 422 return parse_error::kParseNoError; | 422 return parse_error::kParseNoError; |
| 423 } | 423 } |
| 424 glCullFace(mode); | 424 glCullFace(mode); |
| 425 return parse_error::kParseNoError; | 425 return parse_error::kParseNoError; |
| 426 } | 426 } |
| 427 | 427 |
| 428 parse_error::ParseError GLES2DecoderImpl::HandleDeleteBuffers( | 428 parse_error::ParseError GLES2DecoderImpl::HandleDeleteBuffers( |
| 429 uint32 immediate_data_size, const gles2::DeleteBuffers& c) { | 429 uint32 immediate_data_size, const gles2::DeleteBuffers& c) { |
| 430 GLsizei n = static_cast<GLsizei>(c.n); | 430 GLsizei n = static_cast<GLsizei>(c.n); |
| 431 uint32 data_size = n * sizeof(GLuint); | 431 uint32 data_size = n * sizeof(GLuint); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 return parse_error::kParseOutOfBounds; | 526 return parse_error::kParseOutOfBounds; |
| 527 } | 527 } |
| 528 DeleteGLObjects<GLDeleteTexturesHelper>(n, textures); | 528 DeleteGLObjects<GLDeleteTexturesHelper>(n, textures); |
| 529 return parse_error::kParseNoError; | 529 return parse_error::kParseNoError; |
| 530 } | 530 } |
| 531 | 531 |
| 532 parse_error::ParseError GLES2DecoderImpl::HandleDepthFunc( | 532 parse_error::ParseError GLES2DecoderImpl::HandleDepthFunc( |
| 533 uint32 immediate_data_size, const gles2::DepthFunc& c) { | 533 uint32 immediate_data_size, const gles2::DepthFunc& c) { |
| 534 GLenum func = static_cast<GLenum>(c.func); | 534 GLenum func = static_cast<GLenum>(c.func); |
| 535 if (!ValidateGLenumCmpFunction(func)) { | 535 if (!ValidateGLenumCmpFunction(func)) { |
| 536 SetGLError(GL_INVALID_VALUE); | 536 SetGLError(GL_INVALID_ENUM); |
| 537 return parse_error::kParseNoError; | 537 return parse_error::kParseNoError; |
| 538 } | 538 } |
| 539 glDepthFunc(func); | 539 glDepthFunc(func); |
| 540 return parse_error::kParseNoError; | 540 return parse_error::kParseNoError; |
| 541 } | 541 } |
| 542 | 542 |
| 543 parse_error::ParseError GLES2DecoderImpl::HandleDepthMask( | 543 parse_error::ParseError GLES2DecoderImpl::HandleDepthMask( |
| 544 uint32 immediate_data_size, const gles2::DepthMask& c) { | 544 uint32 immediate_data_size, const gles2::DepthMask& c) { |
| 545 GLboolean flag = static_cast<GLboolean>(c.flag); | 545 GLboolean flag = static_cast<GLboolean>(c.flag); |
| 546 glDepthMask(flag); | 546 glDepthMask(flag); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 568 return parse_error::kParseNoError; | 568 return parse_error::kParseNoError; |
| 569 } | 569 } |
| 570 glDetachShader(program, shader); | 570 glDetachShader(program, shader); |
| 571 return parse_error::kParseNoError; | 571 return parse_error::kParseNoError; |
| 572 } | 572 } |
| 573 | 573 |
| 574 parse_error::ParseError GLES2DecoderImpl::HandleDisable( | 574 parse_error::ParseError GLES2DecoderImpl::HandleDisable( |
| 575 uint32 immediate_data_size, const gles2::Disable& c) { | 575 uint32 immediate_data_size, const gles2::Disable& c) { |
| 576 GLenum cap = static_cast<GLenum>(c.cap); | 576 GLenum cap = static_cast<GLenum>(c.cap); |
| 577 if (!ValidateGLenumCapability(cap)) { | 577 if (!ValidateGLenumCapability(cap)) { |
| 578 SetGLError(GL_INVALID_VALUE); | 578 SetGLError(GL_INVALID_ENUM); |
| 579 return parse_error::kParseNoError; | 579 return parse_error::kParseNoError; |
| 580 } | 580 } |
| 581 glDisable(cap); | 581 glDisable(cap); |
| 582 return parse_error::kParseNoError; | 582 return parse_error::kParseNoError; |
| 583 } | 583 } |
| 584 | 584 |
| 585 parse_error::ParseError GLES2DecoderImpl::HandleDisableVertexAttribArray( | 585 parse_error::ParseError GLES2DecoderImpl::HandleDisableVertexAttribArray( |
| 586 uint32 immediate_data_size, const gles2::DisableVertexAttribArray& c) { | 586 uint32 immediate_data_size, const gles2::DisableVertexAttribArray& c) { |
| 587 GLuint index = static_cast<GLuint>(c.index); | 587 GLuint index = static_cast<GLuint>(c.index); |
| 588 DoDisableVertexAttribArray(index); | 588 DoDisableVertexAttribArray(index); |
| 589 return parse_error::kParseNoError; | 589 return parse_error::kParseNoError; |
| 590 } | 590 } |
| 591 | 591 |
| 592 parse_error::ParseError GLES2DecoderImpl::HandleDrawArrays( | 592 parse_error::ParseError GLES2DecoderImpl::HandleDrawArrays( |
| 593 uint32 immediate_data_size, const gles2::DrawArrays& c) { | 593 uint32 immediate_data_size, const gles2::DrawArrays& c) { |
| 594 GLenum mode = static_cast<GLenum>(c.mode); | 594 GLenum mode = static_cast<GLenum>(c.mode); |
| 595 GLint first = static_cast<GLint>(c.first); | 595 GLint first = static_cast<GLint>(c.first); |
| 596 GLsizei count = static_cast<GLsizei>(c.count); | 596 GLsizei count = static_cast<GLsizei>(c.count); |
| 597 if (!ValidateGLenumDrawMode(mode)) { | 597 if (!ValidateGLenumDrawMode(mode)) { |
| 598 SetGLError(GL_INVALID_VALUE); | 598 SetGLError(GL_INVALID_ENUM); |
| 599 return parse_error::kParseNoError; | 599 return parse_error::kParseNoError; |
| 600 } | 600 } |
| 601 DoDrawArrays(mode, first, count); | 601 DoDrawArrays(mode, first, count); |
| 602 return parse_error::kParseNoError; | 602 return parse_error::kParseNoError; |
| 603 } | 603 } |
| 604 | 604 |
| 605 parse_error::ParseError GLES2DecoderImpl::HandleEnable( | 605 parse_error::ParseError GLES2DecoderImpl::HandleEnable( |
| 606 uint32 immediate_data_size, const gles2::Enable& c) { | 606 uint32 immediate_data_size, const gles2::Enable& c) { |
| 607 GLenum cap = static_cast<GLenum>(c.cap); | 607 GLenum cap = static_cast<GLenum>(c.cap); |
| 608 if (!ValidateGLenumCapability(cap)) { | 608 if (!ValidateGLenumCapability(cap)) { |
| 609 SetGLError(GL_INVALID_VALUE); | 609 SetGLError(GL_INVALID_ENUM); |
| 610 return parse_error::kParseNoError; | 610 return parse_error::kParseNoError; |
| 611 } | 611 } |
| 612 glEnable(cap); | 612 glEnable(cap); |
| 613 return parse_error::kParseNoError; | 613 return parse_error::kParseNoError; |
| 614 } | 614 } |
| 615 | 615 |
| 616 parse_error::ParseError GLES2DecoderImpl::HandleEnableVertexAttribArray( | 616 parse_error::ParseError GLES2DecoderImpl::HandleEnableVertexAttribArray( |
| 617 uint32 immediate_data_size, const gles2::EnableVertexAttribArray& c) { | 617 uint32 immediate_data_size, const gles2::EnableVertexAttribArray& c) { |
| 618 GLuint index = static_cast<GLuint>(c.index); | 618 GLuint index = static_cast<GLuint>(c.index); |
| 619 DoEnableVertexAttribArray(index); | 619 DoEnableVertexAttribArray(index); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 636 uint32 immediate_data_size, const gles2::FramebufferRenderbuffer& c) { | 636 uint32 immediate_data_size, const gles2::FramebufferRenderbuffer& c) { |
| 637 GLenum target = static_cast<GLenum>(c.target); | 637 GLenum target = static_cast<GLenum>(c.target); |
| 638 GLenum attachment = static_cast<GLenum>(c.attachment); | 638 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 639 GLenum renderbuffertarget = static_cast<GLenum>(c.renderbuffertarget); | 639 GLenum renderbuffertarget = static_cast<GLenum>(c.renderbuffertarget); |
| 640 GLuint renderbuffer; | 640 GLuint renderbuffer; |
| 641 if (!id_map_.GetServiceId(c.renderbuffer, &renderbuffer)) { | 641 if (!id_map_.GetServiceId(c.renderbuffer, &renderbuffer)) { |
| 642 SetGLError(GL_INVALID_VALUE); | 642 SetGLError(GL_INVALID_VALUE); |
| 643 return parse_error::kParseNoError; | 643 return parse_error::kParseNoError; |
| 644 } | 644 } |
| 645 if (!ValidateGLenumFrameBufferTarget(target)) { | 645 if (!ValidateGLenumFrameBufferTarget(target)) { |
| 646 SetGLError(GL_INVALID_VALUE); | 646 SetGLError(GL_INVALID_ENUM); |
| 647 return parse_error::kParseNoError; | 647 return parse_error::kParseNoError; |
| 648 } | 648 } |
| 649 if (!ValidateGLenumAttachment(attachment)) { | 649 if (!ValidateGLenumAttachment(attachment)) { |
| 650 SetGLError(GL_INVALID_VALUE); | 650 SetGLError(GL_INVALID_ENUM); |
| 651 return parse_error::kParseNoError; | 651 return parse_error::kParseNoError; |
| 652 } | 652 } |
| 653 if (!ValidateGLenumRenderBufferTarget(renderbuffertarget)) { | 653 if (!ValidateGLenumRenderBufferTarget(renderbuffertarget)) { |
| 654 SetGLError(GL_INVALID_VALUE); | 654 SetGLError(GL_INVALID_ENUM); |
| 655 return parse_error::kParseNoError; | 655 return parse_error::kParseNoError; |
| 656 } | 656 } |
| 657 glFramebufferRenderbufferEXT( | 657 glFramebufferRenderbufferEXT( |
| 658 target, attachment, renderbuffertarget, renderbuffer); | 658 target, attachment, renderbuffertarget, renderbuffer); |
| 659 return parse_error::kParseNoError; | 659 return parse_error::kParseNoError; |
| 660 } | 660 } |
| 661 | 661 |
| 662 parse_error::ParseError GLES2DecoderImpl::HandleFramebufferTexture2D( | 662 parse_error::ParseError GLES2DecoderImpl::HandleFramebufferTexture2D( |
| 663 uint32 immediate_data_size, const gles2::FramebufferTexture2D& c) { | 663 uint32 immediate_data_size, const gles2::FramebufferTexture2D& c) { |
| 664 GLenum target = static_cast<GLenum>(c.target); | 664 GLenum target = static_cast<GLenum>(c.target); |
| 665 GLenum attachment = static_cast<GLenum>(c.attachment); | 665 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 666 GLenum textarget = static_cast<GLenum>(c.textarget); | 666 GLenum textarget = static_cast<GLenum>(c.textarget); |
| 667 GLuint texture; | 667 GLuint texture; |
| 668 if (!id_map_.GetServiceId(c.texture, &texture)) { | 668 if (!id_map_.GetServiceId(c.texture, &texture)) { |
| 669 SetGLError(GL_INVALID_VALUE); | 669 SetGLError(GL_INVALID_VALUE); |
| 670 return parse_error::kParseNoError; | 670 return parse_error::kParseNoError; |
| 671 } | 671 } |
| 672 GLint level = static_cast<GLint>(c.level); | 672 GLint level = static_cast<GLint>(c.level); |
| 673 if (!ValidateGLenumFrameBufferTarget(target)) { | 673 if (!ValidateGLenumFrameBufferTarget(target)) { |
| 674 SetGLError(GL_INVALID_VALUE); | 674 SetGLError(GL_INVALID_ENUM); |
| 675 return parse_error::kParseNoError; | 675 return parse_error::kParseNoError; |
| 676 } | 676 } |
| 677 if (!ValidateGLenumAttachment(attachment)) { | 677 if (!ValidateGLenumAttachment(attachment)) { |
| 678 SetGLError(GL_INVALID_VALUE); | 678 SetGLError(GL_INVALID_ENUM); |
| 679 return parse_error::kParseNoError; | 679 return parse_error::kParseNoError; |
| 680 } | 680 } |
| 681 if (!ValidateGLenumTextureTarget(textarget)) { | 681 if (!ValidateGLenumTextureTarget(textarget)) { |
| 682 SetGLError(GL_INVALID_VALUE); | 682 SetGLError(GL_INVALID_ENUM); |
| 683 return parse_error::kParseNoError; | 683 return parse_error::kParseNoError; |
| 684 } | 684 } |
| 685 glFramebufferTexture2DEXT(target, attachment, textarget, texture, level); | 685 glFramebufferTexture2DEXT(target, attachment, textarget, texture, level); |
| 686 return parse_error::kParseNoError; | 686 return parse_error::kParseNoError; |
| 687 } | 687 } |
| 688 | 688 |
| 689 parse_error::ParseError GLES2DecoderImpl::HandleFrontFace( | 689 parse_error::ParseError GLES2DecoderImpl::HandleFrontFace( |
| 690 uint32 immediate_data_size, const gles2::FrontFace& c) { | 690 uint32 immediate_data_size, const gles2::FrontFace& c) { |
| 691 GLenum mode = static_cast<GLenum>(c.mode); | 691 GLenum mode = static_cast<GLenum>(c.mode); |
| 692 if (!ValidateGLenumFaceMode(mode)) { | 692 if (!ValidateGLenumFaceMode(mode)) { |
| 693 SetGLError(GL_INVALID_VALUE); | 693 SetGLError(GL_INVALID_ENUM); |
| 694 return parse_error::kParseNoError; | 694 return parse_error::kParseNoError; |
| 695 } | 695 } |
| 696 glFrontFace(mode); | 696 glFrontFace(mode); |
| 697 return parse_error::kParseNoError; | 697 return parse_error::kParseNoError; |
| 698 } | 698 } |
| 699 | 699 |
| 700 parse_error::ParseError GLES2DecoderImpl::HandleGenBuffers( | 700 parse_error::ParseError GLES2DecoderImpl::HandleGenBuffers( |
| 701 uint32 immediate_data_size, const gles2::GenBuffers& c) { | 701 uint32 immediate_data_size, const gles2::GenBuffers& c) { |
| 702 GLsizei n = static_cast<GLsizei>(c.n); | 702 GLsizei n = static_cast<GLsizei>(c.n); |
| 703 uint32 data_size = n * sizeof(GLuint); | 703 uint32 data_size = n * sizeof(GLuint); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 720 return parse_error::kParseOutOfBounds; | 720 return parse_error::kParseOutOfBounds; |
| 721 } | 721 } |
| 722 GenGLObjects<GLGenBuffersHelper>(n, buffers); | 722 GenGLObjects<GLGenBuffersHelper>(n, buffers); |
| 723 return parse_error::kParseNoError; | 723 return parse_error::kParseNoError; |
| 724 } | 724 } |
| 725 | 725 |
| 726 parse_error::ParseError GLES2DecoderImpl::HandleGenerateMipmap( | 726 parse_error::ParseError GLES2DecoderImpl::HandleGenerateMipmap( |
| 727 uint32 immediate_data_size, const gles2::GenerateMipmap& c) { | 727 uint32 immediate_data_size, const gles2::GenerateMipmap& c) { |
| 728 GLenum target = static_cast<GLenum>(c.target); | 728 GLenum target = static_cast<GLenum>(c.target); |
| 729 if (!ValidateGLenumTextureBindTarget(target)) { | 729 if (!ValidateGLenumTextureBindTarget(target)) { |
| 730 SetGLError(GL_INVALID_VALUE); | 730 SetGLError(GL_INVALID_ENUM); |
| 731 return parse_error::kParseNoError; | 731 return parse_error::kParseNoError; |
| 732 } | 732 } |
| 733 glGenerateMipmapEXT(target); | 733 glGenerateMipmapEXT(target); |
| 734 return parse_error::kParseNoError; | 734 return parse_error::kParseNoError; |
| 735 } | 735 } |
| 736 | 736 |
| 737 parse_error::ParseError GLES2DecoderImpl::HandleGenFramebuffers( | 737 parse_error::ParseError GLES2DecoderImpl::HandleGenFramebuffers( |
| 738 uint32 immediate_data_size, const gles2::GenFramebuffers& c) { | 738 uint32 immediate_data_size, const gles2::GenFramebuffers& c) { |
| 739 GLsizei n = static_cast<GLsizei>(c.n); | 739 GLsizei n = static_cast<GLsizei>(c.n); |
| 740 uint32 data_size = n * sizeof(GLuint); | 740 uint32 data_size = n * sizeof(GLuint); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 parse_error::ParseError GLES2DecoderImpl::HandleGetBufferParameteriv( | 830 parse_error::ParseError GLES2DecoderImpl::HandleGetBufferParameteriv( |
| 831 uint32 immediate_data_size, const gles2::GetBufferParameteriv& c) { | 831 uint32 immediate_data_size, const gles2::GetBufferParameteriv& c) { |
| 832 GLenum target = static_cast<GLenum>(c.target); | 832 GLenum target = static_cast<GLenum>(c.target); |
| 833 GLenum pname = static_cast<GLenum>(c.pname); | 833 GLenum pname = static_cast<GLenum>(c.pname); |
| 834 GLint* params; | 834 GLint* params; |
| 835 GLsizei num_values = util_.GLGetNumValuesReturned(pname); | 835 GLsizei num_values = util_.GLGetNumValuesReturned(pname); |
| 836 uint32 params_size = num_values * sizeof(*params); | 836 uint32 params_size = num_values * sizeof(*params); |
| 837 params = GetSharedMemoryAs<GLint*>( | 837 params = GetSharedMemoryAs<GLint*>( |
| 838 c.params_shm_id, c.params_shm_offset, params_size); | 838 c.params_shm_id, c.params_shm_offset, params_size); |
| 839 if (!ValidateGLenumBufferTarget(target)) { | 839 if (!ValidateGLenumBufferTarget(target)) { |
| 840 SetGLError(GL_INVALID_VALUE); | 840 SetGLError(GL_INVALID_ENUM); |
| 841 return parse_error::kParseNoError; | 841 return parse_error::kParseNoError; |
| 842 } | 842 } |
| 843 if (!ValidateGLenumBufferParameter(pname)) { | 843 if (!ValidateGLenumBufferParameter(pname)) { |
| 844 SetGLError(GL_INVALID_VALUE); | 844 SetGLError(GL_INVALID_ENUM); |
| 845 return parse_error::kParseNoError; | 845 return parse_error::kParseNoError; |
| 846 } | 846 } |
| 847 if (params == NULL) { | 847 if (params == NULL) { |
| 848 return parse_error::kParseOutOfBounds; | 848 return parse_error::kParseOutOfBounds; |
| 849 } | 849 } |
| 850 glGetBufferParameteriv(target, pname, params); | 850 glGetBufferParameteriv(target, pname, params); |
| 851 return parse_error::kParseNoError; | 851 return parse_error::kParseNoError; |
| 852 } | 852 } |
| 853 | 853 |
| 854 parse_error::ParseError GLES2DecoderImpl::HandleGetError( | 854 parse_error::ParseError GLES2DecoderImpl::HandleGetError( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 880 const gles2::GetFramebufferAttachmentParameteriv& c) { | 880 const gles2::GetFramebufferAttachmentParameteriv& c) { |
| 881 GLenum target = static_cast<GLenum>(c.target); | 881 GLenum target = static_cast<GLenum>(c.target); |
| 882 GLenum attachment = static_cast<GLenum>(c.attachment); | 882 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 883 GLenum pname = static_cast<GLenum>(c.pname); | 883 GLenum pname = static_cast<GLenum>(c.pname); |
| 884 GLint* params; | 884 GLint* params; |
| 885 GLsizei num_values = util_.GLGetNumValuesReturned(pname); | 885 GLsizei num_values = util_.GLGetNumValuesReturned(pname); |
| 886 uint32 params_size = num_values * sizeof(*params); | 886 uint32 params_size = num_values * sizeof(*params); |
| 887 params = GetSharedMemoryAs<GLint*>( | 887 params = GetSharedMemoryAs<GLint*>( |
| 888 c.params_shm_id, c.params_shm_offset, params_size); | 888 c.params_shm_id, c.params_shm_offset, params_size); |
| 889 if (!ValidateGLenumFrameBufferTarget(target)) { | 889 if (!ValidateGLenumFrameBufferTarget(target)) { |
| 890 SetGLError(GL_INVALID_VALUE); | 890 SetGLError(GL_INVALID_ENUM); |
| 891 return parse_error::kParseNoError; | 891 return parse_error::kParseNoError; |
| 892 } | 892 } |
| 893 if (!ValidateGLenumAttachment(attachment)) { | 893 if (!ValidateGLenumAttachment(attachment)) { |
| 894 SetGLError(GL_INVALID_VALUE); | 894 SetGLError(GL_INVALID_ENUM); |
| 895 return parse_error::kParseNoError; | 895 return parse_error::kParseNoError; |
| 896 } | 896 } |
| 897 if (!ValidateGLenumFrameBufferParameter(pname)) { | 897 if (!ValidateGLenumFrameBufferParameter(pname)) { |
| 898 SetGLError(GL_INVALID_VALUE); | 898 SetGLError(GL_INVALID_ENUM); |
| 899 return parse_error::kParseNoError; | 899 return parse_error::kParseNoError; |
| 900 } | 900 } |
| 901 if (params == NULL) { | 901 if (params == NULL) { |
| 902 return parse_error::kParseOutOfBounds; | 902 return parse_error::kParseOutOfBounds; |
| 903 } | 903 } |
| 904 glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params); | 904 glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params); |
| 905 return parse_error::kParseNoError; | 905 return parse_error::kParseNoError; |
| 906 } | 906 } |
| 907 | 907 |
| 908 parse_error::ParseError GLES2DecoderImpl::HandleGetIntegerv( | 908 parse_error::ParseError GLES2DecoderImpl::HandleGetIntegerv( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 927 SetGLError(GL_INVALID_VALUE); | 927 SetGLError(GL_INVALID_VALUE); |
| 928 return parse_error::kParseNoError; | 928 return parse_error::kParseNoError; |
| 929 } | 929 } |
| 930 GLenum pname = static_cast<GLenum>(c.pname); | 930 GLenum pname = static_cast<GLenum>(c.pname); |
| 931 GLint* params; | 931 GLint* params; |
| 932 GLsizei num_values = util_.GLGetNumValuesReturned(pname); | 932 GLsizei num_values = util_.GLGetNumValuesReturned(pname); |
| 933 uint32 params_size = num_values * sizeof(*params); | 933 uint32 params_size = num_values * sizeof(*params); |
| 934 params = GetSharedMemoryAs<GLint*>( | 934 params = GetSharedMemoryAs<GLint*>( |
| 935 c.params_shm_id, c.params_shm_offset, params_size); | 935 c.params_shm_id, c.params_shm_offset, params_size); |
| 936 if (!ValidateGLenumProgramParameter(pname)) { | 936 if (!ValidateGLenumProgramParameter(pname)) { |
| 937 SetGLError(GL_INVALID_VALUE); | 937 SetGLError(GL_INVALID_ENUM); |
| 938 return parse_error::kParseNoError; | 938 return parse_error::kParseNoError; |
| 939 } | 939 } |
| 940 if (params == NULL) { | 940 if (params == NULL) { |
| 941 return parse_error::kParseOutOfBounds; | 941 return parse_error::kParseOutOfBounds; |
| 942 } | 942 } |
| 943 glGetProgramiv(program, pname, params); | 943 glGetProgramiv(program, pname, params); |
| 944 return parse_error::kParseNoError; | 944 return parse_error::kParseNoError; |
| 945 } | 945 } |
| 946 | 946 |
| 947 parse_error::ParseError GLES2DecoderImpl::HandleGetProgramInfoLog( | 947 parse_error::ParseError GLES2DecoderImpl::HandleGetProgramInfoLog( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 974 parse_error::ParseError GLES2DecoderImpl::HandleGetRenderbufferParameteriv( | 974 parse_error::ParseError GLES2DecoderImpl::HandleGetRenderbufferParameteriv( |
| 975 uint32 immediate_data_size, const gles2::GetRenderbufferParameteriv& c) { | 975 uint32 immediate_data_size, const gles2::GetRenderbufferParameteriv& c) { |
| 976 GLenum target = static_cast<GLenum>(c.target); | 976 GLenum target = static_cast<GLenum>(c.target); |
| 977 GLenum pname = static_cast<GLenum>(c.pname); | 977 GLenum pname = static_cast<GLenum>(c.pname); |
| 978 GLint* params; | 978 GLint* params; |
| 979 GLsizei num_values = util_.GLGetNumValuesReturned(pname); | 979 GLsizei num_values = util_.GLGetNumValuesReturned(pname); |
| 980 uint32 params_size = num_values * sizeof(*params); | 980 uint32 params_size = num_values * sizeof(*params); |
| 981 params = GetSharedMemoryAs<GLint*>( | 981 params = GetSharedMemoryAs<GLint*>( |
| 982 c.params_shm_id, c.params_shm_offset, params_size); | 982 c.params_shm_id, c.params_shm_offset, params_size); |
| 983 if (!ValidateGLenumRenderBufferTarget(target)) { | 983 if (!ValidateGLenumRenderBufferTarget(target)) { |
| 984 SetGLError(GL_INVALID_VALUE); | 984 SetGLError(GL_INVALID_ENUM); |
| 985 return parse_error::kParseNoError; | 985 return parse_error::kParseNoError; |
| 986 } | 986 } |
| 987 if (!ValidateGLenumRenderBufferParameter(pname)) { | 987 if (!ValidateGLenumRenderBufferParameter(pname)) { |
| 988 SetGLError(GL_INVALID_VALUE); | 988 SetGLError(GL_INVALID_ENUM); |
| 989 return parse_error::kParseNoError; | 989 return parse_error::kParseNoError; |
| 990 } | 990 } |
| 991 if (params == NULL) { | 991 if (params == NULL) { |
| 992 return parse_error::kParseOutOfBounds; | 992 return parse_error::kParseOutOfBounds; |
| 993 } | 993 } |
| 994 glGetRenderbufferParameterivEXT(target, pname, params); | 994 glGetRenderbufferParameterivEXT(target, pname, params); |
| 995 return parse_error::kParseNoError; | 995 return parse_error::kParseNoError; |
| 996 } | 996 } |
| 997 | 997 |
| 998 parse_error::ParseError GLES2DecoderImpl::HandleGetShaderiv( | 998 parse_error::ParseError GLES2DecoderImpl::HandleGetShaderiv( |
| 999 uint32 immediate_data_size, const gles2::GetShaderiv& c) { | 999 uint32 immediate_data_size, const gles2::GetShaderiv& c) { |
| 1000 GLuint shader; | 1000 GLuint shader; |
| 1001 if (!id_map_.GetServiceId(c.shader, &shader)) { | 1001 if (!id_map_.GetServiceId(c.shader, &shader)) { |
| 1002 SetGLError(GL_INVALID_VALUE); | 1002 SetGLError(GL_INVALID_VALUE); |
| 1003 return parse_error::kParseNoError; | 1003 return parse_error::kParseNoError; |
| 1004 } | 1004 } |
| 1005 GLenum pname = static_cast<GLenum>(c.pname); | 1005 GLenum pname = static_cast<GLenum>(c.pname); |
| 1006 GLint* params; | 1006 GLint* params; |
| 1007 GLsizei num_values = util_.GLGetNumValuesReturned(pname); | 1007 GLsizei num_values = util_.GLGetNumValuesReturned(pname); |
| 1008 uint32 params_size = num_values * sizeof(*params); | 1008 uint32 params_size = num_values * sizeof(*params); |
| 1009 params = GetSharedMemoryAs<GLint*>( | 1009 params = GetSharedMemoryAs<GLint*>( |
| 1010 c.params_shm_id, c.params_shm_offset, params_size); | 1010 c.params_shm_id, c.params_shm_offset, params_size); |
| 1011 if (!ValidateGLenumShaderParameter(pname)) { | 1011 if (!ValidateGLenumShaderParameter(pname)) { |
| 1012 SetGLError(GL_INVALID_VALUE); | 1012 SetGLError(GL_INVALID_ENUM); |
| 1013 return parse_error::kParseNoError; | 1013 return parse_error::kParseNoError; |
| 1014 } | 1014 } |
| 1015 if (params == NULL) { | 1015 if (params == NULL) { |
| 1016 return parse_error::kParseOutOfBounds; | 1016 return parse_error::kParseOutOfBounds; |
| 1017 } | 1017 } |
| 1018 glGetShaderiv(shader, pname, params); | 1018 glGetShaderiv(shader, pname, params); |
| 1019 return parse_error::kParseNoError; | 1019 return parse_error::kParseNoError; |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 parse_error::ParseError GLES2DecoderImpl::HandleGetShaderInfoLog( | 1022 parse_error::ParseError GLES2DecoderImpl::HandleGetShaderInfoLog( |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 return parse_error::kParseOutOfBounds; | 1070 return parse_error::kParseOutOfBounds; |
| 1071 } | 1071 } |
| 1072 glGetShaderSource(shader, bufsize, length, source); | 1072 glGetShaderSource(shader, bufsize, length, source); |
| 1073 return parse_error::kParseNoError; | 1073 return parse_error::kParseNoError; |
| 1074 } | 1074 } |
| 1075 | 1075 |
| 1076 parse_error::ParseError GLES2DecoderImpl::HandleGetString( | 1076 parse_error::ParseError GLES2DecoderImpl::HandleGetString( |
| 1077 uint32 immediate_data_size, const gles2::GetString& c) { | 1077 uint32 immediate_data_size, const gles2::GetString& c) { |
| 1078 GLenum name = static_cast<GLenum>(c.name); | 1078 GLenum name = static_cast<GLenum>(c.name); |
| 1079 if (!ValidateGLenumStringType(name)) { | 1079 if (!ValidateGLenumStringType(name)) { |
| 1080 SetGLError(GL_INVALID_VALUE); | 1080 SetGLError(GL_INVALID_ENUM); |
| 1081 return parse_error::kParseNoError; | 1081 return parse_error::kParseNoError; |
| 1082 } | 1082 } |
| 1083 glGetString(name); | 1083 glGetString(name); |
| 1084 return parse_error::kParseNoError; | 1084 return parse_error::kParseNoError; |
| 1085 } | 1085 } |
| 1086 | 1086 |
| 1087 parse_error::ParseError GLES2DecoderImpl::HandleGetTexParameterfv( | 1087 parse_error::ParseError GLES2DecoderImpl::HandleGetTexParameterfv( |
| 1088 uint32 immediate_data_size, const gles2::GetTexParameterfv& c) { | 1088 uint32 immediate_data_size, const gles2::GetTexParameterfv& c) { |
| 1089 GLenum target = static_cast<GLenum>(c.target); | 1089 GLenum target = static_cast<GLenum>(c.target); |
| 1090 GLenum pname = static_cast<GLenum>(c.pname); | 1090 GLenum pname = static_cast<GLenum>(c.pname); |
| 1091 GLfloat* params; | 1091 GLfloat* params; |
| 1092 GLsizei num_values = util_.GLGetNumValuesReturned(pname); | 1092 GLsizei num_values = util_.GLGetNumValuesReturned(pname); |
| 1093 uint32 params_size = num_values * sizeof(*params); | 1093 uint32 params_size = num_values * sizeof(*params); |
| 1094 params = GetSharedMemoryAs<GLfloat*>( | 1094 params = GetSharedMemoryAs<GLfloat*>( |
| 1095 c.params_shm_id, c.params_shm_offset, params_size); | 1095 c.params_shm_id, c.params_shm_offset, params_size); |
| 1096 if (!ValidateGLenumTextureTarget(target)) { | 1096 if (!ValidateGLenumTextureTarget(target)) { |
| 1097 SetGLError(GL_INVALID_VALUE); | 1097 SetGLError(GL_INVALID_ENUM); |
| 1098 return parse_error::kParseNoError; | 1098 return parse_error::kParseNoError; |
| 1099 } | 1099 } |
| 1100 if (!ValidateGLenumTextureParameter(pname)) { | 1100 if (!ValidateGLenumTextureParameter(pname)) { |
| 1101 SetGLError(GL_INVALID_VALUE); | 1101 SetGLError(GL_INVALID_ENUM); |
| 1102 return parse_error::kParseNoError; | 1102 return parse_error::kParseNoError; |
| 1103 } | 1103 } |
| 1104 if (params == NULL) { | 1104 if (params == NULL) { |
| 1105 return parse_error::kParseOutOfBounds; | 1105 return parse_error::kParseOutOfBounds; |
| 1106 } | 1106 } |
| 1107 glGetTexParameterfv(target, pname, params); | 1107 glGetTexParameterfv(target, pname, params); |
| 1108 return parse_error::kParseNoError; | 1108 return parse_error::kParseNoError; |
| 1109 } | 1109 } |
| 1110 | 1110 |
| 1111 parse_error::ParseError GLES2DecoderImpl::HandleGetTexParameteriv( | 1111 parse_error::ParseError GLES2DecoderImpl::HandleGetTexParameteriv( |
| 1112 uint32 immediate_data_size, const gles2::GetTexParameteriv& c) { | 1112 uint32 immediate_data_size, const gles2::GetTexParameteriv& c) { |
| 1113 GLenum target = static_cast<GLenum>(c.target); | 1113 GLenum target = static_cast<GLenum>(c.target); |
| 1114 GLenum pname = static_cast<GLenum>(c.pname); | 1114 GLenum pname = static_cast<GLenum>(c.pname); |
| 1115 GLint* params; | 1115 GLint* params; |
| 1116 GLsizei num_values = util_.GLGetNumValuesReturned(pname); | 1116 GLsizei num_values = util_.GLGetNumValuesReturned(pname); |
| 1117 uint32 params_size = num_values * sizeof(*params); | 1117 uint32 params_size = num_values * sizeof(*params); |
| 1118 params = GetSharedMemoryAs<GLint*>( | 1118 params = GetSharedMemoryAs<GLint*>( |
| 1119 c.params_shm_id, c.params_shm_offset, params_size); | 1119 c.params_shm_id, c.params_shm_offset, params_size); |
| 1120 if (!ValidateGLenumTextureTarget(target)) { | 1120 if (!ValidateGLenumTextureTarget(target)) { |
| 1121 SetGLError(GL_INVALID_VALUE); | 1121 SetGLError(GL_INVALID_ENUM); |
| 1122 return parse_error::kParseNoError; | 1122 return parse_error::kParseNoError; |
| 1123 } | 1123 } |
| 1124 if (!ValidateGLenumTextureParameter(pname)) { | 1124 if (!ValidateGLenumTextureParameter(pname)) { |
| 1125 SetGLError(GL_INVALID_VALUE); | 1125 SetGLError(GL_INVALID_ENUM); |
| 1126 return parse_error::kParseNoError; | 1126 return parse_error::kParseNoError; |
| 1127 } | 1127 } |
| 1128 if (params == NULL) { | 1128 if (params == NULL) { |
| 1129 return parse_error::kParseOutOfBounds; | 1129 return parse_error::kParseOutOfBounds; |
| 1130 } | 1130 } |
| 1131 glGetTexParameteriv(target, pname, params); | 1131 glGetTexParameteriv(target, pname, params); |
| 1132 return parse_error::kParseNoError; | 1132 return parse_error::kParseNoError; |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 parse_error::ParseError GLES2DecoderImpl::HandleGetVertexAttribfv( | 1135 parse_error::ParseError GLES2DecoderImpl::HandleGetVertexAttribfv( |
| 1136 uint32 immediate_data_size, const gles2::GetVertexAttribfv& c) { | 1136 uint32 immediate_data_size, const gles2::GetVertexAttribfv& c) { |
| 1137 GLuint index = static_cast<GLuint>(c.index); | 1137 GLuint index = static_cast<GLuint>(c.index); |
| 1138 GLenum pname = static_cast<GLenum>(c.pname); | 1138 GLenum pname = static_cast<GLenum>(c.pname); |
| 1139 GLfloat* params; | 1139 GLfloat* params; |
| 1140 GLsizei num_values = util_.GLGetNumValuesReturned(pname); | 1140 GLsizei num_values = util_.GLGetNumValuesReturned(pname); |
| 1141 uint32 params_size = num_values * sizeof(*params); | 1141 uint32 params_size = num_values * sizeof(*params); |
| 1142 params = GetSharedMemoryAs<GLfloat*>( | 1142 params = GetSharedMemoryAs<GLfloat*>( |
| 1143 c.params_shm_id, c.params_shm_offset, params_size); | 1143 c.params_shm_id, c.params_shm_offset, params_size); |
| 1144 if (!ValidateGLenumVertexAttribute(pname)) { | 1144 if (!ValidateGLenumVertexAttribute(pname)) { |
| 1145 SetGLError(GL_INVALID_VALUE); | 1145 SetGLError(GL_INVALID_ENUM); |
| 1146 return parse_error::kParseNoError; | 1146 return parse_error::kParseNoError; |
| 1147 } | 1147 } |
| 1148 if (params == NULL) { | 1148 if (params == NULL) { |
| 1149 return parse_error::kParseOutOfBounds; | 1149 return parse_error::kParseOutOfBounds; |
| 1150 } | 1150 } |
| 1151 glGetVertexAttribfv(index, pname, params); | 1151 glGetVertexAttribfv(index, pname, params); |
| 1152 return parse_error::kParseNoError; | 1152 return parse_error::kParseNoError; |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 parse_error::ParseError GLES2DecoderImpl::HandleGetVertexAttribiv( | 1155 parse_error::ParseError GLES2DecoderImpl::HandleGetVertexAttribiv( |
| 1156 uint32 immediate_data_size, const gles2::GetVertexAttribiv& c) { | 1156 uint32 immediate_data_size, const gles2::GetVertexAttribiv& c) { |
| 1157 GLuint index = static_cast<GLuint>(c.index); | 1157 GLuint index = static_cast<GLuint>(c.index); |
| 1158 GLenum pname = static_cast<GLenum>(c.pname); | 1158 GLenum pname = static_cast<GLenum>(c.pname); |
| 1159 GLint* params; | 1159 GLint* params; |
| 1160 GLsizei num_values = util_.GLGetNumValuesReturned(pname); | 1160 GLsizei num_values = util_.GLGetNumValuesReturned(pname); |
| 1161 uint32 params_size = num_values * sizeof(*params); | 1161 uint32 params_size = num_values * sizeof(*params); |
| 1162 params = GetSharedMemoryAs<GLint*>( | 1162 params = GetSharedMemoryAs<GLint*>( |
| 1163 c.params_shm_id, c.params_shm_offset, params_size); | 1163 c.params_shm_id, c.params_shm_offset, params_size); |
| 1164 if (!ValidateGLenumVertexAttribute(pname)) { | 1164 if (!ValidateGLenumVertexAttribute(pname)) { |
| 1165 SetGLError(GL_INVALID_VALUE); | 1165 SetGLError(GL_INVALID_ENUM); |
| 1166 return parse_error::kParseNoError; | 1166 return parse_error::kParseNoError; |
| 1167 } | 1167 } |
| 1168 if (params == NULL) { | 1168 if (params == NULL) { |
| 1169 return parse_error::kParseOutOfBounds; | 1169 return parse_error::kParseOutOfBounds; |
| 1170 } | 1170 } |
| 1171 glGetVertexAttribiv(index, pname, params); | 1171 glGetVertexAttribiv(index, pname, params); |
| 1172 return parse_error::kParseNoError; | 1172 return parse_error::kParseNoError; |
| 1173 } | 1173 } |
| 1174 | 1174 |
| 1175 parse_error::ParseError GLES2DecoderImpl::HandleHint( | 1175 parse_error::ParseError GLES2DecoderImpl::HandleHint( |
| 1176 uint32 immediate_data_size, const gles2::Hint& c) { | 1176 uint32 immediate_data_size, const gles2::Hint& c) { |
| 1177 GLenum target = static_cast<GLenum>(c.target); | 1177 GLenum target = static_cast<GLenum>(c.target); |
| 1178 GLenum mode = static_cast<GLenum>(c.mode); | 1178 GLenum mode = static_cast<GLenum>(c.mode); |
| 1179 if (!ValidateGLenumHintTarget(target)) { | 1179 if (!ValidateGLenumHintTarget(target)) { |
| 1180 SetGLError(GL_INVALID_VALUE); | 1180 SetGLError(GL_INVALID_ENUM); |
| 1181 return parse_error::kParseNoError; | 1181 return parse_error::kParseNoError; |
| 1182 } | 1182 } |
| 1183 if (!ValidateGLenumHintMode(mode)) { | 1183 if (!ValidateGLenumHintMode(mode)) { |
| 1184 SetGLError(GL_INVALID_VALUE); | 1184 SetGLError(GL_INVALID_ENUM); |
| 1185 return parse_error::kParseNoError; | 1185 return parse_error::kParseNoError; |
| 1186 } | 1186 } |
| 1187 glHint(target, mode); | 1187 glHint(target, mode); |
| 1188 return parse_error::kParseNoError; | 1188 return parse_error::kParseNoError; |
| 1189 } | 1189 } |
| 1190 | 1190 |
| 1191 parse_error::ParseError GLES2DecoderImpl::HandleIsBuffer( | 1191 parse_error::ParseError GLES2DecoderImpl::HandleIsBuffer( |
| 1192 uint32 immediate_data_size, const gles2::IsBuffer& c) { | 1192 uint32 immediate_data_size, const gles2::IsBuffer& c) { |
| 1193 GLuint buffer; | 1193 GLuint buffer; |
| 1194 if (!id_map_.GetServiceId(c.buffer, &buffer)) { | 1194 if (!id_map_.GetServiceId(c.buffer, &buffer)) { |
| 1195 SetGLError(GL_INVALID_VALUE); | 1195 SetGLError(GL_INVALID_VALUE); |
| 1196 return parse_error::kParseNoError; | 1196 return parse_error::kParseNoError; |
| 1197 } | 1197 } |
| 1198 GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( | 1198 GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( |
| 1199 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 1199 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 1200 *result_dst = glIsBuffer(buffer); | 1200 *result_dst = glIsBuffer(buffer); |
| 1201 return parse_error::kParseNoError; | 1201 return parse_error::kParseNoError; |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 parse_error::ParseError GLES2DecoderImpl::HandleIsEnabled( | 1204 parse_error::ParseError GLES2DecoderImpl::HandleIsEnabled( |
| 1205 uint32 immediate_data_size, const gles2::IsEnabled& c) { | 1205 uint32 immediate_data_size, const gles2::IsEnabled& c) { |
| 1206 GLenum cap = static_cast<GLenum>(c.cap); | 1206 GLenum cap = static_cast<GLenum>(c.cap); |
| 1207 GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( | 1207 GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( |
| 1208 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 1208 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 1209 if (!ValidateGLenumCapability(cap)) { | 1209 if (!ValidateGLenumCapability(cap)) { |
| 1210 SetGLError(GL_INVALID_VALUE); | 1210 SetGLError(GL_INVALID_ENUM); |
| 1211 return parse_error::kParseNoError; | 1211 return parse_error::kParseNoError; |
| 1212 } | 1212 } |
| 1213 *result_dst = glIsEnabled(cap); | 1213 *result_dst = glIsEnabled(cap); |
| 1214 return parse_error::kParseNoError; | 1214 return parse_error::kParseNoError; |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 parse_error::ParseError GLES2DecoderImpl::HandleIsFramebuffer( | 1217 parse_error::ParseError GLES2DecoderImpl::HandleIsFramebuffer( |
| 1218 uint32 immediate_data_size, const gles2::IsFramebuffer& c) { | 1218 uint32 immediate_data_size, const gles2::IsFramebuffer& c) { |
| 1219 GLuint framebuffer; | 1219 GLuint framebuffer; |
| 1220 if (!id_map_.GetServiceId(c.framebuffer, &framebuffer)) { | 1220 if (!id_map_.GetServiceId(c.framebuffer, &framebuffer)) { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 return parse_error::kParseNoError; | 1305 return parse_error::kParseNoError; |
| 1306 } | 1306 } |
| 1307 | 1307 |
| 1308 parse_error::ParseError GLES2DecoderImpl::HandleRenderbufferStorage( | 1308 parse_error::ParseError GLES2DecoderImpl::HandleRenderbufferStorage( |
| 1309 uint32 immediate_data_size, const gles2::RenderbufferStorage& c) { | 1309 uint32 immediate_data_size, const gles2::RenderbufferStorage& c) { |
| 1310 GLenum target = static_cast<GLenum>(c.target); | 1310 GLenum target = static_cast<GLenum>(c.target); |
| 1311 GLenum internalformat = static_cast<GLenum>(c.internalformat); | 1311 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 1312 GLsizei width = static_cast<GLsizei>(c.width); | 1312 GLsizei width = static_cast<GLsizei>(c.width); |
| 1313 GLsizei height = static_cast<GLsizei>(c.height); | 1313 GLsizei height = static_cast<GLsizei>(c.height); |
| 1314 if (!ValidateGLenumRenderBufferTarget(target)) { | 1314 if (!ValidateGLenumRenderBufferTarget(target)) { |
| 1315 SetGLError(GL_INVALID_VALUE); | 1315 SetGLError(GL_INVALID_ENUM); |
| 1316 return parse_error::kParseNoError; | 1316 return parse_error::kParseNoError; |
| 1317 } | 1317 } |
| 1318 if (!ValidateGLenumRenderBufferFormat(internalformat)) { | 1318 if (!ValidateGLenumRenderBufferFormat(internalformat)) { |
| 1319 SetGLError(GL_INVALID_VALUE); | 1319 SetGLError(GL_INVALID_ENUM); |
| 1320 return parse_error::kParseNoError; | 1320 return parse_error::kParseNoError; |
| 1321 } | 1321 } |
| 1322 glRenderbufferStorageEXT(target, internalformat, width, height); | 1322 glRenderbufferStorageEXT(target, internalformat, width, height); |
| 1323 return parse_error::kParseNoError; | 1323 return parse_error::kParseNoError; |
| 1324 } | 1324 } |
| 1325 | 1325 |
| 1326 parse_error::ParseError GLES2DecoderImpl::HandleSampleCoverage( | 1326 parse_error::ParseError GLES2DecoderImpl::HandleSampleCoverage( |
| 1327 uint32 immediate_data_size, const gles2::SampleCoverage& c) { | 1327 uint32 immediate_data_size, const gles2::SampleCoverage& c) { |
| 1328 GLclampf value = static_cast<GLclampf>(c.value); | 1328 GLclampf value = static_cast<GLclampf>(c.value); |
| 1329 GLboolean invert = static_cast<GLboolean>(c.invert); | 1329 GLboolean invert = static_cast<GLboolean>(c.invert); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1340 glScissor(x, y, width, height); | 1340 glScissor(x, y, width, height); |
| 1341 return parse_error::kParseNoError; | 1341 return parse_error::kParseNoError; |
| 1342 } | 1342 } |
| 1343 | 1343 |
| 1344 parse_error::ParseError GLES2DecoderImpl::HandleStencilFunc( | 1344 parse_error::ParseError GLES2DecoderImpl::HandleStencilFunc( |
| 1345 uint32 immediate_data_size, const gles2::StencilFunc& c) { | 1345 uint32 immediate_data_size, const gles2::StencilFunc& c) { |
| 1346 GLenum func = static_cast<GLenum>(c.func); | 1346 GLenum func = static_cast<GLenum>(c.func); |
| 1347 GLint ref = static_cast<GLint>(c.ref); | 1347 GLint ref = static_cast<GLint>(c.ref); |
| 1348 GLuint mask = static_cast<GLuint>(c.mask); | 1348 GLuint mask = static_cast<GLuint>(c.mask); |
| 1349 if (!ValidateGLenumCmpFunction(func)) { | 1349 if (!ValidateGLenumCmpFunction(func)) { |
| 1350 SetGLError(GL_INVALID_VALUE); | 1350 SetGLError(GL_INVALID_ENUM); |
| 1351 return parse_error::kParseNoError; | 1351 return parse_error::kParseNoError; |
| 1352 } | 1352 } |
| 1353 glStencilFunc(func, ref, mask); | 1353 glStencilFunc(func, ref, mask); |
| 1354 return parse_error::kParseNoError; | 1354 return parse_error::kParseNoError; |
| 1355 } | 1355 } |
| 1356 | 1356 |
| 1357 parse_error::ParseError GLES2DecoderImpl::HandleStencilFuncSeparate( | 1357 parse_error::ParseError GLES2DecoderImpl::HandleStencilFuncSeparate( |
| 1358 uint32 immediate_data_size, const gles2::StencilFuncSeparate& c) { | 1358 uint32 immediate_data_size, const gles2::StencilFuncSeparate& c) { |
| 1359 GLenum face = static_cast<GLenum>(c.face); | 1359 GLenum face = static_cast<GLenum>(c.face); |
| 1360 GLenum func = static_cast<GLenum>(c.func); | 1360 GLenum func = static_cast<GLenum>(c.func); |
| 1361 GLint ref = static_cast<GLint>(c.ref); | 1361 GLint ref = static_cast<GLint>(c.ref); |
| 1362 GLuint mask = static_cast<GLuint>(c.mask); | 1362 GLuint mask = static_cast<GLuint>(c.mask); |
| 1363 if (!ValidateGLenumFaceType(face)) { | 1363 if (!ValidateGLenumFaceType(face)) { |
| 1364 SetGLError(GL_INVALID_VALUE); | 1364 SetGLError(GL_INVALID_ENUM); |
| 1365 return parse_error::kParseNoError; | 1365 return parse_error::kParseNoError; |
| 1366 } | 1366 } |
| 1367 if (!ValidateGLenumCmpFunction(func)) { | 1367 if (!ValidateGLenumCmpFunction(func)) { |
| 1368 SetGLError(GL_INVALID_VALUE); | 1368 SetGLError(GL_INVALID_ENUM); |
| 1369 return parse_error::kParseNoError; | 1369 return parse_error::kParseNoError; |
| 1370 } | 1370 } |
| 1371 glStencilFuncSeparate(face, func, ref, mask); | 1371 glStencilFuncSeparate(face, func, ref, mask); |
| 1372 return parse_error::kParseNoError; | 1372 return parse_error::kParseNoError; |
| 1373 } | 1373 } |
| 1374 | 1374 |
| 1375 parse_error::ParseError GLES2DecoderImpl::HandleStencilMask( | 1375 parse_error::ParseError GLES2DecoderImpl::HandleStencilMask( |
| 1376 uint32 immediate_data_size, const gles2::StencilMask& c) { | 1376 uint32 immediate_data_size, const gles2::StencilMask& c) { |
| 1377 GLuint mask = static_cast<GLuint>(c.mask); | 1377 GLuint mask = static_cast<GLuint>(c.mask); |
| 1378 glStencilMask(mask); | 1378 glStencilMask(mask); |
| 1379 return parse_error::kParseNoError; | 1379 return parse_error::kParseNoError; |
| 1380 } | 1380 } |
| 1381 | 1381 |
| 1382 parse_error::ParseError GLES2DecoderImpl::HandleStencilMaskSeparate( | 1382 parse_error::ParseError GLES2DecoderImpl::HandleStencilMaskSeparate( |
| 1383 uint32 immediate_data_size, const gles2::StencilMaskSeparate& c) { | 1383 uint32 immediate_data_size, const gles2::StencilMaskSeparate& c) { |
| 1384 GLenum face = static_cast<GLenum>(c.face); | 1384 GLenum face = static_cast<GLenum>(c.face); |
| 1385 GLuint mask = static_cast<GLuint>(c.mask); | 1385 GLuint mask = static_cast<GLuint>(c.mask); |
| 1386 if (!ValidateGLenumFaceType(face)) { | 1386 if (!ValidateGLenumFaceType(face)) { |
| 1387 SetGLError(GL_INVALID_VALUE); | 1387 SetGLError(GL_INVALID_ENUM); |
| 1388 return parse_error::kParseNoError; | 1388 return parse_error::kParseNoError; |
| 1389 } | 1389 } |
| 1390 glStencilMaskSeparate(face, mask); | 1390 glStencilMaskSeparate(face, mask); |
| 1391 return parse_error::kParseNoError; | 1391 return parse_error::kParseNoError; |
| 1392 } | 1392 } |
| 1393 | 1393 |
| 1394 parse_error::ParseError GLES2DecoderImpl::HandleStencilOp( | 1394 parse_error::ParseError GLES2DecoderImpl::HandleStencilOp( |
| 1395 uint32 immediate_data_size, const gles2::StencilOp& c) { | 1395 uint32 immediate_data_size, const gles2::StencilOp& c) { |
| 1396 GLenum fail = static_cast<GLenum>(c.fail); | 1396 GLenum fail = static_cast<GLenum>(c.fail); |
| 1397 GLenum zfail = static_cast<GLenum>(c.zfail); | 1397 GLenum zfail = static_cast<GLenum>(c.zfail); |
| 1398 GLenum zpass = static_cast<GLenum>(c.zpass); | 1398 GLenum zpass = static_cast<GLenum>(c.zpass); |
| 1399 if (!ValidateGLenumStencilOp(fail)) { | 1399 if (!ValidateGLenumStencilOp(fail)) { |
| 1400 SetGLError(GL_INVALID_VALUE); | 1400 SetGLError(GL_INVALID_ENUM); |
| 1401 return parse_error::kParseNoError; | 1401 return parse_error::kParseNoError; |
| 1402 } | 1402 } |
| 1403 if (!ValidateGLenumStencilOp(zfail)) { | 1403 if (!ValidateGLenumStencilOp(zfail)) { |
| 1404 SetGLError(GL_INVALID_VALUE); | 1404 SetGLError(GL_INVALID_ENUM); |
| 1405 return parse_error::kParseNoError; | 1405 return parse_error::kParseNoError; |
| 1406 } | 1406 } |
| 1407 if (!ValidateGLenumStencilOp(zpass)) { | 1407 if (!ValidateGLenumStencilOp(zpass)) { |
| 1408 SetGLError(GL_INVALID_VALUE); | 1408 SetGLError(GL_INVALID_ENUM); |
| 1409 return parse_error::kParseNoError; | 1409 return parse_error::kParseNoError; |
| 1410 } | 1410 } |
| 1411 glStencilOp(fail, zfail, zpass); | 1411 glStencilOp(fail, zfail, zpass); |
| 1412 return parse_error::kParseNoError; | 1412 return parse_error::kParseNoError; |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 parse_error::ParseError GLES2DecoderImpl::HandleStencilOpSeparate( | 1415 parse_error::ParseError GLES2DecoderImpl::HandleStencilOpSeparate( |
| 1416 uint32 immediate_data_size, const gles2::StencilOpSeparate& c) { | 1416 uint32 immediate_data_size, const gles2::StencilOpSeparate& c) { |
| 1417 GLenum face = static_cast<GLenum>(c.face); | 1417 GLenum face = static_cast<GLenum>(c.face); |
| 1418 GLenum fail = static_cast<GLenum>(c.fail); | 1418 GLenum fail = static_cast<GLenum>(c.fail); |
| 1419 GLenum zfail = static_cast<GLenum>(c.zfail); | 1419 GLenum zfail = static_cast<GLenum>(c.zfail); |
| 1420 GLenum zpass = static_cast<GLenum>(c.zpass); | 1420 GLenum zpass = static_cast<GLenum>(c.zpass); |
| 1421 if (!ValidateGLenumFaceType(face)) { | 1421 if (!ValidateGLenumFaceType(face)) { |
| 1422 SetGLError(GL_INVALID_VALUE); | 1422 SetGLError(GL_INVALID_ENUM); |
| 1423 return parse_error::kParseNoError; | 1423 return parse_error::kParseNoError; |
| 1424 } | 1424 } |
| 1425 if (!ValidateGLenumStencilOp(fail)) { | 1425 if (!ValidateGLenumStencilOp(fail)) { |
| 1426 SetGLError(GL_INVALID_VALUE); | 1426 SetGLError(GL_INVALID_ENUM); |
| 1427 return parse_error::kParseNoError; | 1427 return parse_error::kParseNoError; |
| 1428 } | 1428 } |
| 1429 if (!ValidateGLenumStencilOp(zfail)) { | 1429 if (!ValidateGLenumStencilOp(zfail)) { |
| 1430 SetGLError(GL_INVALID_VALUE); | 1430 SetGLError(GL_INVALID_ENUM); |
| 1431 return parse_error::kParseNoError; | 1431 return parse_error::kParseNoError; |
| 1432 } | 1432 } |
| 1433 if (!ValidateGLenumStencilOp(zpass)) { | 1433 if (!ValidateGLenumStencilOp(zpass)) { |
| 1434 SetGLError(GL_INVALID_VALUE); | 1434 SetGLError(GL_INVALID_ENUM); |
| 1435 return parse_error::kParseNoError; | 1435 return parse_error::kParseNoError; |
| 1436 } | 1436 } |
| 1437 glStencilOpSeparate(face, fail, zfail, zpass); | 1437 glStencilOpSeparate(face, fail, zfail, zpass); |
| 1438 return parse_error::kParseNoError; | 1438 return parse_error::kParseNoError; |
| 1439 } | 1439 } |
| 1440 | 1440 |
| 1441 parse_error::ParseError GLES2DecoderImpl::HandleTexParameterf( | 1441 parse_error::ParseError GLES2DecoderImpl::HandleTexParameterf( |
| 1442 uint32 immediate_data_size, const gles2::TexParameterf& c) { | 1442 uint32 immediate_data_size, const gles2::TexParameterf& c) { |
| 1443 GLenum target = static_cast<GLenum>(c.target); | 1443 GLenum target = static_cast<GLenum>(c.target); |
| 1444 GLenum pname = static_cast<GLenum>(c.pname); | 1444 GLenum pname = static_cast<GLenum>(c.pname); |
| 1445 GLfloat param = static_cast<GLfloat>(c.param); | 1445 GLfloat param = static_cast<GLfloat>(c.param); |
| 1446 if (!ValidateGLenumTextureBindTarget(target)) { | 1446 if (!ValidateGLenumTextureBindTarget(target)) { |
| 1447 SetGLError(GL_INVALID_VALUE); | 1447 SetGLError(GL_INVALID_ENUM); |
| 1448 return parse_error::kParseNoError; | 1448 return parse_error::kParseNoError; |
| 1449 } | 1449 } |
| 1450 if (!ValidateGLenumTextureParameter(pname)) { | 1450 if (!ValidateGLenumTextureParameter(pname)) { |
| 1451 SetGLError(GL_INVALID_VALUE); | 1451 SetGLError(GL_INVALID_ENUM); |
| 1452 return parse_error::kParseNoError; | 1452 return parse_error::kParseNoError; |
| 1453 } | 1453 } |
| 1454 glTexParameterf(target, pname, param); | 1454 glTexParameterf(target, pname, param); |
| 1455 return parse_error::kParseNoError; | 1455 return parse_error::kParseNoError; |
| 1456 } | 1456 } |
| 1457 | 1457 |
| 1458 parse_error::ParseError GLES2DecoderImpl::HandleTexParameterfv( | 1458 parse_error::ParseError GLES2DecoderImpl::HandleTexParameterfv( |
| 1459 uint32 immediate_data_size, const gles2::TexParameterfv& c) { | 1459 uint32 immediate_data_size, const gles2::TexParameterfv& c) { |
| 1460 GLenum target = static_cast<GLenum>(c.target); | 1460 GLenum target = static_cast<GLenum>(c.target); |
| 1461 GLenum pname = static_cast<GLenum>(c.pname); | 1461 GLenum pname = static_cast<GLenum>(c.pname); |
| 1462 uint32 data_size = | 1462 uint32 data_size = |
| 1463 ComputeImmediateDataSize(immediate_data_size, 1, sizeof(GLfloat), 1); | 1463 ComputeImmediateDataSize(immediate_data_size, 1, sizeof(GLfloat), 1); |
| 1464 const GLfloat* params = GetSharedMemoryAs<const GLfloat*>( | 1464 const GLfloat* params = GetSharedMemoryAs<const GLfloat*>( |
| 1465 c.params_shm_id, c.params_shm_offset, data_size); | 1465 c.params_shm_id, c.params_shm_offset, data_size); |
| 1466 if (!ValidateGLenumTextureBindTarget(target)) { | 1466 if (!ValidateGLenumTextureBindTarget(target)) { |
| 1467 SetGLError(GL_INVALID_VALUE); | 1467 SetGLError(GL_INVALID_ENUM); |
| 1468 return parse_error::kParseNoError; | 1468 return parse_error::kParseNoError; |
| 1469 } | 1469 } |
| 1470 if (!ValidateGLenumTextureParameter(pname)) { | 1470 if (!ValidateGLenumTextureParameter(pname)) { |
| 1471 SetGLError(GL_INVALID_VALUE); | 1471 SetGLError(GL_INVALID_ENUM); |
| 1472 return parse_error::kParseNoError; | 1472 return parse_error::kParseNoError; |
| 1473 } | 1473 } |
| 1474 if (params == NULL) { | 1474 if (params == NULL) { |
| 1475 return parse_error::kParseOutOfBounds; | 1475 return parse_error::kParseOutOfBounds; |
| 1476 } | 1476 } |
| 1477 glTexParameterfv(target, pname, params); | 1477 glTexParameterfv(target, pname, params); |
| 1478 return parse_error::kParseNoError; | 1478 return parse_error::kParseNoError; |
| 1479 } | 1479 } |
| 1480 | 1480 |
| 1481 parse_error::ParseError GLES2DecoderImpl::HandleTexParameterfvImmediate( | 1481 parse_error::ParseError GLES2DecoderImpl::HandleTexParameterfvImmediate( |
| 1482 uint32 immediate_data_size, const gles2::TexParameterfvImmediate& c) { | 1482 uint32 immediate_data_size, const gles2::TexParameterfvImmediate& c) { |
| 1483 GLenum target = static_cast<GLenum>(c.target); | 1483 GLenum target = static_cast<GLenum>(c.target); |
| 1484 GLenum pname = static_cast<GLenum>(c.pname); | 1484 GLenum pname = static_cast<GLenum>(c.pname); |
| 1485 uint32 data_size = | 1485 uint32 data_size = |
| 1486 ComputeImmediateDataSize(immediate_data_size, 1, sizeof(GLfloat), 1); | 1486 ComputeImmediateDataSize(immediate_data_size, 1, sizeof(GLfloat), 1); |
| 1487 const GLfloat* params = GetImmediateDataAs<const GLfloat*>( | 1487 const GLfloat* params = GetImmediateDataAs<const GLfloat*>( |
| 1488 c, data_size, immediate_data_size); | 1488 c, data_size, immediate_data_size); |
| 1489 if (!ValidateGLenumTextureBindTarget(target)) { | 1489 if (!ValidateGLenumTextureBindTarget(target)) { |
| 1490 SetGLError(GL_INVALID_VALUE); | 1490 SetGLError(GL_INVALID_ENUM); |
| 1491 return parse_error::kParseNoError; | 1491 return parse_error::kParseNoError; |
| 1492 } | 1492 } |
| 1493 if (!ValidateGLenumTextureParameter(pname)) { | 1493 if (!ValidateGLenumTextureParameter(pname)) { |
| 1494 SetGLError(GL_INVALID_VALUE); | 1494 SetGLError(GL_INVALID_ENUM); |
| 1495 return parse_error::kParseNoError; | 1495 return parse_error::kParseNoError; |
| 1496 } | 1496 } |
| 1497 if (params == NULL) { | 1497 if (params == NULL) { |
| 1498 return parse_error::kParseOutOfBounds; | 1498 return parse_error::kParseOutOfBounds; |
| 1499 } | 1499 } |
| 1500 glTexParameterfv(target, pname, params); | 1500 glTexParameterfv(target, pname, params); |
| 1501 return parse_error::kParseNoError; | 1501 return parse_error::kParseNoError; |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 parse_error::ParseError GLES2DecoderImpl::HandleTexParameteri( | 1504 parse_error::ParseError GLES2DecoderImpl::HandleTexParameteri( |
| 1505 uint32 immediate_data_size, const gles2::TexParameteri& c) { | 1505 uint32 immediate_data_size, const gles2::TexParameteri& c) { |
| 1506 GLenum target = static_cast<GLenum>(c.target); | 1506 GLenum target = static_cast<GLenum>(c.target); |
| 1507 GLenum pname = static_cast<GLenum>(c.pname); | 1507 GLenum pname = static_cast<GLenum>(c.pname); |
| 1508 GLint param = static_cast<GLint>(c.param); | 1508 GLint param = static_cast<GLint>(c.param); |
| 1509 if (!ValidateGLenumTextureBindTarget(target)) { | 1509 if (!ValidateGLenumTextureBindTarget(target)) { |
| 1510 SetGLError(GL_INVALID_VALUE); | 1510 SetGLError(GL_INVALID_ENUM); |
| 1511 return parse_error::kParseNoError; | 1511 return parse_error::kParseNoError; |
| 1512 } | 1512 } |
| 1513 if (!ValidateGLenumTextureParameter(pname)) { | 1513 if (!ValidateGLenumTextureParameter(pname)) { |
| 1514 SetGLError(GL_INVALID_VALUE); | 1514 SetGLError(GL_INVALID_ENUM); |
| 1515 return parse_error::kParseNoError; | 1515 return parse_error::kParseNoError; |
| 1516 } | 1516 } |
| 1517 glTexParameteri(target, pname, param); | 1517 glTexParameteri(target, pname, param); |
| 1518 return parse_error::kParseNoError; | 1518 return parse_error::kParseNoError; |
| 1519 } | 1519 } |
| 1520 | 1520 |
| 1521 parse_error::ParseError GLES2DecoderImpl::HandleTexParameteriv( | 1521 parse_error::ParseError GLES2DecoderImpl::HandleTexParameteriv( |
| 1522 uint32 immediate_data_size, const gles2::TexParameteriv& c) { | 1522 uint32 immediate_data_size, const gles2::TexParameteriv& c) { |
| 1523 GLenum target = static_cast<GLenum>(c.target); | 1523 GLenum target = static_cast<GLenum>(c.target); |
| 1524 GLenum pname = static_cast<GLenum>(c.pname); | 1524 GLenum pname = static_cast<GLenum>(c.pname); |
| 1525 uint32 data_size = | 1525 uint32 data_size = |
| 1526 ComputeImmediateDataSize(immediate_data_size, 1, sizeof(GLint), 1); | 1526 ComputeImmediateDataSize(immediate_data_size, 1, sizeof(GLint), 1); |
| 1527 const GLint* params = GetSharedMemoryAs<const GLint*>( | 1527 const GLint* params = GetSharedMemoryAs<const GLint*>( |
| 1528 c.params_shm_id, c.params_shm_offset, data_size); | 1528 c.params_shm_id, c.params_shm_offset, data_size); |
| 1529 if (!ValidateGLenumTextureBindTarget(target)) { | 1529 if (!ValidateGLenumTextureBindTarget(target)) { |
| 1530 SetGLError(GL_INVALID_VALUE); | 1530 SetGLError(GL_INVALID_ENUM); |
| 1531 return parse_error::kParseNoError; | 1531 return parse_error::kParseNoError; |
| 1532 } | 1532 } |
| 1533 if (!ValidateGLenumTextureParameter(pname)) { | 1533 if (!ValidateGLenumTextureParameter(pname)) { |
| 1534 SetGLError(GL_INVALID_VALUE); | 1534 SetGLError(GL_INVALID_ENUM); |
| 1535 return parse_error::kParseNoError; | 1535 return parse_error::kParseNoError; |
| 1536 } | 1536 } |
| 1537 if (params == NULL) { | 1537 if (params == NULL) { |
| 1538 return parse_error::kParseOutOfBounds; | 1538 return parse_error::kParseOutOfBounds; |
| 1539 } | 1539 } |
| 1540 glTexParameteriv(target, pname, params); | 1540 glTexParameteriv(target, pname, params); |
| 1541 return parse_error::kParseNoError; | 1541 return parse_error::kParseNoError; |
| 1542 } | 1542 } |
| 1543 | 1543 |
| 1544 parse_error::ParseError GLES2DecoderImpl::HandleTexParameterivImmediate( | 1544 parse_error::ParseError GLES2DecoderImpl::HandleTexParameterivImmediate( |
| 1545 uint32 immediate_data_size, const gles2::TexParameterivImmediate& c) { | 1545 uint32 immediate_data_size, const gles2::TexParameterivImmediate& c) { |
| 1546 GLenum target = static_cast<GLenum>(c.target); | 1546 GLenum target = static_cast<GLenum>(c.target); |
| 1547 GLenum pname = static_cast<GLenum>(c.pname); | 1547 GLenum pname = static_cast<GLenum>(c.pname); |
| 1548 uint32 data_size = | 1548 uint32 data_size = |
| 1549 ComputeImmediateDataSize(immediate_data_size, 1, sizeof(GLint), 1); | 1549 ComputeImmediateDataSize(immediate_data_size, 1, sizeof(GLint), 1); |
| 1550 const GLint* params = GetImmediateDataAs<const GLint*>( | 1550 const GLint* params = GetImmediateDataAs<const GLint*>( |
| 1551 c, data_size, immediate_data_size); | 1551 c, data_size, immediate_data_size); |
| 1552 if (!ValidateGLenumTextureBindTarget(target)) { | 1552 if (!ValidateGLenumTextureBindTarget(target)) { |
| 1553 SetGLError(GL_INVALID_VALUE); | 1553 SetGLError(GL_INVALID_ENUM); |
| 1554 return parse_error::kParseNoError; | 1554 return parse_error::kParseNoError; |
| 1555 } | 1555 } |
| 1556 if (!ValidateGLenumTextureParameter(pname)) { | 1556 if (!ValidateGLenumTextureParameter(pname)) { |
| 1557 SetGLError(GL_INVALID_VALUE); | 1557 SetGLError(GL_INVALID_ENUM); |
| 1558 return parse_error::kParseNoError; | 1558 return parse_error::kParseNoError; |
| 1559 } | 1559 } |
| 1560 if (params == NULL) { | 1560 if (params == NULL) { |
| 1561 return parse_error::kParseOutOfBounds; | 1561 return parse_error::kParseOutOfBounds; |
| 1562 } | 1562 } |
| 1563 glTexParameteriv(target, pname, params); | 1563 glTexParameteriv(target, pname, params); |
| 1564 return parse_error::kParseNoError; | 1564 return parse_error::kParseNoError; |
| 1565 } | 1565 } |
| 1566 | 1566 |
| 1567 parse_error::ParseError GLES2DecoderImpl::HandleTexSubImage2D( | 1567 parse_error::ParseError GLES2DecoderImpl::HandleTexSubImage2D( |
| 1568 uint32 immediate_data_size, const gles2::TexSubImage2D& c) { | 1568 uint32 immediate_data_size, const gles2::TexSubImage2D& c) { |
| 1569 GLenum target = static_cast<GLenum>(c.target); | 1569 GLenum target = static_cast<GLenum>(c.target); |
| 1570 GLint level = static_cast<GLint>(c.level); | 1570 GLint level = static_cast<GLint>(c.level); |
| 1571 GLint xoffset = static_cast<GLint>(c.xoffset); | 1571 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 1572 GLint yoffset = static_cast<GLint>(c.yoffset); | 1572 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 1573 GLsizei width = static_cast<GLsizei>(c.width); | 1573 GLsizei width = static_cast<GLsizei>(c.width); |
| 1574 GLsizei height = static_cast<GLsizei>(c.height); | 1574 GLsizei height = static_cast<GLsizei>(c.height); |
| 1575 GLenum format = static_cast<GLenum>(c.format); | 1575 GLenum format = static_cast<GLenum>(c.format); |
| 1576 GLenum type = static_cast<GLenum>(c.type); | 1576 GLenum type = static_cast<GLenum>(c.type); |
| 1577 uint32 data_size = GLES2Util::ComputeImageDataSize( | 1577 uint32 data_size = GLES2Util::ComputeImageDataSize( |
| 1578 width, height, format, type, unpack_alignment_); | 1578 width, height, format, type, unpack_alignment_); |
| 1579 const void* pixels = GetSharedMemoryAs<const void*>( | 1579 const void* pixels = GetSharedMemoryAs<const void*>( |
| 1580 c.pixels_shm_id, c.pixels_shm_offset, data_size); | 1580 c.pixels_shm_id, c.pixels_shm_offset, data_size); |
| 1581 if (!ValidateGLenumTextureTarget(target)) { | 1581 if (!ValidateGLenumTextureTarget(target)) { |
| 1582 SetGLError(GL_INVALID_VALUE); | 1582 SetGLError(GL_INVALID_ENUM); |
| 1583 return parse_error::kParseNoError; | 1583 return parse_error::kParseNoError; |
| 1584 } | 1584 } |
| 1585 if (!ValidateGLenumTextureFormat(format)) { | 1585 if (!ValidateGLenumTextureFormat(format)) { |
| 1586 SetGLError(GL_INVALID_VALUE); | 1586 SetGLError(GL_INVALID_ENUM); |
| 1587 return parse_error::kParseNoError; | 1587 return parse_error::kParseNoError; |
| 1588 } | 1588 } |
| 1589 if (!ValidateGLenumPixelType(type)) { | 1589 if (!ValidateGLenumPixelType(type)) { |
| 1590 SetGLError(GL_INVALID_VALUE); | 1590 SetGLError(GL_INVALID_ENUM); |
| 1591 return parse_error::kParseNoError; | 1591 return parse_error::kParseNoError; |
| 1592 } | 1592 } |
| 1593 if (pixels == NULL) { | 1593 if (pixels == NULL) { |
| 1594 return parse_error::kParseOutOfBounds; | 1594 return parse_error::kParseOutOfBounds; |
| 1595 } | 1595 } |
| 1596 glTexSubImage2D( | 1596 glTexSubImage2D( |
| 1597 target, level, xoffset, yoffset, width, height, format, type, pixels); | 1597 target, level, xoffset, yoffset, width, height, format, type, pixels); |
| 1598 return parse_error::kParseNoError; | 1598 return parse_error::kParseNoError; |
| 1599 } | 1599 } |
| 1600 | 1600 |
| 1601 parse_error::ParseError GLES2DecoderImpl::HandleTexSubImage2DImmediate( | 1601 parse_error::ParseError GLES2DecoderImpl::HandleTexSubImage2DImmediate( |
| 1602 uint32 immediate_data_size, const gles2::TexSubImage2DImmediate& c) { | 1602 uint32 immediate_data_size, const gles2::TexSubImage2DImmediate& c) { |
| 1603 GLenum target = static_cast<GLenum>(c.target); | 1603 GLenum target = static_cast<GLenum>(c.target); |
| 1604 GLint level = static_cast<GLint>(c.level); | 1604 GLint level = static_cast<GLint>(c.level); |
| 1605 GLint xoffset = static_cast<GLint>(c.xoffset); | 1605 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 1606 GLint yoffset = static_cast<GLint>(c.yoffset); | 1606 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 1607 GLsizei width = static_cast<GLsizei>(c.width); | 1607 GLsizei width = static_cast<GLsizei>(c.width); |
| 1608 GLsizei height = static_cast<GLsizei>(c.height); | 1608 GLsizei height = static_cast<GLsizei>(c.height); |
| 1609 GLenum format = static_cast<GLenum>(c.format); | 1609 GLenum format = static_cast<GLenum>(c.format); |
| 1610 GLenum type = static_cast<GLenum>(c.type); | 1610 GLenum type = static_cast<GLenum>(c.type); |
| 1611 uint32 data_size = GLES2Util::ComputeImageDataSize( | 1611 uint32 data_size = GLES2Util::ComputeImageDataSize( |
| 1612 width, height, format, type, unpack_alignment_); | 1612 width, height, format, type, unpack_alignment_); |
| 1613 const void* pixels = GetImmediateDataAs<const void*>( | 1613 const void* pixels = GetImmediateDataAs<const void*>( |
| 1614 c, data_size, immediate_data_size); | 1614 c, data_size, immediate_data_size); |
| 1615 if (!ValidateGLenumTextureTarget(target)) { | 1615 if (!ValidateGLenumTextureTarget(target)) { |
| 1616 SetGLError(GL_INVALID_VALUE); | 1616 SetGLError(GL_INVALID_ENUM); |
| 1617 return parse_error::kParseNoError; | 1617 return parse_error::kParseNoError; |
| 1618 } | 1618 } |
| 1619 if (!ValidateGLenumTextureFormat(format)) { | 1619 if (!ValidateGLenumTextureFormat(format)) { |
| 1620 SetGLError(GL_INVALID_VALUE); | 1620 SetGLError(GL_INVALID_ENUM); |
| 1621 return parse_error::kParseNoError; | 1621 return parse_error::kParseNoError; |
| 1622 } | 1622 } |
| 1623 if (!ValidateGLenumPixelType(type)) { | 1623 if (!ValidateGLenumPixelType(type)) { |
| 1624 SetGLError(GL_INVALID_VALUE); | 1624 SetGLError(GL_INVALID_ENUM); |
| 1625 return parse_error::kParseNoError; | 1625 return parse_error::kParseNoError; |
| 1626 } | 1626 } |
| 1627 if (pixels == NULL) { | 1627 if (pixels == NULL) { |
| 1628 return parse_error::kParseOutOfBounds; | 1628 return parse_error::kParseOutOfBounds; |
| 1629 } | 1629 } |
| 1630 glTexSubImage2D( | 1630 glTexSubImage2D( |
| 1631 target, level, xoffset, yoffset, width, height, format, type, pixels); | 1631 target, level, xoffset, yoffset, width, height, format, type, pixels); |
| 1632 return parse_error::kParseNoError; | 1632 return parse_error::kParseNoError; |
| 1633 } | 1633 } |
| 1634 | 1634 |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2225 glViewport(x, y, width, height); | 2225 glViewport(x, y, width, height); |
| 2226 return parse_error::kParseNoError; | 2226 return parse_error::kParseNoError; |
| 2227 } | 2227 } |
| 2228 | 2228 |
| 2229 parse_error::ParseError GLES2DecoderImpl::HandleSwapBuffers( | 2229 parse_error::ParseError GLES2DecoderImpl::HandleSwapBuffers( |
| 2230 uint32 immediate_data_size, const gles2::SwapBuffers& c) { | 2230 uint32 immediate_data_size, const gles2::SwapBuffers& c) { |
| 2231 DoSwapBuffers(); | 2231 DoSwapBuffers(); |
| 2232 return parse_error::kParseNoError; | 2232 return parse_error::kParseNoError; |
| 2233 } | 2233 } |
| 2234 | 2234 |
| OLD | NEW |