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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1800383002: Disable timestamps in WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clarify comment Created 4 years, 9 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: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 8cb9716e7e3efc4c9f5e2c68174b8a607219868c..784587c863366be37814a5321950b295497acb10 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -5483,8 +5483,21 @@ void GLES2Implementation::GetQueryivEXT(
<< GLES2Util::GetStringQueryParameter(pname) << ", "
<< static_cast<const void*>(params) << ")");
if (pname == GL_QUERY_COUNTER_BITS_EXT) {
- // We convert all queries to CPU time so we support 64 bits.
- *params = 64;
+ switch (target) {
+ case GL_TIMESTAMP_EXT:
+ // Overall reliable driver support for timestamps is limited, so we
+ // disable the timestamp portion of this extension to encourage use of
+ // the better supported time elapsed queries.
+ *params = 0;
+ break;
+ case GL_TIME_ELAPSED_EXT:
+ // We convert all queries to CPU time so we support 64 bits.
+ *params = 64;
+ break;
+ default:
+ SetGLErrorInvalidEnum("glGetQueryivEXT", target, "target");
+ break;
+ }
return;
} else if (pname != GL_CURRENT_QUERY_EXT) {
SetGLErrorInvalidEnum("glGetQueryivEXT", pname, "pname");

Powered by Google App Engine
This is Rietveld 408576698