| 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 4957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4968 width, height, internalformat, usage); | 4968 width, height, internalformat, usage); |
| 4969 CheckGLError(); | 4969 CheckGLError(); |
| 4970 return image_id; | 4970 return image_id; |
| 4971 } | 4971 } |
| 4972 | 4972 |
| 4973 bool GLES2Implementation::ValidateSize(const char* func, GLsizeiptr size) { | 4973 bool GLES2Implementation::ValidateSize(const char* func, GLsizeiptr size) { |
| 4974 if (size < 0) { | 4974 if (size < 0) { |
| 4975 SetGLError(GL_INVALID_VALUE, func, "size < 0"); | 4975 SetGLError(GL_INVALID_VALUE, func, "size < 0"); |
| 4976 return false; | 4976 return false; |
| 4977 } | 4977 } |
| 4978 if (!FitInt32NonNegative<GLsizeiptr>(size)) { | 4978 if (!base::IsValueInRangeForNumericType<int32_t>(size)) { |
| 4979 SetGLError(GL_INVALID_OPERATION, func, "size more than 32-bit"); | 4979 SetGLError(GL_INVALID_OPERATION, func, "size more than 32-bit"); |
| 4980 return false; | 4980 return false; |
| 4981 } | 4981 } |
| 4982 return true; | 4982 return true; |
| 4983 } | 4983 } |
| 4984 | 4984 |
| 4985 bool GLES2Implementation::ValidateOffset(const char* func, GLintptr offset) { | 4985 bool GLES2Implementation::ValidateOffset(const char* func, GLintptr offset) { |
| 4986 if (offset < 0) { | 4986 if (offset < 0) { |
| 4987 SetGLError(GL_INVALID_VALUE, func, "offset < 0"); | 4987 SetGLError(GL_INVALID_VALUE, func, "offset < 0"); |
| 4988 return false; | 4988 return false; |
| 4989 } | 4989 } |
| 4990 if (!FitInt32NonNegative<GLintptr>(offset)) { | 4990 if (!base::IsValueInRangeForNumericType<int32_t>(offset)) { |
| 4991 SetGLError(GL_INVALID_OPERATION, func, "offset more than 32-bit"); | 4991 SetGLError(GL_INVALID_OPERATION, func, "offset more than 32-bit"); |
| 4992 return false; | 4992 return false; |
| 4993 } | 4993 } |
| 4994 return true; | 4994 return true; |
| 4995 } | 4995 } |
| 4996 | 4996 |
| 4997 bool GLES2Implementation::GetSamplerParameterfvHelper( | 4997 bool GLES2Implementation::GetSamplerParameterfvHelper( |
| 4998 GLuint /* sampler */, GLenum /* pname */, GLfloat* /* params */) { | 4998 GLuint /* sampler */, GLenum /* pname */, GLfloat* /* params */) { |
| 4999 // TODO(zmo): Implement client side caching. | 4999 // TODO(zmo): Implement client side caching. |
| 5000 return false; | 5000 return false; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5127 CheckGLError(); | 5127 CheckGLError(); |
| 5128 } | 5128 } |
| 5129 | 5129 |
| 5130 // Include the auto-generated part of this file. We split this because it means | 5130 // Include the auto-generated part of this file. We split this because it means |
| 5131 // we can easily edit the non-auto generated parts right here in this file | 5131 // we can easily edit the non-auto generated parts right here in this file |
| 5132 // instead of having to edit some template or the code generator. | 5132 // instead of having to edit some template or the code generator. |
| 5133 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 5133 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 5134 | 5134 |
| 5135 } // namespace gles2 | 5135 } // namespace gles2 |
| 5136 } // namespace gpu | 5136 } // namespace gpu |
| OLD | NEW |