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

Unified Diff: Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1325453007: Added support for EXTDisjointTimerQuery on the Blink side. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Marked EXTDisjointTimerQuery as a draft extension, also added TODO for kbr about per frame updates Created 5 years, 3 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: Source/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/Source/modules/webgl/WebGLRenderingContextBase.cpp b/Source/modules/webgl/WebGLRenderingContextBase.cpp
index fca5c3e2eb1224b37564569495d2ec4ad4a8e37a..0f732c438d6348c7ec00a50f539fd93ed27647b2 100644
--- a/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -2866,6 +2866,15 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* scriptState, GL
return WebGLAny(scriptState, maxDrawBuffers());
synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_draw_buffers not enabled");
return ScriptValue::createNull(scriptState);
+ case GL_TIMESTAMP_EXT:
+ if (extensionEnabled(EXTDisjointTimerQueryName))
+ return getInt64Parameter(scriptState, GL_TIMESTAMP_EXT);
+ return ScriptValue::createNull(scriptState);
Ken Russell (switch to Gerrit) 2015/09/04 01:17:09 This should generate an INVALID_ENUM error if the
David Yen 2015/09/04 16:04:41 Done.
+ case GL_GPU_DISJOINT_EXT:
+ if (extensionEnabled(EXTDisjointTimerQueryName))
+ return getBooleanParameter(scriptState, GL_GPU_DISJOINT_EXT);
+ return ScriptValue::createNull(scriptState);
Ken Russell (switch to Gerrit) 2015/09/04 01:17:09 Same thing here.
David Yen 2015/09/04 16:04:41 Done.
+
default:
if ((extensionEnabled(WebGLDrawBuffersName) || isWebGL2OrHigher())
&& pname >= GL_DRAW_BUFFER0_EXT
@@ -5168,6 +5177,14 @@ ScriptValue WebGLRenderingContextBase::getIntParameter(ScriptState* scriptState,
return WebGLAny(scriptState, value);
}
+ScriptValue WebGLRenderingContextBase::getInt64Parameter(ScriptState* scriptState, GLenum pname)
+{
+ GLint64 value = 0;
+ if (!isContextLost())
+ webContext()->getInteger64v(pname, &value);
+ return WebGLAny(scriptState, value);
+}
+
ScriptValue WebGLRenderingContextBase::getUnsignedIntParameter(ScriptState* scriptState, GLenum pname)
{
GLint value = 0;

Powered by Google App Engine
This is Rietveld 408576698