| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 if (target != GL_TIME_ELAPSED_EXT) { | 77 if (target != GL_TIME_ELAPSED_EXT) { |
| 78 scoped.context()->synthesizeGLError(GL_INVALID_ENUM, "beginQueryEXT", | 78 scoped.context()->synthesizeGLError(GL_INVALID_ENUM, "beginQueryEXT", |
| 79 "invalid target"); | 79 "invalid target"); |
| 80 return; | 80 return; |
| 81 } | 81 } |
| 82 | 82 |
| 83 if (m_currentElapsedQuery) { | 83 if (m_currentElapsedQuery) { |
| 84 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "beginQueryEXT", | 84 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "beginQueryEXT", |
| 85 "no current query"); | 85 "a query is already active for target"); |
| 86 return; | 86 return; |
| 87 } | 87 } |
| 88 | 88 |
| 89 if (query->hasTarget() && query->target() != target) { | 89 if (query->hasTarget() && query->target() != target) { |
| 90 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "beginQueryEXT", | 90 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "beginQueryEXT", |
| 91 "target does not match query"); | 91 "target does not match query"); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 | 94 |
| 95 scoped.context()->contextGL()->BeginQueryEXT(target, query->object()); | 95 scoped.context()->contextGL()->BeginQueryEXT(target, query->object()); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 WebGLExtension::trace(visitor); | 214 WebGLExtension::trace(visitor); |
| 215 } | 215 } |
| 216 | 216 |
| 217 EXTDisjointTimerQuery::EXTDisjointTimerQuery(WebGLRenderingContextBase* context) | 217 EXTDisjointTimerQuery::EXTDisjointTimerQuery(WebGLRenderingContextBase* context) |
| 218 : WebGLExtension(context) { | 218 : WebGLExtension(context) { |
| 219 context->extensionsUtil()->ensureExtensionEnabled( | 219 context->extensionsUtil()->ensureExtensionEnabled( |
| 220 "GL_EXT_disjoint_timer_query"); | 220 "GL_EXT_disjoint_timer_query"); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace blink | 223 } // namespace blink |
| OLD | NEW |