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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 "invalid target"); | 136 "invalid target"); |
137 return; | 137 return; |
138 } | 138 } |
139 | 139 |
140 if (query->hasTarget() && query->target() != target) { | 140 if (query->hasTarget() && query->target() != target) { |
141 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "queryCounterEXT", | 141 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "queryCounterEXT", |
142 "target does not match query"); | 142 "target does not match query"); |
143 return; | 143 return; |
144 } | 144 } |
145 | 145 |
146 // Timestamps are disabled in WebGL due to lack of driver support on multiple
platforms, so we don't actually perform a GL call | 146 // Timestamps are disabled in WebGL due to lack of driver support on multiple |
| 147 // platforms, so we don't actually perform a GL call. |
147 query->setTarget(target); | 148 query->setTarget(target); |
148 query->resetCachedResult(); | 149 query->resetCachedResult(); |
149 } | 150 } |
150 | 151 |
151 ScriptValue EXTDisjointTimerQuery::getQueryEXT(ScriptState* scriptState, | 152 ScriptValue EXTDisjointTimerQuery::getQueryEXT(ScriptState* scriptState, |
152 GLenum target, | 153 GLenum target, |
153 GLenum pname) { | 154 GLenum pname) { |
154 WebGLExtensionScopedContext scoped(this); | 155 WebGLExtensionScopedContext scoped(this); |
155 if (scoped.isLost()) | 156 if (scoped.isLost()) |
156 return ScriptValue::createNull(scriptState); | 157 return ScriptValue::createNull(scriptState); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 WebGLExtension::trace(visitor); | 214 WebGLExtension::trace(visitor); |
214 } | 215 } |
215 | 216 |
216 EXTDisjointTimerQuery::EXTDisjointTimerQuery(WebGLRenderingContextBase* context) | 217 EXTDisjointTimerQuery::EXTDisjointTimerQuery(WebGLRenderingContextBase* context) |
217 : WebGLExtension(context) { | 218 : WebGLExtension(context) { |
218 context->extensionsUtil()->ensureExtensionEnabled( | 219 context->extensionsUtil()->ensureExtensionEnabled( |
219 "GL_EXT_disjoint_timer_query"); | 220 "GL_EXT_disjoint_timer_query"); |
220 } | 221 } |
221 | 222 |
222 } // namespace blink | 223 } // namespace blink |
OLD | NEW |