Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1028333002: Chromium -> Mojo roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/client_context_state_impl_autogen.h ('k') | gpu/command_buffer/common/gles2_cmd_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698