| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" |
| 6 | 6 |
| 7 namespace gpu { | 7 namespace gpu { |
| 8 namespace gles2 { | 8 namespace gles2 { |
| 9 | 9 |
| 10 // Custom Handlers | 10 // Custom Handlers |
| 11 error::Error GLES2DecoderPassthroughImpl::HandleBindAttribLocationBucket( | 11 error::Error GLES2DecoderPassthroughImpl::HandleBindAttribLocationBucket( |
| 12 uint32_t immediate_data_size, | 12 uint32_t immediate_data_size, |
| 13 const void* cmd_data) { | 13 const volatile void* cmd_data) { |
| 14 const gles2::cmds::BindAttribLocationBucket& c = | 14 const volatile gles2::cmds::BindAttribLocationBucket& c = |
| 15 *static_cast<const gles2::cmds::BindAttribLocationBucket*>(cmd_data); | 15 *static_cast<const volatile gles2::cmds::BindAttribLocationBucket*>( |
| 16 cmd_data); |
| 16 GLuint program = static_cast<GLuint>(c.program); | 17 GLuint program = static_cast<GLuint>(c.program); |
| 17 GLuint index = static_cast<GLuint>(c.index); | 18 GLuint index = static_cast<GLuint>(c.index); |
| 18 Bucket* bucket = GetBucket(c.name_bucket_id); | 19 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 19 if (!bucket || bucket->size() == 0) { | 20 if (!bucket || bucket->size() == 0) { |
| 20 return error::kInvalidArguments; | 21 return error::kInvalidArguments; |
| 21 } | 22 } |
| 22 std::string name_str; | 23 std::string name_str; |
| 23 if (!bucket->GetAsString(&name_str)) { | 24 if (!bucket->GetAsString(&name_str)) { |
| 24 return error::kInvalidArguments; | 25 return error::kInvalidArguments; |
| 25 } | 26 } |
| 26 error::Error error = DoBindAttribLocation(program, index, name_str.c_str()); | 27 error::Error error = DoBindAttribLocation(program, index, name_str.c_str()); |
| 27 if (error != error::kNoError) { | 28 if (error != error::kNoError) { |
| 28 return error; | 29 return error; |
| 29 } | 30 } |
| 30 return error::kNoError; | 31 return error::kNoError; |
| 31 } | 32 } |
| 32 | 33 |
| 33 error::Error GLES2DecoderPassthroughImpl::HandleBufferData( | 34 error::Error GLES2DecoderPassthroughImpl::HandleBufferData( |
| 34 uint32_t immediate_data_size, | 35 uint32_t immediate_data_size, |
| 35 const void* cmd_data) { | 36 const volatile void* cmd_data) { |
| 36 const gles2::cmds::BufferData& c = | 37 const volatile gles2::cmds::BufferData& c = |
| 37 *static_cast<const gles2::cmds::BufferData*>(cmd_data); | 38 *static_cast<const volatile gles2::cmds::BufferData*>(cmd_data); |
| 38 GLenum target = static_cast<GLenum>(c.target); | 39 GLenum target = static_cast<GLenum>(c.target); |
| 39 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 40 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 40 uint32_t data_shm_id = static_cast<uint32_t>(c.data_shm_id); | 41 uint32_t data_shm_id = static_cast<uint32_t>(c.data_shm_id); |
| 41 uint32_t data_shm_offset = static_cast<uint32_t>(c.data_shm_offset); | 42 uint32_t data_shm_offset = static_cast<uint32_t>(c.data_shm_offset); |
| 42 GLenum usage = static_cast<GLenum>(c.usage); | 43 GLenum usage = static_cast<GLenum>(c.usage); |
| 43 const void* data = NULL; | 44 const void* data = NULL; |
| 44 if (data_shm_id != 0 || data_shm_offset != 0) { | 45 if (data_shm_id != 0 || data_shm_offset != 0) { |
| 45 data = GetSharedMemoryAs<const void*>(data_shm_id, data_shm_offset, size); | 46 data = GetSharedMemoryAs<const void*>(data_shm_id, data_shm_offset, size); |
| 46 if (!data) { | 47 if (!data) { |
| 47 return error::kOutOfBounds; | 48 return error::kOutOfBounds; |
| 48 } | 49 } |
| 49 } | 50 } |
| 50 error::Error error = DoBufferData(target, size, data, usage); | 51 error::Error error = DoBufferData(target, size, data, usage); |
| 51 if (error != error::kNoError) { | 52 if (error != error::kNoError) { |
| 52 return error; | 53 return error; |
| 53 } | 54 } |
| 54 return error::kNoError; | 55 return error::kNoError; |
| 55 } | 56 } |
| 56 | 57 |
| 57 error::Error GLES2DecoderPassthroughImpl::HandleClientWaitSync( | 58 error::Error GLES2DecoderPassthroughImpl::HandleClientWaitSync( |
| 58 uint32_t immediate_data_size, | 59 uint32_t immediate_data_size, |
| 59 const void* cmd_data) { | 60 const volatile void* cmd_data) { |
| 60 const gles2::cmds::ClientWaitSync& c = | 61 const volatile gles2::cmds::ClientWaitSync& c = |
| 61 *static_cast<const gles2::cmds::ClientWaitSync*>(cmd_data); | 62 *static_cast<const volatile gles2::cmds::ClientWaitSync*>(cmd_data); |
| 62 const GLuint sync = static_cast<GLuint>(c.sync); | 63 const GLuint sync = static_cast<GLuint>(c.sync); |
| 63 const GLbitfield flags = static_cast<GLbitfield>(c.flags); | 64 const GLbitfield flags = static_cast<GLbitfield>(c.flags); |
| 64 const GLuint64 timeout = c.timeout(); | 65 const GLuint64 timeout = c.timeout(); |
| 65 typedef cmds::ClientWaitSync::Result Result; | 66 typedef cmds::ClientWaitSync::Result Result; |
| 66 Result* result_dst = GetSharedMemoryAs<Result*>( | 67 Result* result_dst = GetSharedMemoryAs<Result*>( |
| 67 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); | 68 c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); |
| 68 if (!result_dst) { | 69 if (!result_dst) { |
| 69 return error::kOutOfBounds; | 70 return error::kOutOfBounds; |
| 70 } | 71 } |
| 71 error::Error error = DoClientWaitSync(sync, flags, timeout, result_dst); | 72 error::Error error = DoClientWaitSync(sync, flags, timeout, result_dst); |
| 72 if (error != error::kNoError) { | 73 if (error != error::kNoError) { |
| 73 return error; | 74 return error; |
| 74 } | 75 } |
| 75 return error::kNoError; | 76 return error::kNoError; |
| 76 } | 77 } |
| 77 | 78 |
| 78 error::Error GLES2DecoderPassthroughImpl::HandleCreateProgram( | 79 error::Error GLES2DecoderPassthroughImpl::HandleCreateProgram( |
| 79 uint32_t immediate_data_size, | 80 uint32_t immediate_data_size, |
| 80 const void* cmd_data) { | 81 const volatile void* cmd_data) { |
| 81 const gles2::cmds::CreateProgram& c = | 82 const volatile gles2::cmds::CreateProgram& c = |
| 82 *static_cast<const gles2::cmds::CreateProgram*>(cmd_data); | 83 *static_cast<const volatile gles2::cmds::CreateProgram*>(cmd_data); |
| 83 GLuint client_id = static_cast<GLuint>(c.client_id); | 84 GLuint client_id = static_cast<GLuint>(c.client_id); |
| 84 error::Error error = DoCreateProgram(client_id); | 85 error::Error error = DoCreateProgram(client_id); |
| 85 if (error != error::kNoError) { | 86 if (error != error::kNoError) { |
| 86 return error; | 87 return error; |
| 87 } | 88 } |
| 88 return error::kNoError; | 89 return error::kNoError; |
| 89 } | 90 } |
| 90 | 91 |
| 91 error::Error GLES2DecoderPassthroughImpl::HandleCreateShader( | 92 error::Error GLES2DecoderPassthroughImpl::HandleCreateShader( |
| 92 uint32_t immediate_data_size, | 93 uint32_t immediate_data_size, |
| 93 const void* cmd_data) { | 94 const volatile void* cmd_data) { |
| 94 const gles2::cmds::CreateShader& c = | 95 const volatile gles2::cmds::CreateShader& c = |
| 95 *static_cast<const gles2::cmds::CreateShader*>(cmd_data); | 96 *static_cast<const volatile gles2::cmds::CreateShader*>(cmd_data); |
| 96 GLenum type = static_cast<GLenum>(c.type); | 97 GLenum type = static_cast<GLenum>(c.type); |
| 97 GLuint client_id = static_cast<GLuint>(c.client_id); | 98 GLuint client_id = static_cast<GLuint>(c.client_id); |
| 98 error::Error error = DoCreateShader(type, client_id); | 99 error::Error error = DoCreateShader(type, client_id); |
| 99 if (error != error::kNoError) { | 100 if (error != error::kNoError) { |
| 100 return error; | 101 return error; |
| 101 } | 102 } |
| 102 return error::kNoError; | 103 return error::kNoError; |
| 103 } | 104 } |
| 104 | 105 |
| 105 error::Error GLES2DecoderPassthroughImpl::HandleFenceSync( | 106 error::Error GLES2DecoderPassthroughImpl::HandleFenceSync( |
| 106 uint32_t immediate_data_size, | 107 uint32_t immediate_data_size, |
| 107 const void* cmd_data) { | 108 const volatile void* cmd_data) { |
| 108 const gles2::cmds::FenceSync& c = | 109 const volatile gles2::cmds::FenceSync& c = |
| 109 *static_cast<const gles2::cmds::FenceSync*>(cmd_data); | 110 *static_cast<const volatile gles2::cmds::FenceSync*>(cmd_data); |
| 110 GLenum condition = static_cast<GLenum>(c.condition); | 111 GLenum condition = static_cast<GLenum>(c.condition); |
| 111 GLbitfield flags = static_cast<GLbitfield>(c.flags); | 112 GLbitfield flags = static_cast<GLbitfield>(c.flags); |
| 112 GLuint client_id = static_cast<GLuint>(c.client_id); | 113 GLuint client_id = static_cast<GLuint>(c.client_id); |
| 113 error::Error error = DoFenceSync(condition, flags, client_id); | 114 error::Error error = DoFenceSync(condition, flags, client_id); |
| 114 if (error != error::kNoError) { | 115 if (error != error::kNoError) { |
| 115 return error; | 116 return error; |
| 116 } | 117 } |
| 117 return error::kNoError; | 118 return error::kNoError; |
| 118 } | 119 } |
| 119 | 120 |
| 120 error::Error GLES2DecoderPassthroughImpl::HandleDrawArrays( | 121 error::Error GLES2DecoderPassthroughImpl::HandleDrawArrays( |
| 121 uint32_t immediate_data_size, | 122 uint32_t immediate_data_size, |
| 122 const void* cmd_data) { | 123 const volatile void* cmd_data) { |
| 123 const gles2::cmds::DrawArrays& c = | 124 const volatile gles2::cmds::DrawArrays& c = |
| 124 *static_cast<const gles2::cmds::DrawArrays*>(cmd_data); | 125 *static_cast<const volatile gles2::cmds::DrawArrays*>(cmd_data); |
| 125 GLenum mode = static_cast<GLenum>(c.mode); | 126 GLenum mode = static_cast<GLenum>(c.mode); |
| 126 GLint first = static_cast<GLint>(c.first); | 127 GLint first = static_cast<GLint>(c.first); |
| 127 GLsizei count = static_cast<GLsizei>(c.count); | 128 GLsizei count = static_cast<GLsizei>(c.count); |
| 128 error::Error error = DoDrawArrays(mode, first, count); | 129 error::Error error = DoDrawArrays(mode, first, count); |
| 129 if (error != error::kNoError) { | 130 if (error != error::kNoError) { |
| 130 return error; | 131 return error; |
| 131 } | 132 } |
| 132 return error::kNoError; | 133 return error::kNoError; |
| 133 } | 134 } |
| 134 | 135 |
| 135 error::Error GLES2DecoderPassthroughImpl::HandleDrawElements( | 136 error::Error GLES2DecoderPassthroughImpl::HandleDrawElements( |
| 136 uint32_t immediate_data_size, | 137 uint32_t immediate_data_size, |
| 137 const void* cmd_data) { | 138 const volatile void* cmd_data) { |
| 138 const gles2::cmds::DrawElements& c = | 139 const volatile gles2::cmds::DrawElements& c = |
| 139 *static_cast<const gles2::cmds::DrawElements*>(cmd_data); | 140 *static_cast<const volatile gles2::cmds::DrawElements*>(cmd_data); |
| 140 GLenum mode = static_cast<GLenum>(c.mode); | 141 GLenum mode = static_cast<GLenum>(c.mode); |
| 141 GLsizei count = static_cast<GLsizei>(c.count); | 142 GLsizei count = static_cast<GLsizei>(c.count); |
| 142 GLenum type = static_cast<GLenum>(c.type); | 143 GLenum type = static_cast<GLenum>(c.type); |
| 143 const GLvoid* indices = | 144 const GLvoid* indices = |
| 144 reinterpret_cast<const GLvoid*>(static_cast<uintptr_t>(c.index_offset)); | 145 reinterpret_cast<const GLvoid*>(static_cast<uintptr_t>(c.index_offset)); |
| 145 error::Error error = DoDrawElements(mode, count, type, indices); | 146 error::Error error = DoDrawElements(mode, count, type, indices); |
| 146 if (error != error::kNoError) { | 147 if (error != error::kNoError) { |
| 147 return error; | 148 return error; |
| 148 } | 149 } |
| 149 return error::kNoError; | 150 return error::kNoError; |
| 150 } | 151 } |
| 151 | 152 |
| 152 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveAttrib( | 153 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveAttrib( |
| 153 uint32_t immediate_data_size, | 154 uint32_t immediate_data_size, |
| 154 const void* cmd_data) { | 155 const volatile void* cmd_data) { |
| 155 const gles2::cmds::GetActiveAttrib& c = | 156 const volatile gles2::cmds::GetActiveAttrib& c = |
| 156 *static_cast<const gles2::cmds::GetActiveAttrib*>(cmd_data); | 157 *static_cast<const volatile gles2::cmds::GetActiveAttrib*>(cmd_data); |
| 157 GLuint program = static_cast<GLuint>(c.program); | 158 GLuint program = static_cast<GLuint>(c.program); |
| 158 GLuint index = static_cast<GLuint>(c.index); | 159 GLuint index = static_cast<GLuint>(c.index); |
| 159 uint32_t name_bucket_id = c.name_bucket_id; | 160 uint32_t name_bucket_id = c.name_bucket_id; |
| 160 typedef cmds::GetActiveAttrib::Result Result; | 161 typedef cmds::GetActiveAttrib::Result Result; |
| 161 Result* result = GetSharedMemoryAs<Result*>( | 162 Result* result = GetSharedMemoryAs<Result*>( |
| 162 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | 163 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 163 if (!result) { | 164 if (!result) { |
| 164 return error::kOutOfBounds; | 165 return error::kOutOfBounds; |
| 165 } | 166 } |
| 166 // Check that the client initialized the result. | 167 // Check that the client initialized the result. |
| 167 if (result->success != 0) { | 168 if (result->success != 0) { |
| 168 return error::kInvalidArguments; | 169 return error::kInvalidArguments; |
| 169 } | 170 } |
| 170 | 171 |
| 171 std::string name; | 172 std::string name; |
| 172 error::Error error = | 173 error::Error error = |
| 173 DoGetActiveAttrib(program, index, &result->size, &result->type, &name); | 174 DoGetActiveAttrib(program, index, &result->size, &result->type, &name); |
| 174 if (error != error::kNoError) { | 175 if (error != error::kNoError) { |
| 175 return error; | 176 return error; |
| 176 } | 177 } |
| 177 | 178 |
| 178 result->success = 1; // true. | 179 result->success = 1; // true. |
| 179 Bucket* bucket = CreateBucket(name_bucket_id); | 180 Bucket* bucket = CreateBucket(name_bucket_id); |
| 180 bucket->SetFromString(name.c_str()); | 181 bucket->SetFromString(name.c_str()); |
| 181 return error::kNoError; | 182 return error::kNoError; |
| 182 } | 183 } |
| 183 | 184 |
| 184 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveUniform( | 185 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveUniform( |
| 185 uint32_t immediate_data_size, | 186 uint32_t immediate_data_size, |
| 186 const void* cmd_data) { | 187 const volatile void* cmd_data) { |
| 187 const gles2::cmds::GetActiveUniform& c = | 188 const volatile gles2::cmds::GetActiveUniform& c = |
| 188 *static_cast<const gles2::cmds::GetActiveUniform*>(cmd_data); | 189 *static_cast<const volatile gles2::cmds::GetActiveUniform*>(cmd_data); |
| 189 GLuint program = static_cast<GLuint>(c.program); | 190 GLuint program = static_cast<GLuint>(c.program); |
| 190 GLuint index = static_cast<GLuint>(c.index); | 191 GLuint index = static_cast<GLuint>(c.index); |
| 191 uint32_t name_bucket_id = c.name_bucket_id; | 192 uint32_t name_bucket_id = c.name_bucket_id; |
| 192 typedef cmds::GetActiveUniform::Result Result; | 193 typedef cmds::GetActiveUniform::Result Result; |
| 193 Result* result = GetSharedMemoryAs<Result*>( | 194 Result* result = GetSharedMemoryAs<Result*>( |
| 194 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | 195 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 195 if (!result) { | 196 if (!result) { |
| 196 return error::kOutOfBounds; | 197 return error::kOutOfBounds; |
| 197 } | 198 } |
| 198 // Check that the client initialized the result. | 199 // Check that the client initialized the result. |
| 199 if (result->success != 0) { | 200 if (result->success != 0) { |
| 200 return error::kInvalidArguments; | 201 return error::kInvalidArguments; |
| 201 } | 202 } |
| 202 | 203 |
| 203 std::string name; | 204 std::string name; |
| 204 error::Error error = | 205 error::Error error = |
| 205 DoGetActiveUniform(program, index, &result->size, &result->type, &name); | 206 DoGetActiveUniform(program, index, &result->size, &result->type, &name); |
| 206 if (error != error::kNoError) { | 207 if (error != error::kNoError) { |
| 207 return error; | 208 return error; |
| 208 } | 209 } |
| 209 | 210 |
| 210 result->success = 1; // true. | 211 result->success = 1; // true. |
| 211 Bucket* bucket = CreateBucket(name_bucket_id); | 212 Bucket* bucket = CreateBucket(name_bucket_id); |
| 212 bucket->SetFromString(name.c_str()); | 213 bucket->SetFromString(name.c_str()); |
| 213 return error::kNoError; | 214 return error::kNoError; |
| 214 } | 215 } |
| 215 | 216 |
| 216 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveUniformBlockiv( | 217 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveUniformBlockiv( |
| 217 uint32_t immediate_data_size, | 218 uint32_t immediate_data_size, |
| 218 const void* cmd_data) { | 219 const volatile void* cmd_data) { |
| 219 const gles2::cmds::GetActiveUniformBlockiv& c = | 220 const volatile gles2::cmds::GetActiveUniformBlockiv& c = |
| 220 *static_cast<const gles2::cmds::GetActiveUniformBlockiv*>(cmd_data); | 221 *static_cast<const volatile gles2::cmds::GetActiveUniformBlockiv*>( |
| 222 cmd_data); |
| 221 GLuint program = static_cast<GLuint>(c.program); | 223 GLuint program = static_cast<GLuint>(c.program); |
| 222 GLuint uniformBlockIndex = static_cast<GLuint>(c.index); | 224 GLuint uniformBlockIndex = static_cast<GLuint>(c.index); |
| 223 GLenum pname = static_cast<GLenum>(c.pname); | 225 GLenum pname = static_cast<GLenum>(c.pname); |
| 224 unsigned int buffer_size = 0; | 226 unsigned int buffer_size = 0; |
| 225 typedef cmds::GetActiveUniformBlockiv::Result Result; | 227 typedef cmds::GetActiveUniformBlockiv::Result Result; |
| 226 Result* result = GetSharedMemoryAndSizeAs<Result*>( | 228 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 227 c.params_shm_id, c.params_shm_offset, &buffer_size); | 229 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 228 GLint* params = result ? result->GetData() : NULL; | 230 GLint* params = result ? result->GetData() : NULL; |
| 229 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | 231 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 230 GLsizei length = 0; | 232 GLsizei length = 0; |
| 231 error::Error error = DoGetActiveUniformBlockiv( | 233 error::Error error = DoGetActiveUniformBlockiv( |
| 232 program, uniformBlockIndex, pname, bufsize, &length, params); | 234 program, uniformBlockIndex, pname, bufsize, &length, params); |
| 233 if (error != error::kNoError) { | 235 if (error != error::kNoError) { |
| 234 return error; | 236 return error; |
| 235 } | 237 } |
| 236 if (length > bufsize) { | 238 if (length > bufsize) { |
| 237 return error::kOutOfBounds; | 239 return error::kOutOfBounds; |
| 238 } | 240 } |
| 239 result->SetNumResults(length); | 241 result->SetNumResults(length); |
| 240 return error::kNoError; | 242 return error::kNoError; |
| 241 } | 243 } |
| 242 | 244 |
| 243 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveUniformBlockName( | 245 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveUniformBlockName( |
| 244 uint32_t immediate_data_size, | 246 uint32_t immediate_data_size, |
| 245 const void* cmd_data) { | 247 const volatile void* cmd_data) { |
| 246 const gles2::cmds::GetActiveUniformBlockName& c = | 248 const volatile gles2::cmds::GetActiveUniformBlockName& c = |
| 247 *static_cast<const gles2::cmds::GetActiveUniformBlockName*>(cmd_data); | 249 *static_cast<const volatile gles2::cmds::GetActiveUniformBlockName*>( |
| 250 cmd_data); |
| 248 GLuint program = static_cast<GLuint>(c.program); | 251 GLuint program = static_cast<GLuint>(c.program); |
| 249 GLuint uniformBlockIndex = static_cast<GLuint>(c.index); | 252 GLuint uniformBlockIndex = static_cast<GLuint>(c.index); |
| 250 uint32_t name_bucket_id = c.name_bucket_id; | 253 uint32_t name_bucket_id = c.name_bucket_id; |
| 251 typedef cmds::GetActiveUniformBlockName::Result Result; | 254 typedef cmds::GetActiveUniformBlockName::Result Result; |
| 252 Result* result = GetSharedMemoryAs<Result*>( | 255 Result* result = GetSharedMemoryAs<Result*>( |
| 253 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | 256 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 254 if (!result) { | 257 if (!result) { |
| 255 return error::kOutOfBounds; | 258 return error::kOutOfBounds; |
| 256 } | 259 } |
| 257 // Check that the client initialized the result. | 260 // Check that the client initialized the result. |
| 258 if (*result != 0) { | 261 if (*result != 0) { |
| 259 return error::kInvalidArguments; | 262 return error::kInvalidArguments; |
| 260 } | 263 } |
| 261 | 264 |
| 262 std::string name; | 265 std::string name; |
| 263 error::Error error = | 266 error::Error error = |
| 264 DoGetActiveUniformBlockName(program, uniformBlockIndex, &name); | 267 DoGetActiveUniformBlockName(program, uniformBlockIndex, &name); |
| 265 if (error != error::kNoError) { | 268 if (error != error::kNoError) { |
| 266 return error; | 269 return error; |
| 267 } | 270 } |
| 268 | 271 |
| 269 *result = 1; | 272 *result = 1; |
| 270 Bucket* bucket = CreateBucket(name_bucket_id); | 273 Bucket* bucket = CreateBucket(name_bucket_id); |
| 271 bucket->SetFromString(name.c_str()); | 274 bucket->SetFromString(name.c_str()); |
| 272 return error::kNoError; | 275 return error::kNoError; |
| 273 } | 276 } |
| 274 | 277 |
| 275 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveUniformsiv( | 278 error::Error GLES2DecoderPassthroughImpl::HandleGetActiveUniformsiv( |
| 276 uint32_t immediate_data_size, | 279 uint32_t immediate_data_size, |
| 277 const void* cmd_data) { | 280 const volatile void* cmd_data) { |
| 278 const gles2::cmds::GetActiveUniformsiv& c = | 281 const volatile gles2::cmds::GetActiveUniformsiv& c = |
| 279 *static_cast<const gles2::cmds::GetActiveUniformsiv*>(cmd_data); | 282 *static_cast<const volatile gles2::cmds::GetActiveUniformsiv*>(cmd_data); |
| 280 GLuint program = static_cast<GLuint>(c.program); | 283 GLuint program = static_cast<GLuint>(c.program); |
| 281 GLenum pname = static_cast<GLenum>(c.pname); | 284 GLenum pname = static_cast<GLenum>(c.pname); |
| 282 Bucket* bucket = GetBucket(c.indices_bucket_id); | 285 Bucket* bucket = GetBucket(c.indices_bucket_id); |
| 283 if (!bucket) { | 286 if (!bucket) { |
| 284 return error::kInvalidArguments; | 287 return error::kInvalidArguments; |
| 285 } | 288 } |
| 286 GLsizei uniformCount = static_cast<GLsizei>(bucket->size() / sizeof(GLuint)); | 289 GLsizei uniformCount = static_cast<GLsizei>(bucket->size() / sizeof(GLuint)); |
| 287 const GLuint* indices = bucket->GetDataAs<const GLuint*>(0, bucket->size()); | 290 const GLuint* indices = bucket->GetDataAs<const GLuint*>(0, bucket->size()); |
| 288 typedef cmds::GetActiveUniformsiv::Result Result; | 291 typedef cmds::GetActiveUniformsiv::Result Result; |
| 289 Result* result = GetSharedMemoryAs<Result*>( | 292 Result* result = GetSharedMemoryAs<Result*>( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 304 if (error != error::kNoError) { | 307 if (error != error::kNoError) { |
| 305 return error; | 308 return error; |
| 306 } | 309 } |
| 307 | 310 |
| 308 result->SetNumResults(length); | 311 result->SetNumResults(length); |
| 309 return error::kNoError; | 312 return error::kNoError; |
| 310 } | 313 } |
| 311 | 314 |
| 312 error::Error GLES2DecoderPassthroughImpl::HandleGetAttachedShaders( | 315 error::Error GLES2DecoderPassthroughImpl::HandleGetAttachedShaders( |
| 313 uint32_t immediate_data_size, | 316 uint32_t immediate_data_size, |
| 314 const void* cmd_data) { | 317 const volatile void* cmd_data) { |
| 315 const gles2::cmds::GetAttachedShaders& c = | 318 const volatile gles2::cmds::GetAttachedShaders& c = |
| 316 *static_cast<const gles2::cmds::GetAttachedShaders*>(cmd_data); | 319 *static_cast<const volatile gles2::cmds::GetAttachedShaders*>(cmd_data); |
| 317 GLuint program = static_cast<GLuint>(c.program); | 320 GLuint program = static_cast<GLuint>(c.program); |
| 318 typedef cmds::GetAttachedShaders::Result Result; | 321 typedef cmds::GetAttachedShaders::Result Result; |
| 319 uint32_t maxCount = Result::ComputeMaxResults(c.result_size); | 322 uint32_t maxCount = Result::ComputeMaxResults(c.result_size); |
| 320 Result* result = GetSharedMemoryAs<Result*>( | 323 Result* result = GetSharedMemoryAs<Result*>( |
| 321 c.result_shm_id, c.result_shm_offset, Result::ComputeSize(maxCount)); | 324 c.result_shm_id, c.result_shm_offset, Result::ComputeSize(maxCount)); |
| 322 if (!result) { | 325 if (!result) { |
| 323 return error::kOutOfBounds; | 326 return error::kOutOfBounds; |
| 324 } | 327 } |
| 325 // Check that the client initialized the result. | 328 // Check that the client initialized the result. |
| 326 if (result->size != 0) { | 329 if (result->size != 0) { |
| 327 return error::kInvalidArguments; | 330 return error::kInvalidArguments; |
| 328 } | 331 } |
| 329 GLsizei count = 0; | 332 GLsizei count = 0; |
| 330 error::Error error = | 333 error::Error error = |
| 331 DoGetAttachedShaders(program, maxCount, &count, result->GetData()); | 334 DoGetAttachedShaders(program, maxCount, &count, result->GetData()); |
| 332 if (error != error::kNoError) { | 335 if (error != error::kNoError) { |
| 333 return error; | 336 return error; |
| 334 } | 337 } |
| 335 | 338 |
| 336 result->SetNumResults(count); | 339 result->SetNumResults(count); |
| 337 return error::kNoError; | 340 return error::kNoError; |
| 338 } | 341 } |
| 339 | 342 |
| 340 error::Error GLES2DecoderPassthroughImpl::HandleGetAttribLocation( | 343 error::Error GLES2DecoderPassthroughImpl::HandleGetAttribLocation( |
| 341 uint32_t immediate_data_size, | 344 uint32_t immediate_data_size, |
| 342 const void* cmd_data) { | 345 const volatile void* cmd_data) { |
| 343 const gles2::cmds::GetAttribLocation& c = | 346 const volatile gles2::cmds::GetAttribLocation& c = |
| 344 *static_cast<const gles2::cmds::GetAttribLocation*>(cmd_data); | 347 *static_cast<const volatile gles2::cmds::GetAttribLocation*>(cmd_data); |
| 345 GLuint program = static_cast<GLuint>(c.program); | 348 GLuint program = static_cast<GLuint>(c.program); |
| 346 Bucket* bucket = GetBucket(c.name_bucket_id); | 349 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 347 if (!bucket) { | 350 if (!bucket) { |
| 348 return error::kInvalidArguments; | 351 return error::kInvalidArguments; |
| 349 } | 352 } |
| 350 std::string name_str; | 353 std::string name_str; |
| 351 if (!bucket->GetAsString(&name_str)) { | 354 if (!bucket->GetAsString(&name_str)) { |
| 352 return error::kInvalidArguments; | 355 return error::kInvalidArguments; |
| 353 } | 356 } |
| 354 GLint* location = GetSharedMemoryAs<GLint*>( | 357 GLint* location = GetSharedMemoryAs<GLint*>( |
| 355 c.location_shm_id, c.location_shm_offset, sizeof(GLint)); | 358 c.location_shm_id, c.location_shm_offset, sizeof(GLint)); |
| 356 if (!location) { | 359 if (!location) { |
| 357 return error::kOutOfBounds; | 360 return error::kOutOfBounds; |
| 358 } | 361 } |
| 359 if (*location != -1) { | 362 if (*location != -1) { |
| 360 return error::kInvalidArguments; | 363 return error::kInvalidArguments; |
| 361 } | 364 } |
| 362 error::Error error = DoGetAttribLocation(program, name_str.c_str(), location); | 365 error::Error error = DoGetAttribLocation(program, name_str.c_str(), location); |
| 363 if (error != error::kNoError) { | 366 if (error != error::kNoError) { |
| 364 return error; | 367 return error; |
| 365 } | 368 } |
| 366 return error::kNoError; | 369 return error::kNoError; |
| 367 } | 370 } |
| 368 | 371 |
| 369 error::Error GLES2DecoderPassthroughImpl::HandleGetFragDataLocation( | 372 error::Error GLES2DecoderPassthroughImpl::HandleGetFragDataLocation( |
| 370 uint32_t immediate_data_size, | 373 uint32_t immediate_data_size, |
| 371 const void* cmd_data) { | 374 const volatile void* cmd_data) { |
| 372 const gles2::cmds::GetFragDataLocation& c = | 375 const volatile gles2::cmds::GetFragDataLocation& c = |
| 373 *static_cast<const gles2::cmds::GetFragDataLocation*>(cmd_data); | 376 *static_cast<const volatile gles2::cmds::GetFragDataLocation*>(cmd_data); |
| 374 GLuint program = static_cast<GLuint>(c.program); | 377 GLuint program = static_cast<GLuint>(c.program); |
| 375 Bucket* bucket = GetBucket(c.name_bucket_id); | 378 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 376 if (!bucket) { | 379 if (!bucket) { |
| 377 return error::kInvalidArguments; | 380 return error::kInvalidArguments; |
| 378 } | 381 } |
| 379 std::string name_str; | 382 std::string name_str; |
| 380 if (!bucket->GetAsString(&name_str)) { | 383 if (!bucket->GetAsString(&name_str)) { |
| 381 return error::kInvalidArguments; | 384 return error::kInvalidArguments; |
| 382 } | 385 } |
| 383 GLint* location = GetSharedMemoryAs<GLint*>( | 386 GLint* location = GetSharedMemoryAs<GLint*>( |
| 384 c.location_shm_id, c.location_shm_offset, sizeof(GLint)); | 387 c.location_shm_id, c.location_shm_offset, sizeof(GLint)); |
| 385 if (!location) { | 388 if (!location) { |
| 386 return error::kOutOfBounds; | 389 return error::kOutOfBounds; |
| 387 } | 390 } |
| 388 if (*location != -1) { | 391 if (*location != -1) { |
| 389 return error::kInvalidArguments; | 392 return error::kInvalidArguments; |
| 390 } | 393 } |
| 391 error::Error error = | 394 error::Error error = |
| 392 DoGetFragDataLocation(program, name_str.c_str(), location); | 395 DoGetFragDataLocation(program, name_str.c_str(), location); |
| 393 if (error != error::kNoError) { | 396 if (error != error::kNoError) { |
| 394 return error; | 397 return error; |
| 395 } | 398 } |
| 396 return error::kNoError; | 399 return error::kNoError; |
| 397 } | 400 } |
| 398 | 401 |
| 399 error::Error GLES2DecoderPassthroughImpl::HandleGetInternalformativ( | 402 error::Error GLES2DecoderPassthroughImpl::HandleGetInternalformativ( |
| 400 uint32_t immediate_data_size, | 403 uint32_t immediate_data_size, |
| 401 const void* cmd_data) { | 404 const volatile void* cmd_data) { |
| 402 const gles2::cmds::GetInternalformativ& c = | 405 const volatile gles2::cmds::GetInternalformativ& c = |
| 403 *static_cast<const gles2::cmds::GetInternalformativ*>(cmd_data); | 406 *static_cast<const volatile gles2::cmds::GetInternalformativ*>(cmd_data); |
| 404 GLenum target = static_cast<GLenum>(c.target); | 407 GLenum target = static_cast<GLenum>(c.target); |
| 405 GLenum internalformat = static_cast<GLenum>(c.format); | 408 GLenum internalformat = static_cast<GLenum>(c.format); |
| 406 GLenum pname = static_cast<GLenum>(c.pname); | 409 GLenum pname = static_cast<GLenum>(c.pname); |
| 407 unsigned int buffer_size = 0; | 410 unsigned int buffer_size = 0; |
| 408 typedef cmds::GetInternalformativ::Result Result; | 411 typedef cmds::GetInternalformativ::Result Result; |
| 409 Result* result = GetSharedMemoryAndSizeAs<Result*>( | 412 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 410 c.params_shm_id, c.params_shm_offset, &buffer_size); | 413 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 411 GLint* params = result ? result->GetData() : NULL; | 414 GLint* params = result ? result->GetData() : NULL; |
| 412 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | 415 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 413 GLsizei length = 0; | 416 GLsizei length = 0; |
| 414 error::Error error = DoGetInternalformativ(target, internalformat, pname, | 417 error::Error error = DoGetInternalformativ(target, internalformat, pname, |
| 415 bufsize, &length, params); | 418 bufsize, &length, params); |
| 416 if (error != error::kNoError) { | 419 if (error != error::kNoError) { |
| 417 return error; | 420 return error; |
| 418 } | 421 } |
| 419 if (length > bufsize) { | 422 if (length > bufsize) { |
| 420 return error::kOutOfBounds; | 423 return error::kOutOfBounds; |
| 421 } | 424 } |
| 422 result->SetNumResults(length); | 425 result->SetNumResults(length); |
| 423 return error::kNoError; | 426 return error::kNoError; |
| 424 } | 427 } |
| 425 | 428 |
| 426 error::Error GLES2DecoderPassthroughImpl::HandleGetProgramInfoLog( | 429 error::Error GLES2DecoderPassthroughImpl::HandleGetProgramInfoLog( |
| 427 uint32_t immediate_data_size, | 430 uint32_t immediate_data_size, |
| 428 const void* cmd_data) { | 431 const volatile void* cmd_data) { |
| 429 const gles2::cmds::GetProgramInfoLog& c = | 432 const volatile gles2::cmds::GetProgramInfoLog& c = |
| 430 *static_cast<const gles2::cmds::GetProgramInfoLog*>(cmd_data); | 433 *static_cast<const volatile gles2::cmds::GetProgramInfoLog*>(cmd_data); |
| 431 GLuint program = static_cast<GLuint>(c.program); | 434 GLuint program = static_cast<GLuint>(c.program); |
| 432 uint32_t bucket_id = static_cast<uint32_t>(c.bucket_id); | 435 uint32_t bucket_id = static_cast<uint32_t>(c.bucket_id); |
| 433 | 436 |
| 434 std::string infolog; | 437 std::string infolog; |
| 435 error::Error error = DoGetProgramInfoLog(program, &infolog); | 438 error::Error error = DoGetProgramInfoLog(program, &infolog); |
| 436 if (error != error::kNoError) { | 439 if (error != error::kNoError) { |
| 437 return error; | 440 return error; |
| 438 } | 441 } |
| 439 | 442 |
| 440 Bucket* bucket = CreateBucket(bucket_id); | 443 Bucket* bucket = CreateBucket(bucket_id); |
| 441 bucket->SetFromString(infolog.c_str()); | 444 bucket->SetFromString(infolog.c_str()); |
| 442 return error::kNoError; | 445 return error::kNoError; |
| 443 } | 446 } |
| 444 | 447 |
| 445 error::Error GLES2DecoderPassthroughImpl::HandleGetShaderInfoLog( | 448 error::Error GLES2DecoderPassthroughImpl::HandleGetShaderInfoLog( |
| 446 uint32_t immediate_data_size, | 449 uint32_t immediate_data_size, |
| 447 const void* cmd_data) { | 450 const volatile void* cmd_data) { |
| 448 const gles2::cmds::GetShaderInfoLog& c = | 451 const volatile gles2::cmds::GetShaderInfoLog& c = |
| 449 *static_cast<const gles2::cmds::GetShaderInfoLog*>(cmd_data); | 452 *static_cast<const volatile gles2::cmds::GetShaderInfoLog*>(cmd_data); |
| 450 GLuint shader = static_cast<GLuint>(c.shader); | 453 GLuint shader = static_cast<GLuint>(c.shader); |
| 451 uint32_t bucket_id = static_cast<uint32_t>(c.bucket_id); | 454 uint32_t bucket_id = static_cast<uint32_t>(c.bucket_id); |
| 452 | 455 |
| 453 std::string infolog; | 456 std::string infolog; |
| 454 error::Error error = DoGetShaderInfoLog(shader, &infolog); | 457 error::Error error = DoGetShaderInfoLog(shader, &infolog); |
| 455 if (error != error::kNoError) { | 458 if (error != error::kNoError) { |
| 456 return error; | 459 return error; |
| 457 } | 460 } |
| 458 | 461 |
| 459 Bucket* bucket = CreateBucket(bucket_id); | 462 Bucket* bucket = CreateBucket(bucket_id); |
| 460 bucket->SetFromString(infolog.c_str()); | 463 bucket->SetFromString(infolog.c_str()); |
| 461 return error::kNoError; | 464 return error::kNoError; |
| 462 } | 465 } |
| 463 | 466 |
| 464 error::Error GLES2DecoderPassthroughImpl::HandleGetShaderPrecisionFormat( | 467 error::Error GLES2DecoderPassthroughImpl::HandleGetShaderPrecisionFormat( |
| 465 uint32_t immediate_data_size, | 468 uint32_t immediate_data_size, |
| 466 const void* cmd_data) { | 469 const volatile void* cmd_data) { |
| 467 const gles2::cmds::GetShaderPrecisionFormat& c = | 470 const volatile gles2::cmds::GetShaderPrecisionFormat& c = |
| 468 *static_cast<const gles2::cmds::GetShaderPrecisionFormat*>(cmd_data); | 471 *static_cast<const volatile gles2::cmds::GetShaderPrecisionFormat*>( |
| 472 cmd_data); |
| 469 GLenum shader_type = static_cast<GLenum>(c.shadertype); | 473 GLenum shader_type = static_cast<GLenum>(c.shadertype); |
| 470 GLenum precision_type = static_cast<GLenum>(c.precisiontype); | 474 GLenum precision_type = static_cast<GLenum>(c.precisiontype); |
| 471 typedef cmds::GetShaderPrecisionFormat::Result Result; | 475 typedef cmds::GetShaderPrecisionFormat::Result Result; |
| 472 Result* result = GetSharedMemoryAs<Result*>( | 476 Result* result = GetSharedMemoryAs<Result*>( |
| 473 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | 477 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 474 if (!result) { | 478 if (!result) { |
| 475 return error::kOutOfBounds; | 479 return error::kOutOfBounds; |
| 476 } | 480 } |
| 477 // Check that the client initialized the result. | 481 // Check that the client initialized the result. |
| 478 if (result->success != 0) { | 482 if (result->success != 0) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 490 result->success = 1; // true | 494 result->success = 1; // true |
| 491 result->min_range = range[0]; | 495 result->min_range = range[0]; |
| 492 result->max_range = range[1]; | 496 result->max_range = range[1]; |
| 493 result->precision = precision; | 497 result->precision = precision; |
| 494 | 498 |
| 495 return error::kNoError; | 499 return error::kNoError; |
| 496 } | 500 } |
| 497 | 501 |
| 498 error::Error GLES2DecoderPassthroughImpl::HandleGetShaderSource( | 502 error::Error GLES2DecoderPassthroughImpl::HandleGetShaderSource( |
| 499 uint32_t immediate_data_size, | 503 uint32_t immediate_data_size, |
| 500 const void* cmd_data) { | 504 const volatile void* cmd_data) { |
| 501 const gles2::cmds::GetShaderSource& c = | 505 const volatile gles2::cmds::GetShaderSource& c = |
| 502 *static_cast<const gles2::cmds::GetShaderSource*>(cmd_data); | 506 *static_cast<const volatile gles2::cmds::GetShaderSource*>(cmd_data); |
| 503 GLuint shader = static_cast<GLuint>(c.shader); | 507 GLuint shader = static_cast<GLuint>(c.shader); |
| 504 uint32_t bucket_id = static_cast<uint32_t>(c.bucket_id); | 508 uint32_t bucket_id = static_cast<uint32_t>(c.bucket_id); |
| 505 | 509 |
| 506 std::string source; | 510 std::string source; |
| 507 error::Error error = DoGetShaderSource(shader, &source); | 511 error::Error error = DoGetShaderSource(shader, &source); |
| 508 if (error != error::kNoError) { | 512 if (error != error::kNoError) { |
| 509 return error; | 513 return error; |
| 510 } | 514 } |
| 511 | 515 |
| 512 Bucket* bucket = CreateBucket(bucket_id); | 516 Bucket* bucket = CreateBucket(bucket_id); |
| 513 bucket->SetFromString(source.c_str()); | 517 bucket->SetFromString(source.c_str()); |
| 514 | 518 |
| 515 return error::kNoError; | 519 return error::kNoError; |
| 516 } | 520 } |
| 517 | 521 |
| 518 error::Error GLES2DecoderPassthroughImpl::HandleGetString( | 522 error::Error GLES2DecoderPassthroughImpl::HandleGetString( |
| 519 uint32_t immediate_data_size, | 523 uint32_t immediate_data_size, |
| 520 const void* cmd_data) { | 524 const volatile void* cmd_data) { |
| 521 const gles2::cmds::GetString& c = | 525 const volatile gles2::cmds::GetString& c = |
| 522 *static_cast<const gles2::cmds::GetString*>(cmd_data); | 526 *static_cast<const volatile gles2::cmds::GetString*>(cmd_data); |
| 523 GLenum name = static_cast<GLenum>(c.name); | 527 GLenum name = static_cast<GLenum>(c.name); |
| 524 | 528 |
| 525 const char* str = nullptr; | 529 const char* str = nullptr; |
| 526 error::Error error = DoGetString(name, &str); | 530 error::Error error = DoGetString(name, &str); |
| 527 if (error != error::kNoError) { | 531 if (error != error::kNoError) { |
| 528 return error; | 532 return error; |
| 529 } | 533 } |
| 530 if (!str) { | 534 if (!str) { |
| 531 return error::kOutOfBounds; | 535 return error::kOutOfBounds; |
| 532 } | 536 } |
| 533 Bucket* bucket = CreateBucket(c.bucket_id); | 537 Bucket* bucket = CreateBucket(c.bucket_id); |
| 534 bucket->SetFromString(str); | 538 bucket->SetFromString(str); |
| 535 | 539 |
| 536 return error::kNoError; | 540 return error::kNoError; |
| 537 } | 541 } |
| 538 | 542 |
| 539 error::Error GLES2DecoderPassthroughImpl::HandleGetTransformFeedbackVarying( | 543 error::Error GLES2DecoderPassthroughImpl::HandleGetTransformFeedbackVarying( |
| 540 uint32_t immediate_data_size, | 544 uint32_t immediate_data_size, |
| 541 const void* cmd_data) { | 545 const volatile void* cmd_data) { |
| 542 const gles2::cmds::GetTransformFeedbackVarying& c = | 546 const volatile gles2::cmds::GetTransformFeedbackVarying& c = |
| 543 *static_cast<const gles2::cmds::GetTransformFeedbackVarying*>(cmd_data); | 547 *static_cast<const volatile gles2::cmds::GetTransformFeedbackVarying*>( |
| 548 cmd_data); |
| 544 GLuint program = static_cast<GLuint>(c.program); | 549 GLuint program = static_cast<GLuint>(c.program); |
| 545 GLuint index = static_cast<GLuint>(c.index); | 550 GLuint index = static_cast<GLuint>(c.index); |
| 546 uint32_t name_bucket_id = c.name_bucket_id; | 551 uint32_t name_bucket_id = c.name_bucket_id; |
| 547 typedef cmds::GetTransformFeedbackVarying::Result Result; | 552 typedef cmds::GetTransformFeedbackVarying::Result Result; |
| 548 Result* result = GetSharedMemoryAs<Result*>( | 553 Result* result = GetSharedMemoryAs<Result*>( |
| 549 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | 554 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 550 if (!result) { | 555 if (!result) { |
| 551 return error::kOutOfBounds; | 556 return error::kOutOfBounds; |
| 552 } | 557 } |
| 553 // Check that the client initialized the result. | 558 // Check that the client initialized the result. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 567 result->success = 1; // true. | 572 result->success = 1; // true. |
| 568 result->size = static_cast<int32_t>(size); | 573 result->size = static_cast<int32_t>(size); |
| 569 result->type = static_cast<uint32_t>(type); | 574 result->type = static_cast<uint32_t>(type); |
| 570 Bucket* bucket = CreateBucket(name_bucket_id); | 575 Bucket* bucket = CreateBucket(name_bucket_id); |
| 571 bucket->SetFromString(name.c_str()); | 576 bucket->SetFromString(name.c_str()); |
| 572 return error::kNoError; | 577 return error::kNoError; |
| 573 } | 578 } |
| 574 | 579 |
| 575 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformBlockIndex( | 580 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformBlockIndex( |
| 576 uint32_t immediate_data_size, | 581 uint32_t immediate_data_size, |
| 577 const void* cmd_data) { | 582 const volatile void* cmd_data) { |
| 578 const gles2::cmds::GetUniformBlockIndex& c = | 583 const volatile gles2::cmds::GetUniformBlockIndex& c = |
| 579 *static_cast<const gles2::cmds::GetUniformBlockIndex*>(cmd_data); | 584 *static_cast<const volatile gles2::cmds::GetUniformBlockIndex*>(cmd_data); |
| 580 GLuint program = static_cast<GLuint>(c.program); | 585 GLuint program = static_cast<GLuint>(c.program); |
| 581 Bucket* bucket = GetBucket(c.name_bucket_id); | 586 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 582 if (!bucket) { | 587 if (!bucket) { |
| 583 return error::kInvalidArguments; | 588 return error::kInvalidArguments; |
| 584 } | 589 } |
| 585 std::string name_str; | 590 std::string name_str; |
| 586 if (!bucket->GetAsString(&name_str)) { | 591 if (!bucket->GetAsString(&name_str)) { |
| 587 return error::kInvalidArguments; | 592 return error::kInvalidArguments; |
| 588 } | 593 } |
| 589 GLint* index = GetSharedMemoryAs<GLint*>(c.index_shm_id, c.index_shm_offset, | 594 GLint* index = GetSharedMemoryAs<GLint*>(c.index_shm_id, c.index_shm_offset, |
| 590 sizeof(GLint)); | 595 sizeof(GLint)); |
| 591 if (!index) { | 596 if (!index) { |
| 592 return error::kOutOfBounds; | 597 return error::kOutOfBounds; |
| 593 } | 598 } |
| 594 if (*index != -1) { | 599 if (*index != -1) { |
| 595 return error::kInvalidArguments; | 600 return error::kInvalidArguments; |
| 596 } | 601 } |
| 597 error::Error error = DoGetUniformBlockIndex(program, name_str.c_str(), index); | 602 error::Error error = DoGetUniformBlockIndex(program, name_str.c_str(), index); |
| 598 if (error != error::kNoError) { | 603 if (error != error::kNoError) { |
| 599 return error; | 604 return error; |
| 600 } | 605 } |
| 601 return error::kNoError; | 606 return error::kNoError; |
| 602 } | 607 } |
| 603 | 608 |
| 604 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformfv( | 609 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformfv( |
| 605 uint32_t immediate_data_size, | 610 uint32_t immediate_data_size, |
| 606 const void* cmd_data) { | 611 const volatile void* cmd_data) { |
| 607 const gles2::cmds::GetUniformfv& c = | 612 const volatile gles2::cmds::GetUniformfv& c = |
| 608 *static_cast<const gles2::cmds::GetUniformfv*>(cmd_data); | 613 *static_cast<const volatile gles2::cmds::GetUniformfv*>(cmd_data); |
| 609 GLuint program = static_cast<GLuint>(c.program); | 614 GLuint program = static_cast<GLuint>(c.program); |
| 610 GLint location = static_cast<GLint>(c.location); | 615 GLint location = static_cast<GLint>(c.location); |
| 611 unsigned int buffer_size = 0; | 616 unsigned int buffer_size = 0; |
| 612 typedef cmds::GetUniformfv::Result Result; | 617 typedef cmds::GetUniformfv::Result Result; |
| 613 Result* result = GetSharedMemoryAndSizeAs<Result*>( | 618 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 614 c.params_shm_id, c.params_shm_offset, &buffer_size); | 619 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 615 GLfloat* params = result ? result->GetData() : NULL; | 620 GLfloat* params = result ? result->GetData() : NULL; |
| 616 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | 621 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 617 GLsizei length = 0; | 622 GLsizei length = 0; |
| 618 error::Error error = | 623 error::Error error = |
| 619 DoGetUniformfv(program, location, bufsize, &length, params); | 624 DoGetUniformfv(program, location, bufsize, &length, params); |
| 620 if (error != error::kNoError) { | 625 if (error != error::kNoError) { |
| 621 return error; | 626 return error; |
| 622 } | 627 } |
| 623 if (length > bufsize) { | 628 if (length > bufsize) { |
| 624 return error::kOutOfBounds; | 629 return error::kOutOfBounds; |
| 625 } | 630 } |
| 626 result->SetNumResults(length); | 631 result->SetNumResults(length); |
| 627 return error::kNoError; | 632 return error::kNoError; |
| 628 } | 633 } |
| 629 | 634 |
| 630 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformiv( | 635 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformiv( |
| 631 uint32_t immediate_data_size, | 636 uint32_t immediate_data_size, |
| 632 const void* cmd_data) { | 637 const volatile void* cmd_data) { |
| 633 const gles2::cmds::GetUniformiv& c = | 638 const volatile gles2::cmds::GetUniformiv& c = |
| 634 *static_cast<const gles2::cmds::GetUniformiv*>(cmd_data); | 639 *static_cast<const volatile gles2::cmds::GetUniformiv*>(cmd_data); |
| 635 GLuint program = static_cast<GLuint>(c.program); | 640 GLuint program = static_cast<GLuint>(c.program); |
| 636 GLint location = static_cast<GLint>(c.location); | 641 GLint location = static_cast<GLint>(c.location); |
| 637 unsigned int buffer_size = 0; | 642 unsigned int buffer_size = 0; |
| 638 typedef cmds::GetUniformiv::Result Result; | 643 typedef cmds::GetUniformiv::Result Result; |
| 639 Result* result = GetSharedMemoryAndSizeAs<Result*>( | 644 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 640 c.params_shm_id, c.params_shm_offset, &buffer_size); | 645 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 641 GLint* params = result ? result->GetData() : NULL; | 646 GLint* params = result ? result->GetData() : NULL; |
| 642 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | 647 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 643 GLsizei length = 0; | 648 GLsizei length = 0; |
| 644 error::Error error = | 649 error::Error error = |
| 645 DoGetUniformiv(program, location, bufsize, &length, params); | 650 DoGetUniformiv(program, location, bufsize, &length, params); |
| 646 if (error != error::kNoError) { | 651 if (error != error::kNoError) { |
| 647 return error; | 652 return error; |
| 648 } | 653 } |
| 649 if (length > bufsize) { | 654 if (length > bufsize) { |
| 650 return error::kOutOfBounds; | 655 return error::kOutOfBounds; |
| 651 } | 656 } |
| 652 result->SetNumResults(length); | 657 result->SetNumResults(length); |
| 653 return error::kNoError; | 658 return error::kNoError; |
| 654 } | 659 } |
| 655 | 660 |
| 656 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformuiv( | 661 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformuiv( |
| 657 uint32_t immediate_data_size, | 662 uint32_t immediate_data_size, |
| 658 const void* cmd_data) { | 663 const volatile void* cmd_data) { |
| 659 const gles2::cmds::GetUniformuiv& c = | 664 const volatile gles2::cmds::GetUniformuiv& c = |
| 660 *static_cast<const gles2::cmds::GetUniformuiv*>(cmd_data); | 665 *static_cast<const volatile gles2::cmds::GetUniformuiv*>(cmd_data); |
| 661 GLuint program = static_cast<GLuint>(c.program); | 666 GLuint program = static_cast<GLuint>(c.program); |
| 662 GLint location = static_cast<GLint>(c.location); | 667 GLint location = static_cast<GLint>(c.location); |
| 663 unsigned int buffer_size = 0; | 668 unsigned int buffer_size = 0; |
| 664 typedef cmds::GetUniformuiv::Result Result; | 669 typedef cmds::GetUniformuiv::Result Result; |
| 665 Result* result = GetSharedMemoryAndSizeAs<Result*>( | 670 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 666 c.params_shm_id, c.params_shm_offset, &buffer_size); | 671 c.params_shm_id, c.params_shm_offset, &buffer_size); |
| 667 GLuint* params = result ? result->GetData() : NULL; | 672 GLuint* params = result ? result->GetData() : NULL; |
| 668 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | 673 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 669 GLsizei length = 0; | 674 GLsizei length = 0; |
| 670 error::Error error = | 675 error::Error error = |
| 671 DoGetUniformuiv(program, location, bufsize, &length, params); | 676 DoGetUniformuiv(program, location, bufsize, &length, params); |
| 672 if (error != error::kNoError) { | 677 if (error != error::kNoError) { |
| 673 return error; | 678 return error; |
| 674 } | 679 } |
| 675 if (length > bufsize) { | 680 if (length > bufsize) { |
| 676 return error::kOutOfBounds; | 681 return error::kOutOfBounds; |
| 677 } | 682 } |
| 678 result->SetNumResults(length); | 683 result->SetNumResults(length); |
| 679 return error::kNoError; | 684 return error::kNoError; |
| 680 } | 685 } |
| 681 | 686 |
| 682 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformIndices( | 687 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformIndices( |
| 683 uint32_t immediate_data_size, | 688 uint32_t immediate_data_size, |
| 684 const void* cmd_data) { | 689 const volatile void* cmd_data) { |
| 685 const gles2::cmds::GetUniformIndices& c = | 690 const volatile gles2::cmds::GetUniformIndices& c = |
| 686 *static_cast<const gles2::cmds::GetUniformIndices*>(cmd_data); | 691 *static_cast<const volatile gles2::cmds::GetUniformIndices*>(cmd_data); |
| 687 GLuint program = static_cast<GLuint>(c.program); | 692 GLuint program = static_cast<GLuint>(c.program); |
| 688 Bucket* bucket = GetBucket(c.names_bucket_id); | 693 Bucket* bucket = GetBucket(c.names_bucket_id); |
| 689 if (!bucket) { | 694 if (!bucket) { |
| 690 return error::kInvalidArguments; | 695 return error::kInvalidArguments; |
| 691 } | 696 } |
| 692 GLsizei count = 0; | 697 GLsizei count = 0; |
| 693 std::vector<char*> names; | 698 std::vector<char*> names; |
| 694 std::vector<GLint> len; | 699 std::vector<GLint> len; |
| 695 if (!bucket->GetAsStrings(&count, &names, &len) || count <= 0) { | 700 if (!bucket->GetAsStrings(&count, &names, &len) || count <= 0) { |
| 696 return error::kInvalidArguments; | 701 return error::kInvalidArguments; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 715 } | 720 } |
| 716 if (length != count) { | 721 if (length != count) { |
| 717 return error::kOutOfBounds; | 722 return error::kOutOfBounds; |
| 718 } | 723 } |
| 719 result->SetNumResults(length); | 724 result->SetNumResults(length); |
| 720 return error::kNoError; | 725 return error::kNoError; |
| 721 } | 726 } |
| 722 | 727 |
| 723 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformLocation( | 728 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformLocation( |
| 724 uint32_t immediate_data_size, | 729 uint32_t immediate_data_size, |
| 725 const void* cmd_data) { | 730 const volatile void* cmd_data) { |
| 726 const gles2::cmds::GetUniformLocation& c = | 731 const volatile gles2::cmds::GetUniformLocation& c = |
| 727 *static_cast<const gles2::cmds::GetUniformLocation*>(cmd_data); | 732 *static_cast<const volatile gles2::cmds::GetUniformLocation*>(cmd_data); |
| 728 GLuint program = static_cast<GLuint>(c.program); | 733 GLuint program = static_cast<GLuint>(c.program); |
| 729 Bucket* bucket = GetBucket(c.name_bucket_id); | 734 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 730 if (!bucket) { | 735 if (!bucket) { |
| 731 return error::kInvalidArguments; | 736 return error::kInvalidArguments; |
| 732 } | 737 } |
| 733 std::string name_str; | 738 std::string name_str; |
| 734 if (!bucket->GetAsString(&name_str)) { | 739 if (!bucket->GetAsString(&name_str)) { |
| 735 return error::kInvalidArguments; | 740 return error::kInvalidArguments; |
| 736 } | 741 } |
| 737 GLint* location = GetSharedMemoryAs<GLint*>( | 742 GLint* location = GetSharedMemoryAs<GLint*>( |
| 738 c.location_shm_id, c.location_shm_offset, sizeof(GLint)); | 743 c.location_shm_id, c.location_shm_offset, sizeof(GLint)); |
| 739 if (!location) { | 744 if (!location) { |
| 740 return error::kOutOfBounds; | 745 return error::kOutOfBounds; |
| 741 } | 746 } |
| 742 if (*location != -1) { | 747 if (*location != -1) { |
| 743 return error::kInvalidArguments; | 748 return error::kInvalidArguments; |
| 744 } | 749 } |
| 745 error::Error error = | 750 error::Error error = |
| 746 DoGetUniformLocation(program, name_str.c_str(), location); | 751 DoGetUniformLocation(program, name_str.c_str(), location); |
| 747 if (error != error::kNoError) { | 752 if (error != error::kNoError) { |
| 748 return error; | 753 return error; |
| 749 } | 754 } |
| 750 return error::kNoError; | 755 return error::kNoError; |
| 751 } | 756 } |
| 752 | 757 |
| 753 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribPointerv( | 758 error::Error GLES2DecoderPassthroughImpl::HandleGetVertexAttribPointerv( |
| 754 uint32_t immediate_data_size, | 759 uint32_t immediate_data_size, |
| 755 const void* cmd_data) { | 760 const volatile void* cmd_data) { |
| 756 const gles2::cmds::GetVertexAttribPointerv& c = | 761 const volatile gles2::cmds::GetVertexAttribPointerv& c = |
| 757 *static_cast<const gles2::cmds::GetVertexAttribPointerv*>(cmd_data); | 762 *static_cast<const volatile gles2::cmds::GetVertexAttribPointerv*>( |
| 763 cmd_data); |
| 758 GLuint index = static_cast<GLuint>(c.index); | 764 GLuint index = static_cast<GLuint>(c.index); |
| 759 GLenum pname = static_cast<GLenum>(c.pname); | 765 GLenum pname = static_cast<GLenum>(c.pname); |
| 760 unsigned int buffer_size = 0; | 766 unsigned int buffer_size = 0; |
| 761 typedef cmds::GetVertexAttribPointerv::Result Result; | 767 typedef cmds::GetVertexAttribPointerv::Result Result; |
| 762 Result* result = GetSharedMemoryAndSizeAs<Result*>( | 768 Result* result = GetSharedMemoryAndSizeAs<Result*>( |
| 763 c.pointer_shm_id, c.pointer_shm_offset, &buffer_size); | 769 c.pointer_shm_id, c.pointer_shm_offset, &buffer_size); |
| 764 GLuint* params = result ? result->GetData() : NULL; | 770 GLuint* params = result ? result->GetData() : NULL; |
| 765 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); | 771 GLsizei bufsize = Result::ComputeMaxResults(buffer_size); |
| 766 GLsizei length = 0; | 772 GLsizei length = 0; |
| 767 error::Error error = | 773 error::Error error = |
| 768 DoGetVertexAttribPointerv(index, pname, bufsize, &length, params); | 774 DoGetVertexAttribPointerv(index, pname, bufsize, &length, params); |
| 769 if (error != error::kNoError) { | 775 if (error != error::kNoError) { |
| 770 return error; | 776 return error; |
| 771 } | 777 } |
| 772 if (length > bufsize) { | 778 if (length > bufsize) { |
| 773 return error::kOutOfBounds; | 779 return error::kOutOfBounds; |
| 774 } | 780 } |
| 775 result->SetNumResults(length); | 781 result->SetNumResults(length); |
| 776 return error::kNoError; | 782 return error::kNoError; |
| 777 } | 783 } |
| 778 | 784 |
| 779 error::Error GLES2DecoderPassthroughImpl::HandlePixelStorei( | 785 error::Error GLES2DecoderPassthroughImpl::HandlePixelStorei( |
| 780 uint32_t immediate_data_size, | 786 uint32_t immediate_data_size, |
| 781 const void* cmd_data) { | 787 const volatile void* cmd_data) { |
| 782 const gles2::cmds::PixelStorei& c = | 788 const volatile gles2::cmds::PixelStorei& c = |
| 783 *static_cast<const gles2::cmds::PixelStorei*>(cmd_data); | 789 *static_cast<const volatile gles2::cmds::PixelStorei*>(cmd_data); |
| 784 GLenum pname = static_cast<GLuint>(c.pname); | 790 GLenum pname = static_cast<GLuint>(c.pname); |
| 785 GLint param = static_cast<GLint>(c.param); | 791 GLint param = static_cast<GLint>(c.param); |
| 786 error::Error error = DoPixelStorei(pname, param); | 792 error::Error error = DoPixelStorei(pname, param); |
| 787 if (error != error::kNoError) { | 793 if (error != error::kNoError) { |
| 788 return error; | 794 return error; |
| 789 } | 795 } |
| 790 return error::kNoError; | 796 return error::kNoError; |
| 791 } | 797 } |
| 792 | 798 |
| 793 error::Error GLES2DecoderPassthroughImpl::HandleReadPixels( | 799 error::Error GLES2DecoderPassthroughImpl::HandleReadPixels( |
| 794 uint32_t immediate_data_size, | 800 uint32_t immediate_data_size, |
| 795 const void* cmd_data) { | 801 const volatile void* cmd_data) { |
| 796 const gles2::cmds::ReadPixels& c = | 802 const volatile gles2::cmds::ReadPixels& c = |
| 797 *static_cast<const gles2::cmds::ReadPixels*>(cmd_data); | 803 *static_cast<const volatile gles2::cmds::ReadPixels*>(cmd_data); |
| 798 GLint x = static_cast<GLint>(c.x); | 804 GLint x = static_cast<GLint>(c.x); |
| 799 GLint y = static_cast<GLint>(c.y); | 805 GLint y = static_cast<GLint>(c.y); |
| 800 GLsizei width = static_cast<GLsizei>(c.width); | 806 GLsizei width = static_cast<GLsizei>(c.width); |
| 801 GLsizei height = static_cast<GLsizei>(c.height); | 807 GLsizei height = static_cast<GLsizei>(c.height); |
| 802 GLenum format = static_cast<GLenum>(c.format); | 808 GLenum format = static_cast<GLenum>(c.format); |
| 803 GLenum type = static_cast<GLenum>(c.type); | 809 GLenum type = static_cast<GLenum>(c.type); |
| 804 | 810 |
| 805 uint8_t* pixels = nullptr; | 811 uint8_t* pixels = nullptr; |
| 806 unsigned int buffer_size = 0; | 812 unsigned int buffer_size = 0; |
| 807 if (c.pixels_shm_id != 0) { | 813 if (c.pixels_shm_id != 0) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 result->success = 1; | 846 result->success = 1; |
| 841 result->row_length = static_cast<uint32_t>(width); | 847 result->row_length = static_cast<uint32_t>(width); |
| 842 result->num_rows = static_cast<uint32_t>(height); | 848 result->num_rows = static_cast<uint32_t>(height); |
| 843 } | 849 } |
| 844 | 850 |
| 845 return error::kNoError; | 851 return error::kNoError; |
| 846 } | 852 } |
| 847 | 853 |
| 848 error::Error GLES2DecoderPassthroughImpl::HandleShaderBinary( | 854 error::Error GLES2DecoderPassthroughImpl::HandleShaderBinary( |
| 849 uint32_t immediate_data_size, | 855 uint32_t immediate_data_size, |
| 850 const void* cmd_data) { | 856 const volatile void* cmd_data) { |
| 851 const gles2::cmds::ShaderBinary& c = | 857 const volatile gles2::cmds::ShaderBinary& c = |
| 852 *static_cast<const gles2::cmds::ShaderBinary*>(cmd_data); | 858 *static_cast<const volatile gles2::cmds::ShaderBinary*>(cmd_data); |
| 853 GLsizei n = static_cast<GLsizei>(c.n); | 859 GLsizei n = static_cast<GLsizei>(c.n); |
| 854 GLsizei length = static_cast<GLsizei>(c.length); | 860 GLsizei length = static_cast<GLsizei>(c.length); |
| 855 uint32_t data_size; | 861 uint32_t data_size; |
| 856 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { | 862 if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) { |
| 857 return error::kOutOfBounds; | 863 return error::kOutOfBounds; |
| 858 } | 864 } |
| 859 const GLuint* shaders = GetSharedMemoryAs<const GLuint*>( | 865 const GLuint* shaders = GetSharedMemoryAs<const GLuint*>( |
| 860 c.shaders_shm_id, c.shaders_shm_offset, data_size); | 866 c.shaders_shm_id, c.shaders_shm_offset, data_size); |
| 861 GLenum binaryformat = static_cast<GLenum>(c.binaryformat); | 867 GLenum binaryformat = static_cast<GLenum>(c.binaryformat); |
| 862 const void* binary = GetSharedMemoryAs<const void*>( | 868 const void* binary = GetSharedMemoryAs<const void*>( |
| 863 c.binary_shm_id, c.binary_shm_offset, length); | 869 c.binary_shm_id, c.binary_shm_offset, length); |
| 864 if (shaders == NULL || binary == NULL) { | 870 if (shaders == NULL || binary == NULL) { |
| 865 return error::kOutOfBounds; | 871 return error::kOutOfBounds; |
| 866 } | 872 } |
| 867 | 873 |
| 868 error::Error error = DoShaderBinary(n, shaders, binaryformat, binary, length); | 874 error::Error error = DoShaderBinary(n, shaders, binaryformat, binary, length); |
| 869 if (error != error::kNoError) { | 875 if (error != error::kNoError) { |
| 870 return error; | 876 return error; |
| 871 } | 877 } |
| 872 | 878 |
| 873 return error::kNoError; | 879 return error::kNoError; |
| 874 } | 880 } |
| 875 | 881 |
| 876 error::Error GLES2DecoderPassthroughImpl::HandleTexImage2D( | 882 error::Error GLES2DecoderPassthroughImpl::HandleTexImage2D( |
| 877 uint32_t immediate_data_size, | 883 uint32_t immediate_data_size, |
| 878 const void* cmd_data) { | 884 const volatile void* cmd_data) { |
| 879 const gles2::cmds::TexImage2D& c = | 885 const volatile gles2::cmds::TexImage2D& c = |
| 880 *static_cast<const gles2::cmds::TexImage2D*>(cmd_data); | 886 *static_cast<const volatile gles2::cmds::TexImage2D*>(cmd_data); |
| 881 GLenum target = static_cast<GLenum>(c.target); | 887 GLenum target = static_cast<GLenum>(c.target); |
| 882 GLint level = static_cast<GLint>(c.level); | 888 GLint level = static_cast<GLint>(c.level); |
| 883 GLint internal_format = static_cast<GLint>(c.internalformat); | 889 GLint internal_format = static_cast<GLint>(c.internalformat); |
| 884 GLsizei width = static_cast<GLsizei>(c.width); | 890 GLsizei width = static_cast<GLsizei>(c.width); |
| 885 GLsizei height = static_cast<GLsizei>(c.height); | 891 GLsizei height = static_cast<GLsizei>(c.height); |
| 886 GLint border = static_cast<GLint>(c.border); | 892 GLint border = static_cast<GLint>(c.border); |
| 887 GLenum format = static_cast<GLenum>(c.format); | 893 GLenum format = static_cast<GLenum>(c.format); |
| 888 GLenum type = static_cast<GLenum>(c.type); | 894 GLenum type = static_cast<GLenum>(c.type); |
| 889 | 895 |
| 890 GLsizei imagesize = 0; | 896 GLsizei imagesize = 0; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 904 format, type, imagesize, pixels); | 910 format, type, imagesize, pixels); |
| 905 if (error != error::kNoError) { | 911 if (error != error::kNoError) { |
| 906 return error; | 912 return error; |
| 907 } | 913 } |
| 908 | 914 |
| 909 return error::kNoError; | 915 return error::kNoError; |
| 910 } | 916 } |
| 911 | 917 |
| 912 error::Error GLES2DecoderPassthroughImpl::HandleTexImage3D( | 918 error::Error GLES2DecoderPassthroughImpl::HandleTexImage3D( |
| 913 uint32_t immediate_data_size, | 919 uint32_t immediate_data_size, |
| 914 const void* cmd_data) { | 920 const volatile void* cmd_data) { |
| 915 const gles2::cmds::TexImage3D& c = | 921 const volatile gles2::cmds::TexImage3D& c = |
| 916 *static_cast<const gles2::cmds::TexImage3D*>(cmd_data); | 922 *static_cast<const volatile gles2::cmds::TexImage3D*>(cmd_data); |
| 917 GLenum target = static_cast<GLenum>(c.target); | 923 GLenum target = static_cast<GLenum>(c.target); |
| 918 GLint level = static_cast<GLint>(c.level); | 924 GLint level = static_cast<GLint>(c.level); |
| 919 GLint internal_format = static_cast<GLint>(c.internalformat); | 925 GLint internal_format = static_cast<GLint>(c.internalformat); |
| 920 GLsizei width = static_cast<GLsizei>(c.width); | 926 GLsizei width = static_cast<GLsizei>(c.width); |
| 921 GLsizei height = static_cast<GLsizei>(c.height); | 927 GLsizei height = static_cast<GLsizei>(c.height); |
| 922 GLsizei depth = static_cast<GLsizei>(c.depth); | 928 GLsizei depth = static_cast<GLsizei>(c.depth); |
| 923 GLint border = static_cast<GLint>(c.border); | 929 GLint border = static_cast<GLint>(c.border); |
| 924 GLenum format = static_cast<GLenum>(c.format); | 930 GLenum format = static_cast<GLenum>(c.format); |
| 925 GLenum type = static_cast<GLenum>(c.type); | 931 GLenum type = static_cast<GLenum>(c.type); |
| 926 | 932 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 941 format, type, imagesize, pixels); | 947 format, type, imagesize, pixels); |
| 942 if (error != error::kNoError) { | 948 if (error != error::kNoError) { |
| 943 return error; | 949 return error; |
| 944 } | 950 } |
| 945 | 951 |
| 946 return error::kNoError; | 952 return error::kNoError; |
| 947 } | 953 } |
| 948 | 954 |
| 949 error::Error GLES2DecoderPassthroughImpl::HandleTexSubImage2D( | 955 error::Error GLES2DecoderPassthroughImpl::HandleTexSubImage2D( |
| 950 uint32_t immediate_data_size, | 956 uint32_t immediate_data_size, |
| 951 const void* cmd_data) { | 957 const volatile void* cmd_data) { |
| 952 const gles2::cmds::TexSubImage2D& c = | 958 const volatile gles2::cmds::TexSubImage2D& c = |
| 953 *static_cast<const gles2::cmds::TexSubImage2D*>(cmd_data); | 959 *static_cast<const volatile gles2::cmds::TexSubImage2D*>(cmd_data); |
| 954 GLenum target = static_cast<GLenum>(c.target); | 960 GLenum target = static_cast<GLenum>(c.target); |
| 955 GLint level = static_cast<GLint>(c.level); | 961 GLint level = static_cast<GLint>(c.level); |
| 956 GLint xoffset = static_cast<GLint>(c.xoffset); | 962 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 957 GLint yoffset = static_cast<GLint>(c.yoffset); | 963 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 958 GLsizei width = static_cast<GLsizei>(c.width); | 964 GLsizei width = static_cast<GLsizei>(c.width); |
| 959 GLsizei height = static_cast<GLsizei>(c.height); | 965 GLsizei height = static_cast<GLsizei>(c.height); |
| 960 GLenum format = static_cast<GLenum>(c.format); | 966 GLenum format = static_cast<GLenum>(c.format); |
| 961 GLenum type = static_cast<GLenum>(c.type); | 967 GLenum type = static_cast<GLenum>(c.type); |
| 962 | 968 |
| 963 unsigned int buffer_size = 0; | 969 unsigned int buffer_size = 0; |
| 964 const void* pixels = GetSharedMemoryAndSizeAs<uint8_t*>( | 970 const void* pixels = GetSharedMemoryAndSizeAs<uint8_t*>( |
| 965 c.pixels_shm_id, c.pixels_shm_offset, &buffer_size); | 971 c.pixels_shm_id, c.pixels_shm_offset, &buffer_size); |
| 966 if (!pixels) { | 972 if (!pixels) { |
| 967 return error::kOutOfBounds; | 973 return error::kOutOfBounds; |
| 968 } | 974 } |
| 969 GLsizei imagesize = buffer_size; | 975 GLsizei imagesize = buffer_size; |
| 970 | 976 |
| 971 error::Error error = DoTexSubImage2D(target, level, xoffset, yoffset, width, | 977 error::Error error = DoTexSubImage2D(target, level, xoffset, yoffset, width, |
| 972 height, format, type, imagesize, pixels); | 978 height, format, type, imagesize, pixels); |
| 973 if (error != error::kNoError) { | 979 if (error != error::kNoError) { |
| 974 return error; | 980 return error; |
| 975 } | 981 } |
| 976 | 982 |
| 977 return error::kNoError; | 983 return error::kNoError; |
| 978 } | 984 } |
| 979 | 985 |
| 980 error::Error GLES2DecoderPassthroughImpl::HandleTexSubImage3D( | 986 error::Error GLES2DecoderPassthroughImpl::HandleTexSubImage3D( |
| 981 uint32_t immediate_data_size, | 987 uint32_t immediate_data_size, |
| 982 const void* cmd_data) { | 988 const volatile void* cmd_data) { |
| 983 const gles2::cmds::TexSubImage3D& c = | 989 const volatile gles2::cmds::TexSubImage3D& c = |
| 984 *static_cast<const gles2::cmds::TexSubImage3D*>(cmd_data); | 990 *static_cast<const volatile gles2::cmds::TexSubImage3D*>(cmd_data); |
| 985 GLenum target = static_cast<GLenum>(c.target); | 991 GLenum target = static_cast<GLenum>(c.target); |
| 986 GLint level = static_cast<GLint>(c.level); | 992 GLint level = static_cast<GLint>(c.level); |
| 987 GLint xoffset = static_cast<GLint>(c.xoffset); | 993 GLint xoffset = static_cast<GLint>(c.xoffset); |
| 988 GLint yoffset = static_cast<GLint>(c.yoffset); | 994 GLint yoffset = static_cast<GLint>(c.yoffset); |
| 989 GLint zoffset = static_cast<GLint>(c.zoffset); | 995 GLint zoffset = static_cast<GLint>(c.zoffset); |
| 990 GLsizei width = static_cast<GLsizei>(c.width); | 996 GLsizei width = static_cast<GLsizei>(c.width); |
| 991 GLsizei height = static_cast<GLsizei>(c.height); | 997 GLsizei height = static_cast<GLsizei>(c.height); |
| 992 GLsizei depth = static_cast<GLsizei>(c.depth); | 998 GLsizei depth = static_cast<GLsizei>(c.depth); |
| 993 GLenum format = static_cast<GLenum>(c.format); | 999 GLenum format = static_cast<GLenum>(c.format); |
| 994 GLenum type = static_cast<GLenum>(c.type); | 1000 GLenum type = static_cast<GLenum>(c.type); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1006 depth, format, type, imagesize, pixels); | 1012 depth, format, type, imagesize, pixels); |
| 1007 if (error != error::kNoError) { | 1013 if (error != error::kNoError) { |
| 1008 return error; | 1014 return error; |
| 1009 } | 1015 } |
| 1010 | 1016 |
| 1011 return error::kNoError; | 1017 return error::kNoError; |
| 1012 } | 1018 } |
| 1013 | 1019 |
| 1014 error::Error GLES2DecoderPassthroughImpl::HandleUniformBlockBinding( | 1020 error::Error GLES2DecoderPassthroughImpl::HandleUniformBlockBinding( |
| 1015 uint32_t immediate_data_size, | 1021 uint32_t immediate_data_size, |
| 1016 const void* cmd_data) { | 1022 const volatile void* cmd_data) { |
| 1017 const gles2::cmds::UniformBlockBinding& c = | 1023 const volatile gles2::cmds::UniformBlockBinding& c = |
| 1018 *static_cast<const gles2::cmds::UniformBlockBinding*>(cmd_data); | 1024 *static_cast<const volatile gles2::cmds::UniformBlockBinding*>(cmd_data); |
| 1019 GLuint program = static_cast<GLuint>(c.program); | 1025 GLuint program = static_cast<GLuint>(c.program); |
| 1020 GLuint index = static_cast<GLuint>(c.index); | 1026 GLuint index = static_cast<GLuint>(c.index); |
| 1021 GLuint binding = static_cast<GLuint>(c.binding); | 1027 GLuint binding = static_cast<GLuint>(c.binding); |
| 1022 | 1028 |
| 1023 error::Error error = DoUniformBlockBinding(program, index, binding); | 1029 error::Error error = DoUniformBlockBinding(program, index, binding); |
| 1024 if (error != error::kNoError) { | 1030 if (error != error::kNoError) { |
| 1025 return error; | 1031 return error; |
| 1026 } | 1032 } |
| 1027 | 1033 |
| 1028 return error::kNoError; | 1034 return error::kNoError; |
| 1029 } | 1035 } |
| 1030 | 1036 |
| 1031 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribIPointer( | 1037 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribIPointer( |
| 1032 uint32_t immediate_data_size, | 1038 uint32_t immediate_data_size, |
| 1033 const void* cmd_data) { | 1039 const volatile void* cmd_data) { |
| 1034 const gles2::cmds::VertexAttribIPointer& c = | 1040 const volatile gles2::cmds::VertexAttribIPointer& c = |
| 1035 *static_cast<const gles2::cmds::VertexAttribIPointer*>(cmd_data); | 1041 *static_cast<const volatile gles2::cmds::VertexAttribIPointer*>(cmd_data); |
| 1036 GLuint index = static_cast<GLuint>(c.indx); | 1042 GLuint index = static_cast<GLuint>(c.indx); |
| 1037 GLint size = static_cast<GLint>(c.size); | 1043 GLint size = static_cast<GLint>(c.size); |
| 1038 GLenum type = static_cast<GLenum>(c.type); | 1044 GLenum type = static_cast<GLenum>(c.type); |
| 1039 GLsizei stride = static_cast<GLsizei>(c.stride); | 1045 GLsizei stride = static_cast<GLsizei>(c.stride); |
| 1040 GLsizei offset = static_cast<GLsizei>(c.offset); | 1046 GLsizei offset = static_cast<GLsizei>(c.offset); |
| 1041 const void* ptr = reinterpret_cast<const void*>(offset); | 1047 const void* ptr = reinterpret_cast<const void*>(offset); |
| 1042 | 1048 |
| 1043 error::Error error = DoVertexAttribIPointer(index, size, type, stride, ptr); | 1049 error::Error error = DoVertexAttribIPointer(index, size, type, stride, ptr); |
| 1044 if (error != error::kNoError) { | 1050 if (error != error::kNoError) { |
| 1045 return error; | 1051 return error; |
| 1046 } | 1052 } |
| 1047 | 1053 |
| 1048 return error::kNoError; | 1054 return error::kNoError; |
| 1049 } | 1055 } |
| 1050 | 1056 |
| 1051 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribPointer( | 1057 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribPointer( |
| 1052 uint32_t immediate_data_size, | 1058 uint32_t immediate_data_size, |
| 1053 const void* cmd_data) { | 1059 const volatile void* cmd_data) { |
| 1054 const gles2::cmds::VertexAttribPointer& c = | 1060 const volatile gles2::cmds::VertexAttribPointer& c = |
| 1055 *static_cast<const gles2::cmds::VertexAttribPointer*>(cmd_data); | 1061 *static_cast<const volatile gles2::cmds::VertexAttribPointer*>(cmd_data); |
| 1056 GLuint index = static_cast<GLuint>(c.indx); | 1062 GLuint index = static_cast<GLuint>(c.indx); |
| 1057 GLint size = static_cast<GLint>(c.size); | 1063 GLint size = static_cast<GLint>(c.size); |
| 1058 GLenum type = static_cast<GLenum>(c.type); | 1064 GLenum type = static_cast<GLenum>(c.type); |
| 1059 GLboolean normalized = static_cast<GLenum>(c.normalized); | 1065 GLboolean normalized = static_cast<GLenum>(c.normalized); |
| 1060 GLsizei stride = static_cast<GLsizei>(c.stride); | 1066 GLsizei stride = static_cast<GLsizei>(c.stride); |
| 1061 GLsizei offset = static_cast<GLsizei>(c.offset); | 1067 GLsizei offset = static_cast<GLsizei>(c.offset); |
| 1062 const void* ptr = reinterpret_cast<const void*>(offset); | 1068 const void* ptr = reinterpret_cast<const void*>(offset); |
| 1063 | 1069 |
| 1064 error::Error error = | 1070 error::Error error = |
| 1065 DoVertexAttribPointer(index, size, type, normalized, stride, ptr); | 1071 DoVertexAttribPointer(index, size, type, normalized, stride, ptr); |
| 1066 if (error != error::kNoError) { | 1072 if (error != error::kNoError) { |
| 1067 return error; | 1073 return error; |
| 1068 } | 1074 } |
| 1069 | 1075 |
| 1070 return error::kNoError; | 1076 return error::kNoError; |
| 1071 } | 1077 } |
| 1072 | 1078 |
| 1073 error::Error GLES2DecoderPassthroughImpl::HandleWaitSync( | 1079 error::Error GLES2DecoderPassthroughImpl::HandleWaitSync( |
| 1074 uint32_t immediate_data_size, | 1080 uint32_t immediate_data_size, |
| 1075 const void* cmd_data) { | 1081 const volatile void* cmd_data) { |
| 1076 const gles2::cmds::WaitSync& c = | 1082 const volatile gles2::cmds::WaitSync& c = |
| 1077 *static_cast<const gles2::cmds::WaitSync*>(cmd_data); | 1083 *static_cast<const volatile gles2::cmds::WaitSync*>(cmd_data); |
| 1078 const GLuint sync = static_cast<GLuint>(c.sync); | 1084 const GLuint sync = static_cast<GLuint>(c.sync); |
| 1079 const GLbitfield flags = static_cast<GLbitfield>(c.flags); | 1085 const GLbitfield flags = static_cast<GLbitfield>(c.flags); |
| 1080 const GLuint64 timeout = c.timeout(); | 1086 const GLuint64 timeout = c.timeout(); |
| 1081 | 1087 |
| 1082 error::Error error = DoWaitSync(sync, flags, timeout); | 1088 error::Error error = DoWaitSync(sync, flags, timeout); |
| 1083 if (error != error::kNoError) { | 1089 if (error != error::kNoError) { |
| 1084 return error; | 1090 return error; |
| 1085 } | 1091 } |
| 1086 | 1092 |
| 1087 return error::kNoError; | 1093 return error::kNoError; |
| 1088 } | 1094 } |
| 1089 | 1095 |
| 1090 error::Error GLES2DecoderPassthroughImpl::HandleQueryCounterEXT( | 1096 error::Error GLES2DecoderPassthroughImpl::HandleQueryCounterEXT( |
| 1091 uint32_t immediate_data_size, | 1097 uint32_t immediate_data_size, |
| 1092 const void* cmd_data) { | 1098 const volatile void* cmd_data) { |
| 1093 const gles2::cmds::QueryCounterEXT& c = | 1099 const volatile gles2::cmds::QueryCounterEXT& c = |
| 1094 *static_cast<const gles2::cmds::QueryCounterEXT*>(cmd_data); | 1100 *static_cast<const volatile gles2::cmds::QueryCounterEXT*>(cmd_data); |
| 1095 GLuint id = static_cast<GLuint>(c.id); | 1101 GLuint id = static_cast<GLuint>(c.id); |
| 1096 GLenum target = static_cast<GLenum>(c.target); | 1102 GLenum target = static_cast<GLenum>(c.target); |
| 1097 | 1103 |
| 1098 error::Error error = DoQueryCounterEXT(id, target); | 1104 error::Error error = DoQueryCounterEXT(id, target); |
| 1099 if (error != error::kNoError) { | 1105 if (error != error::kNoError) { |
| 1100 return error; | 1106 return error; |
| 1101 } | 1107 } |
| 1102 | 1108 |
| 1103 return error::kNoError; | 1109 return error::kNoError; |
| 1104 } | 1110 } |
| 1105 | 1111 |
| 1106 error::Error GLES2DecoderPassthroughImpl::HandleBeginQueryEXT( | 1112 error::Error GLES2DecoderPassthroughImpl::HandleBeginQueryEXT( |
| 1107 uint32_t immediate_data_size, | 1113 uint32_t immediate_data_size, |
| 1108 const void* cmd_data) { | 1114 const volatile void* cmd_data) { |
| 1109 const gles2::cmds::BeginQueryEXT& c = | 1115 const volatile gles2::cmds::BeginQueryEXT& c = |
| 1110 *static_cast<const gles2::cmds::BeginQueryEXT*>(cmd_data); | 1116 *static_cast<const volatile gles2::cmds::BeginQueryEXT*>(cmd_data); |
| 1111 GLenum target = static_cast<GLenum>(c.target); | 1117 GLenum target = static_cast<GLenum>(c.target); |
| 1112 GLuint id = static_cast<GLuint>(c.id); | 1118 GLuint id = static_cast<GLuint>(c.id); |
| 1113 | 1119 |
| 1114 error::Error error = DoBeginQueryEXT(target, id); | 1120 error::Error error = DoBeginQueryEXT(target, id); |
| 1115 if (error != error::kNoError) { | 1121 if (error != error::kNoError) { |
| 1116 return error; | 1122 return error; |
| 1117 } | 1123 } |
| 1118 | 1124 |
| 1119 return error::kNoError; | 1125 return error::kNoError; |
| 1120 } | 1126 } |
| 1121 | 1127 |
| 1122 error::Error GLES2DecoderPassthroughImpl::HandleEndQueryEXT( | 1128 error::Error GLES2DecoderPassthroughImpl::HandleEndQueryEXT( |
| 1123 uint32_t immediate_data_size, | 1129 uint32_t immediate_data_size, |
| 1124 const void* cmd_data) { | 1130 const volatile void* cmd_data) { |
| 1125 const gles2::cmds::EndQueryEXT& c = | 1131 const volatile gles2::cmds::EndQueryEXT& c = |
| 1126 *static_cast<const gles2::cmds::EndQueryEXT*>(cmd_data); | 1132 *static_cast<const volatile gles2::cmds::EndQueryEXT*>(cmd_data); |
| 1127 GLenum target = static_cast<GLenum>(c.target); | 1133 GLenum target = static_cast<GLenum>(c.target); |
| 1128 | 1134 |
| 1129 error::Error error = DoEndQueryEXT(target); | 1135 error::Error error = DoEndQueryEXT(target); |
| 1130 if (error != error::kNoError) { | 1136 if (error != error::kNoError) { |
| 1131 return error; | 1137 return error; |
| 1132 } | 1138 } |
| 1133 | 1139 |
| 1134 return error::kNoError; | 1140 return error::kNoError; |
| 1135 } | 1141 } |
| 1136 | 1142 |
| 1137 error::Error GLES2DecoderPassthroughImpl::HandleSetDisjointValueSyncCHROMIUM( | 1143 error::Error GLES2DecoderPassthroughImpl::HandleSetDisjointValueSyncCHROMIUM( |
| 1138 uint32_t immediate_data_size, | 1144 uint32_t immediate_data_size, |
| 1139 const void* cmd_data) { | 1145 const volatile void* cmd_data) { |
| 1140 const gles2::cmds::SetDisjointValueSyncCHROMIUM& c = | 1146 const volatile gles2::cmds::SetDisjointValueSyncCHROMIUM& c = |
| 1141 *static_cast<const gles2::cmds::SetDisjointValueSyncCHROMIUM*>(cmd_data); | 1147 *static_cast<const volatile gles2::cmds::SetDisjointValueSyncCHROMIUM*>( |
| 1148 cmd_data); |
| 1142 DisjointValueSync* sync = GetSharedMemoryAs<DisjointValueSync*>( | 1149 DisjointValueSync* sync = GetSharedMemoryAs<DisjointValueSync*>( |
| 1143 c.sync_data_shm_id, c.sync_data_shm_offset, sizeof(*sync)); | 1150 c.sync_data_shm_id, c.sync_data_shm_offset, sizeof(*sync)); |
| 1144 if (!sync) { | 1151 if (!sync) { |
| 1145 return error::kOutOfBounds; | 1152 return error::kOutOfBounds; |
| 1146 } | 1153 } |
| 1147 error::Error error = DoSetDisjointValueSyncCHROMIUM(sync); | 1154 error::Error error = DoSetDisjointValueSyncCHROMIUM(sync); |
| 1148 if (error != error::kNoError) { | 1155 if (error != error::kNoError) { |
| 1149 return error; | 1156 return error; |
| 1150 } | 1157 } |
| 1151 return error::kNoError; | 1158 return error::kNoError; |
| 1152 } | 1159 } |
| 1153 | 1160 |
| 1154 error::Error GLES2DecoderPassthroughImpl::HandleInsertEventMarkerEXT( | 1161 error::Error GLES2DecoderPassthroughImpl::HandleInsertEventMarkerEXT( |
| 1155 uint32_t immediate_data_size, | 1162 uint32_t immediate_data_size, |
| 1156 const void* cmd_data) { | 1163 const volatile void* cmd_data) { |
| 1157 const gles2::cmds::InsertEventMarkerEXT& c = | 1164 const volatile gles2::cmds::InsertEventMarkerEXT& c = |
| 1158 *static_cast<const gles2::cmds::InsertEventMarkerEXT*>(cmd_data); | 1165 *static_cast<const volatile gles2::cmds::InsertEventMarkerEXT*>(cmd_data); |
| 1159 GLuint bucket_id = static_cast<GLuint>(c.bucket_id); | 1166 GLuint bucket_id = static_cast<GLuint>(c.bucket_id); |
| 1160 Bucket* bucket = GetBucket(bucket_id); | 1167 Bucket* bucket = GetBucket(bucket_id); |
| 1161 if (!bucket || bucket->size() == 0) { | 1168 if (!bucket || bucket->size() == 0) { |
| 1162 return error::kInvalidArguments; | 1169 return error::kInvalidArguments; |
| 1163 } | 1170 } |
| 1164 std::string str; | 1171 std::string str; |
| 1165 if (!bucket->GetAsString(&str)) { | 1172 if (!bucket->GetAsString(&str)) { |
| 1166 return error::kInvalidArguments; | 1173 return error::kInvalidArguments; |
| 1167 } | 1174 } |
| 1168 error::Error error = DoInsertEventMarkerEXT(0, str.c_str()); | 1175 error::Error error = DoInsertEventMarkerEXT(0, str.c_str()); |
| 1169 if (error != error::kNoError) { | 1176 if (error != error::kNoError) { |
| 1170 return error; | 1177 return error; |
| 1171 } | 1178 } |
| 1172 return error::kNoError; | 1179 return error::kNoError; |
| 1173 } | 1180 } |
| 1174 | 1181 |
| 1175 error::Error GLES2DecoderPassthroughImpl::HandlePushGroupMarkerEXT( | 1182 error::Error GLES2DecoderPassthroughImpl::HandlePushGroupMarkerEXT( |
| 1176 uint32_t immediate_data_size, | 1183 uint32_t immediate_data_size, |
| 1177 const void* cmd_data) { | 1184 const volatile void* cmd_data) { |
| 1178 const gles2::cmds::PushGroupMarkerEXT& c = | 1185 const volatile gles2::cmds::PushGroupMarkerEXT& c = |
| 1179 *static_cast<const gles2::cmds::PushGroupMarkerEXT*>(cmd_data); | 1186 *static_cast<const volatile gles2::cmds::PushGroupMarkerEXT*>(cmd_data); |
| 1180 GLuint bucket_id = static_cast<GLuint>(c.bucket_id); | 1187 GLuint bucket_id = static_cast<GLuint>(c.bucket_id); |
| 1181 Bucket* bucket = GetBucket(bucket_id); | 1188 Bucket* bucket = GetBucket(bucket_id); |
| 1182 if (!bucket || bucket->size() == 0) { | 1189 if (!bucket || bucket->size() == 0) { |
| 1183 return error::kInvalidArguments; | 1190 return error::kInvalidArguments; |
| 1184 } | 1191 } |
| 1185 std::string str; | 1192 std::string str; |
| 1186 if (!bucket->GetAsString(&str)) { | 1193 if (!bucket->GetAsString(&str)) { |
| 1187 return error::kInvalidArguments; | 1194 return error::kInvalidArguments; |
| 1188 } | 1195 } |
| 1189 error::Error error = DoPushGroupMarkerEXT(0, str.c_str()); | 1196 error::Error error = DoPushGroupMarkerEXT(0, str.c_str()); |
| 1190 if (error != error::kNoError) { | 1197 if (error != error::kNoError) { |
| 1191 return error; | 1198 return error; |
| 1192 } | 1199 } |
| 1193 return error::kNoError; | 1200 return error::kNoError; |
| 1194 } | 1201 } |
| 1195 | 1202 |
| 1196 error::Error GLES2DecoderPassthroughImpl::HandleEnableFeatureCHROMIUM( | 1203 error::Error GLES2DecoderPassthroughImpl::HandleEnableFeatureCHROMIUM( |
| 1197 uint32_t immediate_data_size, | 1204 uint32_t immediate_data_size, |
| 1198 const void* cmd_data) { | 1205 const volatile void* cmd_data) { |
| 1199 const gles2::cmds::EnableFeatureCHROMIUM& c = | 1206 const volatile gles2::cmds::EnableFeatureCHROMIUM& c = |
| 1200 *static_cast<const gles2::cmds::EnableFeatureCHROMIUM*>(cmd_data); | 1207 *static_cast<const volatile gles2::cmds::EnableFeatureCHROMIUM*>( |
| 1208 cmd_data); |
| 1201 Bucket* bucket = GetBucket(c.bucket_id); | 1209 Bucket* bucket = GetBucket(c.bucket_id); |
| 1202 if (!bucket || bucket->size() == 0) { | 1210 if (!bucket || bucket->size() == 0) { |
| 1203 return error::kInvalidArguments; | 1211 return error::kInvalidArguments; |
| 1204 } | 1212 } |
| 1205 typedef cmds::EnableFeatureCHROMIUM::Result Result; | 1213 typedef cmds::EnableFeatureCHROMIUM::Result Result; |
| 1206 Result* result = GetSharedMemoryAs<Result*>( | 1214 Result* result = GetSharedMemoryAs<Result*>( |
| 1207 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | 1215 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1208 if (!result) { | 1216 if (!result) { |
| 1209 return error::kOutOfBounds; | 1217 return error::kOutOfBounds; |
| 1210 } | 1218 } |
| 1211 // Check that the client initialized the result. | 1219 // Check that the client initialized the result. |
| 1212 if (*result != 0) { | 1220 if (*result != 0) { |
| 1213 return error::kInvalidArguments; | 1221 return error::kInvalidArguments; |
| 1214 } | 1222 } |
| 1215 std::string feature_str; | 1223 std::string feature_str; |
| 1216 if (!bucket->GetAsString(&feature_str)) { | 1224 if (!bucket->GetAsString(&feature_str)) { |
| 1217 return error::kInvalidArguments; | 1225 return error::kInvalidArguments; |
| 1218 } | 1226 } |
| 1219 error::Error error = DoEnableFeatureCHROMIUM(feature_str.c_str()); | 1227 error::Error error = DoEnableFeatureCHROMIUM(feature_str.c_str()); |
| 1220 if (error != error::kNoError) { | 1228 if (error != error::kNoError) { |
| 1221 return error; | 1229 return error; |
| 1222 } | 1230 } |
| 1223 | 1231 |
| 1224 *result = 1; // true. | 1232 *result = 1; // true. |
| 1225 return error::kNoError; | 1233 return error::kNoError; |
| 1226 } | 1234 } |
| 1227 | 1235 |
| 1228 error::Error GLES2DecoderPassthroughImpl::HandleMapBufferRange( | 1236 error::Error GLES2DecoderPassthroughImpl::HandleMapBufferRange( |
| 1229 uint32_t immediate_data_size, | 1237 uint32_t immediate_data_size, |
| 1230 const void* cmd_data) { | 1238 const volatile void* cmd_data) { |
| 1231 const gles2::cmds::MapBufferRange& c = | 1239 const volatile gles2::cmds::MapBufferRange& c = |
| 1232 *static_cast<const gles2::cmds::MapBufferRange*>(cmd_data); | 1240 *static_cast<const volatile gles2::cmds::MapBufferRange*>(cmd_data); |
| 1233 GLenum target = static_cast<GLenum>(c.target); | 1241 GLenum target = static_cast<GLenum>(c.target); |
| 1234 GLbitfield access = static_cast<GLbitfield>(c.access); | 1242 GLbitfield access = static_cast<GLbitfield>(c.access); |
| 1235 GLintptr offset = static_cast<GLintptr>(c.offset); | 1243 GLintptr offset = static_cast<GLintptr>(c.offset); |
| 1236 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); | 1244 GLsizeiptr size = static_cast<GLsizeiptr>(c.size); |
| 1237 | 1245 |
| 1238 typedef cmds::MapBufferRange::Result Result; | 1246 typedef cmds::MapBufferRange::Result Result; |
| 1239 Result* result = GetSharedMemoryAs<Result*>( | 1247 Result* result = GetSharedMemoryAs<Result*>( |
| 1240 c.result_shm_id, c.result_shm_offset, sizeof(*result)); | 1248 c.result_shm_id, c.result_shm_offset, sizeof(*result)); |
| 1241 if (!result) { | 1249 if (!result) { |
| 1242 return error::kOutOfBounds; | 1250 return error::kOutOfBounds; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1256 if (error != error::kNoError) { | 1264 if (error != error::kNoError) { |
| 1257 return error; | 1265 return error; |
| 1258 } | 1266 } |
| 1259 | 1267 |
| 1260 *result = 1; | 1268 *result = 1; |
| 1261 return error::kNoError; | 1269 return error::kNoError; |
| 1262 } | 1270 } |
| 1263 | 1271 |
| 1264 error::Error GLES2DecoderPassthroughImpl::HandleUnmapBuffer( | 1272 error::Error GLES2DecoderPassthroughImpl::HandleUnmapBuffer( |
| 1265 uint32_t immediate_data_size, | 1273 uint32_t immediate_data_size, |
| 1266 const void* cmd_data) { | 1274 const volatile void* cmd_data) { |
| 1267 const gles2::cmds::UnmapBuffer& c = | 1275 const volatile gles2::cmds::UnmapBuffer& c = |
| 1268 *static_cast<const gles2::cmds::UnmapBuffer*>(cmd_data); | 1276 *static_cast<const volatile gles2::cmds::UnmapBuffer*>(cmd_data); |
| 1269 GLenum target = static_cast<GLenum>(c.target); | 1277 GLenum target = static_cast<GLenum>(c.target); |
| 1270 error::Error error = DoUnmapBuffer(target); | 1278 error::Error error = DoUnmapBuffer(target); |
| 1271 if (error != error::kNoError) { | 1279 if (error != error::kNoError) { |
| 1272 return error; | 1280 return error; |
| 1273 } | 1281 } |
| 1274 return error::kNoError; | 1282 return error::kNoError; |
| 1275 } | 1283 } |
| 1276 | 1284 |
| 1277 error::Error GLES2DecoderPassthroughImpl::HandleResizeCHROMIUM( | 1285 error::Error GLES2DecoderPassthroughImpl::HandleResizeCHROMIUM( |
| 1278 uint32_t immediate_data_size, | 1286 uint32_t immediate_data_size, |
| 1279 const void* cmd_data) { | 1287 const volatile void* cmd_data) { |
| 1280 const gles2::cmds::ResizeCHROMIUM& c = | 1288 const volatile gles2::cmds::ResizeCHROMIUM& c = |
| 1281 *static_cast<const gles2::cmds::ResizeCHROMIUM*>(cmd_data); | 1289 *static_cast<const volatile gles2::cmds::ResizeCHROMIUM*>(cmd_data); |
| 1282 GLuint width = static_cast<GLuint>(c.width); | 1290 GLuint width = static_cast<GLuint>(c.width); |
| 1283 GLuint height = static_cast<GLuint>(c.height); | 1291 GLuint height = static_cast<GLuint>(c.height); |
| 1284 GLfloat scale_factor = static_cast<GLfloat>(c.scale_factor); | 1292 GLfloat scale_factor = static_cast<GLfloat>(c.scale_factor); |
| 1285 GLboolean has_alpha = static_cast<GLboolean>(c.alpha); | 1293 GLboolean has_alpha = static_cast<GLboolean>(c.alpha); |
| 1286 error::Error error = DoResizeCHROMIUM(width, height, scale_factor, has_alpha); | 1294 error::Error error = DoResizeCHROMIUM(width, height, scale_factor, has_alpha); |
| 1287 if (error != error::kNoError) { | 1295 if (error != error::kNoError) { |
| 1288 return error; | 1296 return error; |
| 1289 } | 1297 } |
| 1290 return error::kNoError; | 1298 return error::kNoError; |
| 1291 } | 1299 } |
| 1292 | 1300 |
| 1293 error::Error | 1301 error::Error |
| 1294 GLES2DecoderPassthroughImpl::HandleGetRequestableExtensionsCHROMIUM( | 1302 GLES2DecoderPassthroughImpl::HandleGetRequestableExtensionsCHROMIUM( |
| 1295 uint32_t immediate_data_size, | 1303 uint32_t immediate_data_size, |
| 1296 const void* cmd_data) { | 1304 const volatile void* cmd_data) { |
| 1297 const gles2::cmds::GetRequestableExtensionsCHROMIUM& c = | 1305 const volatile gles2::cmds::GetRequestableExtensionsCHROMIUM& c = |
| 1298 *static_cast<const gles2::cmds::GetRequestableExtensionsCHROMIUM*>( | 1306 *static_cast< |
| 1307 const volatile gles2::cmds::GetRequestableExtensionsCHROMIUM*>( |
| 1299 cmd_data); | 1308 cmd_data); |
| 1300 const char* str = nullptr; | 1309 const char* str = nullptr; |
| 1301 error::Error error = DoGetRequestableExtensionsCHROMIUM(&str); | 1310 error::Error error = DoGetRequestableExtensionsCHROMIUM(&str); |
| 1302 if (error != error::kNoError) { | 1311 if (error != error::kNoError) { |
| 1303 return error; | 1312 return error; |
| 1304 } | 1313 } |
| 1305 if (!str) { | 1314 if (!str) { |
| 1306 return error::kOutOfBounds; | 1315 return error::kOutOfBounds; |
| 1307 } | 1316 } |
| 1308 Bucket* bucket = CreateBucket(c.bucket_id); | 1317 Bucket* bucket = CreateBucket(c.bucket_id); |
| 1309 bucket->SetFromString(str); | 1318 bucket->SetFromString(str); |
| 1310 | 1319 |
| 1311 return error::kNoError; | 1320 return error::kNoError; |
| 1312 } | 1321 } |
| 1313 | 1322 |
| 1314 error::Error GLES2DecoderPassthroughImpl::HandleRequestExtensionCHROMIUM( | 1323 error::Error GLES2DecoderPassthroughImpl::HandleRequestExtensionCHROMIUM( |
| 1315 uint32_t immediate_data_size, | 1324 uint32_t immediate_data_size, |
| 1316 const void* cmd_data) { | 1325 const volatile void* cmd_data) { |
| 1317 const gles2::cmds::RequestExtensionCHROMIUM& c = | 1326 const volatile gles2::cmds::RequestExtensionCHROMIUM& c = |
| 1318 *static_cast<const gles2::cmds::RequestExtensionCHROMIUM*>(cmd_data); | 1327 *static_cast<const volatile gles2::cmds::RequestExtensionCHROMIUM*>( |
| 1328 cmd_data); |
| 1319 Bucket* bucket = GetBucket(c.bucket_id); | 1329 Bucket* bucket = GetBucket(c.bucket_id); |
| 1320 if (!bucket || bucket->size() == 0) { | 1330 if (!bucket || bucket->size() == 0) { |
| 1321 return error::kInvalidArguments; | 1331 return error::kInvalidArguments; |
| 1322 } | 1332 } |
| 1323 std::string feature_str; | 1333 std::string feature_str; |
| 1324 if (!bucket->GetAsString(&feature_str)) { | 1334 if (!bucket->GetAsString(&feature_str)) { |
| 1325 return error::kInvalidArguments; | 1335 return error::kInvalidArguments; |
| 1326 } | 1336 } |
| 1327 error::Error error = DoRequestExtensionCHROMIUM(feature_str.c_str()); | 1337 error::Error error = DoRequestExtensionCHROMIUM(feature_str.c_str()); |
| 1328 if (error != error::kNoError) { | 1338 if (error != error::kNoError) { |
| 1329 return error; | 1339 return error; |
| 1330 } | 1340 } |
| 1331 return error::kNoError; | 1341 return error::kNoError; |
| 1332 } | 1342 } |
| 1333 | 1343 |
| 1334 error::Error GLES2DecoderPassthroughImpl::HandleGetProgramInfoCHROMIUM( | 1344 error::Error GLES2DecoderPassthroughImpl::HandleGetProgramInfoCHROMIUM( |
| 1335 uint32_t immediate_data_size, | 1345 uint32_t immediate_data_size, |
| 1336 const void* cmd_data) { | 1346 const volatile void* cmd_data) { |
| 1337 const gles2::cmds::GetProgramInfoCHROMIUM& c = | 1347 const volatile gles2::cmds::GetProgramInfoCHROMIUM& c = |
| 1338 *static_cast<const gles2::cmds::GetProgramInfoCHROMIUM*>(cmd_data); | 1348 *static_cast<const volatile gles2::cmds::GetProgramInfoCHROMIUM*>( |
| 1349 cmd_data); |
| 1339 GLuint program = static_cast<GLuint>(c.program); | 1350 GLuint program = static_cast<GLuint>(c.program); |
| 1340 | 1351 |
| 1341 uint32_t bucket_id = c.bucket_id; | 1352 uint32_t bucket_id = c.bucket_id; |
| 1342 Bucket* bucket = CreateBucket(bucket_id); | 1353 Bucket* bucket = CreateBucket(bucket_id); |
| 1343 bucket->SetSize(sizeof(ProgramInfoHeader)); // in case we fail. | 1354 bucket->SetSize(sizeof(ProgramInfoHeader)); // in case we fail. |
| 1344 | 1355 |
| 1345 std::vector<uint8_t> data; | 1356 std::vector<uint8_t> data; |
| 1346 error::Error error = DoGetProgramInfoCHROMIUM(program, &data); | 1357 error::Error error = DoGetProgramInfoCHROMIUM(program, &data); |
| 1347 if (error != error::kNoError) { | 1358 if (error != error::kNoError) { |
| 1348 return error; | 1359 return error; |
| 1349 } | 1360 } |
| 1350 | 1361 |
| 1351 bucket->SetSize(data.size()); | 1362 bucket->SetSize(data.size()); |
| 1352 bucket->SetData(data.data(), 0, data.size()); | 1363 bucket->SetData(data.data(), 0, data.size()); |
| 1353 | 1364 |
| 1354 return error::kNoError; | 1365 return error::kNoError; |
| 1355 } | 1366 } |
| 1356 | 1367 |
| 1357 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformBlocksCHROMIUM( | 1368 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformBlocksCHROMIUM( |
| 1358 uint32_t immediate_data_size, | 1369 uint32_t immediate_data_size, |
| 1359 const void* cmd_data) { | 1370 const volatile void* cmd_data) { |
| 1360 const gles2::cmds::GetUniformBlocksCHROMIUM& c = | 1371 const volatile gles2::cmds::GetUniformBlocksCHROMIUM& c = |
| 1361 *static_cast<const gles2::cmds::GetUniformBlocksCHROMIUM*>(cmd_data); | 1372 *static_cast<const volatile gles2::cmds::GetUniformBlocksCHROMIUM*>( |
| 1373 cmd_data); |
| 1362 GLuint program = static_cast<GLuint>(c.program); | 1374 GLuint program = static_cast<GLuint>(c.program); |
| 1363 | 1375 |
| 1364 uint32_t bucket_id = c.bucket_id; | 1376 uint32_t bucket_id = c.bucket_id; |
| 1365 Bucket* bucket = CreateBucket(bucket_id); | 1377 Bucket* bucket = CreateBucket(bucket_id); |
| 1366 bucket->SetSize(sizeof(UniformBlocksHeader)); // in case we fail. | 1378 bucket->SetSize(sizeof(UniformBlocksHeader)); // in case we fail. |
| 1367 | 1379 |
| 1368 std::vector<uint8_t> data; | 1380 std::vector<uint8_t> data; |
| 1369 error::Error error = DoGetUniformBlocksCHROMIUM(program, &data); | 1381 error::Error error = DoGetUniformBlocksCHROMIUM(program, &data); |
| 1370 if (error != error::kNoError) { | 1382 if (error != error::kNoError) { |
| 1371 return error; | 1383 return error; |
| 1372 } | 1384 } |
| 1373 | 1385 |
| 1374 bucket->SetSize(data.size()); | 1386 bucket->SetSize(data.size()); |
| 1375 bucket->SetData(data.data(), 0, data.size()); | 1387 bucket->SetData(data.data(), 0, data.size()); |
| 1376 | 1388 |
| 1377 return error::kNoError; | 1389 return error::kNoError; |
| 1378 } | 1390 } |
| 1379 | 1391 |
| 1380 error::Error | 1392 error::Error |
| 1381 GLES2DecoderPassthroughImpl::HandleGetTransformFeedbackVaryingsCHROMIUM( | 1393 GLES2DecoderPassthroughImpl::HandleGetTransformFeedbackVaryingsCHROMIUM( |
| 1382 uint32_t immediate_data_size, | 1394 uint32_t immediate_data_size, |
| 1383 const void* cmd_data) { | 1395 const volatile void* cmd_data) { |
| 1384 const gles2::cmds::GetTransformFeedbackVaryingsCHROMIUM& c = | 1396 const volatile gles2::cmds::GetTransformFeedbackVaryingsCHROMIUM& c = |
| 1385 *static_cast<const gles2::cmds::GetTransformFeedbackVaryingsCHROMIUM*>( | 1397 *static_cast< |
| 1398 const volatile gles2::cmds::GetTransformFeedbackVaryingsCHROMIUM*>( |
| 1386 cmd_data); | 1399 cmd_data); |
| 1387 GLuint program = static_cast<GLuint>(c.program); | 1400 GLuint program = static_cast<GLuint>(c.program); |
| 1388 | 1401 |
| 1389 uint32_t bucket_id = c.bucket_id; | 1402 uint32_t bucket_id = c.bucket_id; |
| 1390 Bucket* bucket = CreateBucket(bucket_id); | 1403 Bucket* bucket = CreateBucket(bucket_id); |
| 1391 bucket->SetSize(sizeof(TransformFeedbackVaryingsHeader)); // in case we fail. | 1404 bucket->SetSize(sizeof(TransformFeedbackVaryingsHeader)); // in case we fail. |
| 1392 | 1405 |
| 1393 std::vector<uint8_t> data; | 1406 std::vector<uint8_t> data; |
| 1394 error::Error error = DoGetTransformFeedbackVaryingsCHROMIUM(program, &data); | 1407 error::Error error = DoGetTransformFeedbackVaryingsCHROMIUM(program, &data); |
| 1395 if (error != error::kNoError) { | 1408 if (error != error::kNoError) { |
| 1396 return error; | 1409 return error; |
| 1397 } | 1410 } |
| 1398 | 1411 |
| 1399 bucket->SetSize(data.size()); | 1412 bucket->SetSize(data.size()); |
| 1400 bucket->SetData(data.data(), 0, data.size()); | 1413 bucket->SetData(data.data(), 0, data.size()); |
| 1401 | 1414 |
| 1402 return error::kNoError; | 1415 return error::kNoError; |
| 1403 } | 1416 } |
| 1404 | 1417 |
| 1405 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformsES3CHROMIUM( | 1418 error::Error GLES2DecoderPassthroughImpl::HandleGetUniformsES3CHROMIUM( |
| 1406 uint32_t immediate_data_size, | 1419 uint32_t immediate_data_size, |
| 1407 const void* cmd_data) { | 1420 const volatile void* cmd_data) { |
| 1408 const gles2::cmds::GetUniformsES3CHROMIUM& c = | 1421 const volatile gles2::cmds::GetUniformsES3CHROMIUM& c = |
| 1409 *static_cast<const gles2::cmds::GetUniformsES3CHROMIUM*>(cmd_data); | 1422 *static_cast<const volatile gles2::cmds::GetUniformsES3CHROMIUM*>( |
| 1423 cmd_data); |
| 1410 GLuint program = static_cast<GLuint>(c.program); | 1424 GLuint program = static_cast<GLuint>(c.program); |
| 1411 | 1425 |
| 1412 uint32_t bucket_id = c.bucket_id; | 1426 uint32_t bucket_id = c.bucket_id; |
| 1413 Bucket* bucket = CreateBucket(bucket_id); | 1427 Bucket* bucket = CreateBucket(bucket_id); |
| 1414 bucket->SetSize(sizeof(UniformsES3Header)); // in case we fail. | 1428 bucket->SetSize(sizeof(UniformsES3Header)); // in case we fail. |
| 1415 | 1429 |
| 1416 std::vector<uint8_t> data; | 1430 std::vector<uint8_t> data; |
| 1417 error::Error error = DoGetUniformsES3CHROMIUM(program, &data); | 1431 error::Error error = DoGetUniformsES3CHROMIUM(program, &data); |
| 1418 if (error != error::kNoError) { | 1432 if (error != error::kNoError) { |
| 1419 return error; | 1433 return error; |
| 1420 } | 1434 } |
| 1421 | 1435 |
| 1422 bucket->SetSize(data.size()); | 1436 bucket->SetSize(data.size()); |
| 1423 bucket->SetData(data.data(), 0, data.size()); | 1437 bucket->SetData(data.data(), 0, data.size()); |
| 1424 | 1438 |
| 1425 return error::kNoError; | 1439 return error::kNoError; |
| 1426 } | 1440 } |
| 1427 | 1441 |
| 1428 error::Error GLES2DecoderPassthroughImpl::HandleGetTranslatedShaderSourceANGLE( | 1442 error::Error GLES2DecoderPassthroughImpl::HandleGetTranslatedShaderSourceANGLE( |
| 1429 uint32_t immediate_data_size, | 1443 uint32_t immediate_data_size, |
| 1430 const void* cmd_data) { | 1444 const volatile void* cmd_data) { |
| 1431 const gles2::cmds::GetTranslatedShaderSourceANGLE& c = | 1445 const volatile gles2::cmds::GetTranslatedShaderSourceANGLE& c = |
| 1432 *static_cast<const gles2::cmds::GetTranslatedShaderSourceANGLE*>( | 1446 *static_cast<const volatile gles2::cmds::GetTranslatedShaderSourceANGLE*>( |
| 1433 cmd_data); | 1447 cmd_data); |
| 1434 GLuint shader = static_cast<GLuint>(c.shader); | 1448 GLuint shader = static_cast<GLuint>(c.shader); |
| 1435 | 1449 |
| 1436 std::string source; | 1450 std::string source; |
| 1437 error::Error error = DoGetTranslatedShaderSourceANGLE(shader, &source); | 1451 error::Error error = DoGetTranslatedShaderSourceANGLE(shader, &source); |
| 1438 if (error != error::kNoError) { | 1452 if (error != error::kNoError) { |
| 1439 return error; | 1453 return error; |
| 1440 } | 1454 } |
| 1441 | 1455 |
| 1442 Bucket* bucket = CreateBucket(c.bucket_id); | 1456 Bucket* bucket = CreateBucket(c.bucket_id); |
| 1443 bucket->SetFromString(source.c_str()); | 1457 bucket->SetFromString(source.c_str()); |
| 1444 | 1458 |
| 1445 return error::kNoError; | 1459 return error::kNoError; |
| 1446 } | 1460 } |
| 1447 | 1461 |
| 1448 error::Error GLES2DecoderPassthroughImpl::HandlePostSubBufferCHROMIUM( | 1462 error::Error GLES2DecoderPassthroughImpl::HandlePostSubBufferCHROMIUM( |
| 1449 uint32_t immediate_data_size, | 1463 uint32_t immediate_data_size, |
| 1450 const void* cmd_data) { | 1464 const volatile void* cmd_data) { |
| 1451 const gles2::cmds::PostSubBufferCHROMIUM& c = | 1465 const volatile gles2::cmds::PostSubBufferCHROMIUM& c = |
| 1452 *static_cast<const gles2::cmds::PostSubBufferCHROMIUM*>(cmd_data); | 1466 *static_cast<const volatile gles2::cmds::PostSubBufferCHROMIUM*>( |
| 1467 cmd_data); |
| 1453 GLint x = static_cast<GLint>(c.x); | 1468 GLint x = static_cast<GLint>(c.x); |
| 1454 GLint y = static_cast<GLint>(c.y); | 1469 GLint y = static_cast<GLint>(c.y); |
| 1455 GLint width = static_cast<GLint>(c.width); | 1470 GLint width = static_cast<GLint>(c.width); |
| 1456 GLint height = static_cast<GLint>(c.height); | 1471 GLint height = static_cast<GLint>(c.height); |
| 1457 error::Error error = DoPostSubBufferCHROMIUM(x, y, width, height); | 1472 error::Error error = DoPostSubBufferCHROMIUM(x, y, width, height); |
| 1458 if (error != error::kNoError) { | 1473 if (error != error::kNoError) { |
| 1459 return error; | 1474 return error; |
| 1460 } | 1475 } |
| 1461 return error::kNoError; | 1476 return error::kNoError; |
| 1462 } | 1477 } |
| 1463 | 1478 |
| 1464 error::Error GLES2DecoderPassthroughImpl::HandleDrawArraysInstancedANGLE( | 1479 error::Error GLES2DecoderPassthroughImpl::HandleDrawArraysInstancedANGLE( |
| 1465 uint32_t immediate_data_size, | 1480 uint32_t immediate_data_size, |
| 1466 const void* cmd_data) { | 1481 const volatile void* cmd_data) { |
| 1467 const gles2::cmds::DrawArraysInstancedANGLE& c = | 1482 const volatile gles2::cmds::DrawArraysInstancedANGLE& c = |
| 1468 *static_cast<const gles2::cmds::DrawArraysInstancedANGLE*>(cmd_data); | 1483 *static_cast<const volatile gles2::cmds::DrawArraysInstancedANGLE*>( |
| 1484 cmd_data); |
| 1469 GLenum mode = static_cast<GLenum>(c.mode); | 1485 GLenum mode = static_cast<GLenum>(c.mode); |
| 1470 GLint first = static_cast<GLint>(c.first); | 1486 GLint first = static_cast<GLint>(c.first); |
| 1471 GLsizei count = static_cast<GLsizei>(c.count); | 1487 GLsizei count = static_cast<GLsizei>(c.count); |
| 1472 GLsizei primcount = static_cast<GLsizei>(c.primcount); | 1488 GLsizei primcount = static_cast<GLsizei>(c.primcount); |
| 1473 error::Error error = | 1489 error::Error error = |
| 1474 DoDrawArraysInstancedANGLE(mode, first, count, primcount); | 1490 DoDrawArraysInstancedANGLE(mode, first, count, primcount); |
| 1475 if (error != error::kNoError) { | 1491 if (error != error::kNoError) { |
| 1476 return error; | 1492 return error; |
| 1477 } | 1493 } |
| 1478 return error::kNoError; | 1494 return error::kNoError; |
| 1479 } | 1495 } |
| 1480 | 1496 |
| 1481 error::Error GLES2DecoderPassthroughImpl::HandleDrawElementsInstancedANGLE( | 1497 error::Error GLES2DecoderPassthroughImpl::HandleDrawElementsInstancedANGLE( |
| 1482 uint32_t immediate_data_size, | 1498 uint32_t immediate_data_size, |
| 1483 const void* cmd_data) { | 1499 const volatile void* cmd_data) { |
| 1484 const gles2::cmds::DrawElementsInstancedANGLE& c = | 1500 const volatile gles2::cmds::DrawElementsInstancedANGLE& c = |
| 1485 *static_cast<const gles2::cmds::DrawElementsInstancedANGLE*>(cmd_data); | 1501 *static_cast<const volatile gles2::cmds::DrawElementsInstancedANGLE*>( |
| 1502 cmd_data); |
| 1486 GLenum mode = static_cast<GLenum>(c.mode); | 1503 GLenum mode = static_cast<GLenum>(c.mode); |
| 1487 GLsizei count = static_cast<GLsizei>(c.count); | 1504 GLsizei count = static_cast<GLsizei>(c.count); |
| 1488 GLenum type = static_cast<GLenum>(c.type); | 1505 GLenum type = static_cast<GLenum>(c.type); |
| 1489 const GLvoid* indices = | 1506 const GLvoid* indices = |
| 1490 reinterpret_cast<const GLvoid*>(static_cast<uintptr_t>(c.index_offset)); | 1507 reinterpret_cast<const GLvoid*>(static_cast<uintptr_t>(c.index_offset)); |
| 1491 GLsizei primcount = static_cast<GLsizei>(c.primcount); | 1508 GLsizei primcount = static_cast<GLsizei>(c.primcount); |
| 1492 error::Error error = | 1509 error::Error error = |
| 1493 DoDrawElementsInstancedANGLE(mode, count, type, indices, primcount); | 1510 DoDrawElementsInstancedANGLE(mode, count, type, indices, primcount); |
| 1494 if (error != error::kNoError) { | 1511 if (error != error::kNoError) { |
| 1495 return error; | 1512 return error; |
| 1496 } | 1513 } |
| 1497 return error::kNoError; | 1514 return error::kNoError; |
| 1498 } | 1515 } |
| 1499 | 1516 |
| 1500 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribDivisorANGLE( | 1517 error::Error GLES2DecoderPassthroughImpl::HandleVertexAttribDivisorANGLE( |
| 1501 uint32_t immediate_data_size, | 1518 uint32_t immediate_data_size, |
| 1502 const void* cmd_data) { | 1519 const volatile void* cmd_data) { |
| 1503 const gles2::cmds::VertexAttribDivisorANGLE& c = | 1520 const volatile gles2::cmds::VertexAttribDivisorANGLE& c = |
| 1504 *static_cast<const gles2::cmds::VertexAttribDivisorANGLE*>(cmd_data); | 1521 *static_cast<const volatile gles2::cmds::VertexAttribDivisorANGLE*>( |
| 1522 cmd_data); |
| 1505 GLuint index = static_cast<GLuint>(c.index); | 1523 GLuint index = static_cast<GLuint>(c.index); |
| 1506 GLuint divisor = static_cast<GLuint>(c.divisor); | 1524 GLuint divisor = static_cast<GLuint>(c.divisor); |
| 1507 error::Error error = DoVertexAttribDivisorANGLE(index, divisor); | 1525 error::Error error = DoVertexAttribDivisorANGLE(index, divisor); |
| 1508 if (error != error::kNoError) { | 1526 if (error != error::kNoError) { |
| 1509 return error; | 1527 return error; |
| 1510 } | 1528 } |
| 1511 return error::kNoError; | 1529 return error::kNoError; |
| 1512 } | 1530 } |
| 1513 | 1531 |
| 1514 error::Error | 1532 error::Error |
| 1515 GLES2DecoderPassthroughImpl::HandleBindUniformLocationCHROMIUMBucket( | 1533 GLES2DecoderPassthroughImpl::HandleBindUniformLocationCHROMIUMBucket( |
| 1516 uint32_t immediate_data_size, | 1534 uint32_t immediate_data_size, |
| 1517 const void* cmd_data) { | 1535 const volatile void* cmd_data) { |
| 1518 const gles2::cmds::BindUniformLocationCHROMIUMBucket& c = | 1536 const volatile gles2::cmds::BindUniformLocationCHROMIUMBucket& c = |
| 1519 *static_cast<const gles2::cmds::BindUniformLocationCHROMIUMBucket*>( | 1537 *static_cast< |
| 1538 const volatile gles2::cmds::BindUniformLocationCHROMIUMBucket*>( |
| 1520 cmd_data); | 1539 cmd_data); |
| 1521 GLuint program = static_cast<GLuint>(c.program); | 1540 GLuint program = static_cast<GLuint>(c.program); |
| 1522 GLint location = static_cast<GLint>(c.location); | 1541 GLint location = static_cast<GLint>(c.location); |
| 1523 Bucket* bucket = GetBucket(c.name_bucket_id); | 1542 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 1524 if (!bucket || bucket->size() == 0) { | 1543 if (!bucket || bucket->size() == 0) { |
| 1525 return error::kInvalidArguments; | 1544 return error::kInvalidArguments; |
| 1526 } | 1545 } |
| 1527 std::string name_str; | 1546 std::string name_str; |
| 1528 if (!bucket->GetAsString(&name_str)) { | 1547 if (!bucket->GetAsString(&name_str)) { |
| 1529 return error::kInvalidArguments; | 1548 return error::kInvalidArguments; |
| 1530 } | 1549 } |
| 1531 error::Error error = | 1550 error::Error error = |
| 1532 DoBindUniformLocationCHROMIUM(program, location, name_str.c_str()); | 1551 DoBindUniformLocationCHROMIUM(program, location, name_str.c_str()); |
| 1533 if (error != error::kNoError) { | 1552 if (error != error::kNoError) { |
| 1534 return error; | 1553 return error; |
| 1535 } | 1554 } |
| 1536 return error::kNoError; | 1555 return error::kNoError; |
| 1537 } | 1556 } |
| 1538 | 1557 |
| 1539 error::Error GLES2DecoderPassthroughImpl::HandleTraceBeginCHROMIUM( | 1558 error::Error GLES2DecoderPassthroughImpl::HandleTraceBeginCHROMIUM( |
| 1540 uint32_t immediate_data_size, | 1559 uint32_t immediate_data_size, |
| 1541 const void* cmd_data) { | 1560 const volatile void* cmd_data) { |
| 1542 const gles2::cmds::TraceBeginCHROMIUM& c = | 1561 const volatile gles2::cmds::TraceBeginCHROMIUM& c = |
| 1543 *static_cast<const gles2::cmds::TraceBeginCHROMIUM*>(cmd_data); | 1562 *static_cast<const volatile gles2::cmds::TraceBeginCHROMIUM*>(cmd_data); |
| 1544 Bucket* category_bucket = GetBucket(c.category_bucket_id); | 1563 Bucket* category_bucket = GetBucket(c.category_bucket_id); |
| 1545 Bucket* name_bucket = GetBucket(c.name_bucket_id); | 1564 Bucket* name_bucket = GetBucket(c.name_bucket_id); |
| 1546 if (!category_bucket || category_bucket->size() == 0 || !name_bucket || | 1565 if (!category_bucket || category_bucket->size() == 0 || !name_bucket || |
| 1547 name_bucket->size() == 0) { | 1566 name_bucket->size() == 0) { |
| 1548 return error::kInvalidArguments; | 1567 return error::kInvalidArguments; |
| 1549 } | 1568 } |
| 1550 | 1569 |
| 1551 std::string category_name; | 1570 std::string category_name; |
| 1552 std::string trace_name; | 1571 std::string trace_name; |
| 1553 if (!category_bucket->GetAsString(&category_name) || | 1572 if (!category_bucket->GetAsString(&category_name) || |
| 1554 !name_bucket->GetAsString(&trace_name)) { | 1573 !name_bucket->GetAsString(&trace_name)) { |
| 1555 return error::kInvalidArguments; | 1574 return error::kInvalidArguments; |
| 1556 } | 1575 } |
| 1557 | 1576 |
| 1558 error::Error error = | 1577 error::Error error = |
| 1559 DoTraceBeginCHROMIUM(category_name.c_str(), trace_name.c_str()); | 1578 DoTraceBeginCHROMIUM(category_name.c_str(), trace_name.c_str()); |
| 1560 if (error != error::kNoError) { | 1579 if (error != error::kNoError) { |
| 1561 return error; | 1580 return error; |
| 1562 } | 1581 } |
| 1563 return error::kNoError; | 1582 return error::kNoError; |
| 1564 } | 1583 } |
| 1565 | 1584 |
| 1566 error::Error GLES2DecoderPassthroughImpl::HandleDescheduleUntilFinishedCHROMIUM( | 1585 error::Error GLES2DecoderPassthroughImpl::HandleDescheduleUntilFinishedCHROMIUM( |
| 1567 uint32_t immediate_data_size, | 1586 uint32_t immediate_data_size, |
| 1568 const void* cmd_data) { | 1587 const volatile void* cmd_data) { |
| 1569 const gles2::cmds::DescheduleUntilFinishedCHROMIUM& c = | |
| 1570 *static_cast<const gles2::cmds::DescheduleUntilFinishedCHROMIUM*>( | |
| 1571 cmd_data); | |
| 1572 (void)c; | |
| 1573 | |
| 1574 error::Error error = DoDescheduleUntilFinishedCHROMIUM(); | 1588 error::Error error = DoDescheduleUntilFinishedCHROMIUM(); |
| 1575 if (error != error::kNoError) { | 1589 if (error != error::kNoError) { |
| 1576 return error; | 1590 return error; |
| 1577 } | 1591 } |
| 1578 return error::kNoError; | 1592 return error::kNoError; |
| 1579 } | 1593 } |
| 1580 | 1594 |
| 1581 error::Error GLES2DecoderPassthroughImpl::HandleInsertFenceSyncCHROMIUM( | 1595 error::Error GLES2DecoderPassthroughImpl::HandleInsertFenceSyncCHROMIUM( |
| 1582 uint32_t immediate_data_size, | 1596 uint32_t immediate_data_size, |
| 1583 const void* cmd_data) { | 1597 const volatile void* cmd_data) { |
| 1584 const gles2::cmds::InsertFenceSyncCHROMIUM& c = | 1598 const volatile gles2::cmds::InsertFenceSyncCHROMIUM& c = |
| 1585 *static_cast<const gles2::cmds::InsertFenceSyncCHROMIUM*>(cmd_data); | 1599 *static_cast<const volatile gles2::cmds::InsertFenceSyncCHROMIUM*>( |
| 1600 cmd_data); |
| 1586 GLuint64 release_count = c.release_count(); | 1601 GLuint64 release_count = c.release_count(); |
| 1587 error::Error error = DoInsertFenceSyncCHROMIUM(release_count); | 1602 error::Error error = DoInsertFenceSyncCHROMIUM(release_count); |
| 1588 if (error != error::kNoError) { | 1603 if (error != error::kNoError) { |
| 1589 return error; | 1604 return error; |
| 1590 } | 1605 } |
| 1591 return error::kNoError; | 1606 return error::kNoError; |
| 1592 } | 1607 } |
| 1593 | 1608 |
| 1594 error::Error GLES2DecoderPassthroughImpl::HandleWaitSyncTokenCHROMIUM( | 1609 error::Error GLES2DecoderPassthroughImpl::HandleWaitSyncTokenCHROMIUM( |
| 1595 uint32_t immediate_data_size, | 1610 uint32_t immediate_data_size, |
| 1596 const void* cmd_data) { | 1611 const volatile void* cmd_data) { |
| 1597 const gles2::cmds::WaitSyncTokenCHROMIUM& c = | 1612 const volatile gles2::cmds::WaitSyncTokenCHROMIUM& c = |
| 1598 *static_cast<const gles2::cmds::WaitSyncTokenCHROMIUM*>(cmd_data); | 1613 *static_cast<const volatile gles2::cmds::WaitSyncTokenCHROMIUM*>( |
| 1614 cmd_data); |
| 1599 CommandBufferNamespace namespace_id = | 1615 CommandBufferNamespace namespace_id = |
| 1600 static_cast<gpu::CommandBufferNamespace>(c.namespace_id); | 1616 static_cast<gpu::CommandBufferNamespace>(c.namespace_id); |
| 1601 CommandBufferId command_buffer_id = | 1617 CommandBufferId command_buffer_id = |
| 1602 CommandBufferId::FromUnsafeValue(c.command_buffer_id()); | 1618 CommandBufferId::FromUnsafeValue(c.command_buffer_id()); |
| 1603 const uint64_t release_count = c.release_count(); | 1619 const uint64_t release_count = c.release_count(); |
| 1604 | 1620 |
| 1605 const CommandBufferNamespace kMinNamespaceId = | 1621 const CommandBufferNamespace kMinNamespaceId = |
| 1606 CommandBufferNamespace::INVALID; | 1622 CommandBufferNamespace::INVALID; |
| 1607 const CommandBufferNamespace kMaxNamespaceId = | 1623 const CommandBufferNamespace kMaxNamespaceId = |
| 1608 CommandBufferNamespace::NUM_COMMAND_BUFFER_NAMESPACES; | 1624 CommandBufferNamespace::NUM_COMMAND_BUFFER_NAMESPACES; |
| 1609 if ((namespace_id < static_cast<int32_t>(kMinNamespaceId)) || | 1625 if ((namespace_id < static_cast<int32_t>(kMinNamespaceId)) || |
| 1610 (namespace_id >= static_cast<int32_t>(kMaxNamespaceId))) { | 1626 (namespace_id >= static_cast<int32_t>(kMaxNamespaceId))) { |
| 1611 namespace_id = gpu::CommandBufferNamespace::INVALID; | 1627 namespace_id = gpu::CommandBufferNamespace::INVALID; |
| 1612 } | 1628 } |
| 1613 | 1629 |
| 1614 error::Error error = | 1630 error::Error error = |
| 1615 DoWaitSyncTokenCHROMIUM(namespace_id, command_buffer_id, release_count); | 1631 DoWaitSyncTokenCHROMIUM(namespace_id, command_buffer_id, release_count); |
| 1616 if (error != error::kNoError) { | 1632 if (error != error::kNoError) { |
| 1617 return error; | 1633 return error; |
| 1618 } | 1634 } |
| 1619 return error::kNoError; | 1635 return error::kNoError; |
| 1620 } | 1636 } |
| 1621 | 1637 |
| 1622 error::Error GLES2DecoderPassthroughImpl::HandleDiscardBackbufferCHROMIUM( | 1638 error::Error GLES2DecoderPassthroughImpl::HandleDiscardBackbufferCHROMIUM( |
| 1623 uint32_t immediate_data_size, | 1639 uint32_t immediate_data_size, |
| 1624 const void* cmd_data) { | 1640 const volatile void* cmd_data) { |
| 1625 const gles2::cmds::DiscardBackbufferCHROMIUM& c = | |
| 1626 *static_cast<const gles2::cmds::DiscardBackbufferCHROMIUM*>(cmd_data); | |
| 1627 (void)c; | |
| 1628 error::Error error = DoDiscardBackbufferCHROMIUM(); | 1641 error::Error error = DoDiscardBackbufferCHROMIUM(); |
| 1629 if (error != error::kNoError) { | 1642 if (error != error::kNoError) { |
| 1630 return error; | 1643 return error; |
| 1631 } | 1644 } |
| 1632 return error::kNoError; | 1645 return error::kNoError; |
| 1633 } | 1646 } |
| 1634 | 1647 |
| 1635 error::Error GLES2DecoderPassthroughImpl::HandleScheduleOverlayPlaneCHROMIUM( | 1648 error::Error GLES2DecoderPassthroughImpl::HandleScheduleOverlayPlaneCHROMIUM( |
| 1636 uint32_t immediate_data_size, | 1649 uint32_t immediate_data_size, |
| 1637 const void* cmd_data) { | 1650 const volatile void* cmd_data) { |
| 1638 const gles2::cmds::ScheduleOverlayPlaneCHROMIUM& c = | 1651 const volatile gles2::cmds::ScheduleOverlayPlaneCHROMIUM& c = |
| 1639 *static_cast<const gles2::cmds::ScheduleOverlayPlaneCHROMIUM*>(cmd_data); | 1652 *static_cast<const volatile gles2::cmds::ScheduleOverlayPlaneCHROMIUM*>( |
| 1653 cmd_data); |
| 1640 GLint plane_z_order = static_cast<GLint>(c.plane_z_order); | 1654 GLint plane_z_order = static_cast<GLint>(c.plane_z_order); |
| 1641 GLenum plane_transform = static_cast<GLenum>(c.plane_transform); | 1655 GLenum plane_transform = static_cast<GLenum>(c.plane_transform); |
| 1642 GLuint overlay_texture_id = static_cast<GLuint>(c.overlay_texture_id); | 1656 GLuint overlay_texture_id = static_cast<GLuint>(c.overlay_texture_id); |
| 1643 GLint bounds_x = static_cast<GLint>(c.bounds_x); | 1657 GLint bounds_x = static_cast<GLint>(c.bounds_x); |
| 1644 GLint bounds_y = static_cast<GLint>(c.bounds_y); | 1658 GLint bounds_y = static_cast<GLint>(c.bounds_y); |
| 1645 GLint bounds_width = static_cast<GLint>(c.bounds_width); | 1659 GLint bounds_width = static_cast<GLint>(c.bounds_width); |
| 1646 GLint bounds_height = static_cast<GLint>(c.bounds_height); | 1660 GLint bounds_height = static_cast<GLint>(c.bounds_height); |
| 1647 GLfloat uv_x = static_cast<GLfloat>(c.uv_x); | 1661 GLfloat uv_x = static_cast<GLfloat>(c.uv_x); |
| 1648 GLfloat uv_y = static_cast<GLfloat>(c.uv_x); | 1662 GLfloat uv_y = static_cast<GLfloat>(c.uv_x); |
| 1649 GLfloat uv_width = static_cast<GLfloat>(c.uv_x); | 1663 GLfloat uv_width = static_cast<GLfloat>(c.uv_x); |
| 1650 GLfloat uv_height = static_cast<GLfloat>(c.uv_x); | 1664 GLfloat uv_height = static_cast<GLfloat>(c.uv_x); |
| 1651 error::Error error = DoScheduleOverlayPlaneCHROMIUM( | 1665 error::Error error = DoScheduleOverlayPlaneCHROMIUM( |
| 1652 plane_z_order, plane_transform, overlay_texture_id, bounds_x, bounds_y, | 1666 plane_z_order, plane_transform, overlay_texture_id, bounds_x, bounds_y, |
| 1653 bounds_width, bounds_height, uv_x, uv_y, uv_width, uv_height); | 1667 bounds_width, bounds_height, uv_x, uv_y, uv_width, uv_height); |
| 1654 if (error != error::kNoError) { | 1668 if (error != error::kNoError) { |
| 1655 return error; | 1669 return error; |
| 1656 } | 1670 } |
| 1657 return error::kNoError; | 1671 return error::kNoError; |
| 1658 } | 1672 } |
| 1659 | 1673 |
| 1660 error::Error | 1674 error::Error |
| 1661 GLES2DecoderPassthroughImpl::HandleScheduleCALayerSharedStateCHROMIUM( | 1675 GLES2DecoderPassthroughImpl::HandleScheduleCALayerSharedStateCHROMIUM( |
| 1662 uint32_t immediate_data_size, | 1676 uint32_t immediate_data_size, |
| 1663 const void* cmd_data) { | 1677 const volatile void* cmd_data) { |
| 1664 const gles2::cmds::ScheduleCALayerSharedStateCHROMIUM& c = | 1678 const volatile gles2::cmds::ScheduleCALayerSharedStateCHROMIUM& c = |
| 1665 *static_cast<const gles2::cmds::ScheduleCALayerSharedStateCHROMIUM*>( | 1679 *static_cast< |
| 1680 const volatile gles2::cmds::ScheduleCALayerSharedStateCHROMIUM*>( |
| 1666 cmd_data); | 1681 cmd_data); |
| 1667 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, | 1682 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, |
| 1668 20 * sizeof(GLfloat)); | 1683 20 * sizeof(GLfloat)); |
| 1669 if (!mem) { | 1684 if (!mem) { |
| 1670 return error::kOutOfBounds; | 1685 return error::kOutOfBounds; |
| 1671 } | 1686 } |
| 1672 GLfloat opacity = static_cast<GLfloat>(c.opacity); | 1687 GLfloat opacity = static_cast<GLfloat>(c.opacity); |
| 1673 GLboolean is_clipped = static_cast<GLboolean>(c.is_clipped); | 1688 GLboolean is_clipped = static_cast<GLboolean>(c.is_clipped); |
| 1674 const GLfloat* clip_rect = mem + 0; | 1689 const GLfloat* clip_rect = mem + 0; |
| 1675 GLint sorting_context_id = static_cast<GLint>(c.sorting_context_id); | 1690 GLint sorting_context_id = static_cast<GLint>(c.sorting_context_id); |
| 1676 const GLfloat* transform = mem + 4; | 1691 const GLfloat* transform = mem + 4; |
| 1677 error::Error error = DoScheduleCALayerSharedStateCHROMIUM( | 1692 error::Error error = DoScheduleCALayerSharedStateCHROMIUM( |
| 1678 opacity, is_clipped, clip_rect, sorting_context_id, transform); | 1693 opacity, is_clipped, clip_rect, sorting_context_id, transform); |
| 1679 if (error != error::kNoError) { | 1694 if (error != error::kNoError) { |
| 1680 return error; | 1695 return error; |
| 1681 } | 1696 } |
| 1682 return error::kNoError; | 1697 return error::kNoError; |
| 1683 } | 1698 } |
| 1684 | 1699 |
| 1685 error::Error GLES2DecoderPassthroughImpl::HandleScheduleCALayerCHROMIUM( | 1700 error::Error GLES2DecoderPassthroughImpl::HandleScheduleCALayerCHROMIUM( |
| 1686 uint32_t immediate_data_size, | 1701 uint32_t immediate_data_size, |
| 1687 const void* cmd_data) { | 1702 const volatile void* cmd_data) { |
| 1688 const gles2::cmds::ScheduleCALayerCHROMIUM& c = | 1703 const volatile gles2::cmds::ScheduleCALayerCHROMIUM& c = |
| 1689 *static_cast<const gles2::cmds::ScheduleCALayerCHROMIUM*>(cmd_data); | 1704 *static_cast<const volatile gles2::cmds::ScheduleCALayerCHROMIUM*>( |
| 1705 cmd_data); |
| 1690 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, | 1706 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, |
| 1691 8 * sizeof(GLfloat)); | 1707 8 * sizeof(GLfloat)); |
| 1692 if (!mem) { | 1708 if (!mem) { |
| 1693 return error::kOutOfBounds; | 1709 return error::kOutOfBounds; |
| 1694 } | 1710 } |
| 1695 GLuint contents_texture_id = static_cast<GLint>(c.contents_texture_id); | 1711 GLuint contents_texture_id = static_cast<GLint>(c.contents_texture_id); |
| 1696 const GLfloat* contents_rect = mem; | 1712 const GLfloat* contents_rect = mem; |
| 1697 GLuint background_color = static_cast<GLuint>(c.background_color); | 1713 GLuint background_color = static_cast<GLuint>(c.background_color); |
| 1698 GLuint edge_aa_mask = static_cast<GLuint>(c.edge_aa_mask); | 1714 GLuint edge_aa_mask = static_cast<GLuint>(c.edge_aa_mask); |
| 1699 const GLfloat* bounds_rect = mem + 4; | 1715 const GLfloat* bounds_rect = mem + 4; |
| 1700 error::Error error = | 1716 error::Error error = |
| 1701 DoScheduleCALayerCHROMIUM(contents_texture_id, contents_rect, | 1717 DoScheduleCALayerCHROMIUM(contents_texture_id, contents_rect, |
| 1702 background_color, edge_aa_mask, bounds_rect); | 1718 background_color, edge_aa_mask, bounds_rect); |
| 1703 if (error != error::kNoError) { | 1719 if (error != error::kNoError) { |
| 1704 return error; | 1720 return error; |
| 1705 } | 1721 } |
| 1706 return error::kNoError; | 1722 return error::kNoError; |
| 1707 } | 1723 } |
| 1708 | 1724 |
| 1709 error::Error GLES2DecoderPassthroughImpl::HandleGenPathsCHROMIUM( | 1725 error::Error GLES2DecoderPassthroughImpl::HandleGenPathsCHROMIUM( |
| 1710 uint32_t immediate_data_size, | 1726 uint32_t immediate_data_size, |
| 1711 const void* cmd_data) { | 1727 const volatile void* cmd_data) { |
| 1712 const gles2::cmds::GenPathsCHROMIUM& c = | 1728 const volatile gles2::cmds::GenPathsCHROMIUM& c = |
| 1713 *static_cast<const gles2::cmds::GenPathsCHROMIUM*>(cmd_data); | 1729 *static_cast<const volatile gles2::cmds::GenPathsCHROMIUM*>(cmd_data); |
| 1714 GLuint path = static_cast<GLuint>(c.first_client_id); | 1730 GLuint path = static_cast<GLuint>(c.first_client_id); |
| 1715 GLsizei range = static_cast<GLsizei>(c.range); | 1731 GLsizei range = static_cast<GLsizei>(c.range); |
| 1716 error::Error error = DoGenPathsCHROMIUM(path, range); | 1732 error::Error error = DoGenPathsCHROMIUM(path, range); |
| 1717 if (error != error::kNoError) { | 1733 if (error != error::kNoError) { |
| 1718 return error; | 1734 return error; |
| 1719 } | 1735 } |
| 1720 return error::kNoError; | 1736 return error::kNoError; |
| 1721 } | 1737 } |
| 1722 | 1738 |
| 1723 error::Error GLES2DecoderPassthroughImpl::HandleDeletePathsCHROMIUM( | 1739 error::Error GLES2DecoderPassthroughImpl::HandleDeletePathsCHROMIUM( |
| 1724 uint32_t immediate_data_size, | 1740 uint32_t immediate_data_size, |
| 1725 const void* cmd_data) { | 1741 const volatile void* cmd_data) { |
| 1726 const gles2::cmds::DeletePathsCHROMIUM& c = | 1742 const volatile gles2::cmds::DeletePathsCHROMIUM& c = |
| 1727 *static_cast<const gles2::cmds::DeletePathsCHROMIUM*>(cmd_data); | 1743 *static_cast<const volatile gles2::cmds::DeletePathsCHROMIUM*>(cmd_data); |
| 1728 GLuint path = static_cast<GLuint>(c.first_client_id); | 1744 GLuint path = static_cast<GLuint>(c.first_client_id); |
| 1729 GLsizei range = static_cast<GLsizei>(c.range); | 1745 GLsizei range = static_cast<GLsizei>(c.range); |
| 1730 error::Error error = DoDeletePathsCHROMIUM(path, range); | 1746 error::Error error = DoDeletePathsCHROMIUM(path, range); |
| 1731 if (error != error::kNoError) { | 1747 if (error != error::kNoError) { |
| 1732 return error; | 1748 return error; |
| 1733 } | 1749 } |
| 1734 return error::kNoError; | 1750 return error::kNoError; |
| 1735 } | 1751 } |
| 1736 | 1752 |
| 1737 error::Error GLES2DecoderPassthroughImpl::HandlePathCommandsCHROMIUM( | 1753 error::Error GLES2DecoderPassthroughImpl::HandlePathCommandsCHROMIUM( |
| 1738 uint32_t immediate_data_size, | 1754 uint32_t immediate_data_size, |
| 1739 const void* cmd_data) { | 1755 const volatile void* cmd_data) { |
| 1740 const gles2::cmds::PathCommandsCHROMIUM& c = | 1756 const volatile gles2::cmds::PathCommandsCHROMIUM& c = |
| 1741 *static_cast<const gles2::cmds::PathCommandsCHROMIUM*>(cmd_data); | 1757 *static_cast<const volatile gles2::cmds::PathCommandsCHROMIUM*>(cmd_data); |
| 1742 GLuint path = static_cast<GLuint>(c.path); | 1758 GLuint path = static_cast<GLuint>(c.path); |
| 1743 GLsizei num_commands = static_cast<GLsizei>(c.numCommands); | 1759 GLsizei num_commands = static_cast<GLsizei>(c.numCommands); |
| 1744 const GLubyte* commands = nullptr; | 1760 const GLubyte* commands = nullptr; |
| 1745 if (num_commands > 0) { | 1761 if (num_commands > 0) { |
| 1746 uint32_t commands_shm_id = static_cast<uint32_t>(c.commands_shm_id); | 1762 uint32_t commands_shm_id = static_cast<uint32_t>(c.commands_shm_id); |
| 1747 uint32_t commands_shm_offset = static_cast<uint32_t>(c.commands_shm_offset); | 1763 uint32_t commands_shm_offset = static_cast<uint32_t>(c.commands_shm_offset); |
| 1748 if (commands_shm_id != 0 || commands_shm_offset != 0) { | 1764 if (commands_shm_id != 0 || commands_shm_offset != 0) { |
| 1749 commands = GetSharedMemoryAs<const GLubyte*>( | 1765 commands = GetSharedMemoryAs<const GLubyte*>( |
| 1750 commands_shm_id, commands_shm_offset, num_commands); | 1766 commands_shm_id, commands_shm_offset, num_commands); |
| 1751 } | 1767 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1777 coord_type, coords, coords_bufsize); | 1793 coord_type, coords, coords_bufsize); |
| 1778 if (error != error::kNoError) { | 1794 if (error != error::kNoError) { |
| 1779 return error; | 1795 return error; |
| 1780 } | 1796 } |
| 1781 | 1797 |
| 1782 return error::kNoError; | 1798 return error::kNoError; |
| 1783 } | 1799 } |
| 1784 | 1800 |
| 1785 error::Error GLES2DecoderPassthroughImpl::HandlePathParameterfCHROMIUM( | 1801 error::Error GLES2DecoderPassthroughImpl::HandlePathParameterfCHROMIUM( |
| 1786 uint32_t immediate_data_size, | 1802 uint32_t immediate_data_size, |
| 1787 const void* cmd_data) { | 1803 const volatile void* cmd_data) { |
| 1788 const gles2::cmds::PathParameterfCHROMIUM& c = | 1804 const volatile gles2::cmds::PathParameterfCHROMIUM& c = |
| 1789 *static_cast<const gles2::cmds::PathParameterfCHROMIUM*>(cmd_data); | 1805 *static_cast<const volatile gles2::cmds::PathParameterfCHROMIUM*>( |
| 1806 cmd_data); |
| 1790 GLuint path = static_cast<GLuint>(c.path); | 1807 GLuint path = static_cast<GLuint>(c.path); |
| 1791 GLenum pname = static_cast<GLenum>(c.pname); | 1808 GLenum pname = static_cast<GLenum>(c.pname); |
| 1792 GLfloat value = static_cast<GLfloat>(c.value); | 1809 GLfloat value = static_cast<GLfloat>(c.value); |
| 1793 error::Error error = DoPathParameterfCHROMIUM(path, pname, value); | 1810 error::Error error = DoPathParameterfCHROMIUM(path, pname, value); |
| 1794 if (error != error::kNoError) { | 1811 if (error != error::kNoError) { |
| 1795 return error; | 1812 return error; |
| 1796 } | 1813 } |
| 1797 return error::kNoError; | 1814 return error::kNoError; |
| 1798 } | 1815 } |
| 1799 | 1816 |
| 1800 error::Error GLES2DecoderPassthroughImpl::HandlePathParameteriCHROMIUM( | 1817 error::Error GLES2DecoderPassthroughImpl::HandlePathParameteriCHROMIUM( |
| 1801 uint32_t immediate_data_size, | 1818 uint32_t immediate_data_size, |
| 1802 const void* cmd_data) { | 1819 const volatile void* cmd_data) { |
| 1803 const gles2::cmds::PathParameteriCHROMIUM& c = | 1820 const volatile gles2::cmds::PathParameteriCHROMIUM& c = |
| 1804 *static_cast<const gles2::cmds::PathParameteriCHROMIUM*>(cmd_data); | 1821 *static_cast<const volatile gles2::cmds::PathParameteriCHROMIUM*>( |
| 1822 cmd_data); |
| 1805 GLuint path = static_cast<GLuint>(c.path); | 1823 GLuint path = static_cast<GLuint>(c.path); |
| 1806 GLenum pname = static_cast<GLenum>(c.pname); | 1824 GLenum pname = static_cast<GLenum>(c.pname); |
| 1807 GLint value = static_cast<GLint>(c.value); | 1825 GLint value = static_cast<GLint>(c.value); |
| 1808 error::Error error = DoPathParameteriCHROMIUM(path, pname, value); | 1826 error::Error error = DoPathParameteriCHROMIUM(path, pname, value); |
| 1809 if (error != error::kNoError) { | 1827 if (error != error::kNoError) { |
| 1810 return error; | 1828 return error; |
| 1811 } | 1829 } |
| 1812 return error::kNoError; | 1830 return error::kNoError; |
| 1813 } | 1831 } |
| 1814 | 1832 |
| 1815 error::Error GLES2DecoderPassthroughImpl::HandleStencilFillPathCHROMIUM( | 1833 error::Error GLES2DecoderPassthroughImpl::HandleStencilFillPathCHROMIUM( |
| 1816 uint32_t immediate_data_size, | 1834 uint32_t immediate_data_size, |
| 1817 const void* cmd_data) { | 1835 const volatile void* cmd_data) { |
| 1818 const gles2::cmds::StencilFillPathCHROMIUM& c = | 1836 const volatile gles2::cmds::StencilFillPathCHROMIUM& c = |
| 1819 *static_cast<const gles2::cmds::StencilFillPathCHROMIUM*>(cmd_data); | 1837 *static_cast<const volatile gles2::cmds::StencilFillPathCHROMIUM*>( |
| 1838 cmd_data); |
| 1820 GLuint path = static_cast<GLuint>(c.path); | 1839 GLuint path = static_cast<GLuint>(c.path); |
| 1821 GLenum fill_mode = static_cast<GLenum>(c.fillMode); | 1840 GLenum fill_mode = static_cast<GLenum>(c.fillMode); |
| 1822 GLuint mask = static_cast<GLuint>(c.mask); | 1841 GLuint mask = static_cast<GLuint>(c.mask); |
| 1823 error::Error error = DoStencilFillPathCHROMIUM(path, fill_mode, mask); | 1842 error::Error error = DoStencilFillPathCHROMIUM(path, fill_mode, mask); |
| 1824 if (error != error::kNoError) { | 1843 if (error != error::kNoError) { |
| 1825 return error; | 1844 return error; |
| 1826 } | 1845 } |
| 1827 return error::kNoError; | 1846 return error::kNoError; |
| 1828 } | 1847 } |
| 1829 | 1848 |
| 1830 error::Error GLES2DecoderPassthroughImpl::HandleStencilStrokePathCHROMIUM( | 1849 error::Error GLES2DecoderPassthroughImpl::HandleStencilStrokePathCHROMIUM( |
| 1831 uint32_t immediate_data_size, | 1850 uint32_t immediate_data_size, |
| 1832 const void* cmd_data) { | 1851 const volatile void* cmd_data) { |
| 1833 const gles2::cmds::StencilStrokePathCHROMIUM& c = | 1852 const volatile gles2::cmds::StencilStrokePathCHROMIUM& c = |
| 1834 *static_cast<const gles2::cmds::StencilStrokePathCHROMIUM*>(cmd_data); | 1853 *static_cast<const volatile gles2::cmds::StencilStrokePathCHROMIUM*>( |
| 1854 cmd_data); |
| 1835 GLuint path = static_cast<GLuint>(c.path); | 1855 GLuint path = static_cast<GLuint>(c.path); |
| 1836 GLint reference = static_cast<GLint>(c.reference); | 1856 GLint reference = static_cast<GLint>(c.reference); |
| 1837 GLuint mask = static_cast<GLuint>(c.mask); | 1857 GLuint mask = static_cast<GLuint>(c.mask); |
| 1838 error::Error error = DoStencilStrokePathCHROMIUM(path, reference, mask); | 1858 error::Error error = DoStencilStrokePathCHROMIUM(path, reference, mask); |
| 1839 if (error != error::kNoError) { | 1859 if (error != error::kNoError) { |
| 1840 return error; | 1860 return error; |
| 1841 } | 1861 } |
| 1842 return error::kNoError; | 1862 return error::kNoError; |
| 1843 } | 1863 } |
| 1844 | 1864 |
| 1845 error::Error GLES2DecoderPassthroughImpl::HandleCoverFillPathCHROMIUM( | 1865 error::Error GLES2DecoderPassthroughImpl::HandleCoverFillPathCHROMIUM( |
| 1846 uint32_t immediate_data_size, | 1866 uint32_t immediate_data_size, |
| 1847 const void* cmd_data) { | 1867 const volatile void* cmd_data) { |
| 1848 const gles2::cmds::CoverFillPathCHROMIUM& c = | 1868 const volatile gles2::cmds::CoverFillPathCHROMIUM& c = |
| 1849 *static_cast<const gles2::cmds::CoverFillPathCHROMIUM*>(cmd_data); | 1869 *static_cast<const volatile gles2::cmds::CoverFillPathCHROMIUM*>( |
| 1870 cmd_data); |
| 1850 GLuint path = static_cast<GLuint>(c.path); | 1871 GLuint path = static_cast<GLuint>(c.path); |
| 1851 GLenum cover_mode = static_cast<GLenum>(c.coverMode); | 1872 GLenum cover_mode = static_cast<GLenum>(c.coverMode); |
| 1852 error::Error error = DoCoverFillPathCHROMIUM(path, cover_mode); | 1873 error::Error error = DoCoverFillPathCHROMIUM(path, cover_mode); |
| 1853 if (error != error::kNoError) { | 1874 if (error != error::kNoError) { |
| 1854 return error; | 1875 return error; |
| 1855 } | 1876 } |
| 1856 return error::kNoError; | 1877 return error::kNoError; |
| 1857 } | 1878 } |
| 1858 | 1879 |
| 1859 error::Error GLES2DecoderPassthroughImpl::HandleCoverStrokePathCHROMIUM( | 1880 error::Error GLES2DecoderPassthroughImpl::HandleCoverStrokePathCHROMIUM( |
| 1860 uint32_t immediate_data_size, | 1881 uint32_t immediate_data_size, |
| 1861 const void* cmd_data) { | 1882 const volatile void* cmd_data) { |
| 1862 const gles2::cmds::CoverStrokePathCHROMIUM& c = | 1883 const volatile gles2::cmds::CoverStrokePathCHROMIUM& c = |
| 1863 *static_cast<const gles2::cmds::CoverStrokePathCHROMIUM*>(cmd_data); | 1884 *static_cast<const volatile gles2::cmds::CoverStrokePathCHROMIUM*>( |
| 1885 cmd_data); |
| 1864 GLuint path = static_cast<GLuint>(c.path); | 1886 GLuint path = static_cast<GLuint>(c.path); |
| 1865 GLenum cover_mode = static_cast<GLenum>(c.coverMode); | 1887 GLenum cover_mode = static_cast<GLenum>(c.coverMode); |
| 1866 error::Error error = DoCoverStrokePathCHROMIUM(path, cover_mode); | 1888 error::Error error = DoCoverStrokePathCHROMIUM(path, cover_mode); |
| 1867 if (error != error::kNoError) { | 1889 if (error != error::kNoError) { |
| 1868 return error; | 1890 return error; |
| 1869 } | 1891 } |
| 1870 return error::kNoError; | 1892 return error::kNoError; |
| 1871 } | 1893 } |
| 1872 | 1894 |
| 1873 error::Error | 1895 error::Error |
| 1874 GLES2DecoderPassthroughImpl::HandleStencilThenCoverFillPathCHROMIUM( | 1896 GLES2DecoderPassthroughImpl::HandleStencilThenCoverFillPathCHROMIUM( |
| 1875 uint32_t immediate_data_size, | 1897 uint32_t immediate_data_size, |
| 1876 const void* cmd_data) { | 1898 const volatile void* cmd_data) { |
| 1877 const gles2::cmds::StencilThenCoverFillPathCHROMIUM& c = | 1899 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM& c = |
| 1878 *static_cast<const gles2::cmds::StencilThenCoverFillPathCHROMIUM*>( | 1900 *static_cast< |
| 1901 const volatile gles2::cmds::StencilThenCoverFillPathCHROMIUM*>( |
| 1879 cmd_data); | 1902 cmd_data); |
| 1880 GLuint path = static_cast<GLuint>(c.path); | 1903 GLuint path = static_cast<GLuint>(c.path); |
| 1881 GLenum fill_mode = static_cast<GLenum>(c.fillMode); | 1904 GLenum fill_mode = static_cast<GLenum>(c.fillMode); |
| 1882 GLuint mask = static_cast<GLuint>(c.mask); | 1905 GLuint mask = static_cast<GLuint>(c.mask); |
| 1883 GLenum cover_mode = static_cast<GLenum>(c.coverMode); | 1906 GLenum cover_mode = static_cast<GLenum>(c.coverMode); |
| 1884 error::Error error = | 1907 error::Error error = |
| 1885 DoStencilThenCoverFillPathCHROMIUM(path, fill_mode, mask, cover_mode); | 1908 DoStencilThenCoverFillPathCHROMIUM(path, fill_mode, mask, cover_mode); |
| 1886 if (error != error::kNoError) { | 1909 if (error != error::kNoError) { |
| 1887 return error; | 1910 return error; |
| 1888 } | 1911 } |
| 1889 return error::kNoError; | 1912 return error::kNoError; |
| 1890 } | 1913 } |
| 1891 | 1914 |
| 1892 error::Error | 1915 error::Error |
| 1893 GLES2DecoderPassthroughImpl::HandleStencilThenCoverStrokePathCHROMIUM( | 1916 GLES2DecoderPassthroughImpl::HandleStencilThenCoverStrokePathCHROMIUM( |
| 1894 uint32_t immediate_data_size, | 1917 uint32_t immediate_data_size, |
| 1895 const void* cmd_data) { | 1918 const volatile void* cmd_data) { |
| 1896 const gles2::cmds::StencilThenCoverStrokePathCHROMIUM& c = | 1919 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM& c = |
| 1897 *static_cast<const gles2::cmds::StencilThenCoverStrokePathCHROMIUM*>( | 1920 *static_cast< |
| 1921 const volatile gles2::cmds::StencilThenCoverStrokePathCHROMIUM*>( |
| 1898 cmd_data); | 1922 cmd_data); |
| 1899 GLuint path = static_cast<GLuint>(c.path); | 1923 GLuint path = static_cast<GLuint>(c.path); |
| 1900 GLint reference = static_cast<GLint>(c.reference); | 1924 GLint reference = static_cast<GLint>(c.reference); |
| 1901 GLuint mask = static_cast<GLuint>(c.mask); | 1925 GLuint mask = static_cast<GLuint>(c.mask); |
| 1902 GLenum cover_mode = static_cast<GLenum>(c.coverMode); | 1926 GLenum cover_mode = static_cast<GLenum>(c.coverMode); |
| 1903 error::Error error = | 1927 error::Error error = |
| 1904 DoStencilThenCoverStrokePathCHROMIUM(path, reference, mask, cover_mode); | 1928 DoStencilThenCoverStrokePathCHROMIUM(path, reference, mask, cover_mode); |
| 1905 if (error != error::kNoError) { | 1929 if (error != error::kNoError) { |
| 1906 return error; | 1930 return error; |
| 1907 } | 1931 } |
| 1908 return error::kNoError; | 1932 return error::kNoError; |
| 1909 } | 1933 } |
| 1910 | 1934 |
| 1911 error::Error | 1935 error::Error |
| 1912 GLES2DecoderPassthroughImpl::HandleStencilFillPathInstancedCHROMIUM( | 1936 GLES2DecoderPassthroughImpl::HandleStencilFillPathInstancedCHROMIUM( |
| 1913 uint32_t immediate_data_size, | 1937 uint32_t immediate_data_size, |
| 1914 const void* cmd_data) { | 1938 const volatile void* cmd_data) { |
| 1915 const gles2::cmds::StencilFillPathInstancedCHROMIUM& c = | 1939 const volatile gles2::cmds::StencilFillPathInstancedCHROMIUM& c = |
| 1916 *static_cast<const gles2::cmds::StencilFillPathInstancedCHROMIUM*>( | 1940 *static_cast< |
| 1941 const volatile gles2::cmds::StencilFillPathInstancedCHROMIUM*>( |
| 1917 cmd_data); | 1942 cmd_data); |
| 1918 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); | 1943 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); |
| 1919 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); | 1944 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); |
| 1920 const GLvoid* paths = nullptr; | 1945 const GLvoid* paths = nullptr; |
| 1921 GLsizei paths_bufsize = 0; | 1946 GLsizei paths_bufsize = 0; |
| 1922 if (num_paths > 0) { | 1947 if (num_paths > 0) { |
| 1923 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); | 1948 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); |
| 1924 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); | 1949 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); |
| 1925 if (paths_shm_id != 0 || paths_shm_offset != 0) { | 1950 if (paths_shm_id != 0 || paths_shm_offset != 0) { |
| 1926 unsigned int memory_size = 0; | 1951 unsigned int memory_size = 0; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1955 if (error != error::kNoError) { | 1980 if (error != error::kNoError) { |
| 1956 return error; | 1981 return error; |
| 1957 } | 1982 } |
| 1958 | 1983 |
| 1959 return error::kNoError; | 1984 return error::kNoError; |
| 1960 } | 1985 } |
| 1961 | 1986 |
| 1962 error::Error | 1987 error::Error |
| 1963 GLES2DecoderPassthroughImpl::HandleStencilStrokePathInstancedCHROMIUM( | 1988 GLES2DecoderPassthroughImpl::HandleStencilStrokePathInstancedCHROMIUM( |
| 1964 uint32_t immediate_data_size, | 1989 uint32_t immediate_data_size, |
| 1965 const void* cmd_data) { | 1990 const volatile void* cmd_data) { |
| 1966 const gles2::cmds::StencilStrokePathInstancedCHROMIUM& c = | 1991 const volatile gles2::cmds::StencilStrokePathInstancedCHROMIUM& c = |
| 1967 *static_cast<const gles2::cmds::StencilStrokePathInstancedCHROMIUM*>( | 1992 *static_cast< |
| 1993 const volatile gles2::cmds::StencilStrokePathInstancedCHROMIUM*>( |
| 1968 cmd_data); | 1994 cmd_data); |
| 1969 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); | 1995 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); |
| 1970 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); | 1996 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); |
| 1971 const GLvoid* paths = nullptr; | 1997 const GLvoid* paths = nullptr; |
| 1972 GLsizei paths_bufsize = 0; | 1998 GLsizei paths_bufsize = 0; |
| 1973 if (num_paths > 0) { | 1999 if (num_paths > 0) { |
| 1974 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); | 2000 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); |
| 1975 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); | 2001 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); |
| 1976 if (paths_shm_id != 0 || paths_shm_offset != 0) { | 2002 if (paths_shm_id != 0 || paths_shm_offset != 0) { |
| 1977 unsigned int memory_size = 0; | 2003 unsigned int memory_size = 0; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2005 mask, transform_type, transform_values, transform_values_bufsize); | 2031 mask, transform_type, transform_values, transform_values_bufsize); |
| 2006 if (error != error::kNoError) { | 2032 if (error != error::kNoError) { |
| 2007 return error; | 2033 return error; |
| 2008 } | 2034 } |
| 2009 | 2035 |
| 2010 return error::kNoError; | 2036 return error::kNoError; |
| 2011 } | 2037 } |
| 2012 | 2038 |
| 2013 error::Error GLES2DecoderPassthroughImpl::HandleCoverFillPathInstancedCHROMIUM( | 2039 error::Error GLES2DecoderPassthroughImpl::HandleCoverFillPathInstancedCHROMIUM( |
| 2014 uint32_t immediate_data_size, | 2040 uint32_t immediate_data_size, |
| 2015 const void* cmd_data) { | 2041 const volatile void* cmd_data) { |
| 2016 const gles2::cmds::CoverFillPathInstancedCHROMIUM& c = | 2042 const volatile gles2::cmds::CoverFillPathInstancedCHROMIUM& c = |
| 2017 *static_cast<const gles2::cmds::CoverFillPathInstancedCHROMIUM*>( | 2043 *static_cast<const volatile gles2::cmds::CoverFillPathInstancedCHROMIUM*>( |
| 2018 cmd_data); | 2044 cmd_data); |
| 2019 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); | 2045 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); |
| 2020 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); | 2046 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); |
| 2021 const GLvoid* paths = nullptr; | 2047 const GLvoid* paths = nullptr; |
| 2022 GLsizei paths_bufsize = 0; | 2048 GLsizei paths_bufsize = 0; |
| 2023 if (num_paths > 0) { | 2049 if (num_paths > 0) { |
| 2024 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); | 2050 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); |
| 2025 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); | 2051 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); |
| 2026 if (paths_shm_id != 0 || paths_shm_offset != 0) { | 2052 if (paths_shm_id != 0 || paths_shm_offset != 0) { |
| 2027 unsigned int memory_size = 0; | 2053 unsigned int memory_size = 0; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2055 if (error != error::kNoError) { | 2081 if (error != error::kNoError) { |
| 2056 return error; | 2082 return error; |
| 2057 } | 2083 } |
| 2058 | 2084 |
| 2059 return error::kNoError; | 2085 return error::kNoError; |
| 2060 } | 2086 } |
| 2061 | 2087 |
| 2062 error::Error | 2088 error::Error |
| 2063 GLES2DecoderPassthroughImpl::HandleCoverStrokePathInstancedCHROMIUM( | 2089 GLES2DecoderPassthroughImpl::HandleCoverStrokePathInstancedCHROMIUM( |
| 2064 uint32_t immediate_data_size, | 2090 uint32_t immediate_data_size, |
| 2065 const void* cmd_data) { | 2091 const volatile void* cmd_data) { |
| 2066 const gles2::cmds::CoverStrokePathInstancedCHROMIUM& c = | 2092 const volatile gles2::cmds::CoverStrokePathInstancedCHROMIUM& c = |
| 2067 *static_cast<const gles2::cmds::CoverStrokePathInstancedCHROMIUM*>( | 2093 *static_cast< |
| 2094 const volatile gles2::cmds::CoverStrokePathInstancedCHROMIUM*>( |
| 2068 cmd_data); | 2095 cmd_data); |
| 2069 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); | 2096 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); |
| 2070 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); | 2097 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); |
| 2071 const GLvoid* paths = nullptr; | 2098 const GLvoid* paths = nullptr; |
| 2072 GLsizei paths_bufsize = 0; | 2099 GLsizei paths_bufsize = 0; |
| 2073 if (num_paths > 0) { | 2100 if (num_paths > 0) { |
| 2074 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); | 2101 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); |
| 2075 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); | 2102 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); |
| 2076 if (paths_shm_id != 0 || paths_shm_offset != 0) { | 2103 if (paths_shm_id != 0 || paths_shm_offset != 0) { |
| 2077 unsigned int memory_size = 0; | 2104 unsigned int memory_size = 0; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2105 if (error != error::kNoError) { | 2132 if (error != error::kNoError) { |
| 2106 return error; | 2133 return error; |
| 2107 } | 2134 } |
| 2108 | 2135 |
| 2109 return error::kNoError; | 2136 return error::kNoError; |
| 2110 } | 2137 } |
| 2111 | 2138 |
| 2112 error::Error | 2139 error::Error |
| 2113 GLES2DecoderPassthroughImpl::HandleStencilThenCoverFillPathInstancedCHROMIUM( | 2140 GLES2DecoderPassthroughImpl::HandleStencilThenCoverFillPathInstancedCHROMIUM( |
| 2114 uint32_t immediate_data_size, | 2141 uint32_t immediate_data_size, |
| 2115 const void* cmd_data) { | 2142 const volatile void* cmd_data) { |
| 2116 const gles2::cmds::StencilThenCoverFillPathInstancedCHROMIUM& c = | 2143 const volatile gles2::cmds::StencilThenCoverFillPathInstancedCHROMIUM& c = |
| 2117 *static_cast< | 2144 *static_cast<const volatile gles2::cmds:: |
| 2118 const gles2::cmds::StencilThenCoverFillPathInstancedCHROMIUM*>( | 2145 StencilThenCoverFillPathInstancedCHROMIUM*>(cmd_data); |
| 2119 cmd_data); | |
| 2120 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); | 2146 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); |
| 2121 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); | 2147 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); |
| 2122 const GLvoid* paths = nullptr; | 2148 const GLvoid* paths = nullptr; |
| 2123 GLsizei paths_bufsize = 0; | 2149 GLsizei paths_bufsize = 0; |
| 2124 if (num_paths > 0) { | 2150 if (num_paths > 0) { |
| 2125 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); | 2151 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); |
| 2126 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); | 2152 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); |
| 2127 if (paths_shm_id != 0 || paths_shm_offset != 0) { | 2153 if (paths_shm_id != 0 || paths_shm_offset != 0) { |
| 2128 unsigned int memory_size = 0; | 2154 unsigned int memory_size = 0; |
| 2129 paths = GetSharedMemoryAndSizeAs<const GLvoid*>( | 2155 paths = GetSharedMemoryAndSizeAs<const GLvoid*>( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2159 if (error != error::kNoError) { | 2185 if (error != error::kNoError) { |
| 2160 return error; | 2186 return error; |
| 2161 } | 2187 } |
| 2162 | 2188 |
| 2163 return error::kNoError; | 2189 return error::kNoError; |
| 2164 } | 2190 } |
| 2165 | 2191 |
| 2166 error::Error | 2192 error::Error |
| 2167 GLES2DecoderPassthroughImpl::HandleStencilThenCoverStrokePathInstancedCHROMIUM( | 2193 GLES2DecoderPassthroughImpl::HandleStencilThenCoverStrokePathInstancedCHROMIUM( |
| 2168 uint32_t immediate_data_size, | 2194 uint32_t immediate_data_size, |
| 2169 const void* cmd_data) { | 2195 const volatile void* cmd_data) { |
| 2170 const gles2::cmds::StencilThenCoverStrokePathInstancedCHROMIUM& c = | 2196 const volatile gles2::cmds::StencilThenCoverStrokePathInstancedCHROMIUM& c = |
| 2171 *static_cast< | 2197 *static_cast<const volatile gles2::cmds:: |
| 2172 const gles2::cmds::StencilThenCoverStrokePathInstancedCHROMIUM*>( | 2198 StencilThenCoverStrokePathInstancedCHROMIUM*>(cmd_data); |
| 2173 cmd_data); | |
| 2174 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); | 2199 GLsizei num_paths = static_cast<GLsizei>(c.numPaths); |
| 2175 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); | 2200 GLenum path_name_type = static_cast<GLuint>(c.pathNameType); |
| 2176 const GLvoid* paths = nullptr; | 2201 const GLvoid* paths = nullptr; |
| 2177 GLsizei paths_bufsize = 0; | 2202 GLsizei paths_bufsize = 0; |
| 2178 if (num_paths > 0) { | 2203 if (num_paths > 0) { |
| 2179 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); | 2204 uint32_t paths_shm_id = static_cast<uint32_t>(c.paths_shm_id); |
| 2180 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); | 2205 uint32_t paths_shm_offset = static_cast<uint32_t>(c.paths_shm_offset); |
| 2181 if (paths_shm_id != 0 || paths_shm_offset != 0) { | 2206 if (paths_shm_id != 0 || paths_shm_offset != 0) { |
| 2182 unsigned int memory_size = 0; | 2207 unsigned int memory_size = 0; |
| 2183 paths = GetSharedMemoryAndSizeAs<const GLvoid*>( | 2208 paths = GetSharedMemoryAndSizeAs<const GLvoid*>( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2213 if (error != error::kNoError) { | 2238 if (error != error::kNoError) { |
| 2214 return error; | 2239 return error; |
| 2215 } | 2240 } |
| 2216 | 2241 |
| 2217 return error::kNoError; | 2242 return error::kNoError; |
| 2218 } | 2243 } |
| 2219 | 2244 |
| 2220 error::Error | 2245 error::Error |
| 2221 GLES2DecoderPassthroughImpl::HandleBindFragmentInputLocationCHROMIUMBucket( | 2246 GLES2DecoderPassthroughImpl::HandleBindFragmentInputLocationCHROMIUMBucket( |
| 2222 uint32_t immediate_data_size, | 2247 uint32_t immediate_data_size, |
| 2223 const void* cmd_data) { | 2248 const volatile void* cmd_data) { |
| 2224 const gles2::cmds::BindFragmentInputLocationCHROMIUMBucket& c = | 2249 const volatile gles2::cmds::BindFragmentInputLocationCHROMIUMBucket& c = |
| 2225 *static_cast<const gles2::cmds::BindFragmentInputLocationCHROMIUMBucket*>( | 2250 *static_cast< |
| 2251 const volatile gles2::cmds::BindFragmentInputLocationCHROMIUMBucket*>( |
| 2226 cmd_data); | 2252 cmd_data); |
| 2227 GLuint program = static_cast<GLuint>(c.program); | 2253 GLuint program = static_cast<GLuint>(c.program); |
| 2228 GLint location = static_cast<GLint>(c.location); | 2254 GLint location = static_cast<GLint>(c.location); |
| 2229 Bucket* bucket = GetBucket(c.name_bucket_id); | 2255 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 2230 if (!bucket || bucket->size() == 0) { | 2256 if (!bucket || bucket->size() == 0) { |
| 2231 return error::kInvalidArguments; | 2257 return error::kInvalidArguments; |
| 2232 } | 2258 } |
| 2233 std::string name_str; | 2259 std::string name_str; |
| 2234 if (!bucket->GetAsString(&name_str)) { | 2260 if (!bucket->GetAsString(&name_str)) { |
| 2235 return error::kInvalidArguments; | 2261 return error::kInvalidArguments; |
| 2236 } | 2262 } |
| 2237 error::Error error = | 2263 error::Error error = |
| 2238 DoBindFragmentInputLocationCHROMIUM(program, location, name_str.c_str()); | 2264 DoBindFragmentInputLocationCHROMIUM(program, location, name_str.c_str()); |
| 2239 if (error != error::kNoError) { | 2265 if (error != error::kNoError) { |
| 2240 return error; | 2266 return error; |
| 2241 } | 2267 } |
| 2242 return error::kNoError; | 2268 return error::kNoError; |
| 2243 } | 2269 } |
| 2244 | 2270 |
| 2245 error::Error | 2271 error::Error |
| 2246 GLES2DecoderPassthroughImpl::HandleProgramPathFragmentInputGenCHROMIUM( | 2272 GLES2DecoderPassthroughImpl::HandleProgramPathFragmentInputGenCHROMIUM( |
| 2247 uint32_t immediate_data_size, | 2273 uint32_t immediate_data_size, |
| 2248 const void* cmd_data) { | 2274 const volatile void* cmd_data) { |
| 2249 const gles2::cmds::ProgramPathFragmentInputGenCHROMIUM& c = | 2275 const volatile gles2::cmds::ProgramPathFragmentInputGenCHROMIUM& c = |
| 2250 *static_cast<const gles2::cmds::ProgramPathFragmentInputGenCHROMIUM*>( | 2276 *static_cast< |
| 2277 const volatile gles2::cmds::ProgramPathFragmentInputGenCHROMIUM*>( |
| 2251 cmd_data); | 2278 cmd_data); |
| 2252 GLint program = static_cast<GLint>(c.program); | 2279 GLint program = static_cast<GLint>(c.program); |
| 2253 GLint location = static_cast<GLint>(c.location); | 2280 GLint location = static_cast<GLint>(c.location); |
| 2254 GLenum gen_mode = static_cast<GLint>(c.genMode); | 2281 GLenum gen_mode = static_cast<GLint>(c.genMode); |
| 2255 GLint components = static_cast<GLint>(c.components); | 2282 GLint components = static_cast<GLint>(c.components); |
| 2256 const GLfloat* coeffs = nullptr; | 2283 const GLfloat* coeffs = nullptr; |
| 2257 GLsizei coeffs_bufsize = 0; | 2284 GLsizei coeffs_bufsize = 0; |
| 2258 if (c.coeffs_shm_id != 0 || c.coeffs_shm_offset != 0) { | 2285 if (c.coeffs_shm_id != 0 || c.coeffs_shm_offset != 0) { |
| 2259 unsigned int memory_size = 0; | 2286 unsigned int memory_size = 0; |
| 2260 coeffs = GetSharedMemoryAndSizeAs<const GLfloat*>( | 2287 coeffs = GetSharedMemoryAndSizeAs<const GLfloat*>( |
| 2261 c.coeffs_shm_id, c.coeffs_shm_offset, &memory_size); | 2288 c.coeffs_shm_id, c.coeffs_shm_offset, &memory_size); |
| 2262 coeffs_bufsize = static_cast<GLsizei>(memory_size); | 2289 coeffs_bufsize = static_cast<GLsizei>(memory_size); |
| 2263 } | 2290 } |
| 2264 if (!coeffs) { | 2291 if (!coeffs) { |
| 2265 return error::kOutOfBounds; | 2292 return error::kOutOfBounds; |
| 2266 } | 2293 } |
| 2267 error::Error error = DoProgramPathFragmentInputGenCHROMIUM( | 2294 error::Error error = DoProgramPathFragmentInputGenCHROMIUM( |
| 2268 program, location, gen_mode, components, coeffs, coeffs_bufsize); | 2295 program, location, gen_mode, components, coeffs, coeffs_bufsize); |
| 2269 if (error != error::kNoError) { | 2296 if (error != error::kNoError) { |
| 2270 return error; | 2297 return error; |
| 2271 } | 2298 } |
| 2272 return error::kNoError; | 2299 return error::kNoError; |
| 2273 } | 2300 } |
| 2274 | 2301 |
| 2275 error::Error | 2302 error::Error |
| 2276 GLES2DecoderPassthroughImpl::HandleBindFragDataLocationIndexedEXTBucket( | 2303 GLES2DecoderPassthroughImpl::HandleBindFragDataLocationIndexedEXTBucket( |
| 2277 uint32_t immediate_data_size, | 2304 uint32_t immediate_data_size, |
| 2278 const void* cmd_data) { | 2305 const volatile void* cmd_data) { |
| 2279 const gles2::cmds::BindFragDataLocationIndexedEXTBucket& c = | 2306 const volatile gles2::cmds::BindFragDataLocationIndexedEXTBucket& c = |
| 2280 *static_cast<const gles2::cmds::BindFragDataLocationIndexedEXTBucket*>( | 2307 *static_cast< |
| 2308 const volatile gles2::cmds::BindFragDataLocationIndexedEXTBucket*>( |
| 2281 cmd_data); | 2309 cmd_data); |
| 2282 GLuint program = static_cast<GLuint>(c.program); | 2310 GLuint program = static_cast<GLuint>(c.program); |
| 2283 GLuint colorNumber = static_cast<GLuint>(c.colorNumber); | 2311 GLuint colorNumber = static_cast<GLuint>(c.colorNumber); |
| 2284 GLuint index = static_cast<GLuint>(c.index); | 2312 GLuint index = static_cast<GLuint>(c.index); |
| 2285 Bucket* bucket = GetBucket(c.name_bucket_id); | 2313 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 2286 if (!bucket || bucket->size() == 0) { | 2314 if (!bucket || bucket->size() == 0) { |
| 2287 return error::kInvalidArguments; | 2315 return error::kInvalidArguments; |
| 2288 } | 2316 } |
| 2289 std::string name_str; | 2317 std::string name_str; |
| 2290 if (!bucket->GetAsString(&name_str)) { | 2318 if (!bucket->GetAsString(&name_str)) { |
| 2291 return error::kInvalidArguments; | 2319 return error::kInvalidArguments; |
| 2292 } | 2320 } |
| 2293 error::Error error = DoBindFragDataLocationIndexedEXT( | 2321 error::Error error = DoBindFragDataLocationIndexedEXT( |
| 2294 program, colorNumber, index, name_str.c_str()); | 2322 program, colorNumber, index, name_str.c_str()); |
| 2295 if (error != error::kNoError) { | 2323 if (error != error::kNoError) { |
| 2296 return error; | 2324 return error; |
| 2297 } | 2325 } |
| 2298 return error::kNoError; | 2326 return error::kNoError; |
| 2299 } | 2327 } |
| 2300 | 2328 |
| 2301 error::Error GLES2DecoderPassthroughImpl::HandleBindFragDataLocationEXTBucket( | 2329 error::Error GLES2DecoderPassthroughImpl::HandleBindFragDataLocationEXTBucket( |
| 2302 uint32_t immediate_data_size, | 2330 uint32_t immediate_data_size, |
| 2303 const void* cmd_data) { | 2331 const volatile void* cmd_data) { |
| 2304 const gles2::cmds::BindFragDataLocationEXTBucket& c = | 2332 const volatile gles2::cmds::BindFragDataLocationEXTBucket& c = |
| 2305 *static_cast<const gles2::cmds::BindFragDataLocationEXTBucket*>(cmd_data); | 2333 *static_cast<const volatile gles2::cmds::BindFragDataLocationEXTBucket*>( |
| 2334 cmd_data); |
| 2306 GLuint program = static_cast<GLuint>(c.program); | 2335 GLuint program = static_cast<GLuint>(c.program); |
| 2307 GLuint colorNumber = static_cast<GLuint>(c.colorNumber); | 2336 GLuint colorNumber = static_cast<GLuint>(c.colorNumber); |
| 2308 Bucket* bucket = GetBucket(c.name_bucket_id); | 2337 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 2309 if (!bucket || bucket->size() == 0) { | 2338 if (!bucket || bucket->size() == 0) { |
| 2310 return error::kInvalidArguments; | 2339 return error::kInvalidArguments; |
| 2311 } | 2340 } |
| 2312 std::string name_str; | 2341 std::string name_str; |
| 2313 if (!bucket->GetAsString(&name_str)) { | 2342 if (!bucket->GetAsString(&name_str)) { |
| 2314 return error::kInvalidArguments; | 2343 return error::kInvalidArguments; |
| 2315 } | 2344 } |
| 2316 error::Error error = | 2345 error::Error error = |
| 2317 DoBindFragDataLocationEXT(program, colorNumber, name_str.c_str()); | 2346 DoBindFragDataLocationEXT(program, colorNumber, name_str.c_str()); |
| 2318 if (error != error::kNoError) { | 2347 if (error != error::kNoError) { |
| 2319 return error; | 2348 return error; |
| 2320 } | 2349 } |
| 2321 return error::kNoError; | 2350 return error::kNoError; |
| 2322 } | 2351 } |
| 2323 | 2352 |
| 2324 error::Error GLES2DecoderPassthroughImpl::HandleGetFragDataIndexEXT( | 2353 error::Error GLES2DecoderPassthroughImpl::HandleGetFragDataIndexEXT( |
| 2325 uint32_t immediate_data_size, | 2354 uint32_t immediate_data_size, |
| 2326 const void* cmd_data) { | 2355 const volatile void* cmd_data) { |
| 2327 const gles2::cmds::GetFragDataIndexEXT& c = | 2356 const volatile gles2::cmds::GetFragDataIndexEXT& c = |
| 2328 *static_cast<const gles2::cmds::GetFragDataIndexEXT*>(cmd_data); | 2357 *static_cast<const volatile gles2::cmds::GetFragDataIndexEXT*>(cmd_data); |
| 2329 GLuint program = static_cast<GLuint>(c.program); | 2358 GLuint program = static_cast<GLuint>(c.program); |
| 2330 Bucket* bucket = GetBucket(c.name_bucket_id); | 2359 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 2331 if (!bucket) { | 2360 if (!bucket) { |
| 2332 return error::kInvalidArguments; | 2361 return error::kInvalidArguments; |
| 2333 } | 2362 } |
| 2334 std::string name_str; | 2363 std::string name_str; |
| 2335 if (!bucket->GetAsString(&name_str)) { | 2364 if (!bucket->GetAsString(&name_str)) { |
| 2336 return error::kInvalidArguments; | 2365 return error::kInvalidArguments; |
| 2337 } | 2366 } |
| 2338 GLint* index = GetSharedMemoryAs<GLint*>(c.index_shm_id, c.index_shm_offset, | 2367 GLint* index = GetSharedMemoryAs<GLint*>(c.index_shm_id, c.index_shm_offset, |
| 2339 sizeof(GLint)); | 2368 sizeof(GLint)); |
| 2340 if (!index) { | 2369 if (!index) { |
| 2341 return error::kOutOfBounds; | 2370 return error::kOutOfBounds; |
| 2342 } | 2371 } |
| 2343 // Check that the client initialized the result. | 2372 // Check that the client initialized the result. |
| 2344 if (*index != -1) { | 2373 if (*index != -1) { |
| 2345 return error::kInvalidArguments; | 2374 return error::kInvalidArguments; |
| 2346 } | 2375 } |
| 2347 error::Error error = DoGetFragDataIndexEXT(program, name_str.c_str(), index); | 2376 error::Error error = DoGetFragDataIndexEXT(program, name_str.c_str(), index); |
| 2348 if (error != error::kNoError) { | 2377 if (error != error::kNoError) { |
| 2349 return error; | 2378 return error; |
| 2350 } | 2379 } |
| 2351 return error::kNoError; | 2380 return error::kNoError; |
| 2352 } | 2381 } |
| 2353 | 2382 |
| 2354 } // namespace gles2 | 2383 } // namespace gles2 |
| 2355 } // namespace gpu | 2384 } // namespace gpu |
| OLD | NEW |