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 "modules/webgl/WebGLRenderingContextBase.h" | 8 #include "modules/webgl/WebGLRenderingContextBase.h" |
9 #include "modules/webgl/WebGLTimerQueryEXT.h" | 9 #include "modules/webgl/WebGLTimerQueryEXT.h" |
10 | 10 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 if (target != GL_TIMESTAMP_EXT) { | 133 if (target != GL_TIMESTAMP_EXT) { |
134 scoped.context()->webContext()->synthesizeGLError(GL_INVALID_ENUM); | 134 scoped.context()->webContext()->synthesizeGLError(GL_INVALID_ENUM); |
135 return; | 135 return; |
136 } | 136 } |
137 | 137 |
138 if (query->hasTarget() && query->target() != target) { | 138 if (query->hasTarget() && query->target() != target) { |
139 scoped.context()->webContext()->synthesizeGLError(GL_INVALID_OPERATION); | 139 scoped.context()->webContext()->synthesizeGLError(GL_INVALID_OPERATION); |
140 return; | 140 return; |
141 } | 141 } |
142 | 142 |
143 scoped.context()->webContext()->queryCounterEXT(query->object(), target); | 143 // Timestamps are disabled in WebGL due to lack of driver support, so we don 't actually perform a GL call |
Ken Russell (switch to Gerrit)
2016/03/24 17:02:26
Let's clarify "due to lack of driver support on mu
| |
144 query->setTarget(target); | 144 query->setTarget(target); |
145 query->resetCachedResult(); | 145 query->resetCachedResult(); |
146 } | 146 } |
147 | 147 |
148 ScriptValue EXTDisjointTimerQuery::getQueryEXT(ScriptState* scriptState, GLenum target, GLenum pname) | 148 ScriptValue EXTDisjointTimerQuery::getQueryEXT(ScriptState* scriptState, GLenum target, GLenum pname) |
149 { | 149 { |
150 WebGLExtensionScopedContext scoped(this); | 150 WebGLExtensionScopedContext scoped(this); |
151 if (scoped.isLost()) | 151 if (scoped.isLost()) |
152 return ScriptValue::createNull(scriptState); | 152 return ScriptValue::createNull(scriptState); |
153 | 153 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 WebGLExtension::trace(visitor); | 205 WebGLExtension::trace(visitor); |
206 } | 206 } |
207 | 207 |
208 EXTDisjointTimerQuery::EXTDisjointTimerQuery(WebGLRenderingContextBase* context) | 208 EXTDisjointTimerQuery::EXTDisjointTimerQuery(WebGLRenderingContextBase* context) |
209 : WebGLExtension(context) | 209 : WebGLExtension(context) |
210 { | 210 { |
211 context->extensionsUtil()->ensureExtensionEnabled("GL_EXT_disjoint_timer_que ry"); | 211 context->extensionsUtil()->ensureExtensionEnabled("GL_EXT_disjoint_timer_que ry"); |
212 } | 212 } |
213 | 213 |
214 } // namespace blink | 214 } // namespace blink |
OLD | NEW |