Commit cae72d6a by Geoff Lang Committed by Commit Bot

Call GetGlobalContext instead of GetValidGlobalContext for gl::GetError

If the context is lost due to an OUT_OF_MEMORY error, it was impossible to check the error. BUG=angleproject:1309 Change-Id: I50fbd46b139d44774dde804445f12b8d34d73e29 Reviewed-on: https://chromium-review.googlesource.com/521203Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent cd930cf0
......@@ -95,7 +95,7 @@ template_entry_point_def = """{return_type}GL_APIENTRY {name}({params})
{{
EVENT("({format_params})"{comma_if_needed}{pass_params});
Context *context = GetValidGlobalContext();
Context *context = {context_getter}();
if (context)
{{
context->gatherParams<EntryPoint::{name}>({pass_params});
......@@ -160,6 +160,12 @@ def default_return_value(return_type):
else:
print(return_type)
def get_context_getter_function(cmd_name):
if cmd_name == "glGetError":
return "GetGlobalContext"
else:
return "GetValidGlobalContext"
def format_entry_point_def(cmd_name, proto, params):
pass_params = [just_the_name(param) for param in params]
format_params = [param_format_string(param) for param in params]
......@@ -175,7 +181,8 @@ def format_entry_point_def(cmd_name, proto, params):
validate_params = ", ".join(["context"] + pass_params),
format_params = ", ".join(format_params),
return_if_needed = "" if default_return == "" else "return ",
default_return_if_needed = "" if default_return == "" else "\n return " + default_return + ";\n")
default_return_if_needed = "" if default_return == "" else "\n return " + default_return + ";\n",
context_getter = get_context_getter_function(cmd_name))
for cmd_name in gles2_commands:
command_xpath = "command/proto[name='" + cmd_name + "']/.."
......@@ -227,4 +234,4 @@ with open(gles_2_0_source_path, "w") as out:
with open(entry_points_enum_header_path, "w") as out:
out.write(entry_points_enum)
out.close()
\ No newline at end of file
out.close()
......@@ -1115,7 +1115,7 @@ GLenum GL_APIENTRY GetError()
{
EVENT("()");
Context *context = GetValidGlobalContext();
Context *context = GetGlobalContext();
if (context)
{
context->gatherParams<EntryPoint::GetError>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment