Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
| 10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 969 return true; | 969 return true; |
| 970 } | 970 } |
| 971 | 971 |
| 972 void GLES2Implementation::DeleteShaderStub( | 972 void GLES2Implementation::DeleteShaderStub( |
| 973 GLsizei n, const GLuint* shaders) { | 973 GLsizei n, const GLuint* shaders) { |
| 974 DCHECK_EQ(1, n); | 974 DCHECK_EQ(1, n); |
| 975 share_group_->program_info_manager()->DeleteInfo(shaders[0]); | 975 share_group_->program_info_manager()->DeleteInfo(shaders[0]); |
| 976 helper_->DeleteShader(shaders[0]); | 976 helper_->DeleteShader(shaders[0]); |
| 977 } | 977 } |
| 978 | 978 |
| 979 void GLES2Implementation::DeleteSyncHelper(GLsync sync) { | |
| 980 GLuint my_sync = ToGLuint(sync); | |
|
piman
2015/01/22 00:49:32
nit: anything better than my_?
Maybe uint_sync?
Zhenyao Mo
2015/01/22 01:12:57
Done.
| |
| 981 if (!GetIdHandler(id_namespaces::kSyncs)->FreeIds( | |
| 982 this, 1, &my_sync, &GLES2Implementation::DeleteSyncStub)) { | |
| 983 SetGLError( | |
| 984 GL_INVALID_VALUE, | |
| 985 "glDeleteSync", "id not created by this context."); | |
| 986 } | |
| 987 } | |
| 988 | |
| 989 void GLES2Implementation::DeleteSyncStub(GLsizei n, const GLuint* syncs) { | |
| 990 DCHECK_EQ(1, n); | |
| 991 helper_->DeleteSync(syncs[0]); | |
| 992 } | |
| 979 | 993 |
| 980 GLint GLES2Implementation::GetAttribLocationHelper( | 994 GLint GLES2Implementation::GetAttribLocationHelper( |
| 981 GLuint program, const char* name) { | 995 GLuint program, const char* name) { |
| 982 typedef cmds::GetAttribLocation::Result Result; | 996 typedef cmds::GetAttribLocation::Result Result; |
| 983 Result* result = GetResultAs<Result*>(); | 997 Result* result = GetResultAs<Result*>(); |
| 984 if (!result) { | 998 if (!result) { |
| 985 return -1; | 999 return -1; |
| 986 } | 1000 } |
| 987 *result = -1; | 1001 *result = -1; |
| 988 SetBucketAsCString(kResultBucketId, name); | 1002 SetBucketAsCString(kResultBucketId, name); |
| (...skipping 3341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4330 return false; | 4344 return false; |
| 4331 } | 4345 } |
| 4332 | 4346 |
| 4333 // Include the auto-generated part of this file. We split this because it means | 4347 // Include the auto-generated part of this file. We split this because it means |
| 4334 // we can easily edit the non-auto generated parts right here in this file | 4348 // we can easily edit the non-auto generated parts right here in this file |
| 4335 // instead of having to edit some template or the code generator. | 4349 // instead of having to edit some template or the code generator. |
| 4336 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 4350 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 4337 | 4351 |
| 4338 } // namespace gles2 | 4352 } // namespace gles2 |
| 4339 } // namespace gpu | 4353 } // namespace gpu |
| OLD | NEW |