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

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

Issue 1385793002: Only make timer queries' results available when control returns to browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review feedback from dyen. 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/WebGLTimerQueryEXT.h
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h b/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h
index feef5be1b762a0e0fed1524fa9e5410604b836a6..a5082ce8811501a1fb0658357f324adfb045a7f5 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h
@@ -7,9 +7,11 @@
#include "modules/webgl/WebGLContextObject.h"
+#include "public/platform/WebThread.h"
+
namespace blink {
-class WebGLTimerQueryEXT : public WebGLContextObject {
+class WebGLTimerQueryEXT : public WebGLContextObject, public WebThread::TaskObserver {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -22,6 +24,12 @@ public:
bool hasTarget() const { return m_target != 0; }
GLenum target() const { return m_target; }
+ void resetCachedResult();
+ void updateCachedResult(WebGraphicsContext3D*);
+
+ bool isQueryResultAvailable();
+ GLuint64 getQueryResult();
+
protected:
WebGLTimerQueryEXT(WebGLRenderingContextBase*);
@@ -29,8 +37,20 @@ private:
bool hasObject() const override { return m_queryId != 0; }
void deleteObjectImpl(WebGraphicsContext3D*) override;
+ void registerTaskObserver();
+ void unregisterTaskObserver();
+
+ // TaskObserver implementation.
+ void didProcessTask() override;
+ void willProcessTask() override { }
+
GLenum m_target;
GLuint m_queryId;
+
+ bool m_taskObserverRegistered;
+ bool m_canUpdateAvailability;
+ bool m_queryResultAvailable;
+ GLuint64 m_queryResult;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698