Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLQuery.h

Issue 1408803003: Enforce queries' new availability semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webgl/WebGLQuery.h
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLQuery.h b/third_party/WebKit/Source/modules/webgl/WebGLQuery.h
index c4ef7d9f48e1c102f44e27cfca6bee9182446b64..867cc49dcb3649b52f59233d9eb39efda3e925e7 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLQuery.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLQuery.h
@@ -11,7 +11,7 @@ namespace blink {
class WebGL2RenderingContextBase;
-class WebGLQuery : public WebGLSharedPlatform3DObject {
+class WebGLQuery : public WebGLSharedPlatform3DObject, public WebThread::TaskObserver {
DEFINE_WRAPPERTYPEINFO();
public:
~WebGLQuery() override;
@@ -19,8 +19,15 @@ public:
static WebGLQuery* create(WebGL2RenderingContextBase*);
void setTarget(GLenum);
+ bool hasTarget() const { return m_target != 0; }
GLenum getTarget() const { return m_target; }
+ void resetCachedResult();
+ void updateCachedResult(WebGraphicsContext3D*);
+
+ bool isQueryResultAvailable();
+ GLuint getQueryResult();
+
protected:
explicit WebGLQuery(WebGL2RenderingContextBase*);
@@ -29,7 +36,19 @@ protected:
private:
bool isQuery() const override { return true; }
+ void registerTaskObserver();
+ void unregisterTaskObserver();
+
+ // TaskObserver implementation.
+ void didProcessTask() override;
+ void willProcessTask() override { }
+
GLenum m_target;
+
+ bool m_taskObserverRegistered;
+ bool m_canUpdateAvailability;
+ bool m_queryResultAvailable;
+ GLuint m_queryResult;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698