| 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/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| (...skipping 6054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6065 << "] glCreateGpuMemoryBufferImageCHROMIUM(" << width | 6065 << "] glCreateGpuMemoryBufferImageCHROMIUM(" << width |
| 6066 << ", " << height << ", " | 6066 << ", " << height << ", " |
| 6067 << GLES2Util::GetStringImageInternalFormat(internalformat) | 6067 << GLES2Util::GetStringImageInternalFormat(internalformat) |
| 6068 << ", " << GLES2Util::GetStringImageUsage(usage) << ")"); | 6068 << ", " << GLES2Util::GetStringImageUsage(usage) << ")"); |
| 6069 GLuint image_id = CreateGpuMemoryBufferImageCHROMIUMHelper( | 6069 GLuint image_id = CreateGpuMemoryBufferImageCHROMIUMHelper( |
| 6070 width, height, internalformat, usage); | 6070 width, height, internalformat, usage); |
| 6071 CheckGLError(); | 6071 CheckGLError(); |
| 6072 return image_id; | 6072 return image_id; |
| 6073 } | 6073 } |
| 6074 | 6074 |
| 6075 GLint GLES2Implementation::GetImageivCHROMIUM(GLuint image_id, GLenum param) { |
| 6076 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 6077 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] GetImageivCHROMIUM(" << image_id |
| 6078 << ", " << GLES2Util::GetStringImageInternalFormat(param) |
| 6079 << ")"); |
| 6080 if (param != GL_GPU_MEMORY_BUFFER_ID) { |
| 6081 SetGLError(GL_INVALID_VALUE, "GetImageivCHROMIUM", "param"); |
| 6082 return -1; |
| 6083 } |
| 6084 return gpu_control_->GetImageGpuMemoryBufferId(image_id); |
| 6085 } |
| 6086 |
| 6075 bool GLES2Implementation::ValidateSize(const char* func, GLsizeiptr size) { | 6087 bool GLES2Implementation::ValidateSize(const char* func, GLsizeiptr size) { |
| 6076 if (size < 0) { | 6088 if (size < 0) { |
| 6077 SetGLError(GL_INVALID_VALUE, func, "size < 0"); | 6089 SetGLError(GL_INVALID_VALUE, func, "size < 0"); |
| 6078 return false; | 6090 return false; |
| 6079 } | 6091 } |
| 6080 if (!base::IsValueInRangeForNumericType<int32_t>(size)) { | 6092 if (!base::IsValueInRangeForNumericType<int32_t>(size)) { |
| 6081 SetGLError(GL_INVALID_OPERATION, func, "size more than 32-bit"); | 6093 SetGLError(GL_INVALID_OPERATION, func, "size more than 32-bit"); |
| 6082 return false; | 6094 return false; |
| 6083 } | 6095 } |
| 6084 return true; | 6096 return true; |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6817 cached_extensions_.clear(); | 6829 cached_extensions_.clear(); |
| 6818 } | 6830 } |
| 6819 | 6831 |
| 6820 // Include the auto-generated part of this file. We split this because it means | 6832 // Include the auto-generated part of this file. We split this because it means |
| 6821 // we can easily edit the non-auto generated parts right here in this file | 6833 // we can easily edit the non-auto generated parts right here in this file |
| 6822 // instead of having to edit some template or the code generator. | 6834 // instead of having to edit some template or the code generator. |
| 6823 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 6835 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 6824 | 6836 |
| 6825 } // namespace gles2 | 6837 } // namespace gles2 |
| 6826 } // namespace gpu | 6838 } // namespace gpu |
| OLD | NEW |