Update Queries to return Error objects instead of calling gl::error.
BUG=angle:520
Change-Id: If8f2bb1c4de7b9cc30861a06aab1d89c97305b26
Reviewed-on: https://chromium-review.googlesource.com/216699
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 28e3d28..d41d2c2 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -110,7 +110,12 @@
return;
}
- context->beginQuery(target, id);
+ gl::Error error = context->beginQuery(target, id);
+ if (error.isError())
+ {
+ context->recordError(error);
+ return;
+ }
}
}
@@ -1451,7 +1456,12 @@
return;
}
- context->endQuery(target);
+ gl::Error error = context->endQuery(target);
+ if (error.isError())
+ {
+ context->recordError(error);
+ return;
+ }
}
}
@@ -2604,11 +2614,27 @@
switch(pname)
{
case GL_QUERY_RESULT_EXT:
- params[0] = queryObject->getResult();
+ {
+ gl::Error error = queryObject->getResult(params);
+ if (error.isError())
+ {
+ context->recordError(error);
+ return;
+ }
+ }
break;
+
case GL_QUERY_RESULT_AVAILABLE_EXT:
- params[0] = queryObject->isResultAvailable();
+ {
+ gl::Error error = queryObject->isResultAvailable(params);
+ if (error.isError())
+ {
+ context->recordError(error);
+ return;
+ }
+ }
break;
+
default:
context->recordError(gl::Error(GL_INVALID_ENUM));
return;
@@ -5301,7 +5327,13 @@
{
return;
}
- context->beginQuery(target, id);
+
+ gl::Error error = context->beginQuery(target, id);
+ if (error.isError())
+ {
+ context->recordError(error);
+ return;
+ }
}
}
@@ -5323,7 +5355,12 @@
return;
}
- context->endQuery(target);
+ gl::Error error = context->endQuery(target);
+ if (error.isError())
+ {
+ context->recordError(error);
+ return;
+ }
}
}
@@ -5388,12 +5425,26 @@
switch(pname)
{
- case GL_QUERY_RESULT:
- params[0] = queryObject->getResult();
+ case GL_QUERY_RESULT_EXT:
+ {
+ gl::Error error = queryObject->getResult(params);
+ if (error.isError())
+ {
+ context->recordError(error);
+ return;
+ }
+ }
break;
- case GL_QUERY_RESULT_AVAILABLE:
- params[0] = queryObject->isResultAvailable();
+ case GL_QUERY_RESULT_AVAILABLE_EXT:
+ {
+ gl::Error error = queryObject->isResultAvailable(params);
+ if (error.isError())
+ {
+ context->recordError(error);
+ return;
+ }
+ }
break;
default: