Clean up Query classes.

BUG=angle:717

Change-Id: I8f29f24964a9661d9f0bea5dca48cebddbf9b0b2
Reviewed-on: https://chromium-review.googlesource.com/211136
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Shannon Woods <shannonwoods@chromium.org>
diff --git a/src/libGLESv2/Query.cpp b/src/libGLESv2/Query.cpp
index 350a13e..a99461e 100644
--- a/src/libGLESv2/Query.cpp
+++ b/src/libGLESv2/Query.cpp
@@ -11,7 +11,6 @@
 
 namespace gl
 {
-
 Query::Query(rx::QueryImpl *impl, GLuint id)
     : RefCountObject(id),
       mQuery(impl)
@@ -25,7 +24,11 @@
 
 void Query::begin()
 {
-    mQuery->begin();
+    // TODO: Rather than keeping track of whether the query was successfully
+    // created via a boolean in the GL-level Query object, we should probably
+    // use the error system to track these failed creations at the context level,
+    // and reset the active query ID for the target to 0 upon failure.
+    mStarted = mQuery->begin();
 }
 
 void Query::end()
@@ -50,7 +53,7 @@
 
 bool Query::isStarted() const
 {
-    return mQuery->isStarted();
+    return mStarted;
 }
 
 }