Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQueryWebGL2.cpp

Issue 2492343003: Fix the WebGLObject arg non-nullable behaviors. (Closed)
Patch Set: Fix the WebGLObject arg non-nullable behaviors. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698