summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/build_gles2_cmd_buffer.py
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-11 11:49:25 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-11 11:49:25 +0000
commitcc3241ac1572fd4ee5164fbe446b48f753e19556 (patch)
tree67738f48fe22efd4b602a0e11aef0bf659b35d11 /gpu/command_buffer/build_gles2_cmd_buffer.py
parent6b0868b3a91974f8015b48f4bcc8fcd8228ff5a0 (diff)
downloadchromium_src-cc3241ac1572fd4ee5164fbe446b48f753e19556.zip
chromium_src-cc3241ac1572fd4ee5164fbe446b48f753e19556.tar.gz
chromium_src-cc3241ac1572fd4ee5164fbe446b48f753e19556.tar.bz2
Make GLES2Implementation handl failed allocation
This passes all the current unit tests I'll write more tests to check this stuff but I want to get it in the tree asap to see if it stops the crashes Note. This is step 2 of 4 Step 1 was doing the same for GLES2CmdHelper and CommandBufferHelper Step 2 is this Step 3 is make these trigger lost context Step 4 is write tests TEST=none BUG=109694 false to NULL Make GLES2CmdHelper and CommandBufferHelper handle failed allocation This passes all the current unit tests. I'll write more tests to check this stuff but I want to get it the tree asap to see if it stop the crashes Note. This is only step 1 of about 4 steps Step 2 is make GLES2Implementation do the same Step 3 is make both of these trigger lost context Step 4 is write tests. TEST=none BUG=109694 R=apatrick@chromium.org Review URL: http://codereview.chromium.org/9168022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117204 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/build_gles2_cmd_buffer.py')
-rwxr-xr-xgpu/command_buffer/build_gles2_cmd_buffer.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 9200fbf..e39e95d 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -1197,6 +1197,7 @@ _FUNCTION_INFO = {
'type': 'Is',
'decoder_func': 'DoCheckFramebufferStatus',
'gl_test_func': 'glCheckFramebufferStatusEXT',
+ 'error_value': 'GL_FRAMEBUFFER_UNSUPPORTED',
'result': ['GLenum'],
},
'Clear': {'decoder_func': 'DoClear'},
@@ -3597,6 +3598,9 @@ class GETnHandler(TypeHandler):
}
typedef %(func_name)s::Result Result;
Result* result = GetResultAs<Result*>();
+ if (!result) {
+ return;
+ }
result->SetNumResults(0);
helper_->%(func_name)s(%(arg_string)s,
GetResultShmId(), GetResultShmOffset());
@@ -4510,6 +4514,7 @@ TEST_F(%(test_name)s, %(name)sInvalidArgsBadSharedMemoryId) {
"""Overrriden from TypeHandler."""
impl_func = func.GetInfo('impl_func')
if impl_func == None or impl_func == True:
+ error_value = func.GetInfo("error_value") or "GL_FALSE"
file.Write("%s %s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
@@ -4518,6 +4523,9 @@ TEST_F(%(test_name)s, %(name)sInvalidArgsBadSharedMemoryId) {
self.WriteClientGLCallLog(func, file)
file.Write(" typedef %s::Result Result;\n" % func.name)
file.Write(" Result* result = GetResultAs<Result*>();\n")
+ file.Write(" if (!result) {\n")
+ file.Write(" return %s;\n" % error_value)
+ file.Write(" }\n")
file.Write(" *result = 0;\n")
arg_string = func.MakeOriginalArgString("")
comma = ""