| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/webgl/EXTDisjointTimerQuery.h" | 5 #include "modules/webgl/EXTDisjointTimerQuery.h" |
| 6 | 6 |
| 7 #include "bindings/modules/v8/WebGLAny.h" | 7 #include "bindings/modules/v8/WebGLAny.h" |
| 8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
| 9 #include "modules/webgl/WebGLRenderingContextBase.h" | 9 #include "modules/webgl/WebGLRenderingContextBase.h" |
| 10 #include "modules/webgl/WebGLTimerQueryEXT.h" | 10 #include "modules/webgl/WebGLTimerQueryEXT.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 if (target != GL_TIMESTAMP_EXT) { | 134 if (target != GL_TIMESTAMP_EXT) { |
| 135 scoped.context()->synthesizeGLError(GL_INVALID_ENUM, "queryCounterEXT",
"invalid target"); | 135 scoped.context()->synthesizeGLError(GL_INVALID_ENUM, "queryCounterEXT",
"invalid target"); |
| 136 return; | 136 return; |
| 137 } | 137 } |
| 138 | 138 |
| 139 if (query->hasTarget() && query->target() != target) { | 139 if (query->hasTarget() && query->target() != target) { |
| 140 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "queryCounterE
XT", "target does not match query"); | 140 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "queryCounterE
XT", "target does not match query"); |
| 141 return; | 141 return; |
| 142 } | 142 } |
| 143 | 143 |
| 144 scoped.context()->contextGL()->QueryCounterEXT(query->object(), target); | 144 // Timestamps are disabled in WebGL due to lack of driver support on multipl
e platforms, so we don't actually perform a GL call |
| 145 query->setTarget(target); | 145 query->setTarget(target); |
| 146 query->resetCachedResult(); | 146 query->resetCachedResult(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 ScriptValue EXTDisjointTimerQuery::getQueryEXT(ScriptState* scriptState, GLenum
target, GLenum pname) | 149 ScriptValue EXTDisjointTimerQuery::getQueryEXT(ScriptState* scriptState, GLenum
target, GLenum pname) |
| 150 { | 150 { |
| 151 WebGLExtensionScopedContext scoped(this); | 151 WebGLExtensionScopedContext scoped(this); |
| 152 if (scoped.isLost()) | 152 if (scoped.isLost()) |
| 153 return ScriptValue::createNull(scriptState); | 153 return ScriptValue::createNull(scriptState); |
| 154 | 154 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 WebGLExtension::trace(visitor); | 206 WebGLExtension::trace(visitor); |
| 207 } | 207 } |
| 208 | 208 |
| 209 EXTDisjointTimerQuery::EXTDisjointTimerQuery(WebGLRenderingContextBase* context) | 209 EXTDisjointTimerQuery::EXTDisjointTimerQuery(WebGLRenderingContextBase* context) |
| 210 : WebGLExtension(context) | 210 : WebGLExtension(context) |
| 211 { | 211 { |
| 212 context->extensionsUtil()->ensureExtensionEnabled("GL_EXT_disjoint_timer_que
ry"); | 212 context->extensionsUtil()->ensureExtensionEnabled("GL_EXT_disjoint_timer_que
ry"); |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace blink | 215 } // namespace blink |
| OLD | NEW |