Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| index 7575cb5fbc776f1d75c9e1cab53541b833f340ed..6986f9b08d29b9dee80c210fba2f32b59ebf2da7 100644 | 
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| @@ -9466,6 +9466,7 @@ bool GLES2DecoderImpl::GenQueriesEXTHelper( | 
| return false; | 
| } | 
| } | 
| + query_manager_->GenQueries(n, client_ids); | 
| // NOTE: We don't generate Query objects here. Only in BeginQueryEXT | 
| 
 
piman
2014/04/22 00:37:31
Please remove comment that is now invalid
 
rptr
2014/04/22 05:43:18
Done.
 
 | 
| return true; | 
| } | 
| @@ -9576,24 +9577,12 @@ error::Error GLES2DecoderImpl::HandleBeginQueryEXT( | 
| QueryManager::Query* query = query_manager_->GetQuery(client_id); | 
| if (!query) { | 
| - // TODO(gman): Decide if we need this check. | 
| - // | 
| - // Checks id was made by glGenQueries | 
| - // | 
| - // From the POV of OpenGL ES 2.0 you need to call glGenQueriesEXT | 
| - // for all Query ids but from the POV of the command buffer service maybe | 
| - // you don't. | 
| - // | 
| - // The client can enforce this. I don't think the service cares. | 
| - // | 
| - // IdAllocatorInterface* id_allocator = | 
| - // group_->GetIdAllocator(id_namespaces::kQueries); | 
| - // if (!id_allocator->InUse(client_id)) { | 
| 
 
rptr
2014/04/19 11:48:45
id_allocator->InUse(client_id) won't work as we ha
 
 | 
| - // LOCAL_SET_GL_ERROR( | 
| - // GL_INVALID_OPERATION, | 
| - // "glBeginQueryEXT", "id not made by glGenQueriesEXT"); | 
| - // return error::kNoError; | 
| - // } | 
| + if (!query_manager_->IsValidQuery(client_id)) { | 
| + LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | 
| + "glBeginQueryEXT", | 
| + "id not made by glGenQueriesEXT"); | 
| + return error::kNoError; | 
| + } | 
| query = query_manager_->CreateQuery( | 
| target, client_id, sync_shm_id, sync_shm_offset); | 
| } |