summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/client')
-rw-r--r--gpu/command_buffer/client/gles2_cmd_helper_autogen.h31
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc159
-rw-r--r--gpu/command_buffer/client/gles2_implementation.h23
-rw-r--r--gpu/command_buffer/client/gles2_implementation_autogen.h136
4 files changed, 74 insertions, 275 deletions
diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
index 6ae38f4..df3ed0e 100644
--- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
+++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -491,9 +491,14 @@
c.Init(program, pname, params_shm_id, params_shm_offset);
}
- void GetProgramInfoLog(GLuint program, uint32 bucket_id) {
+ void GetProgramInfoLog(
+ GLuint program, GLsizei bufsize, uint32 length_shm_id,
+ uint32 length_shm_offset, uint32 infolog_shm_id,
+ uint32 infolog_shm_offset) {
gles2::GetProgramInfoLog& c = GetCmdSpace<gles2::GetProgramInfoLog>();
- c.Init(program, bucket_id);
+ c.Init(
+ program, bufsize, length_shm_id, length_shm_offset, infolog_shm_id,
+ infolog_shm_offset);
}
void GetRenderbufferParameteriv(
@@ -511,9 +516,14 @@
c.Init(shader, pname, params_shm_id, params_shm_offset);
}
- void GetShaderInfoLog(GLuint shader, uint32 bucket_id) {
+ void GetShaderInfoLog(
+ GLuint shader, GLsizei bufsize, uint32 length_shm_id,
+ uint32 length_shm_offset, uint32 infolog_shm_id,
+ uint32 infolog_shm_offset) {
gles2::GetShaderInfoLog& c = GetCmdSpace<gles2::GetShaderInfoLog>();
- c.Init(shader, bucket_id);
+ c.Init(
+ shader, bufsize, length_shm_id, length_shm_offset, infolog_shm_id,
+ infolog_shm_offset);
}
void GetShaderPrecisionFormat(
@@ -524,14 +534,19 @@
c.Init(shadertype, precisiontype, result_shm_id, result_shm_offset);
}
- void GetShaderSource(GLuint shader, uint32 bucket_id) {
+ void GetShaderSource(
+ GLuint shader, GLsizei bufsize, uint32 length_shm_id,
+ uint32 length_shm_offset, uint32 source_shm_id,
+ uint32 source_shm_offset) {
gles2::GetShaderSource& c = GetCmdSpace<gles2::GetShaderSource>();
- c.Init(shader, bucket_id);
+ c.Init(
+ shader, bufsize, length_shm_id, length_shm_offset, source_shm_id,
+ source_shm_offset);
}
- void GetString(GLenum name, uint32 bucket_id) {
+ void GetString(GLenum name) {
gles2::GetString& c = GetCmdSpace<gles2::GetString>();
- c.Init(name, bucket_id);
+ c.Init(name);
}
void GetTexParameterfv(
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 0dacb54..450e48d 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -29,8 +29,7 @@ GLES2Implementation::GLES2Implementation(
transfer_buffer_(transfer_buffer_size, helper, transfer_buffer),
transfer_buffer_id_(transfer_buffer_id),
pack_alignment_(4),
- unpack_alignment_(4),
- error_bits_(0) {
+ unpack_alignment_(4) {
// Eat 1 id so we start at 1 instead of 0.
GLuint eat;
MakeIds(1, &eat);
@@ -59,47 +58,12 @@ void GLES2Implementation::WaitForCmd() {
helper_->CommandBufferHelper::Finish();
}
-GLenum GLES2Implementation::GetError() {
- return GetGLError();
-}
-
-GLenum GLES2Implementation::GetGLError() {
- // Check the GL error first, then our wrapped error.
- typedef gles2::GetError::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = GL_NO_ERROR;
- helper_->GetError(result_shm_id(), result_shm_offset());
- WaitForCmd();
- GLenum error = *result;
- if (error == GL_NO_ERROR && error_bits_ != 0) {
- for (uint32 mask = 1; mask != 0; mask = mask << 1) {
- if ((error_bits_ & mask) != 0) {
- error = GLES2Util::GLErrorBitToGLError(mask);
- break;
- }
- }
- }
-
- if (error != GL_NO_ERROR) {
- // There was an error, clear the corresponding wrapped error.
- error_bits_ &= ~GLES2Util::GLErrorToErrorBit(error);
- }
- return error;
-}
-
-void GLES2Implementation::SetGLError(GLenum error) {
- error_bits_ |= GLES2Util::GLErrorToErrorBit(error);
-}
-
void GLES2Implementation::GetBucketContents(uint32 bucket_id,
std::vector<int8>* data) {
DCHECK(data);
- typedef cmd::GetBucketSize::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = 0;
helper_->GetBucketSize(bucket_id, result_shm_id(), result_shm_offset());
WaitForCmd();
- uint32 size = *result;
+ uint32 size = GetResultAs<cmd::GetBucketSize::Result>();
data->resize(size);
if (size > 0u) {
uint32 max_size = transfer_buffer_.GetLargestFreeOrPendingSize();
@@ -144,25 +108,15 @@ void GLES2Implementation::SetBucketContents(
}
}
-bool GLES2Implementation::GetBucketAsString(
- uint32 bucket_id, std::string* str) {
- DCHECK(str);
+std::string GLES2Implementation::GetBucketAsString(uint32 bucket_id) {
std::vector<int8> data;
- // NOTE: strings are passed NULL terminated. That means the empty
- // string will have a size of 1 and no-string will have a size of 0
GetBucketContents(bucket_id, &data);
- if (data.empty()) {
- return false;
- }
- str->assign(&data[0], &data[0] + data.size() - 1);
- return true;
+ return std::string(reinterpret_cast<char*>(&data[0]), data.size());
}
void GLES2Implementation::SetBucketAsString(
uint32 bucket_id, const std::string& str) {
- // NOTE: strings are passed NULL terminated. That means the empty
- // string will have a size of 1 and no-string will have a size of 0
- SetBucketContents(bucket_id, str.c_str(), str.size() + 1);
+ SetBucketContents(bucket_id, str.c_str(), str.size());
}
void GLES2Implementation::DrawElements(
@@ -203,24 +157,18 @@ void GLES2Implementation::GetVertexAttribPointerv(
GLint GLES2Implementation::GetAttribLocation(
GLuint program, const char* name) {
- typedef cmd::GetBucketSize::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = -1;
helper_->GetAttribLocationImmediate(
program, name, result_shm_id(), result_shm_offset());
WaitForCmd();
- return *result;
+ return GetResultAs<GLint>();
}
GLint GLES2Implementation::GetUniformLocation(
GLuint program, const char* name) {
- typedef cmd::GetBucketSize::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = -1;
helper_->GetUniformLocationImmediate(
program, name, result_shm_id(), result_shm_offset());
WaitForCmd();
- return *result;
+ return GetResultAs<GLint>();
}
void GLES2Implementation::PixelStorei(GLenum pname, GLint param) {
@@ -247,10 +195,6 @@ void GLES2Implementation::VertexAttribPointer(
void GLES2Implementation::ShaderSource(
GLuint shader, GLsizei count, const char** source, const GLint* length) {
- if (count < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
// TODO(gman): change to use buckets and check that there is enough room.
// Compute the total size.
@@ -289,15 +233,6 @@ void GLES2Implementation::BufferData(
void GLES2Implementation::BufferSubData(
GLenum target, GLintptr offset, GLsizeiptr size, const void* data) {
- if (size == 0) {
- return;
- }
-
- if (size < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
-
const int8* source = static_cast<const int8*>(data);
GLsizeiptr max_size = transfer_buffer_.GetLargestFreeOrPendingSize();
while (size) {
@@ -317,11 +252,7 @@ void GLES2Implementation::BufferSubData(
void GLES2Implementation::CompressedTexImage2D(
GLenum target, GLint level, GLenum internalformat, GLsizei width,
GLsizei height, GLint border, GLsizei image_size, const void* data) {
- if (width < 0 || height < 0 || level < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
- // TODO(gman): Switch to use buckets always or at least if no room in shared
+ // TODO(gman): Switch to use buckets alwayst or at least if no room in shared
// memory.
DCHECK_LE(image_size,
static_cast<GLsizei>(
@@ -337,11 +268,7 @@ void GLES2Implementation::CompressedTexImage2D(
void GLES2Implementation::CompressedTexSubImage2D(
GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
GLsizei height, GLenum format, GLsizei image_size, const void* data) {
- if (width < 0 || height < 0 || level < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
- // TODO(gman): Switch to use buckets always or at least if no room in shared
+ // TODO(gman): Switch to use buckets alwayst or at least if no room in shared
// memory.
DCHECK_LE(image_size,
static_cast<GLsizei>(
@@ -358,10 +285,6 @@ void GLES2Implementation::TexImage2D(
GLenum target, GLint level, GLint internalformat, GLsizei width,
GLsizei height, GLint border, GLenum format, GLenum type,
const void* pixels) {
- if (level < 0 || height < 0 || width < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
helper_->TexImage2D(
target, level, internalformat, width, height, border, format, type, 0, 0);
if (pixels) {
@@ -372,10 +295,6 @@ void GLES2Implementation::TexImage2D(
void GLES2Implementation::TexSubImage2D(
GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
GLsizei height, GLenum format, GLenum type, const void* pixels) {
- if (level < 0 || height < 0 || width < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
const int8* source = static_cast<const int8*>(pixels);
GLsizeiptr max_size = transfer_buffer_.GetLargestFreeOrPendingSize();
GLsizeiptr unpadded_row_size = GLES2Util::ComputeImageDataSize(
@@ -436,16 +355,8 @@ GLenum GLES2Implementation::CheckFramebufferStatus(GLenum target) {
void GLES2Implementation::GetActiveAttrib(
GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size,
GLenum* type, char* name) {
- if (bufsize < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
- // Clear the bucket so if we the command fails nothing will be in it.
- helper_->SetBucketSize(kResultBucketId, 0);
typedef gles2::GetActiveAttrib::Result Result;
Result* result = static_cast<Result*>(result_buffer_);
- // Set as failed so if the command fails we'll recover.
- result->success = false;
helper_->GetActiveAttrib(program, index, kResultBucketId,
result_shm_id(), result_shm_offset());
WaitForCmd();
@@ -475,16 +386,8 @@ void GLES2Implementation::GetActiveAttrib(
void GLES2Implementation::GetActiveUniform(
GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size,
GLenum* type, char* name) {
- if (bufsize < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
- // Clear the bucket so if we the command fails nothing will be in it.
- helper_->SetBucketSize(kResultBucketId, 0);
typedef gles2::GetActiveUniform::Result Result;
Result* result = static_cast<Result*>(result_buffer_);
- // Set as failed so if the command fails we'll recover.
- result->success = false;
helper_->GetActiveUniform(program, index, kResultBucketId,
result_shm_id(), result_shm_offset());
WaitForCmd();
@@ -513,10 +416,6 @@ void GLES2Implementation::GetActiveUniform(
void GLES2Implementation::GetAttachedShaders(
GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) {
- if (maxcount < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
typedef gles2::GetAttachedShaders::Result Result;
uint32 size = Result::ComputeSize(maxcount);
Result* result = transfer_buffer_.AllocTyped<Result>(size);
@@ -534,6 +433,16 @@ void GLES2Implementation::GetAttachedShaders(
transfer_buffer_.FreePendingToken(result, token);
}
+void GLES2Implementation::GetProgramInfoLog(
+ GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) {
+ // TODO(gman): implement.
+}
+
+void GLES2Implementation::GetShaderInfoLog(
+ GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) {
+ // TODO(gman): implement.
+}
+
void GLES2Implementation::GetShaderPrecisionFormat(
GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) {
typedef gles2::GetShaderPrecisionFormat::Result Result;
@@ -552,26 +461,14 @@ void GLES2Implementation::GetShaderPrecisionFormat(
}
}
+void GLES2Implementation::GetShaderSource(
+ GLuint shader, GLsizei bufsize, GLsizei* length, char* source) {
+ // TODO(gman): implement.
+}
+
const GLubyte* GLES2Implementation::GetString(GLenum name) {
- const char* result;
- GLStringMap::const_iterator it = gl_strings_.find(name);
- if (it != gl_strings_.end()) {
- result = it->second.c_str();
- } else {
- // Clear the bucket so if we the command fails nothing will be in it.
- helper_->SetBucketSize(kResultBucketId, 0);
- helper_->GetString(name, kResultBucketId);
- std::string str;
- if (GetBucketAsString(kResultBucketId, &str)) {
- std::pair<GLStringMap::const_iterator, bool> insert_result =
- gl_strings_.insert(std::make_pair(name, str));
- DCHECK(insert_result.second);
- result = insert_result.first->second.c_str();
- } else {
- result = NULL;
- }
- }
- return reinterpret_cast<const GLubyte*>(result);
+ // TODO(gman): implement.
+ return 0;
}
void GLES2Implementation::GetUniformfv(
@@ -595,10 +492,6 @@ void GLES2Implementation::ReadPixels(
GLenum type, void* pixels) {
// Note: Negative widths and heights are not handled here but are handled
// by the service side so the glGetError wrapping works.
- if (width < 0 || height < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
if (width == 0 || height == 0) {
return;
}
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 339ed4b..579e0d3 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -5,7 +5,6 @@
#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_
-#include <map>
#include <string>
#include <vector>
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
@@ -63,15 +62,9 @@ class GLES2Implementation {
// Gets the value of the result.
template <typename T>
T GetResultAs() const {
- return static_cast<T>(result_buffer_);
+ return *static_cast<T*>(result_buffer_);
}
- // Gets the GLError through our wrapper.
- GLenum GetGLError();
-
- // Sets our wrapper for the GLError.
- void SetGLError(GLenum error);
-
// Waits for all commands to execute.
void WaitForCmd();
@@ -85,9 +78,8 @@ class GLES2Implementation {
// Sets the contents of a bucket.
void SetBucketContents(uint32 bucket_id, const void* data, size_t size);
- // Gets the contents of a bucket as a string. Returns false if there is no
- // string available which is a separate case from the empty string.
- bool GetBucketAsString(uint32 bucket_id, std::string* str);
+ // Gets the contents of a bucket as a string.
+ std::string GetBucketAsString(uint32 bucket_id);
// Sets the contents of a bucket as a string.
void SetBucketAsString(uint32 bucket_id, const std::string& str);
@@ -110,17 +102,10 @@ class GLES2Implementation {
// unpack alignment as last set by glPixelStorei
GLint unpack_alignment_;
- // Current GL error bits.
- uint32 error_bits_;
-
- // Map of GLenum to Strings for glGetString. We need to cache these because
- // the pointer passed back to the client has to remain valid for eternity.
- typedef std::map<uint32, std::string> GLStringMap;
- GLStringMap gl_strings_;
-
DISALLOW_COPY_AND_ASSIGN(GLES2Implementation);
};
+
} // namespace gles2
} // namespace gpu
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index b758002..8b30119 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -103,14 +103,6 @@ void CompressedTexSubImage2D(
void CopyTexImage2D(
GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
GLsizei width, GLsizei height, GLint border) {
- if (width < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
- if (height < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
helper_->CopyTexImage2D(
target, level, internalformat, x, y, width, height, border);
}
@@ -118,14 +110,6 @@ void CopyTexImage2D(
void CopyTexSubImage2D(
GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y,
GLsizei width, GLsizei height) {
- if (width < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
- if (height < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
helper_->CopyTexSubImage2D(
target, level, xoffset, yoffset, x, y, width, height);
}
@@ -201,10 +185,6 @@ void DisableVertexAttribArray(GLuint index) {
}
void DrawArrays(GLenum mode, GLint first, GLsizei count) {
- if (count < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
helper_->DrawArrays(mode, first, count);
}
@@ -294,7 +274,11 @@ void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params) {
memcpy(params, result_buffer_, num_values * sizeof(*params));
}
-GLenum GetError();
+GLenum GetError() {
+ helper_->GetError(result_shm_id(), result_shm_offset());
+ WaitForCmd();
+ return GetResultAs<GLenum>();
+}
void GetFloatv(GLenum pname, GLfloat* params) {
helper_->GetFloatv(pname, result_shm_id(), result_shm_offset());
@@ -330,21 +314,10 @@ void GetProgramiv(GLuint program, GLenum pname, GLint* params) {
memcpy(params, result_buffer_, num_values * sizeof(*params));
}
+// TODO(gman): Implement this
void GetProgramInfoLog(
- GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) {
- helper_->SetBucketSize(kResultBucketId, 0);
- helper_->GetProgramInfoLog(program, kResultBucketId);
- std::string str;
- if (GetBucketAsString(kResultBucketId, &str)) {
- GLsizei max_size =
- std::min(static_cast<size_t>(bufsize) - 1, str.size());
- if (length != NULL) {
- *length = max_size;
- }
- memcpy(infolog, str.c_str(), max_size);
- infolog[max_size] = '\0';
- }
-}
+ GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
+
void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) {
helper_->GetRenderbufferParameteriv(
target, pname, result_shm_id(), result_shm_offset());
@@ -362,39 +335,17 @@ void GetShaderiv(GLuint shader, GLenum pname, GLint* params) {
memcpy(params, result_buffer_, num_values * sizeof(*params));
}
+// TODO(gman): Implement this
void GetShaderInfoLog(
- GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) {
- helper_->SetBucketSize(kResultBucketId, 0);
- helper_->GetShaderInfoLog(shader, kResultBucketId);
- std::string str;
- if (GetBucketAsString(kResultBucketId, &str)) {
- GLsizei max_size =
- std::min(static_cast<size_t>(bufsize) - 1, str.size());
- if (length != NULL) {
- *length = max_size;
- }
- memcpy(infolog, str.c_str(), max_size);
- infolog[max_size] = '\0';
- }
-}
+ GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
+
void GetShaderPrecisionFormat(
GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+// TODO(gman): Implement this
void GetShaderSource(
- GLuint shader, GLsizei bufsize, GLsizei* length, char* source) {
- helper_->SetBucketSize(kResultBucketId, 0);
- helper_->GetShaderSource(shader, kResultBucketId);
- std::string str;
- if (GetBucketAsString(kResultBucketId, &str)) {
- GLsizei max_size =
- std::min(static_cast<size_t>(bufsize) - 1, str.size());
- if (length != NULL) {
- *length = max_size;
- }
- memcpy(source, str.c_str(), max_size);
- source[max_size] = '\0';
- }
-}
+ GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
+
const GLubyte* GetString(GLenum name);
void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) {
@@ -446,66 +397,45 @@ void Hint(GLenum target, GLenum mode) {
}
GLboolean IsBuffer(GLuint buffer) {
- typedef IsBuffer::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = 0;
helper_->IsBuffer(buffer, result_shm_id(), result_shm_offset());
WaitForCmd();
- return *result;
+ return GetResultAs<GLboolean>();
}
GLboolean IsEnabled(GLenum cap) {
- typedef IsEnabled::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = 0;
helper_->IsEnabled(cap, result_shm_id(), result_shm_offset());
WaitForCmd();
- return *result;
+ return GetResultAs<GLboolean>();
}
GLboolean IsFramebuffer(GLuint framebuffer) {
- typedef IsFramebuffer::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = 0;
helper_->IsFramebuffer(framebuffer, result_shm_id(), result_shm_offset());
WaitForCmd();
- return *result;
+ return GetResultAs<GLboolean>();
}
GLboolean IsProgram(GLuint program) {
- typedef IsProgram::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = 0;
helper_->IsProgram(program, result_shm_id(), result_shm_offset());
WaitForCmd();
- return *result;
+ return GetResultAs<GLboolean>();
}
GLboolean IsRenderbuffer(GLuint renderbuffer) {
- typedef IsRenderbuffer::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = 0;
helper_->IsRenderbuffer(renderbuffer, result_shm_id(), result_shm_offset());
WaitForCmd();
- return *result;
+ return GetResultAs<GLboolean>();
}
GLboolean IsShader(GLuint shader) {
- typedef IsShader::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = 0;
helper_->IsShader(shader, result_shm_id(), result_shm_offset());
WaitForCmd();
- return *result;
+ return GetResultAs<GLboolean>();
}
GLboolean IsTexture(GLuint texture) {
- typedef IsTexture::Result Result;
- Result* result = GetResultAs<Result*>();
- *result = 0;
helper_->IsTexture(texture, result_shm_id(), result_shm_offset());
WaitForCmd();
- return *result;
+ return GetResultAs<GLboolean>();
}
void LineWidth(GLfloat width) {
@@ -528,14 +458,6 @@ void ReadPixels(
void RenderbufferStorage(
GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
- if (width < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
- if (height < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
helper_->RenderbufferStorage(target, internalformat, width, height);
}
@@ -544,14 +466,6 @@ void SampleCoverage(GLclampf value, GLboolean invert) {
}
void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) {
- if (width < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
- if (height < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
helper_->Scissor(x, y, width, height);
}
@@ -731,14 +645,6 @@ void VertexAttribPointer(
const void* ptr);
void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) {
- if (width < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
- if (height < 0) {
- SetGLError(GL_INVALID_VALUE);
- return;
- }
helper_->Viewport(x, y, width, height);
}