summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client/gles2_implementation.h
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-05 00:24:58 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-05 00:24:58 +0000
commitd7f0642692c2ac6de15cd1e713e0c88dd740b58e (patch)
tree43a5c7a0b91b538933f115a16a6618f6d411a693 /gpu/command_buffer/client/gles2_implementation.h
parent8ba903e43de0e0a0953aa16b878c6279931fffb9 (diff)
downloadchromium_src-d7f0642692c2ac6de15cd1e713e0c88dd740b58e.zip
chromium_src-d7f0642692c2ac6de15cd1e713e0c88dd740b58e.tar.gz
chromium_src-d7f0642692c2ac6de15cd1e713e0c88dd740b58e.tar.bz2
Remove support for client side arrays from client side gpu
code used by Chromium and WebGL so that you can't use it by accident. It's stil enabled for Pepper, the conformance tests and the unit tests. Note that bug 71717 was a bug in WebGL. The same call to glDrawElements with the same parameters would have also crashed real OpenGL. The reason it didn't with --in-process-webgl is because some checks were used with that flag that were not without. Mo is fixing that side. Also, I made it so the the GLES2Implementation class is always the same. Otherwise code calling it needed to have the same flags. BUG=71717 TEST=none Review URL: http://codereview.chromium.org/6410092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73878 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client/gles2_implementation.h')
-rw-r--r--gpu/command_buffer/client/gles2_implementation.h74
1 files changed, 7 insertions, 67 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index f3f202e..1017ef1 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -18,8 +18,6 @@
#include "../client/gles2_cmd_helper.h"
#include "../client/ring_buffer.h"
-#define GLES2_SUPPORT_CLIENT_SIDE_BUFFERS 1
-
// TODO(gman): replace with logging code expansion.
#define GPU_CLIENT_LOG(args)
@@ -94,67 +92,13 @@ class GLES2Implementation {
// this file instead of having to edit some template or the code generator.
#include "../client/gles2_implementation_autogen.h"
- #if defined(GLES2_SUPPORT_CLIENT_SIDE_BUFFERS)
- void BindBuffer(GLenum target, GLuint buffer);
- void DeleteBuffers(GLsizei n, const GLuint* buffers);
- void DisableVertexAttribArray(GLuint index);
- void DrawArrays(GLenum mode, GLint first, GLsizei count);
- void EnableVertexAttribArray(GLuint index);
- void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
- void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
- #else
- void BindBuffer(GLenum target, GLuint buffer) {
- if (IsReservedId(buffer)) {
- SetGLError(GL_INVALID_OPERATION, "glBindBuffer: reserved buffer id");
- return;
- }
- if (buffer != 0) {
- id_allocator_.MarkAsUsed(buffer);
- }
- helper_->BindBuffer(target, buffer);
- }
-
- void DeleteBuffers(GLsizei n, const GLuint* buffers) {
- FreeIds(n, buffers);
- helper_->DeleteBuffersImmediate(n, buffers);
- }
-
- void DisableVertexAttribArray(GLuint index) {
- helper_->DisableVertexAttribArray(index);
- }
-
- void DrawArrays(GLenum mode, GLint first, GLsizei count) {
- if (count < 0) {
- SetGLError(GL_INVALID_VALUE, "glDrawArrays: count < 0");
- return;
- }
- helper_->DrawArrays(mode, first, count);
- }
-
- void EnableVertexAttribArray(GLuint index) {
- helper_->EnableVertexAttribArray(index);
- }
-
- void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) {
- typedef GetVertexAttribfv::Result Result;
- Result* result = GetResultAs<Result*>();
- result->SetNumResults(0);
- helper_->GetVertexAttribfv(
- index, pname, result_shm_id(), result_shm_offset());
- WaitForCmd();
- result->CopyResult(params);
- }
-
- void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params) {
- typedef GetVertexAttribiv::Result Result;
- Result* result = GetResultAs<Result*>();
- result->SetNumResults(0);
- helper_->GetVertexAttribiv(
- index, pname, result_shm_id(), result_shm_offset());
- WaitForCmd();
- result->CopyResult(params);
- }
- #endif
+ void BindBuffer(GLenum target, GLuint buffer);
+ void DeleteBuffers(GLsizei n, const GLuint* buffers);
+ void DisableVertexAttribArray(GLuint index);
+ void DrawArrays(GLenum mode, GLint first, GLsizei count);
+ void EnableVertexAttribArray(GLuint index);
+ void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
+ void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
GLuint MakeTextureId() {
GLuint id;
@@ -329,14 +273,12 @@ class GLES2Implementation {
bool IsRenderbufferReservedId(GLuint id) { return false; }
bool IsTextureReservedId(GLuint id) { return false; }
-#if defined(GLES2_SUPPORT_CLIENT_SIDE_BUFFERS)
// Helper for GetVertexAttrib
bool GetVertexAttribHelper(GLuint index, GLenum pname, uint32* param);
// Asks the service for the max index in an element array buffer.
GLsizei GetMaxIndexInElementArrayBuffer(
GLuint buffer_id, GLsizei count, GLenum type, GLuint offset);
-#endif
GLES2Util util_;
GLES2CmdHelper* helper_;
@@ -359,7 +301,6 @@ class GLES2Implementation {
// unpack alignment as last set by glPixelStorei
GLint unpack_alignment_;
-#if defined(GLES2_SUPPORT_CLIENT_SIDE_BUFFERS)
// The currently bound array buffer.
GLuint bound_array_buffer_id_;
@@ -375,7 +316,6 @@ class GLES2Implementation {
scoped_ptr<ClientSideBufferHelper> client_side_buffer_helper_;
GLuint reserved_ids_[2];
-#endif
// Current GL error bits.
uint32 error_bits_;