diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-27 02:14:42 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-27 02:14:42 +0000 |
commit | 85c6d6739a81098c35cb35c3430f038ed4f5ddab (patch) | |
tree | e9302aab1b4368f28f3188087c2cb2d9521b103c /gpu/command_buffer/client/gles2_implementation.h | |
parent | 85aa75c358eded70e4ebe9038d5133847d335b7f (diff) | |
download | chromium_src-85c6d6739a81098c35cb35c3430f038ed4f5ddab.zip chromium_src-85c6d6739a81098c35cb35c3430f038ed4f5ddab.tar.gz chromium_src-85c6d6739a81098c35cb35c3430f038ed4f5ddab.tar.bz2 |
"/b/slave/chromium-rel-linux/build/src/gpu/command_buffer/client/gles2_demo_cc.cc:50:warning: 'length' may be used uninitialized in this function"
Revert 40193 - Added support for glGetString, glGetShaderSource,
glGetProgramInfoLog and glGetShaderInfoLog
This turned up lots of issues.
* glGetShaderiv needed to be wrapped so it
returns the size of the shader the user passed
in. Not the munged shader sent to GL.
* Another issue that came up is that client
side validation is needed to ensure that
the client side GLES2Implementation does not
generate bad commands. For example, calling
glUniform1iv with a negative count would
generate a bad command. The service side
would see that and think the program was
malicious and stop processing commands.
So, that means I had to add some client side
validation and wrap glGetError on the client
side so I can synthisize GL errors there.
TEST=lots of unit tests.
BUG=none
Review URL: http://codereview.chromium.org/661220
TBR=gman@chromium.org
Review URL: http://codereview.chromium.org/660229
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40198 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client/gles2_implementation.h')
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.h | 23 |
1 files changed, 4 insertions, 19 deletions
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 |