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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 return GetHelper(pname, params); | 740 return GetHelper(pname, params); |
741 } | 741 } |
742 | 742 |
743 bool GLES2Implementation::GetInternalformativHelper( | 743 bool GLES2Implementation::GetInternalformativHelper( |
744 GLenum target, GLenum format, GLenum pname, GLsizei bufSize, | 744 GLenum target, GLenum format, GLenum pname, GLsizei bufSize, |
745 GLint* params) { | 745 GLint* params) { |
746 // TODO(zmo): Implement the client side caching. | 746 // TODO(zmo): Implement the client side caching. |
747 return false; | 747 return false; |
748 } | 748 } |
749 | 749 |
| 750 bool GLES2Implementation::GetSyncivHelper( |
| 751 GLsync sync, GLenum pname, GLsizei bufsize, GLsizei* length, |
| 752 GLint* values) { |
| 753 GLint value = 0; |
| 754 switch (pname) { |
| 755 case GL_OBJECT_TYPE: |
| 756 value = GL_SYNC_FENCE; |
| 757 break; |
| 758 case GL_SYNC_CONDITION: |
| 759 value = GL_SYNC_GPU_COMMANDS_COMPLETE; |
| 760 break; |
| 761 case GL_SYNC_FLAGS: |
| 762 value = 0; |
| 763 break; |
| 764 default: |
| 765 return false; |
| 766 } |
| 767 if (bufsize > 0) { |
| 768 DCHECK(values); |
| 769 *values = value; |
| 770 } |
| 771 if (length) { |
| 772 *length = 1; |
| 773 } |
| 774 return true; |
| 775 } |
| 776 |
750 GLuint GLES2Implementation::GetMaxValueInBufferCHROMIUMHelper( | 777 GLuint GLES2Implementation::GetMaxValueInBufferCHROMIUMHelper( |
751 GLuint buffer_id, GLsizei count, GLenum type, GLuint offset) { | 778 GLuint buffer_id, GLsizei count, GLenum type, GLuint offset) { |
752 typedef cmds::GetMaxValueInBufferCHROMIUM::Result Result; | 779 typedef cmds::GetMaxValueInBufferCHROMIUM::Result Result; |
753 Result* result = GetResultAs<Result*>(); | 780 Result* result = GetResultAs<Result*>(); |
754 if (!result) { | 781 if (!result) { |
755 return 0; | 782 return 0; |
756 } | 783 } |
757 *result = 0; | 784 *result = 0; |
758 helper_->GetMaxValueInBufferCHROMIUM( | 785 helper_->GetMaxValueInBufferCHROMIUM( |
759 buffer_id, count, type, offset, GetResultShmId(), GetResultShmOffset()); | 786 buffer_id, count, type, offset, GetResultShmId(), GetResultShmOffset()); |
(...skipping 4204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4964 CheckGLError(); | 4991 CheckGLError(); |
4965 } | 4992 } |
4966 | 4993 |
4967 // Include the auto-generated part of this file. We split this because it means | 4994 // Include the auto-generated part of this file. We split this because it means |
4968 // we can easily edit the non-auto generated parts right here in this file | 4995 // we can easily edit the non-auto generated parts right here in this file |
4969 // instead of having to edit some template or the code generator. | 4996 // instead of having to edit some template or the code generator. |
4970 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 4997 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
4971 | 4998 |
4972 } // namespace gles2 | 4999 } // namespace gles2 |
4973 } // namespace gpu | 5000 } // namespace gpu |
OLD | NEW |