Index: third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQuery.cpp |
diff --git a/third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQuery.cpp b/third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQuery.cpp |
index 30a7b157eca209fa155366a9fde8f0b8f2200e82..d3395bc0b15021055764f1501dde01eb33ae5803 100644 |
--- a/third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQuery.cpp |
+++ b/third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQuery.cpp |
@@ -117,6 +117,7 @@ void EXTDisjointTimerQuery::endQueryEXT(GLenum target) |
} |
scoped.context()->webContext()->endQueryEXT(target); |
+ m_currentElapsedQuery->resetCachedResult(); |
m_currentElapsedQuery.clear(); |
} |
@@ -143,6 +144,7 @@ void EXTDisjointTimerQuery::queryCounterEXT(WebGLTimerQueryEXT* query, GLenum ta |
scoped.context()->webContext()->queryCounterEXT(query->object(), target); |
query->setTarget(target); |
+ query->resetCachedResult(); |
} |
ScriptValue EXTDisjointTimerQuery::getQueryEXT(ScriptState* scriptState, GLenum target, GLenum pname) |
@@ -182,18 +184,14 @@ ScriptValue EXTDisjointTimerQuery::getQueryObjectEXT(ScriptState* scriptState, W |
return ScriptValue::createNull(scriptState); |
} |
- // TODO(kbr): Per the spec, figure out a way to only update this value once |
- // the current frame has completed rendering. |
switch (pname) { |
case GL_QUERY_RESULT_EXT: { |
- GLuint64 result = 0; |
- scoped.context()->webContext()->getQueryObjectui64vEXT(query->object(), pname, &result); |
- return WebGLAny(scriptState, result); |
+ query->updateCachedResult(scoped.context()->webContext()); |
+ return WebGLAny(scriptState, query->getQueryResult()); |
} |
case GL_QUERY_RESULT_AVAILABLE_EXT: { |
- GLuint available = 0; |
- scoped.context()->webContext()->getQueryObjectuivEXT(query->object(), pname, &available); |
- return WebGLAny(scriptState, !!available); |
+ query->updateCachedResult(scoped.context()->webContext()); |
+ return WebGLAny(scriptState, query->isQueryResultAvailable()); |
} |
default: |
scoped.context()->webContext()->synthesizeGLError(GL_INVALID_ENUM); |