| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/EXTDisjointTimerQueryWebGL2.h" | 5 #include "modules/webgl/EXTDisjointTimerQueryWebGL2.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 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 const char* EXTDisjointTimerQueryWebGL2::extensionName() { | 31 const char* EXTDisjointTimerQueryWebGL2::extensionName() { |
| 32 return "EXT_disjoint_timer_query_webgl2"; | 32 return "EXT_disjoint_timer_query_webgl2"; |
| 33 } | 33 } |
| 34 | 34 |
| 35 void EXTDisjointTimerQueryWebGL2::queryCounterEXT(WebGLQuery* query, | 35 void EXTDisjointTimerQueryWebGL2::queryCounterEXT(WebGLQuery* query, |
| 36 GLenum target) { | 36 GLenum target) { |
| 37 WebGLExtensionScopedContext scoped(this); | 37 WebGLExtensionScopedContext scoped(this); |
| 38 if (scoped.isLost()) | 38 if (scoped.isLost()) |
| 39 return; | 39 return; |
| 40 | 40 |
| 41 if (!query || query->isDeleted() || | 41 DCHECK(query); |
| 42 if (query->isDeleted() || |
| 42 !query->validate(scoped.context()->contextGroup(), scoped.context())) { | 43 !query->validate(scoped.context()->contextGroup(), scoped.context())) { |
| 43 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "queryCounterEXT", | 44 scoped.context()->synthesizeGLError(GL_INVALID_OPERATION, "queryCounterEXT", |
| 44 "invalid query"); | 45 "invalid query"); |
| 45 return; | 46 return; |
| 46 } | 47 } |
| 47 | 48 |
| 48 if (target != GL_TIMESTAMP_EXT) { | 49 if (target != GL_TIMESTAMP_EXT) { |
| 49 scoped.context()->synthesizeGLError(GL_INVALID_ENUM, "queryCounterEXT", | 50 scoped.context()->synthesizeGLError(GL_INVALID_ENUM, "queryCounterEXT", |
| 50 "invalid target"); | 51 "invalid target"); |
| 51 return; | 52 return; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 68 } | 69 } |
| 69 | 70 |
| 70 EXTDisjointTimerQueryWebGL2::EXTDisjointTimerQueryWebGL2( | 71 EXTDisjointTimerQueryWebGL2::EXTDisjointTimerQueryWebGL2( |
| 71 WebGLRenderingContextBase* context) | 72 WebGLRenderingContextBase* context) |
| 72 : WebGLExtension(context) { | 73 : WebGLExtension(context) { |
| 73 context->extensionsUtil()->ensureExtensionEnabled( | 74 context->extensionsUtil()->ensureExtensionEnabled( |
| 74 "GL_EXT_disjoint_timer_query_webgl2"); | 75 "GL_EXT_disjoint_timer_query_webgl2"); |
| 75 } | 76 } |
| 76 | 77 |
| 77 } // namespace blink | 78 } // namespace blink |
| OLD | NEW |