| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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. DO NOT EDIT! | 5 // This file is auto-generated. DO NOT EDIT! |
| 6 | 6 |
| 7 // It is included by gles2_cmd_decoder.cc | 7 // It is included by gles2_cmd_decoder.cc |
| 8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ | 8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ |
| 9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ | 9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ |
| 10 | 10 |
| 11 error::Error GLES2DecoderImpl::HandleActiveTexture( | 11 error::Error GLES2DecoderImpl::HandleActiveTexture( |
| 12 uint32 immediate_data_size, const gles2::ActiveTexture& c) { | 12 uint32 immediate_data_size, const gles2::ActiveTexture& c) { |
| 13 GLenum texture = static_cast<GLenum>(c.texture); | 13 GLenum texture = static_cast<GLenum>(c.texture); |
| 14 DoActiveTexture(texture); | 14 DoActiveTexture(texture); |
| 15 return error::kNoError; | 15 return error::kNoError; |
| 16 } | 16 } |
| 17 | 17 |
| 18 error::Error GLES2DecoderImpl::HandleAttachShader( | 18 error::Error GLES2DecoderImpl::HandleAttachShader( |
| 19 uint32 immediate_data_size, const gles2::AttachShader& c) { | 19 uint32 immediate_data_size, const gles2::AttachShader& c) { |
| 20 GLuint program = c.program; | 20 GLuint program = c.program; |
| 21 GLuint shader = c.shader; | 21 GLuint shader = c.shader; |
| 22 DoAttachShader(program, shader); | 22 DoAttachShader(program, shader); |
| 23 return error::kNoError; | 23 return error::kNoError; |
| 24 } | 24 } |
| 25 | 25 |
| 26 error::Error GLES2DecoderImpl::HandleBindBuffer( | 26 error::Error GLES2DecoderImpl::HandleBindBuffer( |
| 27 uint32 immediate_data_size, const gles2::BindBuffer& c) { | 27 uint32 immediate_data_size, const gles2::BindBuffer& c) { |
| 28 GLenum target = static_cast<GLenum>(c.target); | 28 GLenum target = static_cast<GLenum>(c.target); |
| 29 GLuint buffer = c.buffer; | 29 GLuint buffer = c.buffer; |
| 30 if (!ValidateGLenumBufferTarget(target)) { | 30 if (!validators_->buffer_target.IsValid(target)) { |
| 31 SetGLError(GL_INVALID_ENUM, "glBindBuffer: target GL_INVALID_ENUM"); | 31 SetGLError(GL_INVALID_ENUM, "glBindBuffer: target GL_INVALID_ENUM"); |
| 32 return error::kNoError; | 32 return error::kNoError; |
| 33 } | 33 } |
| 34 DoBindBuffer(target, buffer); | 34 DoBindBuffer(target, buffer); |
| 35 return error::kNoError; | 35 return error::kNoError; |
| 36 } | 36 } |
| 37 | 37 |
| 38 error::Error GLES2DecoderImpl::HandleBindFramebuffer( | 38 error::Error GLES2DecoderImpl::HandleBindFramebuffer( |
| 39 uint32 immediate_data_size, const gles2::BindFramebuffer& c) { | 39 uint32 immediate_data_size, const gles2::BindFramebuffer& c) { |
| 40 GLenum target = static_cast<GLenum>(c.target); | 40 GLenum target = static_cast<GLenum>(c.target); |
| 41 GLuint framebuffer = c.framebuffer; | 41 GLuint framebuffer = c.framebuffer; |
| 42 if (!ValidateGLenumFrameBufferTarget(target)) { | 42 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 43 SetGLError(GL_INVALID_ENUM, "glBindFramebuffer: target GL_INVALID_ENUM"); | 43 SetGLError(GL_INVALID_ENUM, "glBindFramebuffer: target GL_INVALID_ENUM"); |
| 44 return error::kNoError; | 44 return error::kNoError; |
| 45 } | 45 } |
| 46 DoBindFramebuffer(target, framebuffer); | 46 DoBindFramebuffer(target, framebuffer); |
| 47 return error::kNoError; | 47 return error::kNoError; |
| 48 } | 48 } |
| 49 | 49 |
| 50 error::Error GLES2DecoderImpl::HandleBindRenderbuffer( | 50 error::Error GLES2DecoderImpl::HandleBindRenderbuffer( |
| 51 uint32 immediate_data_size, const gles2::BindRenderbuffer& c) { | 51 uint32 immediate_data_size, const gles2::BindRenderbuffer& c) { |
| 52 GLenum target = static_cast<GLenum>(c.target); | 52 GLenum target = static_cast<GLenum>(c.target); |
| 53 GLuint renderbuffer = c.renderbuffer; | 53 GLuint renderbuffer = c.renderbuffer; |
| 54 if (!ValidateGLenumRenderBufferTarget(target)) { | 54 if (!validators_->render_buffer_target.IsValid(target)) { |
| 55 SetGLError(GL_INVALID_ENUM, "glBindRenderbuffer: target GL_INVALID_ENUM"); | 55 SetGLError(GL_INVALID_ENUM, "glBindRenderbuffer: target GL_INVALID_ENUM"); |
| 56 return error::kNoError; | 56 return error::kNoError; |
| 57 } | 57 } |
| 58 DoBindRenderbuffer(target, renderbuffer); | 58 DoBindRenderbuffer(target, renderbuffer); |
| 59 return error::kNoError; | 59 return error::kNoError; |
| 60 } | 60 } |
| 61 | 61 |
| 62 error::Error GLES2DecoderImpl::HandleBindTexture( | 62 error::Error GLES2DecoderImpl::HandleBindTexture( |
| 63 uint32 immediate_data_size, const gles2::BindTexture& c) { | 63 uint32 immediate_data_size, const gles2::BindTexture& c) { |
| 64 GLenum target = static_cast<GLenum>(c.target); | 64 GLenum target = static_cast<GLenum>(c.target); |
| 65 GLuint texture = c.texture; | 65 GLuint texture = c.texture; |
| 66 if (!ValidateGLenumTextureBindTarget(target)) { | 66 if (!validators_->texture_bind_target.IsValid(target)) { |
| 67 SetGLError(GL_INVALID_ENUM, "glBindTexture: target GL_INVALID_ENUM"); | 67 SetGLError(GL_INVALID_ENUM, "glBindTexture: target GL_INVALID_ENUM"); |
| 68 return error::kNoError; | 68 return error::kNoError; |
| 69 } | 69 } |
| 70 DoBindTexture(target, texture); | 70 DoBindTexture(target, texture); |
| 71 return error::kNoError; | 71 return error::kNoError; |
| 72 } | 72 } |
| 73 | 73 |
| 74 error::Error GLES2DecoderImpl::HandleBlendColor( | 74 error::Error GLES2DecoderImpl::HandleBlendColor( |
| 75 uint32 immediate_data_size, const gles2::BlendColor& c) { | 75 uint32 immediate_data_size, const gles2::BlendColor& c) { |
| 76 GLclampf red = static_cast<GLclampf>(c.red); | 76 GLclampf red = static_cast<GLclampf>(c.red); |
| 77 GLclampf green = static_cast<GLclampf>(c.green); | 77 GLclampf green = static_cast<GLclampf>(c.green); |
| 78 GLclampf blue = static_cast<GLclampf>(c.blue); | 78 GLclampf blue = static_cast<GLclampf>(c.blue); |
| 79 GLclampf alpha = static_cast<GLclampf>(c.alpha); | 79 GLclampf alpha = static_cast<GLclampf>(c.alpha); |
| 80 glBlendColor(red, green, blue, alpha); | 80 glBlendColor(red, green, blue, alpha); |
| 81 return error::kNoError; | 81 return error::kNoError; |
| 82 } | 82 } |
| 83 | 83 |
| 84 error::Error GLES2DecoderImpl::HandleBlendEquation( | 84 error::Error GLES2DecoderImpl::HandleBlendEquation( |
| 85 uint32 immediate_data_size, const gles2::BlendEquation& c) { | 85 uint32 immediate_data_size, const gles2::BlendEquation& c) { |
| 86 GLenum mode = static_cast<GLenum>(c.mode); | 86 GLenum mode = static_cast<GLenum>(c.mode); |
| 87 if (!ValidateGLenumEquation(mode)) { | 87 if (!validators_->equation.IsValid(mode)) { |
| 88 SetGLError(GL_INVALID_ENUM, "glBlendEquation: mode GL_INVALID_ENUM"); | 88 SetGLError(GL_INVALID_ENUM, "glBlendEquation: mode GL_INVALID_ENUM"); |
| 89 return error::kNoError; | 89 return error::kNoError; |
| 90 } | 90 } |
| 91 glBlendEquation(mode); | 91 glBlendEquation(mode); |
| 92 return error::kNoError; | 92 return error::kNoError; |
| 93 } | 93 } |
| 94 | 94 |
| 95 error::Error GLES2DecoderImpl::HandleBlendEquationSeparate( | 95 error::Error GLES2DecoderImpl::HandleBlendEquationSeparate( |
| 96 uint32 immediate_data_size, const gles2::BlendEquationSeparate& c) { | 96 uint32 immediate_data_size, const gles2::BlendEquationSeparate& c) { |
| 97 GLenum modeRGB = static_cast<GLenum>(c.modeRGB); | 97 GLenum modeRGB = static_cast<GLenum>(c.modeRGB); |
| 98 GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha); | 98 GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha); |
| 99 if (!ValidateGLenumEquation(modeRGB)) { | 99 if (!validators_->equation.IsValid(modeRGB)) { |
| 100 SetGLError( | 100 SetGLError( |
| 101 GL_INVALID_ENUM, "glBlendEquationSeparate: modeRGB GL_INVALID_ENUM"); | 101 GL_INVALID_ENUM, "glBlendEquationSeparate: modeRGB GL_INVALID_ENUM"); |
| 102 return error::kNoError; | 102 return error::kNoError; |
| 103 } | 103 } |
| 104 if (!ValidateGLenumEquation(modeAlpha)) { | 104 if (!validators_->equation.IsValid(modeAlpha)) { |
| 105 SetGLError( | 105 SetGLError( |
| 106 GL_INVALID_ENUM, "glBlendEquationSeparate: modeAlpha GL_INVALID_ENUM"); | 106 GL_INVALID_ENUM, "glBlendEquationSeparate: modeAlpha GL_INVALID_ENUM"); |
| 107 return error::kNoError; | 107 return error::kNoError; |
| 108 } | 108 } |
| 109 glBlendEquationSeparate(modeRGB, modeAlpha); | 109 glBlendEquationSeparate(modeRGB, modeAlpha); |
| 110 return error::kNoError; | 110 return error::kNoError; |
| 111 } | 111 } |
| 112 | 112 |
| 113 error::Error GLES2DecoderImpl::HandleBlendFunc( | 113 error::Error GLES2DecoderImpl::HandleBlendFunc( |
| 114 uint32 immediate_data_size, const gles2::BlendFunc& c) { | 114 uint32 immediate_data_size, const gles2::BlendFunc& c) { |
| 115 GLenum sfactor = static_cast<GLenum>(c.sfactor); | 115 GLenum sfactor = static_cast<GLenum>(c.sfactor); |
| 116 GLenum dfactor = static_cast<GLenum>(c.dfactor); | 116 GLenum dfactor = static_cast<GLenum>(c.dfactor); |
| 117 if (!ValidateGLenumSrcBlendFactor(sfactor)) { | 117 if (!validators_->src_blend_factor.IsValid(sfactor)) { |
| 118 SetGLError(GL_INVALID_ENUM, "glBlendFunc: sfactor GL_INVALID_ENUM"); | 118 SetGLError(GL_INVALID_ENUM, "glBlendFunc: sfactor GL_INVALID_ENUM"); |
| 119 return error::kNoError; | 119 return error::kNoError; |
| 120 } | 120 } |
| 121 if (!ValidateGLenumDstBlendFactor(dfactor)) { | 121 if (!validators_->dst_blend_factor.IsValid(dfactor)) { |
| 122 SetGLError(GL_INVALID_ENUM, "glBlendFunc: dfactor GL_INVALID_ENUM"); | 122 SetGLError(GL_INVALID_ENUM, "glBlendFunc: dfactor GL_INVALID_ENUM"); |
| 123 return error::kNoError; | 123 return error::kNoError; |
| 124 } | 124 } |
| 125 glBlendFunc(sfactor, dfactor); | 125 glBlendFunc(sfactor, dfactor); |
| 126 return error::kNoError; | 126 return error::kNoError; |
| 127 } | 127 } |
| 128 | 128 |
| 129 error::Error GLES2DecoderImpl::HandleBlendFuncSeparate( | 129 error::Error GLES2DecoderImpl::HandleBlendFuncSeparate( |
| 130 uint32 immediate_data_size, const gles2::BlendFuncSeparate& c) { | 130 uint32 immediate_data_size, const gles2::BlendFuncSeparate& c) { |
| 131 GLenum srcRGB = static_cast<GLenum>(c.srcRGB); | 131 GLenum srcRGB = static_cast<GLenum>(c.srcRGB); |
| 132 GLenum dstRGB = static_cast<GLenum>(c.dstRGB); | 132 GLenum dstRGB = static_cast<GLenum>(c.dstRGB); |
| 133 GLenum srcAlpha = static_cast<GLenum>(c.srcAlpha); | 133 GLenum srcAlpha = static_cast<GLenum>(c.srcAlpha); |
| 134 GLenum dstAlpha = static_cast<GLenum>(c.dstAlpha); | 134 GLenum dstAlpha = static_cast<GLenum>(c.dstAlpha); |
| 135 if (!ValidateGLenumSrcBlendFactor(srcRGB)) { | 135 if (!validators_->src_blend_factor.IsValid(srcRGB)) { |
| 136 SetGLError(GL_INVALID_ENUM, "glBlendFuncSeparate: srcRGB GL_INVALID_ENUM"); | 136 SetGLError(GL_INVALID_ENUM, "glBlendFuncSeparate: srcRGB GL_INVALID_ENUM"); |
| 137 return error::kNoError; | 137 return error::kNoError; |
| 138 } | 138 } |
| 139 if (!ValidateGLenumDstBlendFactor(dstRGB)) { | 139 if (!validators_->dst_blend_factor.IsValid(dstRGB)) { |
| 140 SetGLError(GL_INVALID_ENUM, "glBlendFuncSeparate: dstRGB GL_INVALID_ENUM"); | 140 SetGLError(GL_INVALID_ENUM, "glBlendFuncSeparate: dstRGB GL_INVALID_ENUM"); |
| 141 return error::kNoError; | 141 return error::kNoError; |
| 142 } | 142 } |
| 143 if (!ValidateGLenumSrcBlendFactor(srcAlpha)) { | 143 if (!validators_->src_blend_factor.IsValid(srcAlpha)) { |
| 144 SetGLError( | 144 SetGLError( |
| 145 GL_INVALID_ENUM, "glBlendFuncSeparate: srcAlpha GL_INVALID_ENUM"); | 145 GL_INVALID_ENUM, "glBlendFuncSeparate: srcAlpha GL_INVALID_ENUM"); |
| 146 return error::kNoError; | 146 return error::kNoError; |
| 147 } | 147 } |
| 148 if (!ValidateGLenumDstBlendFactor(dstAlpha)) { | 148 if (!validators_->dst_blend_factor.IsValid(dstAlpha)) { |
| 149 SetGLError( | 149 SetGLError( |
| 150 GL_INVALID_ENUM, "glBlendFuncSeparate: dstAlpha GL_INVALID_ENUM"); | 150 GL_INVALID_ENUM, "glBlendFuncSeparate: dstAlpha GL_INVALID_ENUM"); |
| 151 return error::kNoError; | 151 return error::kNoError; |
| 152 } | 152 } |
| 153 glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); | 153 glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); |
| 154 return error::kNoError; | 154 return error::kNoError; |
| 155 } | 155 } |
| 156 | 156 |
| 157 error::Error GLES2DecoderImpl::HandleBufferSubData( | 157 error::Error GLES2DecoderImpl::HandleBufferSubData( |
| 158 uint32 immediate_data_size, const gles2::BufferSubData& c) { | 158 uint32 immediate_data_size, const gles2::BufferSubData& c) { |
| 159 GLenum target = static_cast<GLenum>(c.target); | 159 GLenum target = static_cast<GLenum>(c.target); |
| 160 GLintptr offset = static_cast<GLintptr>(c.offset); | 160 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 161 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 161 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 162 uint32 data_size = size; | 162 uint32 data_size = size; |
| 163 const void* data = GetSharedMemoryAs<const void*>( | 163 const void* data = GetSharedMemoryAs<const void*>( |
| 164 c.data_shm_id, c.data_shm_offset, data_size); | 164 c.data_shm_id, c.data_shm_offset, data_size); |
| 165 if (!ValidateGLenumBufferTarget(target)) { | 165 if (!validators_->buffer_target.IsValid(target)) { |
| 166 SetGLError(GL_INVALID_ENUM, "glBufferSubData: target GL_INVALID_ENUM"); | 166 SetGLError(GL_INVALID_ENUM, "glBufferSubData: target GL_INVALID_ENUM"); |
| 167 return error::kNoError; | 167 return error::kNoError; |
| 168 } | 168 } |
| 169 if (size < 0) { | 169 if (size < 0) { |
| 170 SetGLError(GL_INVALID_VALUE, "glBufferSubData: size < 0"); | 170 SetGLError(GL_INVALID_VALUE, "glBufferSubData: size < 0"); |
| 171 return error::kNoError; | 171 return error::kNoError; |
| 172 } | 172 } |
| 173 if (data == NULL) { | 173 if (data == NULL) { |
| 174 return error::kOutOfBounds; | 174 return error::kOutOfBounds; |
| 175 } | 175 } |
| 176 DoBufferSubData(target, offset, size, data); | 176 DoBufferSubData(target, offset, size, data); |
| 177 return error::kNoError; | 177 return error::kNoError; |
| 178 } | 178 } |
| 179 | 179 |
| 180 error::Error GLES2DecoderImpl::HandleBufferSubDataImmediate( | 180 error::Error GLES2DecoderImpl::HandleBufferSubDataImmediate( |
| 181 uint32 immediate_data_size, const gles2::BufferSubDataImmediate& c) { | 181 uint32 immediate_data_size, const gles2::BufferSubDataImmediate& c) { |
| 182 GLenum target = static_cast<GLenum>(c.target); | 182 GLenum target = static_cast<GLenum>(c.target); |
| 183 GLintptr offset = static_cast<GLintptr>(c.offset); | 183 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 184 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 184 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 185 uint32 data_size = size; | 185 uint32 data_size = size; |
| 186 const void* data = GetImmediateDataAs<const void*>( | 186 const void* data = GetImmediateDataAs<const void*>( |
| 187 c, data_size, immediate_data_size); | 187 c, data_size, immediate_data_size); |
| 188 if (!ValidateGLenumBufferTarget(target)) { | 188 if (!validators_->buffer_target.IsValid(target)) { |
| 189 SetGLError(GL_INVALID_ENUM, "glBufferSubData: target GL_INVALID_ENUM"); | 189 SetGLError(GL_INVALID_ENUM, "glBufferSubData: target GL_INVALID_ENUM"); |
| 190 return error::kNoError; | 190 return error::kNoError; |
| 191 } | 191 } |
| 192 if (size < 0) { | 192 if (size < 0) { |
| 193 SetGLError(GL_INVALID_VALUE, "glBufferSubData: size < 0"); | 193 SetGLError(GL_INVALID_VALUE, "glBufferSubData: size < 0"); |
| 194 return error::kNoError; | 194 return error::kNoError; |
| 195 } | 195 } |
| 196 if (data == NULL) { | 196 if (data == NULL) { |
| 197 return error::kOutOfBounds; | 197 return error::kOutOfBounds; |
| 198 } | 198 } |
| 199 DoBufferSubData(target, offset, size, data); | 199 DoBufferSubData(target, offset, size, data); |
| 200 return error::kNoError; | 200 return error::kNoError; |
| 201 } | 201 } |
| 202 | 202 |
| 203 error::Error GLES2DecoderImpl::HandleCheckFramebufferStatus( | 203 error::Error GLES2DecoderImpl::HandleCheckFramebufferStatus( |
| 204 uint32 immediate_data_size, const gles2::CheckFramebufferStatus& c) { | 204 uint32 immediate_data_size, const gles2::CheckFramebufferStatus& c) { |
| 205 GLenum target = static_cast<GLenum>(c.target); | 205 GLenum target = static_cast<GLenum>(c.target); |
| 206 typedef CheckFramebufferStatus::Result Result; | 206 typedef CheckFramebufferStatus::Result Result; |
| 207 Result* result_dst = GetSharedMemoryAs<Result*>( | 207 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 208 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 208 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 209 if (!result_dst) { | 209 if (!result_dst) { |
| 210 return error::kOutOfBounds; | 210 return error::kOutOfBounds; |
| 211 } | 211 } |
| 212 if (!ValidateGLenumFrameBufferTarget(target)) { | 212 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 213 SetGLError( | 213 SetGLError( |
| 214 GL_INVALID_ENUM, "glCheckFramebufferStatus: target GL_INVALID_ENUM"); | 214 GL_INVALID_ENUM, "glCheckFramebufferStatus: target GL_INVALID_ENUM"); |
| 215 return error::kNoError; | 215 return error::kNoError; |
| 216 } | 216 } |
| 217 *result_dst = DoCheckFramebufferStatus(target); | 217 *result_dst = DoCheckFramebufferStatus(target); |
| 218 return error::kNoError; | 218 return error::kNoError; |
| 219 } | 219 } |
| 220 | 220 |
| 221 error::Error GLES2DecoderImpl::HandleClear( | 221 error::Error GLES2DecoderImpl::HandleClear( |
| 222 uint32 immediate_data_size, const gles2::Clear& c) { | 222 uint32 immediate_data_size, const gles2::Clear& c) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 GLint level = static_cast<GLint>(c.level); | 272 GLint level = static_cast<GLint>(c.level); |
| 273 GLint xoffset = static_cast<GLint>(c.xoffset); | 273 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 274 GLint yoffset = static_cast<GLint>(c.yoffset); | 274 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 275 GLsizei width = static_cast<GLsizei>(c.width); | 275 GLsizei width = static_cast<GLsizei>(c.width); |
| 276 GLsizei height = static_cast<GLsizei>(c.height); | 276 GLsizei height = static_cast<GLsizei>(c.height); |
| 277 GLenum format = static_cast<GLenum>(c.format); | 277 GLenum format = static_cast<GLenum>(c.format); |
| 278 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); | 278 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); |
| 279 uint32 data_size = imageSize; | 279 uint32 data_size = imageSize; |
| 280 const void* data = GetSharedMemoryAs<const void*>( | 280 const void* data = GetSharedMemoryAs<const void*>( |
| 281 c.data_shm_id, c.data_shm_offset, data_size); | 281 c.data_shm_id, c.data_shm_offset, data_size); |
| 282 if (!ValidateGLenumTextureTarget(target)) { | 282 if (!validators_->texture_target.IsValid(target)) { |
| 283 SetGLError( | 283 SetGLError( |
| 284 GL_INVALID_ENUM, "glCompressedTexSubImage2D: target GL_INVALID_ENUM"); | 284 GL_INVALID_ENUM, "glCompressedTexSubImage2D: target GL_INVALID_ENUM"); |
| 285 return error::kNoError; | 285 return error::kNoError; |
| 286 } | 286 } |
| 287 if (width < 0) { | 287 if (width < 0) { |
| 288 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: width < 0"); | 288 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: width < 0"); |
| 289 return error::kNoError; | 289 return error::kNoError; |
| 290 } | 290 } |
| 291 if (height < 0) { | 291 if (height < 0) { |
| 292 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: height < 0"); | 292 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: height < 0"); |
| 293 return error::kNoError; | 293 return error::kNoError; |
| 294 } | 294 } |
| 295 if (!ValidateGLenumCompressedTextureFormat(format)) { | 295 if (!validators_->compressed_texture_format.IsValid(format)) { |
| 296 SetGLError( | 296 SetGLError( |
| 297 GL_INVALID_ENUM, "glCompressedTexSubImage2D: format GL_INVALID_ENUM"); | 297 GL_INVALID_ENUM, "glCompressedTexSubImage2D: format GL_INVALID_ENUM"); |
| 298 return error::kNoError; | 298 return error::kNoError; |
| 299 } | 299 } |
| 300 if (imageSize < 0) { | 300 if (imageSize < 0) { |
| 301 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: imageSize < 0"); | 301 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: imageSize < 0"); |
| 302 return error::kNoError; | 302 return error::kNoError; |
| 303 } | 303 } |
| 304 if (data == NULL) { | 304 if (data == NULL) { |
| 305 return error::kOutOfBounds; | 305 return error::kOutOfBounds; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 316 GLint level = static_cast<GLint>(c.level); | 316 GLint level = static_cast<GLint>(c.level); |
| 317 GLint xoffset = static_cast<GLint>(c.xoffset); | 317 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 318 GLint yoffset = static_cast<GLint>(c.yoffset); | 318 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 319 GLsizei width = static_cast<GLsizei>(c.width); | 319 GLsizei width = static_cast<GLsizei>(c.width); |
| 320 GLsizei height = static_cast<GLsizei>(c.height); | 320 GLsizei height = static_cast<GLsizei>(c.height); |
| 321 GLenum format = static_cast<GLenum>(c.format); | 321 GLenum format = static_cast<GLenum>(c.format); |
| 322 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); | 322 GLsizei imageSize = static_cast<GLsizei>(c.imageSize); |
| 323 uint32 data_size = imageSize; | 323 uint32 data_size = imageSize; |
| 324 const void* data = GetImmediateDataAs<const void*>( | 324 const void* data = GetImmediateDataAs<const void*>( |
| 325 c, data_size, immediate_data_size); | 325 c, data_size, immediate_data_size); |
| 326 if (!ValidateGLenumTextureTarget(target)) { | 326 if (!validators_->texture_target.IsValid(target)) { |
| 327 SetGLError( | 327 SetGLError( |
| 328 GL_INVALID_ENUM, "glCompressedTexSubImage2D: target GL_INVALID_ENUM"); | 328 GL_INVALID_ENUM, "glCompressedTexSubImage2D: target GL_INVALID_ENUM"); |
| 329 return error::kNoError; | 329 return error::kNoError; |
| 330 } | 330 } |
| 331 if (width < 0) { | 331 if (width < 0) { |
| 332 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: width < 0"); | 332 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: width < 0"); |
| 333 return error::kNoError; | 333 return error::kNoError; |
| 334 } | 334 } |
| 335 if (height < 0) { | 335 if (height < 0) { |
| 336 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: height < 0"); | 336 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: height < 0"); |
| 337 return error::kNoError; | 337 return error::kNoError; |
| 338 } | 338 } |
| 339 if (!ValidateGLenumCompressedTextureFormat(format)) { | 339 if (!validators_->compressed_texture_format.IsValid(format)) { |
| 340 SetGLError( | 340 SetGLError( |
| 341 GL_INVALID_ENUM, "glCompressedTexSubImage2D: format GL_INVALID_ENUM"); | 341 GL_INVALID_ENUM, "glCompressedTexSubImage2D: format GL_INVALID_ENUM"); |
| 342 return error::kNoError; | 342 return error::kNoError; |
| 343 } | 343 } |
| 344 if (imageSize < 0) { | 344 if (imageSize < 0) { |
| 345 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: imageSize < 0"); | 345 SetGLError(GL_INVALID_VALUE, "glCompressedTexSubImage2D: imageSize < 0"); |
| 346 return error::kNoError; | 346 return error::kNoError; |
| 347 } | 347 } |
| 348 if (data == NULL) { | 348 if (data == NULL) { |
| 349 return error::kOutOfBounds; | 349 return error::kOutOfBounds; |
| 350 } | 350 } |
| 351 glCompressedTexSubImage2D( | 351 glCompressedTexSubImage2D( |
| 352 target, level, xoffset, yoffset, width, height, format, imageSize, data); | 352 target, level, xoffset, yoffset, width, height, format, imageSize, data); |
| 353 return error::kNoError; | 353 return error::kNoError; |
| 354 } | 354 } |
| 355 | 355 |
| 356 error::Error GLES2DecoderImpl::HandleCopyTexImage2D( | 356 error::Error GLES2DecoderImpl::HandleCopyTexImage2D( |
| 357 uint32 immediate_data_size, const gles2::CopyTexImage2D& c) { | 357 uint32 immediate_data_size, const gles2::CopyTexImage2D& c) { |
| 358 GLenum target = static_cast<GLenum>(c.target); | 358 GLenum target = static_cast<GLenum>(c.target); |
| 359 GLint level = static_cast<GLint>(c.level); | 359 GLint level = static_cast<GLint>(c.level); |
| 360 GLenum internalformat = static_cast<GLenum>(c.internalformat); | 360 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 361 GLint x = static_cast<GLint>(c.x); | 361 GLint x = static_cast<GLint>(c.x); |
| 362 GLint y = static_cast<GLint>(c.y); | 362 GLint y = static_cast<GLint>(c.y); |
| 363 GLsizei width = static_cast<GLsizei>(c.width); | 363 GLsizei width = static_cast<GLsizei>(c.width); |
| 364 GLsizei height = static_cast<GLsizei>(c.height); | 364 GLsizei height = static_cast<GLsizei>(c.height); |
| 365 GLint border = static_cast<GLint>(c.border); | 365 GLint border = static_cast<GLint>(c.border); |
| 366 if (!ValidateGLenumTextureTarget(target)) { | 366 if (!validators_->texture_target.IsValid(target)) { |
| 367 SetGLError(GL_INVALID_ENUM, "glCopyTexImage2D: target GL_INVALID_ENUM"); | 367 SetGLError(GL_INVALID_ENUM, "glCopyTexImage2D: target GL_INVALID_ENUM"); |
| 368 return error::kNoError; | 368 return error::kNoError; |
| 369 } | 369 } |
| 370 if (width < 0) { | 370 if (width < 0) { |
| 371 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D: width < 0"); | 371 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D: width < 0"); |
| 372 return error::kNoError; | 372 return error::kNoError; |
| 373 } | 373 } |
| 374 if (height < 0) { | 374 if (height < 0) { |
| 375 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D: height < 0"); | 375 SetGLError(GL_INVALID_VALUE, "glCopyTexImage2D: height < 0"); |
| 376 return error::kNoError; | 376 return error::kNoError; |
| 377 } | 377 } |
| 378 glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); | 378 glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); |
| 379 return error::kNoError; | 379 return error::kNoError; |
| 380 } | 380 } |
| 381 | 381 |
| 382 error::Error GLES2DecoderImpl::HandleCopyTexSubImage2D( | 382 error::Error GLES2DecoderImpl::HandleCopyTexSubImage2D( |
| 383 uint32 immediate_data_size, const gles2::CopyTexSubImage2D& c) { | 383 uint32 immediate_data_size, const gles2::CopyTexSubImage2D& c) { |
| 384 GLenum target = static_cast<GLenum>(c.target); | 384 GLenum target = static_cast<GLenum>(c.target); |
| 385 GLint level = static_cast<GLint>(c.level); | 385 GLint level = static_cast<GLint>(c.level); |
| 386 GLint xoffset = static_cast<GLint>(c.xoffset); | 386 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 387 GLint yoffset = static_cast<GLint>(c.yoffset); | 387 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 388 GLint x = static_cast<GLint>(c.x); | 388 GLint x = static_cast<GLint>(c.x); |
| 389 GLint y = static_cast<GLint>(c.y); | 389 GLint y = static_cast<GLint>(c.y); |
| 390 GLsizei width = static_cast<GLsizei>(c.width); | 390 GLsizei width = static_cast<GLsizei>(c.width); |
| 391 GLsizei height = static_cast<GLsizei>(c.height); | 391 GLsizei height = static_cast<GLsizei>(c.height); |
| 392 if (!ValidateGLenumTextureTarget(target)) { | 392 if (!validators_->texture_target.IsValid(target)) { |
| 393 SetGLError(GL_INVALID_ENUM, "glCopyTexSubImage2D: target GL_INVALID_ENUM"); | 393 SetGLError(GL_INVALID_ENUM, "glCopyTexSubImage2D: target GL_INVALID_ENUM"); |
| 394 return error::kNoError; | 394 return error::kNoError; |
| 395 } | 395 } |
| 396 if (width < 0) { | 396 if (width < 0) { |
| 397 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D: width < 0"); | 397 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D: width < 0"); |
| 398 return error::kNoError; | 398 return error::kNoError; |
| 399 } | 399 } |
| 400 if (height < 0) { | 400 if (height < 0) { |
| 401 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D: height < 0"); | 401 SetGLError(GL_INVALID_VALUE, "glCopyTexSubImage2D: height < 0"); |
| 402 return error::kNoError; | 402 return error::kNoError; |
| 403 } | 403 } |
| 404 glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); | 404 glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); |
| 405 return error::kNoError; | 405 return error::kNoError; |
| 406 } | 406 } |
| 407 | 407 |
| 408 error::Error GLES2DecoderImpl::HandleCreateProgram( | 408 error::Error GLES2DecoderImpl::HandleCreateProgram( |
| 409 uint32 immediate_data_size, const gles2::CreateProgram& c) { | 409 uint32 immediate_data_size, const gles2::CreateProgram& c) { |
| 410 uint32 client_id = c.client_id; | 410 uint32 client_id = c.client_id; |
| 411 if (!CreateProgramHelper(client_id)) { | 411 if (!CreateProgramHelper(client_id)) { |
| 412 return error::kInvalidArguments; | 412 return error::kInvalidArguments; |
| 413 } | 413 } |
| 414 return error::kNoError; | 414 return error::kNoError; |
| 415 } | 415 } |
| 416 | 416 |
| 417 error::Error GLES2DecoderImpl::HandleCreateShader( | 417 error::Error GLES2DecoderImpl::HandleCreateShader( |
| 418 uint32 immediate_data_size, const gles2::CreateShader& c) { | 418 uint32 immediate_data_size, const gles2::CreateShader& c) { |
| 419 GLenum type = static_cast<GLenum>(c.type); | 419 GLenum type = static_cast<GLenum>(c.type); |
| 420 if (!ValidateGLenumShaderType(type)) { | 420 if (!validators_->shader_type.IsValid(type)) { |
| 421 SetGLError(GL_INVALID_ENUM, "glCreateShader: type GL_INVALID_ENUM"); | 421 SetGLError(GL_INVALID_ENUM, "glCreateShader: type GL_INVALID_ENUM"); |
| 422 return error::kNoError; | 422 return error::kNoError; |
| 423 } | 423 } |
| 424 uint32 client_id = c.client_id; | 424 uint32 client_id = c.client_id; |
| 425 if (!CreateShaderHelper(type, client_id)) { | 425 if (!CreateShaderHelper(type, client_id)) { |
| 426 return error::kInvalidArguments; | 426 return error::kInvalidArguments; |
| 427 } | 427 } |
| 428 return error::kNoError; | 428 return error::kNoError; |
| 429 } | 429 } |
| 430 | 430 |
| 431 error::Error GLES2DecoderImpl::HandleCullFace( | 431 error::Error GLES2DecoderImpl::HandleCullFace( |
| 432 uint32 immediate_data_size, const gles2::CullFace& c) { | 432 uint32 immediate_data_size, const gles2::CullFace& c) { |
| 433 GLenum mode = static_cast<GLenum>(c.mode); | 433 GLenum mode = static_cast<GLenum>(c.mode); |
| 434 if (!ValidateGLenumFaceType(mode)) { | 434 if (!validators_->face_type.IsValid(mode)) { |
| 435 SetGLError(GL_INVALID_ENUM, "glCullFace: mode GL_INVALID_ENUM"); | 435 SetGLError(GL_INVALID_ENUM, "glCullFace: mode GL_INVALID_ENUM"); |
| 436 return error::kNoError; | 436 return error::kNoError; |
| 437 } | 437 } |
| 438 glCullFace(mode); | 438 glCullFace(mode); |
| 439 return error::kNoError; | 439 return error::kNoError; |
| 440 } | 440 } |
| 441 | 441 |
| 442 error::Error GLES2DecoderImpl::HandleDeleteBuffers( | 442 error::Error GLES2DecoderImpl::HandleDeleteBuffers( |
| 443 uint32 immediate_data_size, const gles2::DeleteBuffers& c) { | 443 uint32 immediate_data_size, const gles2::DeleteBuffers& c) { |
| 444 GLsizei n = static_cast<GLsizei>(c.n); | 444 GLsizei n = static_cast<GLsizei>(c.n); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 if (textures == NULL) { | 595 if (textures == NULL) { |
| 596 return error::kOutOfBounds; | 596 return error::kOutOfBounds; |
| 597 } | 597 } |
| 598 DeleteTexturesHelper(n, textures); | 598 DeleteTexturesHelper(n, textures); |
| 599 return error::kNoError; | 599 return error::kNoError; |
| 600 } | 600 } |
| 601 | 601 |
| 602 error::Error GLES2DecoderImpl::HandleDepthFunc( | 602 error::Error GLES2DecoderImpl::HandleDepthFunc( |
| 603 uint32 immediate_data_size, const gles2::DepthFunc& c) { | 603 uint32 immediate_data_size, const gles2::DepthFunc& c) { |
| 604 GLenum func = static_cast<GLenum>(c.func); | 604 GLenum func = static_cast<GLenum>(c.func); |
| 605 if (!ValidateGLenumCmpFunction(func)) { | 605 if (!validators_->cmp_function.IsValid(func)) { |
| 606 SetGLError(GL_INVALID_ENUM, "glDepthFunc: func GL_INVALID_ENUM"); | 606 SetGLError(GL_INVALID_ENUM, "glDepthFunc: func GL_INVALID_ENUM"); |
| 607 return error::kNoError; | 607 return error::kNoError; |
| 608 } | 608 } |
| 609 glDepthFunc(func); | 609 glDepthFunc(func); |
| 610 return error::kNoError; | 610 return error::kNoError; |
| 611 } | 611 } |
| 612 | 612 |
| 613 error::Error GLES2DecoderImpl::HandleDepthMask( | 613 error::Error GLES2DecoderImpl::HandleDepthMask( |
| 614 uint32 immediate_data_size, const gles2::DepthMask& c) { | 614 uint32 immediate_data_size, const gles2::DepthMask& c) { |
| 615 GLboolean flag = static_cast<GLboolean>(c.flag); | 615 GLboolean flag = static_cast<GLboolean>(c.flag); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 629 uint32 immediate_data_size, const gles2::DetachShader& c) { | 629 uint32 immediate_data_size, const gles2::DetachShader& c) { |
| 630 GLuint program = c.program; | 630 GLuint program = c.program; |
| 631 GLuint shader = c.shader; | 631 GLuint shader = c.shader; |
| 632 DoDetachShader(program, shader); | 632 DoDetachShader(program, shader); |
| 633 return error::kNoError; | 633 return error::kNoError; |
| 634 } | 634 } |
| 635 | 635 |
| 636 error::Error GLES2DecoderImpl::HandleDisable( | 636 error::Error GLES2DecoderImpl::HandleDisable( |
| 637 uint32 immediate_data_size, const gles2::Disable& c) { | 637 uint32 immediate_data_size, const gles2::Disable& c) { |
| 638 GLenum cap = static_cast<GLenum>(c.cap); | 638 GLenum cap = static_cast<GLenum>(c.cap); |
| 639 if (!ValidateGLenumCapability(cap)) { | 639 if (!validators_->capability.IsValid(cap)) { |
| 640 SetGLError(GL_INVALID_ENUM, "glDisable: cap GL_INVALID_ENUM"); | 640 SetGLError(GL_INVALID_ENUM, "glDisable: cap GL_INVALID_ENUM"); |
| 641 return error::kNoError; | 641 return error::kNoError; |
| 642 } | 642 } |
| 643 glDisable(cap); | 643 glDisable(cap); |
| 644 return error::kNoError; | 644 return error::kNoError; |
| 645 } | 645 } |
| 646 | 646 |
| 647 error::Error GLES2DecoderImpl::HandleDisableVertexAttribArray( | 647 error::Error GLES2DecoderImpl::HandleDisableVertexAttribArray( |
| 648 uint32 immediate_data_size, const gles2::DisableVertexAttribArray& c) { | 648 uint32 immediate_data_size, const gles2::DisableVertexAttribArray& c) { |
| 649 GLuint index = static_cast<GLuint>(c.index); | 649 GLuint index = static_cast<GLuint>(c.index); |
| 650 DoDisableVertexAttribArray(index); | 650 DoDisableVertexAttribArray(index); |
| 651 return error::kNoError; | 651 return error::kNoError; |
| 652 } | 652 } |
| 653 | 653 |
| 654 error::Error GLES2DecoderImpl::HandleDrawArrays( | 654 error::Error GLES2DecoderImpl::HandleDrawArrays( |
| 655 uint32 immediate_data_size, const gles2::DrawArrays& c) { | 655 uint32 immediate_data_size, const gles2::DrawArrays& c) { |
| 656 GLenum mode = static_cast<GLenum>(c.mode); | 656 GLenum mode = static_cast<GLenum>(c.mode); |
| 657 GLint first = static_cast<GLint>(c.first); | 657 GLint first = static_cast<GLint>(c.first); |
| 658 GLsizei count = static_cast<GLsizei>(c.count); | 658 GLsizei count = static_cast<GLsizei>(c.count); |
| 659 if (!ValidateGLenumDrawMode(mode)) { | 659 if (!validators_->draw_mode.IsValid(mode)) { |
| 660 SetGLError(GL_INVALID_ENUM, "glDrawArrays: mode GL_INVALID_ENUM"); | 660 SetGLError(GL_INVALID_ENUM, "glDrawArrays: mode GL_INVALID_ENUM"); |
| 661 return error::kNoError; | 661 return error::kNoError; |
| 662 } | 662 } |
| 663 if (count < 0) { | 663 if (count < 0) { |
| 664 SetGLError(GL_INVALID_VALUE, "glDrawArrays: count < 0"); | 664 SetGLError(GL_INVALID_VALUE, "glDrawArrays: count < 0"); |
| 665 return error::kNoError; | 665 return error::kNoError; |
| 666 } | 666 } |
| 667 DoDrawArrays(mode, first, count); | 667 DoDrawArrays(mode, first, count); |
| 668 return error::kNoError; | 668 return error::kNoError; |
| 669 } | 669 } |
| 670 | 670 |
| 671 error::Error GLES2DecoderImpl::HandleEnable( | 671 error::Error GLES2DecoderImpl::HandleEnable( |
| 672 uint32 immediate_data_size, const gles2::Enable& c) { | 672 uint32 immediate_data_size, const gles2::Enable& c) { |
| 673 GLenum cap = static_cast<GLenum>(c.cap); | 673 GLenum cap = static_cast<GLenum>(c.cap); |
| 674 if (!ValidateGLenumCapability(cap)) { | 674 if (!validators_->capability.IsValid(cap)) { |
| 675 SetGLError(GL_INVALID_ENUM, "glEnable: cap GL_INVALID_ENUM"); | 675 SetGLError(GL_INVALID_ENUM, "glEnable: cap GL_INVALID_ENUM"); |
| 676 return error::kNoError; | 676 return error::kNoError; |
| 677 } | 677 } |
| 678 glEnable(cap); | 678 glEnable(cap); |
| 679 return error::kNoError; | 679 return error::kNoError; |
| 680 } | 680 } |
| 681 | 681 |
| 682 error::Error GLES2DecoderImpl::HandleEnableVertexAttribArray( | 682 error::Error GLES2DecoderImpl::HandleEnableVertexAttribArray( |
| 683 uint32 immediate_data_size, const gles2::EnableVertexAttribArray& c) { | 683 uint32 immediate_data_size, const gles2::EnableVertexAttribArray& c) { |
| 684 GLuint index = static_cast<GLuint>(c.index); | 684 GLuint index = static_cast<GLuint>(c.index); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 697 glFlush(); | 697 glFlush(); |
| 698 return error::kNoError; | 698 return error::kNoError; |
| 699 } | 699 } |
| 700 | 700 |
| 701 error::Error GLES2DecoderImpl::HandleFramebufferRenderbuffer( | 701 error::Error GLES2DecoderImpl::HandleFramebufferRenderbuffer( |
| 702 uint32 immediate_data_size, const gles2::FramebufferRenderbuffer& c) { | 702 uint32 immediate_data_size, const gles2::FramebufferRenderbuffer& c) { |
| 703 GLenum target = static_cast<GLenum>(c.target); | 703 GLenum target = static_cast<GLenum>(c.target); |
| 704 GLenum attachment = static_cast<GLenum>(c.attachment); | 704 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 705 GLenum renderbuffertarget = static_cast<GLenum>(c.renderbuffertarget); | 705 GLenum renderbuffertarget = static_cast<GLenum>(c.renderbuffertarget); |
| 706 GLuint renderbuffer = c.renderbuffer; | 706 GLuint renderbuffer = c.renderbuffer; |
| 707 if (!ValidateGLenumFrameBufferTarget(target)) { | 707 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 708 SetGLError( | 708 SetGLError( |
| 709 GL_INVALID_ENUM, "glFramebufferRenderbuffer: target GL_INVALID_ENUM"); | 709 GL_INVALID_ENUM, "glFramebufferRenderbuffer: target GL_INVALID_ENUM"); |
| 710 return error::kNoError; | 710 return error::kNoError; |
| 711 } | 711 } |
| 712 if (!ValidateGLenumAttachment(attachment)) { | 712 if (!validators_->attachment.IsValid(attachment)) { |
| 713 SetGLError( | 713 SetGLError( |
| 714 GL_INVALID_ENUM, | 714 GL_INVALID_ENUM, |
| 715 "glFramebufferRenderbuffer: attachment GL_INVALID_ENUM"); | 715 "glFramebufferRenderbuffer: attachment GL_INVALID_ENUM"); |
| 716 return error::kNoError; | 716 return error::kNoError; |
| 717 } | 717 } |
| 718 if (!ValidateGLenumRenderBufferTarget(renderbuffertarget)) { | 718 if (!validators_->render_buffer_target.IsValid(renderbuffertarget)) { |
| 719 SetGLError( | 719 SetGLError( |
| 720 GL_INVALID_ENUM, | 720 GL_INVALID_ENUM, |
| 721 "glFramebufferRenderbuffer: renderbuffertarget GL_INVALID_ENUM"); | 721 "glFramebufferRenderbuffer: renderbuffertarget GL_INVALID_ENUM"); |
| 722 return error::kNoError; | 722 return error::kNoError; |
| 723 } | 723 } |
| 724 DoFramebufferRenderbuffer( | 724 DoFramebufferRenderbuffer( |
| 725 target, attachment, renderbuffertarget, renderbuffer); | 725 target, attachment, renderbuffertarget, renderbuffer); |
| 726 return error::kNoError; | 726 return error::kNoError; |
| 727 } | 727 } |
| 728 | 728 |
| 729 error::Error GLES2DecoderImpl::HandleFramebufferTexture2D( | 729 error::Error GLES2DecoderImpl::HandleFramebufferTexture2D( |
| 730 uint32 immediate_data_size, const gles2::FramebufferTexture2D& c) { | 730 uint32 immediate_data_size, const gles2::FramebufferTexture2D& c) { |
| 731 GLenum target = static_cast<GLenum>(c.target); | 731 GLenum target = static_cast<GLenum>(c.target); |
| 732 GLenum attachment = static_cast<GLenum>(c.attachment); | 732 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 733 GLenum textarget = static_cast<GLenum>(c.textarget); | 733 GLenum textarget = static_cast<GLenum>(c.textarget); |
| 734 GLuint texture = c.texture; | 734 GLuint texture = c.texture; |
| 735 GLint level = static_cast<GLint>(c.level); | 735 GLint level = static_cast<GLint>(c.level); |
| 736 if (!ValidateGLenumFrameBufferTarget(target)) { | 736 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 737 SetGLError( | 737 SetGLError( |
| 738 GL_INVALID_ENUM, "glFramebufferTexture2D: target GL_INVALID_ENUM"); | 738 GL_INVALID_ENUM, "glFramebufferTexture2D: target GL_INVALID_ENUM"); |
| 739 return error::kNoError; | 739 return error::kNoError; |
| 740 } | 740 } |
| 741 if (!ValidateGLenumAttachment(attachment)) { | 741 if (!validators_->attachment.IsValid(attachment)) { |
| 742 SetGLError( | 742 SetGLError( |
| 743 GL_INVALID_ENUM, "glFramebufferTexture2D: attachment GL_INVALID_ENUM"); | 743 GL_INVALID_ENUM, "glFramebufferTexture2D: attachment GL_INVALID_ENUM"); |
| 744 return error::kNoError; | 744 return error::kNoError; |
| 745 } | 745 } |
| 746 if (!ValidateGLenumTextureTarget(textarget)) { | 746 if (!validators_->texture_target.IsValid(textarget)) { |
| 747 SetGLError( | 747 SetGLError( |
| 748 GL_INVALID_ENUM, "glFramebufferTexture2D: textarget GL_INVALID_ENUM"); | 748 GL_INVALID_ENUM, "glFramebufferTexture2D: textarget GL_INVALID_ENUM"); |
| 749 return error::kNoError; | 749 return error::kNoError; |
| 750 } | 750 } |
| 751 DoFramebufferTexture2D(target, attachment, textarget, texture, level); | 751 DoFramebufferTexture2D(target, attachment, textarget, texture, level); |
| 752 return error::kNoError; | 752 return error::kNoError; |
| 753 } | 753 } |
| 754 | 754 |
| 755 error::Error GLES2DecoderImpl::HandleFrontFace( | 755 error::Error GLES2DecoderImpl::HandleFrontFace( |
| 756 uint32 immediate_data_size, const gles2::FrontFace& c) { | 756 uint32 immediate_data_size, const gles2::FrontFace& c) { |
| 757 GLenum mode = static_cast<GLenum>(c.mode); | 757 GLenum mode = static_cast<GLenum>(c.mode); |
| 758 if (!ValidateGLenumFaceMode(mode)) { | 758 if (!validators_->face_mode.IsValid(mode)) { |
| 759 SetGLError(GL_INVALID_ENUM, "glFrontFace: mode GL_INVALID_ENUM"); | 759 SetGLError(GL_INVALID_ENUM, "glFrontFace: mode GL_INVALID_ENUM"); |
| 760 return error::kNoError; | 760 return error::kNoError; |
| 761 } | 761 } |
| 762 glFrontFace(mode); | 762 glFrontFace(mode); |
| 763 return error::kNoError; | 763 return error::kNoError; |
| 764 } | 764 } |
| 765 | 765 |
| 766 error::Error GLES2DecoderImpl::HandleGenBuffers( | 766 error::Error GLES2DecoderImpl::HandleGenBuffers( |
| 767 uint32 immediate_data_size, const gles2::GenBuffers& c) { | 767 uint32 immediate_data_size, const gles2::GenBuffers& c) { |
| 768 GLsizei n = static_cast<GLsizei>(c.n); | 768 GLsizei n = static_cast<GLsizei>(c.n); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 } | 803 } |
| 804 if (!GenBuffersHelper(n, buffers)) { | 804 if (!GenBuffersHelper(n, buffers)) { |
| 805 return error::kInvalidArguments; | 805 return error::kInvalidArguments; |
| 806 } | 806 } |
| 807 return error::kNoError; | 807 return error::kNoError; |
| 808 } | 808 } |
| 809 | 809 |
| 810 error::Error GLES2DecoderImpl::HandleGenerateMipmap( | 810 error::Error GLES2DecoderImpl::HandleGenerateMipmap( |
| 811 uint32 immediate_data_size, const gles2::GenerateMipmap& c) { | 811 uint32 immediate_data_size, const gles2::GenerateMipmap& c) { |
| 812 GLenum target = static_cast<GLenum>(c.target); | 812 GLenum target = static_cast<GLenum>(c.target); |
| 813 if (!ValidateGLenumTextureBindTarget(target)) { | 813 if (!validators_->texture_bind_target.IsValid(target)) { |
| 814 SetGLError(GL_INVALID_ENUM, "glGenerateMipmap: target GL_INVALID_ENUM"); | 814 SetGLError(GL_INVALID_ENUM, "glGenerateMipmap: target GL_INVALID_ENUM"); |
| 815 return error::kNoError; | 815 return error::kNoError; |
| 816 } | 816 } |
| 817 DoGenerateMipmap(target); | 817 DoGenerateMipmap(target); |
| 818 return error::kNoError; | 818 return error::kNoError; |
| 819 } | 819 } |
| 820 | 820 |
| 821 error::Error GLES2DecoderImpl::HandleGenFramebuffers( | 821 error::Error GLES2DecoderImpl::HandleGenFramebuffers( |
| 822 uint32 immediate_data_size, const gles2::GenFramebuffers& c) { | 822 uint32 immediate_data_size, const gles2::GenFramebuffers& c) { |
| 823 GLsizei n = static_cast<GLsizei>(c.n); | 823 GLsizei n = static_cast<GLsizei>(c.n); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 | 952 |
| 953 error::Error GLES2DecoderImpl::HandleGetBooleanv( | 953 error::Error GLES2DecoderImpl::HandleGetBooleanv( |
| 954 uint32 immediate_data_size, const gles2::GetBooleanv& c) { | 954 uint32 immediate_data_size, const gles2::GetBooleanv& c) { |
| 955 GLenum pname = static_cast<GLenum>(c.pname); | 955 GLenum pname = static_cast<GLenum>(c.pname); |
| 956 typedef GetBooleanv::Result Result; | 956 typedef GetBooleanv::Result Result; |
| 957 GLsizei num_values = 0; | 957 GLsizei num_values = 0; |
| 958 GetNumValuesReturnedForGLGet(pname, &num_values); | 958 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 959 Result* result = GetSharedMemoryAs<Result*>( | 959 Result* result = GetSharedMemoryAs<Result*>( |
| 960 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 960 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 961 GLboolean* params = result ? result->GetData() : NULL; | 961 GLboolean* params = result ? result->GetData() : NULL; |
| 962 if (!ValidateGLenumGLState(pname)) { | 962 if (!validators_->g_l_state.IsValid(pname)) { |
| 963 SetGLError(GL_INVALID_ENUM, "glGetBooleanv: pname GL_INVALID_ENUM"); | 963 SetGLError(GL_INVALID_ENUM, "glGetBooleanv: pname GL_INVALID_ENUM"); |
| 964 return error::kNoError; | 964 return error::kNoError; |
| 965 } | 965 } |
| 966 if (params == NULL) { | 966 if (params == NULL) { |
| 967 return error::kOutOfBounds; | 967 return error::kOutOfBounds; |
| 968 } | 968 } |
| 969 // Check that the client initialized the result. | 969 // Check that the client initialized the result. |
| 970 if (result->size != 0) { | 970 if (result->size != 0) { |
| 971 return error::kInvalidArguments; | 971 return error::kInvalidArguments; |
| 972 } | 972 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 984 error::Error GLES2DecoderImpl::HandleGetBufferParameteriv( | 984 error::Error GLES2DecoderImpl::HandleGetBufferParameteriv( |
| 985 uint32 immediate_data_size, const gles2::GetBufferParameteriv& c) { | 985 uint32 immediate_data_size, const gles2::GetBufferParameteriv& c) { |
| 986 GLenum target = static_cast<GLenum>(c.target); | 986 GLenum target = static_cast<GLenum>(c.target); |
| 987 GLenum pname = static_cast<GLenum>(c.pname); | 987 GLenum pname = static_cast<GLenum>(c.pname); |
| 988 typedef GetBufferParameteriv::Result Result; | 988 typedef GetBufferParameteriv::Result Result; |
| 989 GLsizei num_values = 0; | 989 GLsizei num_values = 0; |
| 990 GetNumValuesReturnedForGLGet(pname, &num_values); | 990 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 991 Result* result = GetSharedMemoryAs<Result*>( | 991 Result* result = GetSharedMemoryAs<Result*>( |
| 992 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 992 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 993 GLint* params = result ? result->GetData() : NULL; | 993 GLint* params = result ? result->GetData() : NULL; |
| 994 if (!ValidateGLenumBufferTarget(target)) { | 994 if (!validators_->buffer_target.IsValid(target)) { |
| 995 SetGLError( | 995 SetGLError( |
| 996 GL_INVALID_ENUM, "glGetBufferParameteriv: target GL_INVALID_ENUM"); | 996 GL_INVALID_ENUM, "glGetBufferParameteriv: target GL_INVALID_ENUM"); |
| 997 return error::kNoError; | 997 return error::kNoError; |
| 998 } | 998 } |
| 999 if (!ValidateGLenumBufferParameter(pname)) { | 999 if (!validators_->buffer_parameter.IsValid(pname)) { |
| 1000 SetGLError( | 1000 SetGLError( |
| 1001 GL_INVALID_ENUM, "glGetBufferParameteriv: pname GL_INVALID_ENUM"); | 1001 GL_INVALID_ENUM, "glGetBufferParameteriv: pname GL_INVALID_ENUM"); |
| 1002 return error::kNoError; | 1002 return error::kNoError; |
| 1003 } | 1003 } |
| 1004 if (params == NULL) { | 1004 if (params == NULL) { |
| 1005 return error::kOutOfBounds; | 1005 return error::kOutOfBounds; |
| 1006 } | 1006 } |
| 1007 // Check that the client initialized the result. | 1007 // Check that the client initialized the result. |
| 1008 if (result->size != 0) { | 1008 if (result->size != 0) { |
| 1009 return error::kInvalidArguments; | 1009 return error::kInvalidArguments; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1033 | 1033 |
| 1034 error::Error GLES2DecoderImpl::HandleGetFloatv( | 1034 error::Error GLES2DecoderImpl::HandleGetFloatv( |
| 1035 uint32 immediate_data_size, const gles2::GetFloatv& c) { | 1035 uint32 immediate_data_size, const gles2::GetFloatv& c) { |
| 1036 GLenum pname = static_cast<GLenum>(c.pname); | 1036 GLenum pname = static_cast<GLenum>(c.pname); |
| 1037 typedef GetFloatv::Result Result; | 1037 typedef GetFloatv::Result Result; |
| 1038 GLsizei num_values = 0; | 1038 GLsizei num_values = 0; |
| 1039 GetNumValuesReturnedForGLGet(pname, &num_values); | 1039 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1040 Result* result = GetSharedMemoryAs<Result*>( | 1040 Result* result = GetSharedMemoryAs<Result*>( |
| 1041 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1041 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1042 GLfloat* params = result ? result->GetData() : NULL; | 1042 GLfloat* params = result ? result->GetData() : NULL; |
| 1043 if (!ValidateGLenumGLState(pname)) { | 1043 if (!validators_->g_l_state.IsValid(pname)) { |
| 1044 SetGLError(GL_INVALID_ENUM, "glGetFloatv: pname GL_INVALID_ENUM"); | 1044 SetGLError(GL_INVALID_ENUM, "glGetFloatv: pname GL_INVALID_ENUM"); |
| 1045 return error::kNoError; | 1045 return error::kNoError; |
| 1046 } | 1046 } |
| 1047 if (params == NULL) { | 1047 if (params == NULL) { |
| 1048 return error::kOutOfBounds; | 1048 return error::kOutOfBounds; |
| 1049 } | 1049 } |
| 1050 // Check that the client initialized the result. | 1050 // Check that the client initialized the result. |
| 1051 if (result->size != 0) { | 1051 if (result->size != 0) { |
| 1052 return error::kInvalidArguments; | 1052 return error::kInvalidArguments; |
| 1053 } | 1053 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1067 const gles2::GetFramebufferAttachmentParameteriv& c) { | 1067 const gles2::GetFramebufferAttachmentParameteriv& c) { |
| 1068 GLenum target = static_cast<GLenum>(c.target); | 1068 GLenum target = static_cast<GLenum>(c.target); |
| 1069 GLenum attachment = static_cast<GLenum>(c.attachment); | 1069 GLenum attachment = static_cast<GLenum>(c.attachment); |
| 1070 GLenum pname = static_cast<GLenum>(c.pname); | 1070 GLenum pname = static_cast<GLenum>(c.pname); |
| 1071 typedef GetFramebufferAttachmentParameteriv::Result Result; | 1071 typedef GetFramebufferAttachmentParameteriv::Result Result; |
| 1072 GLsizei num_values = 0; | 1072 GLsizei num_values = 0; |
| 1073 GetNumValuesReturnedForGLGet(pname, &num_values); | 1073 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1074 Result* result = GetSharedMemoryAs<Result*>( | 1074 Result* result = GetSharedMemoryAs<Result*>( |
| 1075 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1075 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1076 GLint* params = result ? result->GetData() : NULL; | 1076 GLint* params = result ? result->GetData() : NULL; |
| 1077 if (!ValidateGLenumFrameBufferTarget(target)) { | 1077 if (!validators_->frame_buffer_target.IsValid(target)) { |
| 1078 SetGLError( | 1078 SetGLError( |
| 1079 GL_INVALID_ENUM, | 1079 GL_INVALID_ENUM, |
| 1080 "glGetFramebufferAttachmentParameteriv: target GL_INVALID_ENUM"); | 1080 "glGetFramebufferAttachmentParameteriv: target GL_INVALID_ENUM"); |
| 1081 return error::kNoError; | 1081 return error::kNoError; |
| 1082 } | 1082 } |
| 1083 if (!ValidateGLenumAttachment(attachment)) { | 1083 if (!validators_->attachment.IsValid(attachment)) { |
| 1084 SetGLError( | 1084 SetGLError( |
| 1085 GL_INVALID_ENUM, | 1085 GL_INVALID_ENUM, |
| 1086 "glGetFramebufferAttachmentParameteriv: attachment GL_INVALID_ENUM"); | 1086 "glGetFramebufferAttachmentParameteriv: attachment GL_INVALID_ENUM"); |
| 1087 return error::kNoError; | 1087 return error::kNoError; |
| 1088 } | 1088 } |
| 1089 if (!ValidateGLenumFrameBufferParameter(pname)) { | 1089 if (!validators_->frame_buffer_parameter.IsValid(pname)) { |
| 1090 SetGLError( | 1090 SetGLError( |
| 1091 GL_INVALID_ENUM, | 1091 GL_INVALID_ENUM, |
| 1092 "glGetFramebufferAttachmentParameteriv: pname GL_INVALID_ENUM"); | 1092 "glGetFramebufferAttachmentParameteriv: pname GL_INVALID_ENUM"); |
| 1093 return error::kNoError; | 1093 return error::kNoError; |
| 1094 } | 1094 } |
| 1095 if (params == NULL) { | 1095 if (params == NULL) { |
| 1096 return error::kOutOfBounds; | 1096 return error::kOutOfBounds; |
| 1097 } | 1097 } |
| 1098 // Check that the client initialized the result. | 1098 // Check that the client initialized the result. |
| 1099 if (result->size != 0) { | 1099 if (result->size != 0) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1112 | 1112 |
| 1113 error::Error GLES2DecoderImpl::HandleGetIntegerv( | 1113 error::Error GLES2DecoderImpl::HandleGetIntegerv( |
| 1114 uint32 immediate_data_size, const gles2::GetIntegerv& c) { | 1114 uint32 immediate_data_size, const gles2::GetIntegerv& c) { |
| 1115 GLenum pname = static_cast<GLenum>(c.pname); | 1115 GLenum pname = static_cast<GLenum>(c.pname); |
| 1116 typedef GetIntegerv::Result Result; | 1116 typedef GetIntegerv::Result Result; |
| 1117 GLsizei num_values = 0; | 1117 GLsizei num_values = 0; |
| 1118 GetNumValuesReturnedForGLGet(pname, &num_values); | 1118 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1119 Result* result = GetSharedMemoryAs<Result*>( | 1119 Result* result = GetSharedMemoryAs<Result*>( |
| 1120 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1120 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1121 GLint* params = result ? result->GetData() : NULL; | 1121 GLint* params = result ? result->GetData() : NULL; |
| 1122 if (!ValidateGLenumGLState(pname)) { | 1122 if (!validators_->g_l_state.IsValid(pname)) { |
| 1123 SetGLError(GL_INVALID_ENUM, "glGetIntegerv: pname GL_INVALID_ENUM"); | 1123 SetGLError(GL_INVALID_ENUM, "glGetIntegerv: pname GL_INVALID_ENUM"); |
| 1124 return error::kNoError; | 1124 return error::kNoError; |
| 1125 } | 1125 } |
| 1126 if (params == NULL) { | 1126 if (params == NULL) { |
| 1127 return error::kOutOfBounds; | 1127 return error::kOutOfBounds; |
| 1128 } | 1128 } |
| 1129 // Check that the client initialized the result. | 1129 // Check that the client initialized the result. |
| 1130 if (result->size != 0) { | 1130 if (result->size != 0) { |
| 1131 return error::kInvalidArguments; | 1131 return error::kInvalidArguments; |
| 1132 } | 1132 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1144 error::Error GLES2DecoderImpl::HandleGetProgramiv( | 1144 error::Error GLES2DecoderImpl::HandleGetProgramiv( |
| 1145 uint32 immediate_data_size, const gles2::GetProgramiv& c) { | 1145 uint32 immediate_data_size, const gles2::GetProgramiv& c) { |
| 1146 GLuint program = c.program; | 1146 GLuint program = c.program; |
| 1147 GLenum pname = static_cast<GLenum>(c.pname); | 1147 GLenum pname = static_cast<GLenum>(c.pname); |
| 1148 typedef GetProgramiv::Result Result; | 1148 typedef GetProgramiv::Result Result; |
| 1149 GLsizei num_values = 0; | 1149 GLsizei num_values = 0; |
| 1150 GetNumValuesReturnedForGLGet(pname, &num_values); | 1150 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1151 Result* result = GetSharedMemoryAs<Result*>( | 1151 Result* result = GetSharedMemoryAs<Result*>( |
| 1152 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1152 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1153 GLint* params = result ? result->GetData() : NULL; | 1153 GLint* params = result ? result->GetData() : NULL; |
| 1154 if (!ValidateGLenumProgramParameter(pname)) { | 1154 if (!validators_->program_parameter.IsValid(pname)) { |
| 1155 SetGLError(GL_INVALID_ENUM, "glGetProgramiv: pname GL_INVALID_ENUM"); | 1155 SetGLError(GL_INVALID_ENUM, "glGetProgramiv: pname GL_INVALID_ENUM"); |
| 1156 return error::kNoError; | 1156 return error::kNoError; |
| 1157 } | 1157 } |
| 1158 if (params == NULL) { | 1158 if (params == NULL) { |
| 1159 return error::kOutOfBounds; | 1159 return error::kOutOfBounds; |
| 1160 } | 1160 } |
| 1161 // Check that the client initialized the result. | 1161 // Check that the client initialized the result. |
| 1162 if (result->size != 0) { | 1162 if (result->size != 0) { |
| 1163 return error::kInvalidArguments; | 1163 return error::kInvalidArguments; |
| 1164 } | 1164 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1176 error::Error GLES2DecoderImpl::HandleGetRenderbufferParameteriv( | 1176 error::Error GLES2DecoderImpl::HandleGetRenderbufferParameteriv( |
| 1177 uint32 immediate_data_size, const gles2::GetRenderbufferParameteriv& c) { | 1177 uint32 immediate_data_size, const gles2::GetRenderbufferParameteriv& c) { |
| 1178 GLenum target = static_cast<GLenum>(c.target); | 1178 GLenum target = static_cast<GLenum>(c.target); |
| 1179 GLenum pname = static_cast<GLenum>(c.pname); | 1179 GLenum pname = static_cast<GLenum>(c.pname); |
| 1180 typedef GetRenderbufferParameteriv::Result Result; | 1180 typedef GetRenderbufferParameteriv::Result Result; |
| 1181 GLsizei num_values = 0; | 1181 GLsizei num_values = 0; |
| 1182 GetNumValuesReturnedForGLGet(pname, &num_values); | 1182 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1183 Result* result = GetSharedMemoryAs<Result*>( | 1183 Result* result = GetSharedMemoryAs<Result*>( |
| 1184 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1184 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1185 GLint* params = result ? result->GetData() : NULL; | 1185 GLint* params = result ? result->GetData() : NULL; |
| 1186 if (!ValidateGLenumRenderBufferTarget(target)) { | 1186 if (!validators_->render_buffer_target.IsValid(target)) { |
| 1187 SetGLError( | 1187 SetGLError( |
| 1188 GL_INVALID_ENUM, | 1188 GL_INVALID_ENUM, |
| 1189 "glGetRenderbufferParameteriv: target GL_INVALID_ENUM"); | 1189 "glGetRenderbufferParameteriv: target GL_INVALID_ENUM"); |
| 1190 return error::kNoError; | 1190 return error::kNoError; |
| 1191 } | 1191 } |
| 1192 if (!ValidateGLenumRenderBufferParameter(pname)) { | 1192 if (!validators_->render_buffer_parameter.IsValid(pname)) { |
| 1193 SetGLError( | 1193 SetGLError( |
| 1194 GL_INVALID_ENUM, | 1194 GL_INVALID_ENUM, |
| 1195 "glGetRenderbufferParameteriv: pname GL_INVALID_ENUM"); | 1195 "glGetRenderbufferParameteriv: pname GL_INVALID_ENUM"); |
| 1196 return error::kNoError; | 1196 return error::kNoError; |
| 1197 } | 1197 } |
| 1198 if (params == NULL) { | 1198 if (params == NULL) { |
| 1199 return error::kOutOfBounds; | 1199 return error::kOutOfBounds; |
| 1200 } | 1200 } |
| 1201 // Check that the client initialized the result. | 1201 // Check that the client initialized the result. |
| 1202 if (result->size != 0) { | 1202 if (result->size != 0) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1216 error::Error GLES2DecoderImpl::HandleGetShaderiv( | 1216 error::Error GLES2DecoderImpl::HandleGetShaderiv( |
| 1217 uint32 immediate_data_size, const gles2::GetShaderiv& c) { | 1217 uint32 immediate_data_size, const gles2::GetShaderiv& c) { |
| 1218 GLuint shader = c.shader; | 1218 GLuint shader = c.shader; |
| 1219 GLenum pname = static_cast<GLenum>(c.pname); | 1219 GLenum pname = static_cast<GLenum>(c.pname); |
| 1220 typedef GetShaderiv::Result Result; | 1220 typedef GetShaderiv::Result Result; |
| 1221 GLsizei num_values = 0; | 1221 GLsizei num_values = 0; |
| 1222 GetNumValuesReturnedForGLGet(pname, &num_values); | 1222 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1223 Result* result = GetSharedMemoryAs<Result*>( | 1223 Result* result = GetSharedMemoryAs<Result*>( |
| 1224 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1224 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1225 GLint* params = result ? result->GetData() : NULL; | 1225 GLint* params = result ? result->GetData() : NULL; |
| 1226 if (!ValidateGLenumShaderParameter(pname)) { | 1226 if (!validators_->shader_parameter.IsValid(pname)) { |
| 1227 SetGLError(GL_INVALID_ENUM, "glGetShaderiv: pname GL_INVALID_ENUM"); | 1227 SetGLError(GL_INVALID_ENUM, "glGetShaderiv: pname GL_INVALID_ENUM"); |
| 1228 return error::kNoError; | 1228 return error::kNoError; |
| 1229 } | 1229 } |
| 1230 if (params == NULL) { | 1230 if (params == NULL) { |
| 1231 return error::kOutOfBounds; | 1231 return error::kOutOfBounds; |
| 1232 } | 1232 } |
| 1233 // Check that the client initialized the result. | 1233 // Check that the client initialized the result. |
| 1234 if (result->size != 0) { | 1234 if (result->size != 0) { |
| 1235 return error::kInvalidArguments; | 1235 return error::kInvalidArguments; |
| 1236 } | 1236 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1248 error::Error GLES2DecoderImpl::HandleGetTexParameterfv( | 1248 error::Error GLES2DecoderImpl::HandleGetTexParameterfv( |
| 1249 uint32 immediate_data_size, const gles2::GetTexParameterfv& c) { | 1249 uint32 immediate_data_size, const gles2::GetTexParameterfv& c) { |
| 1250 GLenum target = static_cast<GLenum>(c.target); | 1250 GLenum target = static_cast<GLenum>(c.target); |
| 1251 GLenum pname = static_cast<GLenum>(c.pname); | 1251 GLenum pname = static_cast<GLenum>(c.pname); |
| 1252 typedef GetTexParameterfv::Result Result; | 1252 typedef GetTexParameterfv::Result Result; |
| 1253 GLsizei num_values = 0; | 1253 GLsizei num_values = 0; |
| 1254 GetNumValuesReturnedForGLGet(pname, &num_values); | 1254 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1255 Result* result = GetSharedMemoryAs<Result*>( | 1255 Result* result = GetSharedMemoryAs<Result*>( |
| 1256 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1256 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1257 GLfloat* params = result ? result->GetData() : NULL; | 1257 GLfloat* params = result ? result->GetData() : NULL; |
| 1258 if (!ValidateGLenumTextureTarget(target)) { | 1258 if (!validators_->texture_target.IsValid(target)) { |
| 1259 SetGLError(GL_INVALID_ENUM, "glGetTexParameterfv: target GL_INVALID_ENUM"); | 1259 SetGLError(GL_INVALID_ENUM, "glGetTexParameterfv: target GL_INVALID_ENUM"); |
| 1260 return error::kNoError; | 1260 return error::kNoError; |
| 1261 } | 1261 } |
| 1262 if (!ValidateGLenumTextureParameter(pname)) { | 1262 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1263 SetGLError(GL_INVALID_ENUM, "glGetTexParameterfv: pname GL_INVALID_ENUM"); | 1263 SetGLError(GL_INVALID_ENUM, "glGetTexParameterfv: pname GL_INVALID_ENUM"); |
| 1264 return error::kNoError; | 1264 return error::kNoError; |
| 1265 } | 1265 } |
| 1266 if (params == NULL) { | 1266 if (params == NULL) { |
| 1267 return error::kOutOfBounds; | 1267 return error::kOutOfBounds; |
| 1268 } | 1268 } |
| 1269 // Check that the client initialized the result. | 1269 // Check that the client initialized the result. |
| 1270 if (result->size != 0) { | 1270 if (result->size != 0) { |
| 1271 return error::kInvalidArguments; | 1271 return error::kInvalidArguments; |
| 1272 } | 1272 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1284 error::Error GLES2DecoderImpl::HandleGetTexParameteriv( | 1284 error::Error GLES2DecoderImpl::HandleGetTexParameteriv( |
| 1285 uint32 immediate_data_size, const gles2::GetTexParameteriv& c) { | 1285 uint32 immediate_data_size, const gles2::GetTexParameteriv& c) { |
| 1286 GLenum target = static_cast<GLenum>(c.target); | 1286 GLenum target = static_cast<GLenum>(c.target); |
| 1287 GLenum pname = static_cast<GLenum>(c.pname); | 1287 GLenum pname = static_cast<GLenum>(c.pname); |
| 1288 typedef GetTexParameteriv::Result Result; | 1288 typedef GetTexParameteriv::Result Result; |
| 1289 GLsizei num_values = 0; | 1289 GLsizei num_values = 0; |
| 1290 GetNumValuesReturnedForGLGet(pname, &num_values); | 1290 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1291 Result* result = GetSharedMemoryAs<Result*>( | 1291 Result* result = GetSharedMemoryAs<Result*>( |
| 1292 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1292 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1293 GLint* params = result ? result->GetData() : NULL; | 1293 GLint* params = result ? result->GetData() : NULL; |
| 1294 if (!ValidateGLenumTextureTarget(target)) { | 1294 if (!validators_->texture_target.IsValid(target)) { |
| 1295 SetGLError(GL_INVALID_ENUM, "glGetTexParameteriv: target GL_INVALID_ENUM"); | 1295 SetGLError(GL_INVALID_ENUM, "glGetTexParameteriv: target GL_INVALID_ENUM"); |
| 1296 return error::kNoError; | 1296 return error::kNoError; |
| 1297 } | 1297 } |
| 1298 if (!ValidateGLenumTextureParameter(pname)) { | 1298 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1299 SetGLError(GL_INVALID_ENUM, "glGetTexParameteriv: pname GL_INVALID_ENUM"); | 1299 SetGLError(GL_INVALID_ENUM, "glGetTexParameteriv: pname GL_INVALID_ENUM"); |
| 1300 return error::kNoError; | 1300 return error::kNoError; |
| 1301 } | 1301 } |
| 1302 if (params == NULL) { | 1302 if (params == NULL) { |
| 1303 return error::kOutOfBounds; | 1303 return error::kOutOfBounds; |
| 1304 } | 1304 } |
| 1305 // Check that the client initialized the result. | 1305 // Check that the client initialized the result. |
| 1306 if (result->size != 0) { | 1306 if (result->size != 0) { |
| 1307 return error::kInvalidArguments; | 1307 return error::kInvalidArguments; |
| 1308 } | 1308 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1320 error::Error GLES2DecoderImpl::HandleGetVertexAttribfv( | 1320 error::Error GLES2DecoderImpl::HandleGetVertexAttribfv( |
| 1321 uint32 immediate_data_size, const gles2::GetVertexAttribfv& c) { | 1321 uint32 immediate_data_size, const gles2::GetVertexAttribfv& c) { |
| 1322 GLuint index = static_cast<GLuint>(c.index); | 1322 GLuint index = static_cast<GLuint>(c.index); |
| 1323 GLenum pname = static_cast<GLenum>(c.pname); | 1323 GLenum pname = static_cast<GLenum>(c.pname); |
| 1324 typedef GetVertexAttribfv::Result Result; | 1324 typedef GetVertexAttribfv::Result Result; |
| 1325 GLsizei num_values = 0; | 1325 GLsizei num_values = 0; |
| 1326 GetNumValuesReturnedForGLGet(pname, &num_values); | 1326 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1327 Result* result = GetSharedMemoryAs<Result*>( | 1327 Result* result = GetSharedMemoryAs<Result*>( |
| 1328 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1328 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1329 GLfloat* params = result ? result->GetData() : NULL; | 1329 GLfloat* params = result ? result->GetData() : NULL; |
| 1330 if (!ValidateGLenumVertexAttribute(pname)) { | 1330 if (!validators_->vertex_attribute.IsValid(pname)) { |
| 1331 SetGLError(GL_INVALID_ENUM, "glGetVertexAttribfv: pname GL_INVALID_ENUM"); | 1331 SetGLError(GL_INVALID_ENUM, "glGetVertexAttribfv: pname GL_INVALID_ENUM"); |
| 1332 return error::kNoError; | 1332 return error::kNoError; |
| 1333 } | 1333 } |
| 1334 if (params == NULL) { | 1334 if (params == NULL) { |
| 1335 return error::kOutOfBounds; | 1335 return error::kOutOfBounds; |
| 1336 } | 1336 } |
| 1337 // Check that the client initialized the result. | 1337 // Check that the client initialized the result. |
| 1338 if (result->size != 0) { | 1338 if (result->size != 0) { |
| 1339 return error::kInvalidArguments; | 1339 return error::kInvalidArguments; |
| 1340 } | 1340 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1352 error::Error GLES2DecoderImpl::HandleGetVertexAttribiv( | 1352 error::Error GLES2DecoderImpl::HandleGetVertexAttribiv( |
| 1353 uint32 immediate_data_size, const gles2::GetVertexAttribiv& c) { | 1353 uint32 immediate_data_size, const gles2::GetVertexAttribiv& c) { |
| 1354 GLuint index = static_cast<GLuint>(c.index); | 1354 GLuint index = static_cast<GLuint>(c.index); |
| 1355 GLenum pname = static_cast<GLenum>(c.pname); | 1355 GLenum pname = static_cast<GLenum>(c.pname); |
| 1356 typedef GetVertexAttribiv::Result Result; | 1356 typedef GetVertexAttribiv::Result Result; |
| 1357 GLsizei num_values = 0; | 1357 GLsizei num_values = 0; |
| 1358 GetNumValuesReturnedForGLGet(pname, &num_values); | 1358 GetNumValuesReturnedForGLGet(pname, &num_values); |
| 1359 Result* result = GetSharedMemoryAs<Result*>( | 1359 Result* result = GetSharedMemoryAs<Result*>( |
| 1360 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); | 1360 c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); |
| 1361 GLint* params = result ? result->GetData() : NULL; | 1361 GLint* params = result ? result->GetData() : NULL; |
| 1362 if (!ValidateGLenumVertexAttribute(pname)) { | 1362 if (!validators_->vertex_attribute.IsValid(pname)) { |
| 1363 SetGLError(GL_INVALID_ENUM, "glGetVertexAttribiv: pname GL_INVALID_ENUM"); | 1363 SetGLError(GL_INVALID_ENUM, "glGetVertexAttribiv: pname GL_INVALID_ENUM"); |
| 1364 return error::kNoError; | 1364 return error::kNoError; |
| 1365 } | 1365 } |
| 1366 if (params == NULL) { | 1366 if (params == NULL) { |
| 1367 return error::kOutOfBounds; | 1367 return error::kOutOfBounds; |
| 1368 } | 1368 } |
| 1369 // Check that the client initialized the result. | 1369 // Check that the client initialized the result. |
| 1370 if (result->size != 0) { | 1370 if (result->size != 0) { |
| 1371 return error::kInvalidArguments; | 1371 return error::kInvalidArguments; |
| 1372 } | 1372 } |
| 1373 CopyRealGLErrorsToWrapper(); | 1373 CopyRealGLErrorsToWrapper(); |
| 1374 DoGetVertexAttribiv(index, pname, params); | 1374 DoGetVertexAttribiv(index, pname, params); |
| 1375 GLenum error = glGetError(); | 1375 GLenum error = glGetError(); |
| 1376 if (error == GL_NO_ERROR) { | 1376 if (error == GL_NO_ERROR) { |
| 1377 result->SetNumResults(num_values); | 1377 result->SetNumResults(num_values); |
| 1378 } else { | 1378 } else { |
| 1379 SetGLError(error, NULL); | 1379 SetGLError(error, NULL); |
| 1380 } | 1380 } |
| 1381 return error::kNoError; | 1381 return error::kNoError; |
| 1382 } | 1382 } |
| 1383 | 1383 |
| 1384 error::Error GLES2DecoderImpl::HandleHint( | 1384 error::Error GLES2DecoderImpl::HandleHint( |
| 1385 uint32 immediate_data_size, const gles2::Hint& c) { | 1385 uint32 immediate_data_size, const gles2::Hint& c) { |
| 1386 GLenum target = static_cast<GLenum>(c.target); | 1386 GLenum target = static_cast<GLenum>(c.target); |
| 1387 GLenum mode = static_cast<GLenum>(c.mode); | 1387 GLenum mode = static_cast<GLenum>(c.mode); |
| 1388 if (!ValidateGLenumHintTarget(target)) { | 1388 if (!validators_->hint_target.IsValid(target)) { |
| 1389 SetGLError(GL_INVALID_ENUM, "glHint: target GL_INVALID_ENUM"); | 1389 SetGLError(GL_INVALID_ENUM, "glHint: target GL_INVALID_ENUM"); |
| 1390 return error::kNoError; | 1390 return error::kNoError; |
| 1391 } | 1391 } |
| 1392 if (!ValidateGLenumHintMode(mode)) { | 1392 if (!validators_->hint_mode.IsValid(mode)) { |
| 1393 SetGLError(GL_INVALID_ENUM, "glHint: mode GL_INVALID_ENUM"); | 1393 SetGLError(GL_INVALID_ENUM, "glHint: mode GL_INVALID_ENUM"); |
| 1394 return error::kNoError; | 1394 return error::kNoError; |
| 1395 } | 1395 } |
| 1396 glHint(target, mode); | 1396 glHint(target, mode); |
| 1397 return error::kNoError; | 1397 return error::kNoError; |
| 1398 } | 1398 } |
| 1399 | 1399 |
| 1400 error::Error GLES2DecoderImpl::HandleIsBuffer( | 1400 error::Error GLES2DecoderImpl::HandleIsBuffer( |
| 1401 uint32 immediate_data_size, const gles2::IsBuffer& c) { | 1401 uint32 immediate_data_size, const gles2::IsBuffer& c) { |
| 1402 GLuint buffer = c.buffer; | 1402 GLuint buffer = c.buffer; |
| 1403 typedef IsBuffer::Result Result; | 1403 typedef IsBuffer::Result Result; |
| 1404 Result* result_dst = GetSharedMemoryAs<Result*>( | 1404 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 1405 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 1405 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 1406 if (!result_dst) { | 1406 if (!result_dst) { |
| 1407 return error::kOutOfBounds; | 1407 return error::kOutOfBounds; |
| 1408 } | 1408 } |
| 1409 *result_dst = DoIsBuffer(buffer); | 1409 *result_dst = DoIsBuffer(buffer); |
| 1410 return error::kNoError; | 1410 return error::kNoError; |
| 1411 } | 1411 } |
| 1412 | 1412 |
| 1413 error::Error GLES2DecoderImpl::HandleIsEnabled( | 1413 error::Error GLES2DecoderImpl::HandleIsEnabled( |
| 1414 uint32 immediate_data_size, const gles2::IsEnabled& c) { | 1414 uint32 immediate_data_size, const gles2::IsEnabled& c) { |
| 1415 GLenum cap = static_cast<GLenum>(c.cap); | 1415 GLenum cap = static_cast<GLenum>(c.cap); |
| 1416 typedef IsEnabled::Result Result; | 1416 typedef IsEnabled::Result Result; |
| 1417 Result* result_dst = GetSharedMemoryAs<Result*>( | 1417 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 1418 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 1418 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 1419 if (!result_dst) { | 1419 if (!result_dst) { |
| 1420 return error::kOutOfBounds; | 1420 return error::kOutOfBounds; |
| 1421 } | 1421 } |
| 1422 if (!ValidateGLenumCapability(cap)) { | 1422 if (!validators_->capability.IsValid(cap)) { |
| 1423 SetGLError(GL_INVALID_ENUM, "glIsEnabled: cap GL_INVALID_ENUM"); | 1423 SetGLError(GL_INVALID_ENUM, "glIsEnabled: cap GL_INVALID_ENUM"); |
| 1424 return error::kNoError; | 1424 return error::kNoError; |
| 1425 } | 1425 } |
| 1426 *result_dst = glIsEnabled(cap); | 1426 *result_dst = glIsEnabled(cap); |
| 1427 return error::kNoError; | 1427 return error::kNoError; |
| 1428 } | 1428 } |
| 1429 | 1429 |
| 1430 error::Error GLES2DecoderImpl::HandleIsFramebuffer( | 1430 error::Error GLES2DecoderImpl::HandleIsFramebuffer( |
| 1431 uint32 immediate_data_size, const gles2::IsFramebuffer& c) { | 1431 uint32 immediate_data_size, const gles2::IsFramebuffer& c) { |
| 1432 GLuint framebuffer = c.framebuffer; | 1432 GLuint framebuffer = c.framebuffer; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 DoReleaseShaderCompiler(); | 1519 DoReleaseShaderCompiler(); |
| 1520 return error::kNoError; | 1520 return error::kNoError; |
| 1521 } | 1521 } |
| 1522 | 1522 |
| 1523 error::Error GLES2DecoderImpl::HandleRenderbufferStorage( | 1523 error::Error GLES2DecoderImpl::HandleRenderbufferStorage( |
| 1524 uint32 immediate_data_size, const gles2::RenderbufferStorage& c) { | 1524 uint32 immediate_data_size, const gles2::RenderbufferStorage& c) { |
| 1525 GLenum target = static_cast<GLenum>(c.target); | 1525 GLenum target = static_cast<GLenum>(c.target); |
| 1526 GLenum internalformat = static_cast<GLenum>(c.internalformat); | 1526 GLenum internalformat = static_cast<GLenum>(c.internalformat); |
| 1527 GLsizei width = static_cast<GLsizei>(c.width); | 1527 GLsizei width = static_cast<GLsizei>(c.width); |
| 1528 GLsizei height = static_cast<GLsizei>(c.height); | 1528 GLsizei height = static_cast<GLsizei>(c.height); |
| 1529 if (!ValidateGLenumRenderBufferTarget(target)) { | 1529 if (!validators_->render_buffer_target.IsValid(target)) { |
| 1530 SetGLError( | 1530 SetGLError( |
| 1531 GL_INVALID_ENUM, "glRenderbufferStorage: target GL_INVALID_ENUM"); | 1531 GL_INVALID_ENUM, "glRenderbufferStorage: target GL_INVALID_ENUM"); |
| 1532 return error::kNoError; | 1532 return error::kNoError; |
| 1533 } | 1533 } |
| 1534 if (!ValidateGLenumRenderBufferFormat(internalformat)) { | 1534 if (!validators_->render_buffer_format.IsValid(internalformat)) { |
| 1535 SetGLError( | 1535 SetGLError( |
| 1536 GL_INVALID_ENUM, | 1536 GL_INVALID_ENUM, |
| 1537 "glRenderbufferStorage: internalformat GL_INVALID_ENUM"); | 1537 "glRenderbufferStorage: internalformat GL_INVALID_ENUM"); |
| 1538 return error::kNoError; | 1538 return error::kNoError; |
| 1539 } | 1539 } |
| 1540 if (width < 0) { | 1540 if (width < 0) { |
| 1541 SetGLError(GL_INVALID_VALUE, "glRenderbufferStorage: width < 0"); | 1541 SetGLError(GL_INVALID_VALUE, "glRenderbufferStorage: width < 0"); |
| 1542 return error::kNoError; | 1542 return error::kNoError; |
| 1543 } | 1543 } |
| 1544 if (height < 0) { | 1544 if (height < 0) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1573 } | 1573 } |
| 1574 glScissor(x, y, width, height); | 1574 glScissor(x, y, width, height); |
| 1575 return error::kNoError; | 1575 return error::kNoError; |
| 1576 } | 1576 } |
| 1577 | 1577 |
| 1578 error::Error GLES2DecoderImpl::HandleStencilFunc( | 1578 error::Error GLES2DecoderImpl::HandleStencilFunc( |
| 1579 uint32 immediate_data_size, const gles2::StencilFunc& c) { | 1579 uint32 immediate_data_size, const gles2::StencilFunc& c) { |
| 1580 GLenum func = static_cast<GLenum>(c.func); | 1580 GLenum func = static_cast<GLenum>(c.func); |
| 1581 GLint ref = static_cast<GLint>(c.ref); | 1581 GLint ref = static_cast<GLint>(c.ref); |
| 1582 GLuint mask = static_cast<GLuint>(c.mask); | 1582 GLuint mask = static_cast<GLuint>(c.mask); |
| 1583 if (!ValidateGLenumCmpFunction(func)) { | 1583 if (!validators_->cmp_function.IsValid(func)) { |
| 1584 SetGLError(GL_INVALID_ENUM, "glStencilFunc: func GL_INVALID_ENUM"); | 1584 SetGLError(GL_INVALID_ENUM, "glStencilFunc: func GL_INVALID_ENUM"); |
| 1585 return error::kNoError; | 1585 return error::kNoError; |
| 1586 } | 1586 } |
| 1587 glStencilFunc(func, ref, mask); | 1587 glStencilFunc(func, ref, mask); |
| 1588 return error::kNoError; | 1588 return error::kNoError; |
| 1589 } | 1589 } |
| 1590 | 1590 |
| 1591 error::Error GLES2DecoderImpl::HandleStencilFuncSeparate( | 1591 error::Error GLES2DecoderImpl::HandleStencilFuncSeparate( |
| 1592 uint32 immediate_data_size, const gles2::StencilFuncSeparate& c) { | 1592 uint32 immediate_data_size, const gles2::StencilFuncSeparate& c) { |
| 1593 GLenum face = static_cast<GLenum>(c.face); | 1593 GLenum face = static_cast<GLenum>(c.face); |
| 1594 GLenum func = static_cast<GLenum>(c.func); | 1594 GLenum func = static_cast<GLenum>(c.func); |
| 1595 GLint ref = static_cast<GLint>(c.ref); | 1595 GLint ref = static_cast<GLint>(c.ref); |
| 1596 GLuint mask = static_cast<GLuint>(c.mask); | 1596 GLuint mask = static_cast<GLuint>(c.mask); |
| 1597 if (!ValidateGLenumFaceType(face)) { | 1597 if (!validators_->face_type.IsValid(face)) { |
| 1598 SetGLError(GL_INVALID_ENUM, "glStencilFuncSeparate: face GL_INVALID_ENUM"); | 1598 SetGLError(GL_INVALID_ENUM, "glStencilFuncSeparate: face GL_INVALID_ENUM"); |
| 1599 return error::kNoError; | 1599 return error::kNoError; |
| 1600 } | 1600 } |
| 1601 if (!ValidateGLenumCmpFunction(func)) { | 1601 if (!validators_->cmp_function.IsValid(func)) { |
| 1602 SetGLError(GL_INVALID_ENUM, "glStencilFuncSeparate: func GL_INVALID_ENUM"); | 1602 SetGLError(GL_INVALID_ENUM, "glStencilFuncSeparate: func GL_INVALID_ENUM"); |
| 1603 return error::kNoError; | 1603 return error::kNoError; |
| 1604 } | 1604 } |
| 1605 glStencilFuncSeparate(face, func, ref, mask); | 1605 glStencilFuncSeparate(face, func, ref, mask); |
| 1606 return error::kNoError; | 1606 return error::kNoError; |
| 1607 } | 1607 } |
| 1608 | 1608 |
| 1609 error::Error GLES2DecoderImpl::HandleStencilMask( | 1609 error::Error GLES2DecoderImpl::HandleStencilMask( |
| 1610 uint32 immediate_data_size, const gles2::StencilMask& c) { | 1610 uint32 immediate_data_size, const gles2::StencilMask& c) { |
| 1611 GLuint mask = static_cast<GLuint>(c.mask); | 1611 GLuint mask = static_cast<GLuint>(c.mask); |
| 1612 glStencilMask(mask); | 1612 glStencilMask(mask); |
| 1613 return error::kNoError; | 1613 return error::kNoError; |
| 1614 } | 1614 } |
| 1615 | 1615 |
| 1616 error::Error GLES2DecoderImpl::HandleStencilMaskSeparate( | 1616 error::Error GLES2DecoderImpl::HandleStencilMaskSeparate( |
| 1617 uint32 immediate_data_size, const gles2::StencilMaskSeparate& c) { | 1617 uint32 immediate_data_size, const gles2::StencilMaskSeparate& c) { |
| 1618 GLenum face = static_cast<GLenum>(c.face); | 1618 GLenum face = static_cast<GLenum>(c.face); |
| 1619 GLuint mask = static_cast<GLuint>(c.mask); | 1619 GLuint mask = static_cast<GLuint>(c.mask); |
| 1620 if (!ValidateGLenumFaceType(face)) { | 1620 if (!validators_->face_type.IsValid(face)) { |
| 1621 SetGLError(GL_INVALID_ENUM, "glStencilMaskSeparate: face GL_INVALID_ENUM"); | 1621 SetGLError(GL_INVALID_ENUM, "glStencilMaskSeparate: face GL_INVALID_ENUM"); |
| 1622 return error::kNoError; | 1622 return error::kNoError; |
| 1623 } | 1623 } |
| 1624 glStencilMaskSeparate(face, mask); | 1624 glStencilMaskSeparate(face, mask); |
| 1625 return error::kNoError; | 1625 return error::kNoError; |
| 1626 } | 1626 } |
| 1627 | 1627 |
| 1628 error::Error GLES2DecoderImpl::HandleStencilOp( | 1628 error::Error GLES2DecoderImpl::HandleStencilOp( |
| 1629 uint32 immediate_data_size, const gles2::StencilOp& c) { | 1629 uint32 immediate_data_size, const gles2::StencilOp& c) { |
| 1630 GLenum fail = static_cast<GLenum>(c.fail); | 1630 GLenum fail = static_cast<GLenum>(c.fail); |
| 1631 GLenum zfail = static_cast<GLenum>(c.zfail); | 1631 GLenum zfail = static_cast<GLenum>(c.zfail); |
| 1632 GLenum zpass = static_cast<GLenum>(c.zpass); | 1632 GLenum zpass = static_cast<GLenum>(c.zpass); |
| 1633 if (!ValidateGLenumStencilOp(fail)) { | 1633 if (!validators_->stencil_op.IsValid(fail)) { |
| 1634 SetGLError(GL_INVALID_ENUM, "glStencilOp: fail GL_INVALID_ENUM"); | 1634 SetGLError(GL_INVALID_ENUM, "glStencilOp: fail GL_INVALID_ENUM"); |
| 1635 return error::kNoError; | 1635 return error::kNoError; |
| 1636 } | 1636 } |
| 1637 if (!ValidateGLenumStencilOp(zfail)) { | 1637 if (!validators_->stencil_op.IsValid(zfail)) { |
| 1638 SetGLError(GL_INVALID_ENUM, "glStencilOp: zfail GL_INVALID_ENUM"); | 1638 SetGLError(GL_INVALID_ENUM, "glStencilOp: zfail GL_INVALID_ENUM"); |
| 1639 return error::kNoError; | 1639 return error::kNoError; |
| 1640 } | 1640 } |
| 1641 if (!ValidateGLenumStencilOp(zpass)) { | 1641 if (!validators_->stencil_op.IsValid(zpass)) { |
| 1642 SetGLError(GL_INVALID_ENUM, "glStencilOp: zpass GL_INVALID_ENUM"); | 1642 SetGLError(GL_INVALID_ENUM, "glStencilOp: zpass GL_INVALID_ENUM"); |
| 1643 return error::kNoError; | 1643 return error::kNoError; |
| 1644 } | 1644 } |
| 1645 glStencilOp(fail, zfail, zpass); | 1645 glStencilOp(fail, zfail, zpass); |
| 1646 return error::kNoError; | 1646 return error::kNoError; |
| 1647 } | 1647 } |
| 1648 | 1648 |
| 1649 error::Error GLES2DecoderImpl::HandleStencilOpSeparate( | 1649 error::Error GLES2DecoderImpl::HandleStencilOpSeparate( |
| 1650 uint32 immediate_data_size, const gles2::StencilOpSeparate& c) { | 1650 uint32 immediate_data_size, const gles2::StencilOpSeparate& c) { |
| 1651 GLenum face = static_cast<GLenum>(c.face); | 1651 GLenum face = static_cast<GLenum>(c.face); |
| 1652 GLenum fail = static_cast<GLenum>(c.fail); | 1652 GLenum fail = static_cast<GLenum>(c.fail); |
| 1653 GLenum zfail = static_cast<GLenum>(c.zfail); | 1653 GLenum zfail = static_cast<GLenum>(c.zfail); |
| 1654 GLenum zpass = static_cast<GLenum>(c.zpass); | 1654 GLenum zpass = static_cast<GLenum>(c.zpass); |
| 1655 if (!ValidateGLenumFaceType(face)) { | 1655 if (!validators_->face_type.IsValid(face)) { |
| 1656 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate: face GL_INVALID_ENUM"); | 1656 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate: face GL_INVALID_ENUM"); |
| 1657 return error::kNoError; | 1657 return error::kNoError; |
| 1658 } | 1658 } |
| 1659 if (!ValidateGLenumStencilOp(fail)) { | 1659 if (!validators_->stencil_op.IsValid(fail)) { |
| 1660 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate: fail GL_INVALID_ENUM"); | 1660 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate: fail GL_INVALID_ENUM"); |
| 1661 return error::kNoError; | 1661 return error::kNoError; |
| 1662 } | 1662 } |
| 1663 if (!ValidateGLenumStencilOp(zfail)) { | 1663 if (!validators_->stencil_op.IsValid(zfail)) { |
| 1664 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate: zfail GL_INVALID_ENUM"); | 1664 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate: zfail GL_INVALID_ENUM"); |
| 1665 return error::kNoError; | 1665 return error::kNoError; |
| 1666 } | 1666 } |
| 1667 if (!ValidateGLenumStencilOp(zpass)) { | 1667 if (!validators_->stencil_op.IsValid(zpass)) { |
| 1668 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate: zpass GL_INVALID_ENUM"); | 1668 SetGLError(GL_INVALID_ENUM, "glStencilOpSeparate: zpass GL_INVALID_ENUM"); |
| 1669 return error::kNoError; | 1669 return error::kNoError; |
| 1670 } | 1670 } |
| 1671 glStencilOpSeparate(face, fail, zfail, zpass); | 1671 glStencilOpSeparate(face, fail, zfail, zpass); |
| 1672 return error::kNoError; | 1672 return error::kNoError; |
| 1673 } | 1673 } |
| 1674 | 1674 |
| 1675 error::Error GLES2DecoderImpl::HandleTexParameterf( | 1675 error::Error GLES2DecoderImpl::HandleTexParameterf( |
| 1676 uint32 immediate_data_size, const gles2::TexParameterf& c) { | 1676 uint32 immediate_data_size, const gles2::TexParameterf& c) { |
| 1677 GLenum target = static_cast<GLenum>(c.target); | 1677 GLenum target = static_cast<GLenum>(c.target); |
| 1678 GLenum pname = static_cast<GLenum>(c.pname); | 1678 GLenum pname = static_cast<GLenum>(c.pname); |
| 1679 GLfloat param = static_cast<GLfloat>(c.param); | 1679 GLfloat param = static_cast<GLfloat>(c.param); |
| 1680 if (!ValidateGLenumTextureBindTarget(target)) { | 1680 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1681 SetGLError(GL_INVALID_ENUM, "glTexParameterf: target GL_INVALID_ENUM"); | 1681 SetGLError(GL_INVALID_ENUM, "glTexParameterf: target GL_INVALID_ENUM"); |
| 1682 return error::kNoError; | 1682 return error::kNoError; |
| 1683 } | 1683 } |
| 1684 if (!ValidateGLenumTextureParameter(pname)) { | 1684 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1685 SetGLError(GL_INVALID_ENUM, "glTexParameterf: pname GL_INVALID_ENUM"); | 1685 SetGLError(GL_INVALID_ENUM, "glTexParameterf: pname GL_INVALID_ENUM"); |
| 1686 return error::kNoError; | 1686 return error::kNoError; |
| 1687 } | 1687 } |
| 1688 DoTexParameterf(target, pname, param); | 1688 DoTexParameterf(target, pname, param); |
| 1689 return error::kNoError; | 1689 return error::kNoError; |
| 1690 } | 1690 } |
| 1691 | 1691 |
| 1692 error::Error GLES2DecoderImpl::HandleTexParameterfv( | 1692 error::Error GLES2DecoderImpl::HandleTexParameterfv( |
| 1693 uint32 immediate_data_size, const gles2::TexParameterfv& c) { | 1693 uint32 immediate_data_size, const gles2::TexParameterfv& c) { |
| 1694 GLenum target = static_cast<GLenum>(c.target); | 1694 GLenum target = static_cast<GLenum>(c.target); |
| 1695 GLenum pname = static_cast<GLenum>(c.pname); | 1695 GLenum pname = static_cast<GLenum>(c.pname); |
| 1696 uint32 data_size; | 1696 uint32 data_size; |
| 1697 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | 1697 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { |
| 1698 return error::kOutOfBounds; | 1698 return error::kOutOfBounds; |
| 1699 } | 1699 } |
| 1700 const GLfloat* params = GetSharedMemoryAs<const GLfloat*>( | 1700 const GLfloat* params = GetSharedMemoryAs<const GLfloat*>( |
| 1701 c.params_shm_id, c.params_shm_offset, data_size); | 1701 c.params_shm_id, c.params_shm_offset, data_size); |
| 1702 if (!ValidateGLenumTextureBindTarget(target)) { | 1702 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1703 SetGLError(GL_INVALID_ENUM, "glTexParameterfv: target GL_INVALID_ENUM"); | 1703 SetGLError(GL_INVALID_ENUM, "glTexParameterfv: target GL_INVALID_ENUM"); |
| 1704 return error::kNoError; | 1704 return error::kNoError; |
| 1705 } | 1705 } |
| 1706 if (!ValidateGLenumTextureParameter(pname)) { | 1706 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1707 SetGLError(GL_INVALID_ENUM, "glTexParameterfv: pname GL_INVALID_ENUM"); | 1707 SetGLError(GL_INVALID_ENUM, "glTexParameterfv: pname GL_INVALID_ENUM"); |
| 1708 return error::kNoError; | 1708 return error::kNoError; |
| 1709 } | 1709 } |
| 1710 if (params == NULL) { | 1710 if (params == NULL) { |
| 1711 return error::kOutOfBounds; | 1711 return error::kOutOfBounds; |
| 1712 } | 1712 } |
| 1713 DoTexParameterfv(target, pname, params); | 1713 DoTexParameterfv(target, pname, params); |
| 1714 return error::kNoError; | 1714 return error::kNoError; |
| 1715 } | 1715 } |
| 1716 | 1716 |
| 1717 error::Error GLES2DecoderImpl::HandleTexParameterfvImmediate( | 1717 error::Error GLES2DecoderImpl::HandleTexParameterfvImmediate( |
| 1718 uint32 immediate_data_size, const gles2::TexParameterfvImmediate& c) { | 1718 uint32 immediate_data_size, const gles2::TexParameterfvImmediate& c) { |
| 1719 GLenum target = static_cast<GLenum>(c.target); | 1719 GLenum target = static_cast<GLenum>(c.target); |
| 1720 GLenum pname = static_cast<GLenum>(c.pname); | 1720 GLenum pname = static_cast<GLenum>(c.pname); |
| 1721 uint32 data_size; | 1721 uint32 data_size; |
| 1722 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { | 1722 if (!ComputeDataSize(1, sizeof(GLfloat), 1, &data_size)) { |
| 1723 return error::kOutOfBounds; | 1723 return error::kOutOfBounds; |
| 1724 } | 1724 } |
| 1725 if (data_size > immediate_data_size) { | 1725 if (data_size > immediate_data_size) { |
| 1726 return error::kOutOfBounds; | 1726 return error::kOutOfBounds; |
| 1727 } | 1727 } |
| 1728 const GLfloat* params = GetImmediateDataAs<const GLfloat*>( | 1728 const GLfloat* params = GetImmediateDataAs<const GLfloat*>( |
| 1729 c, data_size, immediate_data_size); | 1729 c, data_size, immediate_data_size); |
| 1730 if (!ValidateGLenumTextureBindTarget(target)) { | 1730 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1731 SetGLError(GL_INVALID_ENUM, "glTexParameterfv: target GL_INVALID_ENUM"); | 1731 SetGLError(GL_INVALID_ENUM, "glTexParameterfv: target GL_INVALID_ENUM"); |
| 1732 return error::kNoError; | 1732 return error::kNoError; |
| 1733 } | 1733 } |
| 1734 if (!ValidateGLenumTextureParameter(pname)) { | 1734 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1735 SetGLError(GL_INVALID_ENUM, "glTexParameterfv: pname GL_INVALID_ENUM"); | 1735 SetGLError(GL_INVALID_ENUM, "glTexParameterfv: pname GL_INVALID_ENUM"); |
| 1736 return error::kNoError; | 1736 return error::kNoError; |
| 1737 } | 1737 } |
| 1738 if (params == NULL) { | 1738 if (params == NULL) { |
| 1739 return error::kOutOfBounds; | 1739 return error::kOutOfBounds; |
| 1740 } | 1740 } |
| 1741 DoTexParameterfv(target, pname, params); | 1741 DoTexParameterfv(target, pname, params); |
| 1742 return error::kNoError; | 1742 return error::kNoError; |
| 1743 } | 1743 } |
| 1744 | 1744 |
| 1745 error::Error GLES2DecoderImpl::HandleTexParameteri( | 1745 error::Error GLES2DecoderImpl::HandleTexParameteri( |
| 1746 uint32 immediate_data_size, const gles2::TexParameteri& c) { | 1746 uint32 immediate_data_size, const gles2::TexParameteri& c) { |
| 1747 GLenum target = static_cast<GLenum>(c.target); | 1747 GLenum target = static_cast<GLenum>(c.target); |
| 1748 GLenum pname = static_cast<GLenum>(c.pname); | 1748 GLenum pname = static_cast<GLenum>(c.pname); |
| 1749 GLint param = static_cast<GLint>(c.param); | 1749 GLint param = static_cast<GLint>(c.param); |
| 1750 if (!ValidateGLenumTextureBindTarget(target)) { | 1750 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1751 SetGLError(GL_INVALID_ENUM, "glTexParameteri: target GL_INVALID_ENUM"); | 1751 SetGLError(GL_INVALID_ENUM, "glTexParameteri: target GL_INVALID_ENUM"); |
| 1752 return error::kNoError; | 1752 return error::kNoError; |
| 1753 } | 1753 } |
| 1754 if (!ValidateGLenumTextureParameter(pname)) { | 1754 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1755 SetGLError(GL_INVALID_ENUM, "glTexParameteri: pname GL_INVALID_ENUM"); | 1755 SetGLError(GL_INVALID_ENUM, "glTexParameteri: pname GL_INVALID_ENUM"); |
| 1756 return error::kNoError; | 1756 return error::kNoError; |
| 1757 } | 1757 } |
| 1758 DoTexParameteri(target, pname, param); | 1758 DoTexParameteri(target, pname, param); |
| 1759 return error::kNoError; | 1759 return error::kNoError; |
| 1760 } | 1760 } |
| 1761 | 1761 |
| 1762 error::Error GLES2DecoderImpl::HandleTexParameteriv( | 1762 error::Error GLES2DecoderImpl::HandleTexParameteriv( |
| 1763 uint32 immediate_data_size, const gles2::TexParameteriv& c) { | 1763 uint32 immediate_data_size, const gles2::TexParameteriv& c) { |
| 1764 GLenum target = static_cast<GLenum>(c.target); | 1764 GLenum target = static_cast<GLenum>(c.target); |
| 1765 GLenum pname = static_cast<GLenum>(c.pname); | 1765 GLenum pname = static_cast<GLenum>(c.pname); |
| 1766 uint32 data_size; | 1766 uint32 data_size; |
| 1767 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { | 1767 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { |
| 1768 return error::kOutOfBounds; | 1768 return error::kOutOfBounds; |
| 1769 } | 1769 } |
| 1770 const GLint* params = GetSharedMemoryAs<const GLint*>( | 1770 const GLint* params = GetSharedMemoryAs<const GLint*>( |
| 1771 c.params_shm_id, c.params_shm_offset, data_size); | 1771 c.params_shm_id, c.params_shm_offset, data_size); |
| 1772 if (!ValidateGLenumTextureBindTarget(target)) { | 1772 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1773 SetGLError(GL_INVALID_ENUM, "glTexParameteriv: target GL_INVALID_ENUM"); | 1773 SetGLError(GL_INVALID_ENUM, "glTexParameteriv: target GL_INVALID_ENUM"); |
| 1774 return error::kNoError; | 1774 return error::kNoError; |
| 1775 } | 1775 } |
| 1776 if (!ValidateGLenumTextureParameter(pname)) { | 1776 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1777 SetGLError(GL_INVALID_ENUM, "glTexParameteriv: pname GL_INVALID_ENUM"); | 1777 SetGLError(GL_INVALID_ENUM, "glTexParameteriv: pname GL_INVALID_ENUM"); |
| 1778 return error::kNoError; | 1778 return error::kNoError; |
| 1779 } | 1779 } |
| 1780 if (params == NULL) { | 1780 if (params == NULL) { |
| 1781 return error::kOutOfBounds; | 1781 return error::kOutOfBounds; |
| 1782 } | 1782 } |
| 1783 DoTexParameteriv(target, pname, params); | 1783 DoTexParameteriv(target, pname, params); |
| 1784 return error::kNoError; | 1784 return error::kNoError; |
| 1785 } | 1785 } |
| 1786 | 1786 |
| 1787 error::Error GLES2DecoderImpl::HandleTexParameterivImmediate( | 1787 error::Error GLES2DecoderImpl::HandleTexParameterivImmediate( |
| 1788 uint32 immediate_data_size, const gles2::TexParameterivImmediate& c) { | 1788 uint32 immediate_data_size, const gles2::TexParameterivImmediate& c) { |
| 1789 GLenum target = static_cast<GLenum>(c.target); | 1789 GLenum target = static_cast<GLenum>(c.target); |
| 1790 GLenum pname = static_cast<GLenum>(c.pname); | 1790 GLenum pname = static_cast<GLenum>(c.pname); |
| 1791 uint32 data_size; | 1791 uint32 data_size; |
| 1792 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { | 1792 if (!ComputeDataSize(1, sizeof(GLint), 1, &data_size)) { |
| 1793 return error::kOutOfBounds; | 1793 return error::kOutOfBounds; |
| 1794 } | 1794 } |
| 1795 if (data_size > immediate_data_size) { | 1795 if (data_size > immediate_data_size) { |
| 1796 return error::kOutOfBounds; | 1796 return error::kOutOfBounds; |
| 1797 } | 1797 } |
| 1798 const GLint* params = GetImmediateDataAs<const GLint*>( | 1798 const GLint* params = GetImmediateDataAs<const GLint*>( |
| 1799 c, data_size, immediate_data_size); | 1799 c, data_size, immediate_data_size); |
| 1800 if (!ValidateGLenumTextureBindTarget(target)) { | 1800 if (!validators_->texture_bind_target.IsValid(target)) { |
| 1801 SetGLError(GL_INVALID_ENUM, "glTexParameteriv: target GL_INVALID_ENUM"); | 1801 SetGLError(GL_INVALID_ENUM, "glTexParameteriv: target GL_INVALID_ENUM"); |
| 1802 return error::kNoError; | 1802 return error::kNoError; |
| 1803 } | 1803 } |
| 1804 if (!ValidateGLenumTextureParameter(pname)) { | 1804 if (!validators_->texture_parameter.IsValid(pname)) { |
| 1805 SetGLError(GL_INVALID_ENUM, "glTexParameteriv: pname GL_INVALID_ENUM"); | 1805 SetGLError(GL_INVALID_ENUM, "glTexParameteriv: pname GL_INVALID_ENUM"); |
| 1806 return error::kNoError; | 1806 return error::kNoError; |
| 1807 } | 1807 } |
| 1808 if (params == NULL) { | 1808 if (params == NULL) { |
| 1809 return error::kOutOfBounds; | 1809 return error::kOutOfBounds; |
| 1810 } | 1810 } |
| 1811 DoTexParameteriv(target, pname, params); | 1811 DoTexParameteriv(target, pname, params); |
| 1812 return error::kNoError; | 1812 return error::kNoError; |
| 1813 } | 1813 } |
| 1814 | 1814 |
| 1815 error::Error GLES2DecoderImpl::HandleTexSubImage2D( | 1815 error::Error GLES2DecoderImpl::HandleTexSubImage2D( |
| 1816 uint32 immediate_data_size, const gles2::TexSubImage2D& c) { | 1816 uint32 immediate_data_size, const gles2::TexSubImage2D& c) { |
| 1817 GLenum target = static_cast<GLenum>(c.target); | 1817 GLenum target = static_cast<GLenum>(c.target); |
| 1818 GLint level = static_cast<GLint>(c.level); | 1818 GLint level = static_cast<GLint>(c.level); |
| 1819 GLint xoffset = static_cast<GLint>(c.xoffset); | 1819 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 1820 GLint yoffset = static_cast<GLint>(c.yoffset); | 1820 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 1821 GLsizei width = static_cast<GLsizei>(c.width); | 1821 GLsizei width = static_cast<GLsizei>(c.width); |
| 1822 GLsizei height = static_cast<GLsizei>(c.height); | 1822 GLsizei height = static_cast<GLsizei>(c.height); |
| 1823 GLenum format = static_cast<GLenum>(c.format); | 1823 GLenum format = static_cast<GLenum>(c.format); |
| 1824 GLenum type = static_cast<GLenum>(c.type); | 1824 GLenum type = static_cast<GLenum>(c.type); |
| 1825 uint32 data_size; | 1825 uint32 data_size; |
| 1826 if (!GLES2Util::ComputeImageDataSize( | 1826 if (!GLES2Util::ComputeImageDataSize( |
| 1827 width, height, format, type, unpack_alignment_, &data_size)) { | 1827 width, height, format, type, unpack_alignment_, &data_size)) { |
| 1828 return error::kOutOfBounds; | 1828 return error::kOutOfBounds; |
| 1829 } | 1829 } |
| 1830 const void* pixels = GetSharedMemoryAs<const void*>( | 1830 const void* pixels = GetSharedMemoryAs<const void*>( |
| 1831 c.pixels_shm_id, c.pixels_shm_offset, data_size); | 1831 c.pixels_shm_id, c.pixels_shm_offset, data_size); |
| 1832 if (!ValidateGLenumTextureTarget(target)) { | 1832 if (!validators_->texture_target.IsValid(target)) { |
| 1833 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: target GL_INVALID_ENUM"); | 1833 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: target GL_INVALID_ENUM"); |
| 1834 return error::kNoError; | 1834 return error::kNoError; |
| 1835 } | 1835 } |
| 1836 if (width < 0) { | 1836 if (width < 0) { |
| 1837 SetGLError(GL_INVALID_VALUE, "glTexSubImage2D: width < 0"); | 1837 SetGLError(GL_INVALID_VALUE, "glTexSubImage2D: width < 0"); |
| 1838 return error::kNoError; | 1838 return error::kNoError; |
| 1839 } | 1839 } |
| 1840 if (height < 0) { | 1840 if (height < 0) { |
| 1841 SetGLError(GL_INVALID_VALUE, "glTexSubImage2D: height < 0"); | 1841 SetGLError(GL_INVALID_VALUE, "glTexSubImage2D: height < 0"); |
| 1842 return error::kNoError; | 1842 return error::kNoError; |
| 1843 } | 1843 } |
| 1844 if (!ValidateGLenumTextureFormat(format)) { | 1844 if (!validators_->texture_format.IsValid(format)) { |
| 1845 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: format GL_INVALID_ENUM"); | 1845 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: format GL_INVALID_ENUM"); |
| 1846 return error::kNoError; | 1846 return error::kNoError; |
| 1847 } | 1847 } |
| 1848 if (!ValidateGLenumPixelType(type)) { | 1848 if (!validators_->pixel_type.IsValid(type)) { |
| 1849 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: type GL_INVALID_ENUM"); | 1849 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: type GL_INVALID_ENUM"); |
| 1850 return error::kNoError; | 1850 return error::kNoError; |
| 1851 } | 1851 } |
| 1852 if (pixels == NULL) { | 1852 if (pixels == NULL) { |
| 1853 return error::kOutOfBounds; | 1853 return error::kOutOfBounds; |
| 1854 } | 1854 } |
| 1855 glTexSubImage2D( | 1855 glTexSubImage2D( |
| 1856 target, level, xoffset, yoffset, width, height, format, type, pixels); | 1856 target, level, xoffset, yoffset, width, height, format, type, pixels); |
| 1857 return error::kNoError; | 1857 return error::kNoError; |
| 1858 } | 1858 } |
| 1859 | 1859 |
| 1860 error::Error GLES2DecoderImpl::HandleTexSubImage2DImmediate( | 1860 error::Error GLES2DecoderImpl::HandleTexSubImage2DImmediate( |
| 1861 uint32 immediate_data_size, const gles2::TexSubImage2DImmediate& c) { | 1861 uint32 immediate_data_size, const gles2::TexSubImage2DImmediate& c) { |
| 1862 GLenum target = static_cast<GLenum>(c.target); | 1862 GLenum target = static_cast<GLenum>(c.target); |
| 1863 GLint level = static_cast<GLint>(c.level); | 1863 GLint level = static_cast<GLint>(c.level); |
| 1864 GLint xoffset = static_cast<GLint>(c.xoffset); | 1864 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 1865 GLint yoffset = static_cast<GLint>(c.yoffset); | 1865 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 1866 GLsizei width = static_cast<GLsizei>(c.width); | 1866 GLsizei width = static_cast<GLsizei>(c.width); |
| 1867 GLsizei height = static_cast<GLsizei>(c.height); | 1867 GLsizei height = static_cast<GLsizei>(c.height); |
| 1868 GLenum format = static_cast<GLenum>(c.format); | 1868 GLenum format = static_cast<GLenum>(c.format); |
| 1869 GLenum type = static_cast<GLenum>(c.type); | 1869 GLenum type = static_cast<GLenum>(c.type); |
| 1870 uint32 data_size; | 1870 uint32 data_size; |
| 1871 if (!GLES2Util::ComputeImageDataSize( | 1871 if (!GLES2Util::ComputeImageDataSize( |
| 1872 width, height, format, type, unpack_alignment_, &data_size)) { | 1872 width, height, format, type, unpack_alignment_, &data_size)) { |
| 1873 return error::kOutOfBounds; | 1873 return error::kOutOfBounds; |
| 1874 } | 1874 } |
| 1875 const void* pixels = GetImmediateDataAs<const void*>( | 1875 const void* pixels = GetImmediateDataAs<const void*>( |
| 1876 c, data_size, immediate_data_size); | 1876 c, data_size, immediate_data_size); |
| 1877 if (!ValidateGLenumTextureTarget(target)) { | 1877 if (!validators_->texture_target.IsValid(target)) { |
| 1878 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: target GL_INVALID_ENUM"); | 1878 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: target GL_INVALID_ENUM"); |
| 1879 return error::kNoError; | 1879 return error::kNoError; |
| 1880 } | 1880 } |
| 1881 if (width < 0) { | 1881 if (width < 0) { |
| 1882 SetGLError(GL_INVALID_VALUE, "glTexSubImage2D: width < 0"); | 1882 SetGLError(GL_INVALID_VALUE, "glTexSubImage2D: width < 0"); |
| 1883 return error::kNoError; | 1883 return error::kNoError; |
| 1884 } | 1884 } |
| 1885 if (height < 0) { | 1885 if (height < 0) { |
| 1886 SetGLError(GL_INVALID_VALUE, "glTexSubImage2D: height < 0"); | 1886 SetGLError(GL_INVALID_VALUE, "glTexSubImage2D: height < 0"); |
| 1887 return error::kNoError; | 1887 return error::kNoError; |
| 1888 } | 1888 } |
| 1889 if (!ValidateGLenumTextureFormat(format)) { | 1889 if (!validators_->texture_format.IsValid(format)) { |
| 1890 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: format GL_INVALID_ENUM"); | 1890 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: format GL_INVALID_ENUM"); |
| 1891 return error::kNoError; | 1891 return error::kNoError; |
| 1892 } | 1892 } |
| 1893 if (!ValidateGLenumPixelType(type)) { | 1893 if (!validators_->pixel_type.IsValid(type)) { |
| 1894 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: type GL_INVALID_ENUM"); | 1894 SetGLError(GL_INVALID_ENUM, "glTexSubImage2D: type GL_INVALID_ENUM"); |
| 1895 return error::kNoError; | 1895 return error::kNoError; |
| 1896 } | 1896 } |
| 1897 if (pixels == NULL) { | 1897 if (pixels == NULL) { |
| 1898 return error::kOutOfBounds; | 1898 return error::kOutOfBounds; |
| 1899 } | 1899 } |
| 1900 glTexSubImage2D( | 1900 glTexSubImage2D( |
| 1901 target, level, xoffset, yoffset, width, height, format, type, pixels); | 1901 target, level, xoffset, yoffset, width, height, format, type, pixels); |
| 1902 return error::kNoError; | 1902 return error::kNoError; |
| 1903 } | 1903 } |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2350 uint32 data_size; | 2350 uint32 data_size; |
| 2351 if (!ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { | 2351 if (!ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { |
| 2352 return error::kOutOfBounds; | 2352 return error::kOutOfBounds; |
| 2353 } | 2353 } |
| 2354 const GLfloat* value = GetSharedMemoryAs<const GLfloat*>( | 2354 const GLfloat* value = GetSharedMemoryAs<const GLfloat*>( |
| 2355 c.value_shm_id, c.value_shm_offset, data_size); | 2355 c.value_shm_id, c.value_shm_offset, data_size); |
| 2356 if (count < 0) { | 2356 if (count < 0) { |
| 2357 SetGLError(GL_INVALID_VALUE, "glUniformMatrix2fv: count < 0"); | 2357 SetGLError(GL_INVALID_VALUE, "glUniformMatrix2fv: count < 0"); |
| 2358 return error::kNoError; | 2358 return error::kNoError; |
| 2359 } | 2359 } |
| 2360 if (!ValidateGLbooleanFalse(transpose)) { | 2360 if (!validators_->false_only.IsValid(transpose)) { |
| 2361 SetGLError( | 2361 SetGLError( |
| 2362 GL_INVALID_VALUE, "glUniformMatrix2fv: transpose GL_INVALID_VALUE"); | 2362 GL_INVALID_VALUE, "glUniformMatrix2fv: transpose GL_INVALID_VALUE"); |
| 2363 return error::kNoError; | 2363 return error::kNoError; |
| 2364 } | 2364 } |
| 2365 if (value == NULL) { | 2365 if (value == NULL) { |
| 2366 return error::kOutOfBounds; | 2366 return error::kOutOfBounds; |
| 2367 } | 2367 } |
| 2368 glUniformMatrix2fv(location, count, transpose, value); | 2368 glUniformMatrix2fv(location, count, transpose, value); |
| 2369 return error::kNoError; | 2369 return error::kNoError; |
| 2370 } | 2370 } |
| 2371 | 2371 |
| 2372 error::Error GLES2DecoderImpl::HandleUniformMatrix2fvImmediate( | 2372 error::Error GLES2DecoderImpl::HandleUniformMatrix2fvImmediate( |
| 2373 uint32 immediate_data_size, const gles2::UniformMatrix2fvImmediate& c) { | 2373 uint32 immediate_data_size, const gles2::UniformMatrix2fvImmediate& c) { |
| 2374 GLint location = static_cast<GLint>(c.location); | 2374 GLint location = static_cast<GLint>(c.location); |
| 2375 GLsizei count = static_cast<GLsizei>(c.count); | 2375 GLsizei count = static_cast<GLsizei>(c.count); |
| 2376 GLboolean transpose = static_cast<GLboolean>(c.transpose); | 2376 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 2377 uint32 data_size; | 2377 uint32 data_size; |
| 2378 if (!ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { | 2378 if (!ComputeDataSize(1, sizeof(GLfloat), 4, &data_size)) { |
| 2379 return error::kOutOfBounds; | 2379 return error::kOutOfBounds; |
| 2380 } | 2380 } |
| 2381 if (data_size > immediate_data_size) { | 2381 if (data_size > immediate_data_size) { |
| 2382 return error::kOutOfBounds; | 2382 return error::kOutOfBounds; |
| 2383 } | 2383 } |
| 2384 const GLfloat* value = GetImmediateDataAs<const GLfloat*>( | 2384 const GLfloat* value = GetImmediateDataAs<const GLfloat*>( |
| 2385 c, data_size, immediate_data_size); | 2385 c, data_size, immediate_data_size); |
| 2386 if (count < 0) { | 2386 if (count < 0) { |
| 2387 SetGLError(GL_INVALID_VALUE, "glUniformMatrix2fv: count < 0"); | 2387 SetGLError(GL_INVALID_VALUE, "glUniformMatrix2fv: count < 0"); |
| 2388 return error::kNoError; | 2388 return error::kNoError; |
| 2389 } | 2389 } |
| 2390 if (!ValidateGLbooleanFalse(transpose)) { | 2390 if (!validators_->false_only.IsValid(transpose)) { |
| 2391 SetGLError( | 2391 SetGLError( |
| 2392 GL_INVALID_VALUE, "glUniformMatrix2fv: transpose GL_INVALID_VALUE"); | 2392 GL_INVALID_VALUE, "glUniformMatrix2fv: transpose GL_INVALID_VALUE"); |
| 2393 return error::kNoError; | 2393 return error::kNoError; |
| 2394 } | 2394 } |
| 2395 if (value == NULL) { | 2395 if (value == NULL) { |
| 2396 return error::kOutOfBounds; | 2396 return error::kOutOfBounds; |
| 2397 } | 2397 } |
| 2398 glUniformMatrix2fv(location, count, transpose, value); | 2398 glUniformMatrix2fv(location, count, transpose, value); |
| 2399 return error::kNoError; | 2399 return error::kNoError; |
| 2400 } | 2400 } |
| 2401 | 2401 |
| 2402 error::Error GLES2DecoderImpl::HandleUniformMatrix3fv( | 2402 error::Error GLES2DecoderImpl::HandleUniformMatrix3fv( |
| 2403 uint32 immediate_data_size, const gles2::UniformMatrix3fv& c) { | 2403 uint32 immediate_data_size, const gles2::UniformMatrix3fv& c) { |
| 2404 GLint location = static_cast<GLint>(c.location); | 2404 GLint location = static_cast<GLint>(c.location); |
| 2405 GLsizei count = static_cast<GLsizei>(c.count); | 2405 GLsizei count = static_cast<GLsizei>(c.count); |
| 2406 GLboolean transpose = static_cast<GLboolean>(c.transpose); | 2406 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 2407 uint32 data_size; | 2407 uint32 data_size; |
| 2408 if (!ComputeDataSize(1, sizeof(GLfloat), 9, &data_size)) { | 2408 if (!ComputeDataSize(1, sizeof(GLfloat), 9, &data_size)) { |
| 2409 return error::kOutOfBounds; | 2409 return error::kOutOfBounds; |
| 2410 } | 2410 } |
| 2411 const GLfloat* value = GetSharedMemoryAs<const GLfloat*>( | 2411 const GLfloat* value = GetSharedMemoryAs<const GLfloat*>( |
| 2412 c.value_shm_id, c.value_shm_offset, data_size); | 2412 c.value_shm_id, c.value_shm_offset, data_size); |
| 2413 if (count < 0) { | 2413 if (count < 0) { |
| 2414 SetGLError(GL_INVALID_VALUE, "glUniformMatrix3fv: count < 0"); | 2414 SetGLError(GL_INVALID_VALUE, "glUniformMatrix3fv: count < 0"); |
| 2415 return error::kNoError; | 2415 return error::kNoError; |
| 2416 } | 2416 } |
| 2417 if (!ValidateGLbooleanFalse(transpose)) { | 2417 if (!validators_->false_only.IsValid(transpose)) { |
| 2418 SetGLError( | 2418 SetGLError( |
| 2419 GL_INVALID_VALUE, "glUniformMatrix3fv: transpose GL_INVALID_VALUE"); | 2419 GL_INVALID_VALUE, "glUniformMatrix3fv: transpose GL_INVALID_VALUE"); |
| 2420 return error::kNoError; | 2420 return error::kNoError; |
| 2421 } | 2421 } |
| 2422 if (value == NULL) { | 2422 if (value == NULL) { |
| 2423 return error::kOutOfBounds; | 2423 return error::kOutOfBounds; |
| 2424 } | 2424 } |
| 2425 glUniformMatrix3fv(location, count, transpose, value); | 2425 glUniformMatrix3fv(location, count, transpose, value); |
| 2426 return error::kNoError; | 2426 return error::kNoError; |
| 2427 } | 2427 } |
| 2428 | 2428 |
| 2429 error::Error GLES2DecoderImpl::HandleUniformMatrix3fvImmediate( | 2429 error::Error GLES2DecoderImpl::HandleUniformMatrix3fvImmediate( |
| 2430 uint32 immediate_data_size, const gles2::UniformMatrix3fvImmediate& c) { | 2430 uint32 immediate_data_size, const gles2::UniformMatrix3fvImmediate& c) { |
| 2431 GLint location = static_cast<GLint>(c.location); | 2431 GLint location = static_cast<GLint>(c.location); |
| 2432 GLsizei count = static_cast<GLsizei>(c.count); | 2432 GLsizei count = static_cast<GLsizei>(c.count); |
| 2433 GLboolean transpose = static_cast<GLboolean>(c.transpose); | 2433 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 2434 uint32 data_size; | 2434 uint32 data_size; |
| 2435 if (!ComputeDataSize(1, sizeof(GLfloat), 9, &data_size)) { | 2435 if (!ComputeDataSize(1, sizeof(GLfloat), 9, &data_size)) { |
| 2436 return error::kOutOfBounds; | 2436 return error::kOutOfBounds; |
| 2437 } | 2437 } |
| 2438 if (data_size > immediate_data_size) { | 2438 if (data_size > immediate_data_size) { |
| 2439 return error::kOutOfBounds; | 2439 return error::kOutOfBounds; |
| 2440 } | 2440 } |
| 2441 const GLfloat* value = GetImmediateDataAs<const GLfloat*>( | 2441 const GLfloat* value = GetImmediateDataAs<const GLfloat*>( |
| 2442 c, data_size, immediate_data_size); | 2442 c, data_size, immediate_data_size); |
| 2443 if (count < 0) { | 2443 if (count < 0) { |
| 2444 SetGLError(GL_INVALID_VALUE, "glUniformMatrix3fv: count < 0"); | 2444 SetGLError(GL_INVALID_VALUE, "glUniformMatrix3fv: count < 0"); |
| 2445 return error::kNoError; | 2445 return error::kNoError; |
| 2446 } | 2446 } |
| 2447 if (!ValidateGLbooleanFalse(transpose)) { | 2447 if (!validators_->false_only.IsValid(transpose)) { |
| 2448 SetGLError( | 2448 SetGLError( |
| 2449 GL_INVALID_VALUE, "glUniformMatrix3fv: transpose GL_INVALID_VALUE"); | 2449 GL_INVALID_VALUE, "glUniformMatrix3fv: transpose GL_INVALID_VALUE"); |
| 2450 return error::kNoError; | 2450 return error::kNoError; |
| 2451 } | 2451 } |
| 2452 if (value == NULL) { | 2452 if (value == NULL) { |
| 2453 return error::kOutOfBounds; | 2453 return error::kOutOfBounds; |
| 2454 } | 2454 } |
| 2455 glUniformMatrix3fv(location, count, transpose, value); | 2455 glUniformMatrix3fv(location, count, transpose, value); |
| 2456 return error::kNoError; | 2456 return error::kNoError; |
| 2457 } | 2457 } |
| 2458 | 2458 |
| 2459 error::Error GLES2DecoderImpl::HandleUniformMatrix4fv( | 2459 error::Error GLES2DecoderImpl::HandleUniformMatrix4fv( |
| 2460 uint32 immediate_data_size, const gles2::UniformMatrix4fv& c) { | 2460 uint32 immediate_data_size, const gles2::UniformMatrix4fv& c) { |
| 2461 GLint location = static_cast<GLint>(c.location); | 2461 GLint location = static_cast<GLint>(c.location); |
| 2462 GLsizei count = static_cast<GLsizei>(c.count); | 2462 GLsizei count = static_cast<GLsizei>(c.count); |
| 2463 GLboolean transpose = static_cast<GLboolean>(c.transpose); | 2463 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 2464 uint32 data_size; | 2464 uint32 data_size; |
| 2465 if (!ComputeDataSize(1, sizeof(GLfloat), 16, &data_size)) { | 2465 if (!ComputeDataSize(1, sizeof(GLfloat), 16, &data_size)) { |
| 2466 return error::kOutOfBounds; | 2466 return error::kOutOfBounds; |
| 2467 } | 2467 } |
| 2468 const GLfloat* value = GetSharedMemoryAs<const GLfloat*>( | 2468 const GLfloat* value = GetSharedMemoryAs<const GLfloat*>( |
| 2469 c.value_shm_id, c.value_shm_offset, data_size); | 2469 c.value_shm_id, c.value_shm_offset, data_size); |
| 2470 if (count < 0) { | 2470 if (count < 0) { |
| 2471 SetGLError(GL_INVALID_VALUE, "glUniformMatrix4fv: count < 0"); | 2471 SetGLError(GL_INVALID_VALUE, "glUniformMatrix4fv: count < 0"); |
| 2472 return error::kNoError; | 2472 return error::kNoError; |
| 2473 } | 2473 } |
| 2474 if (!ValidateGLbooleanFalse(transpose)) { | 2474 if (!validators_->false_only.IsValid(transpose)) { |
| 2475 SetGLError( | 2475 SetGLError( |
| 2476 GL_INVALID_VALUE, "glUniformMatrix4fv: transpose GL_INVALID_VALUE"); | 2476 GL_INVALID_VALUE, "glUniformMatrix4fv: transpose GL_INVALID_VALUE"); |
| 2477 return error::kNoError; | 2477 return error::kNoError; |
| 2478 } | 2478 } |
| 2479 if (value == NULL) { | 2479 if (value == NULL) { |
| 2480 return error::kOutOfBounds; | 2480 return error::kOutOfBounds; |
| 2481 } | 2481 } |
| 2482 glUniformMatrix4fv(location, count, transpose, value); | 2482 glUniformMatrix4fv(location, count, transpose, value); |
| 2483 return error::kNoError; | 2483 return error::kNoError; |
| 2484 } | 2484 } |
| 2485 | 2485 |
| 2486 error::Error GLES2DecoderImpl::HandleUniformMatrix4fvImmediate( | 2486 error::Error GLES2DecoderImpl::HandleUniformMatrix4fvImmediate( |
| 2487 uint32 immediate_data_size, const gles2::UniformMatrix4fvImmediate& c) { | 2487 uint32 immediate_data_size, const gles2::UniformMatrix4fvImmediate& c) { |
| 2488 GLint location = static_cast<GLint>(c.location); | 2488 GLint location = static_cast<GLint>(c.location); |
| 2489 GLsizei count = static_cast<GLsizei>(c.count); | 2489 GLsizei count = static_cast<GLsizei>(c.count); |
| 2490 GLboolean transpose = static_cast<GLboolean>(c.transpose); | 2490 GLboolean transpose = static_cast<GLboolean>(c.transpose); |
| 2491 uint32 data_size; | 2491 uint32 data_size; |
| 2492 if (!ComputeDataSize(1, sizeof(GLfloat), 16, &data_size)) { | 2492 if (!ComputeDataSize(1, sizeof(GLfloat), 16, &data_size)) { |
| 2493 return error::kOutOfBounds; | 2493 return error::kOutOfBounds; |
| 2494 } | 2494 } |
| 2495 if (data_size > immediate_data_size) { | 2495 if (data_size > immediate_data_size) { |
| 2496 return error::kOutOfBounds; | 2496 return error::kOutOfBounds; |
| 2497 } | 2497 } |
| 2498 const GLfloat* value = GetImmediateDataAs<const GLfloat*>( | 2498 const GLfloat* value = GetImmediateDataAs<const GLfloat*>( |
| 2499 c, data_size, immediate_data_size); | 2499 c, data_size, immediate_data_size); |
| 2500 if (count < 0) { | 2500 if (count < 0) { |
| 2501 SetGLError(GL_INVALID_VALUE, "glUniformMatrix4fv: count < 0"); | 2501 SetGLError(GL_INVALID_VALUE, "glUniformMatrix4fv: count < 0"); |
| 2502 return error::kNoError; | 2502 return error::kNoError; |
| 2503 } | 2503 } |
| 2504 if (!ValidateGLbooleanFalse(transpose)) { | 2504 if (!validators_->false_only.IsValid(transpose)) { |
| 2505 SetGLError( | 2505 SetGLError( |
| 2506 GL_INVALID_VALUE, "glUniformMatrix4fv: transpose GL_INVALID_VALUE"); | 2506 GL_INVALID_VALUE, "glUniformMatrix4fv: transpose GL_INVALID_VALUE"); |
| 2507 return error::kNoError; | 2507 return error::kNoError; |
| 2508 } | 2508 } |
| 2509 if (value == NULL) { | 2509 if (value == NULL) { |
| 2510 return error::kOutOfBounds; | 2510 return error::kOutOfBounds; |
| 2511 } | 2511 } |
| 2512 glUniformMatrix4fv(location, count, transpose, value); | 2512 glUniformMatrix4fv(location, count, transpose, value); |
| 2513 return error::kNoError; | 2513 return error::kNoError; |
| 2514 } | 2514 } |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2732 typedef GetMaxValueInBuffer::Result Result; | 2732 typedef GetMaxValueInBuffer::Result Result; |
| 2733 Result* result_dst = GetSharedMemoryAs<Result*>( | 2733 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 2734 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 2734 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 2735 if (!result_dst) { | 2735 if (!result_dst) { |
| 2736 return error::kOutOfBounds; | 2736 return error::kOutOfBounds; |
| 2737 } | 2737 } |
| 2738 if (count < 0) { | 2738 if (count < 0) { |
| 2739 SetGLError(GL_INVALID_VALUE, "glGetMaxValueInBuffer: count < 0"); | 2739 SetGLError(GL_INVALID_VALUE, "glGetMaxValueInBuffer: count < 0"); |
| 2740 return error::kNoError; | 2740 return error::kNoError; |
| 2741 } | 2741 } |
| 2742 if (!ValidateGLenumGetMaxIndexType(type)) { | 2742 if (!validators_->get_max_index_type.IsValid(type)) { |
| 2743 SetGLError(GL_INVALID_ENUM, "glGetMaxValueInBuffer: type GL_INVALID_ENUM"); | 2743 SetGLError(GL_INVALID_ENUM, "glGetMaxValueInBuffer: type GL_INVALID_ENUM"); |
| 2744 return error::kNoError; | 2744 return error::kNoError; |
| 2745 } | 2745 } |
| 2746 *result_dst = DoGetMaxValueInBuffer(buffer_id, count, type, offset); | 2746 *result_dst = DoGetMaxValueInBuffer(buffer_id, count, type, offset); |
| 2747 return error::kNoError; | 2747 return error::kNoError; |
| 2748 } | 2748 } |
| 2749 | 2749 |
| 2750 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ | 2750 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ |
| 2751 | 2751 |
| OLD | NEW |