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

Side by Side Diff: ui/gl/gl_bindings_autogen_osmesa.cc

Issue 1775353002: Add DCHECK for nullptr in gl bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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
« no previous file with comments | « ui/gl/gl_bindings_autogen_glx.cc ('k') | ui/gl/gl_bindings_autogen_wgl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This file is auto-generated from 5 // This file is auto-generated from
6 // ui/gl/generate_bindings.py 6 // ui/gl/generate_bindings.py
7 // It's formatted by clang-format using chromium coding style: 7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename 8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT! 9 // DO NOT EDIT!
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 if (g_debugBindingsInitialized) 56 if (g_debugBindingsInitialized)
57 InitializeDebugBindings(); 57 InitializeDebugBindings();
58 } 58 }
59 59
60 extern "C" { 60 extern "C" {
61 61
62 static void GL_BINDING_CALL Debug_OSMesaColorClamp(GLboolean enable) { 62 static void GL_BINDING_CALL Debug_OSMesaColorClamp(GLboolean enable) {
63 GL_SERVICE_LOG("OSMesaColorClamp" 63 GL_SERVICE_LOG("OSMesaColorClamp"
64 << "(" << GLEnums::GetStringBool(enable) << ")"); 64 << "(" << GLEnums::GetStringBool(enable) << ")");
65 DCHECK(g_driver_osmesa.debug_fn.OSMesaColorClampFn != nullptr);
65 g_driver_osmesa.debug_fn.OSMesaColorClampFn(enable); 66 g_driver_osmesa.debug_fn.OSMesaColorClampFn(enable);
66 } 67 }
67 68
68 static OSMesaContext GL_BINDING_CALL 69 static OSMesaContext GL_BINDING_CALL
69 Debug_OSMesaCreateContext(GLenum format, OSMesaContext sharelist) { 70 Debug_OSMesaCreateContext(GLenum format, OSMesaContext sharelist) {
70 GL_SERVICE_LOG("OSMesaCreateContext" 71 GL_SERVICE_LOG("OSMesaCreateContext"
71 << "(" << GLEnums::GetStringEnum(format) << ", " << sharelist 72 << "(" << GLEnums::GetStringEnum(format) << ", " << sharelist
72 << ")"); 73 << ")");
74 DCHECK(g_driver_osmesa.debug_fn.OSMesaCreateContextFn != nullptr);
73 OSMesaContext result = 75 OSMesaContext result =
74 g_driver_osmesa.debug_fn.OSMesaCreateContextFn(format, sharelist); 76 g_driver_osmesa.debug_fn.OSMesaCreateContextFn(format, sharelist);
75 GL_SERVICE_LOG("GL_RESULT: " << result); 77 GL_SERVICE_LOG("GL_RESULT: " << result);
76 return result; 78 return result;
77 } 79 }
78 80
79 static OSMesaContext GL_BINDING_CALL 81 static OSMesaContext GL_BINDING_CALL
80 Debug_OSMesaCreateContextExt(GLenum format, 82 Debug_OSMesaCreateContextExt(GLenum format,
81 GLint depthBits, 83 GLint depthBits,
82 GLint stencilBits, 84 GLint stencilBits,
83 GLint accumBits, 85 GLint accumBits,
84 OSMesaContext sharelist) { 86 OSMesaContext sharelist) {
85 GL_SERVICE_LOG("OSMesaCreateContextExt" 87 GL_SERVICE_LOG("OSMesaCreateContextExt"
86 << "(" << GLEnums::GetStringEnum(format) << ", " << depthBits 88 << "(" << GLEnums::GetStringEnum(format) << ", " << depthBits
87 << ", " << stencilBits << ", " << accumBits << ", " 89 << ", " << stencilBits << ", " << accumBits << ", "
88 << sharelist << ")"); 90 << sharelist << ")");
91 DCHECK(g_driver_osmesa.debug_fn.OSMesaCreateContextExtFn != nullptr);
89 OSMesaContext result = g_driver_osmesa.debug_fn.OSMesaCreateContextExtFn( 92 OSMesaContext result = g_driver_osmesa.debug_fn.OSMesaCreateContextExtFn(
90 format, depthBits, stencilBits, accumBits, sharelist); 93 format, depthBits, stencilBits, accumBits, sharelist);
91 GL_SERVICE_LOG("GL_RESULT: " << result); 94 GL_SERVICE_LOG("GL_RESULT: " << result);
92 return result; 95 return result;
93 } 96 }
94 97
95 static void GL_BINDING_CALL Debug_OSMesaDestroyContext(OSMesaContext ctx) { 98 static void GL_BINDING_CALL Debug_OSMesaDestroyContext(OSMesaContext ctx) {
96 GL_SERVICE_LOG("OSMesaDestroyContext" 99 GL_SERVICE_LOG("OSMesaDestroyContext"
97 << "(" << ctx << ")"); 100 << "(" << ctx << ")");
101 DCHECK(g_driver_osmesa.debug_fn.OSMesaDestroyContextFn != nullptr);
98 g_driver_osmesa.debug_fn.OSMesaDestroyContextFn(ctx); 102 g_driver_osmesa.debug_fn.OSMesaDestroyContextFn(ctx);
99 } 103 }
100 104
101 static GLboolean GL_BINDING_CALL Debug_OSMesaGetColorBuffer(OSMesaContext c, 105 static GLboolean GL_BINDING_CALL Debug_OSMesaGetColorBuffer(OSMesaContext c,
102 GLint* width, 106 GLint* width,
103 GLint* height, 107 GLint* height,
104 GLint* format, 108 GLint* format,
105 void** buffer) { 109 void** buffer) {
106 GL_SERVICE_LOG("OSMesaGetColorBuffer" 110 GL_SERVICE_LOG("OSMesaGetColorBuffer"
107 << "(" << c << ", " << static_cast<const void*>(width) << ", " 111 << "(" << c << ", " << static_cast<const void*>(width) << ", "
108 << static_cast<const void*>(height) << ", " 112 << static_cast<const void*>(height) << ", "
109 << static_cast<const void*>(format) << ", " << buffer << ")"); 113 << static_cast<const void*>(format) << ", " << buffer << ")");
114 DCHECK(g_driver_osmesa.debug_fn.OSMesaGetColorBufferFn != nullptr);
110 GLboolean result = g_driver_osmesa.debug_fn.OSMesaGetColorBufferFn( 115 GLboolean result = g_driver_osmesa.debug_fn.OSMesaGetColorBufferFn(
111 c, width, height, format, buffer); 116 c, width, height, format, buffer);
112 GL_SERVICE_LOG("GL_RESULT: " << result); 117 GL_SERVICE_LOG("GL_RESULT: " << result);
113 return result; 118 return result;
114 } 119 }
115 120
116 static OSMesaContext GL_BINDING_CALL Debug_OSMesaGetCurrentContext(void) { 121 static OSMesaContext GL_BINDING_CALL Debug_OSMesaGetCurrentContext(void) {
117 GL_SERVICE_LOG("OSMesaGetCurrentContext" 122 GL_SERVICE_LOG("OSMesaGetCurrentContext"
118 << "(" 123 << "("
119 << ")"); 124 << ")");
125 DCHECK(g_driver_osmesa.debug_fn.OSMesaGetCurrentContextFn != nullptr);
120 OSMesaContext result = g_driver_osmesa.debug_fn.OSMesaGetCurrentContextFn(); 126 OSMesaContext result = g_driver_osmesa.debug_fn.OSMesaGetCurrentContextFn();
121 GL_SERVICE_LOG("GL_RESULT: " << result); 127 GL_SERVICE_LOG("GL_RESULT: " << result);
122 return result; 128 return result;
123 } 129 }
124 130
125 static GLboolean GL_BINDING_CALL 131 static GLboolean GL_BINDING_CALL
126 Debug_OSMesaGetDepthBuffer(OSMesaContext c, 132 Debug_OSMesaGetDepthBuffer(OSMesaContext c,
127 GLint* width, 133 GLint* width,
128 GLint* height, 134 GLint* height,
129 GLint* bytesPerValue, 135 GLint* bytesPerValue,
130 void** buffer) { 136 void** buffer) {
131 GL_SERVICE_LOG("OSMesaGetDepthBuffer" 137 GL_SERVICE_LOG("OSMesaGetDepthBuffer"
132 << "(" << c << ", " << static_cast<const void*>(width) << ", " 138 << "(" << c << ", " << static_cast<const void*>(width) << ", "
133 << static_cast<const void*>(height) << ", " 139 << static_cast<const void*>(height) << ", "
134 << static_cast<const void*>(bytesPerValue) << ", " << buffer 140 << static_cast<const void*>(bytesPerValue) << ", " << buffer
135 << ")"); 141 << ")");
142 DCHECK(g_driver_osmesa.debug_fn.OSMesaGetDepthBufferFn != nullptr);
136 GLboolean result = g_driver_osmesa.debug_fn.OSMesaGetDepthBufferFn( 143 GLboolean result = g_driver_osmesa.debug_fn.OSMesaGetDepthBufferFn(
137 c, width, height, bytesPerValue, buffer); 144 c, width, height, bytesPerValue, buffer);
138 GL_SERVICE_LOG("GL_RESULT: " << result); 145 GL_SERVICE_LOG("GL_RESULT: " << result);
139 return result; 146 return result;
140 } 147 }
141 148
142 static void GL_BINDING_CALL Debug_OSMesaGetIntegerv(GLint pname, GLint* value) { 149 static void GL_BINDING_CALL Debug_OSMesaGetIntegerv(GLint pname, GLint* value) {
143 GL_SERVICE_LOG("OSMesaGetIntegerv" 150 GL_SERVICE_LOG("OSMesaGetIntegerv"
144 << "(" << pname << ", " << static_cast<const void*>(value) 151 << "(" << pname << ", " << static_cast<const void*>(value)
145 << ")"); 152 << ")");
153 DCHECK(g_driver_osmesa.debug_fn.OSMesaGetIntegervFn != nullptr);
146 g_driver_osmesa.debug_fn.OSMesaGetIntegervFn(pname, value); 154 g_driver_osmesa.debug_fn.OSMesaGetIntegervFn(pname, value);
147 } 155 }
148 156
149 static OSMESAproc GL_BINDING_CALL 157 static OSMESAproc GL_BINDING_CALL
150 Debug_OSMesaGetProcAddress(const char* funcName) { 158 Debug_OSMesaGetProcAddress(const char* funcName) {
151 GL_SERVICE_LOG("OSMesaGetProcAddress" 159 GL_SERVICE_LOG("OSMesaGetProcAddress"
152 << "(" << funcName << ")"); 160 << "(" << funcName << ")");
161 DCHECK(g_driver_osmesa.debug_fn.OSMesaGetProcAddressFn != nullptr);
153 OSMESAproc result = g_driver_osmesa.debug_fn.OSMesaGetProcAddressFn(funcName); 162 OSMESAproc result = g_driver_osmesa.debug_fn.OSMesaGetProcAddressFn(funcName);
154 GL_SERVICE_LOG("GL_RESULT: " << result); 163 GL_SERVICE_LOG("GL_RESULT: " << result);
155 return result; 164 return result;
156 } 165 }
157 166
158 static GLboolean GL_BINDING_CALL Debug_OSMesaMakeCurrent(OSMesaContext ctx, 167 static GLboolean GL_BINDING_CALL Debug_OSMesaMakeCurrent(OSMesaContext ctx,
159 void* buffer, 168 void* buffer,
160 GLenum type, 169 GLenum type,
161 GLsizei width, 170 GLsizei width,
162 GLsizei height) { 171 GLsizei height) {
163 GL_SERVICE_LOG("OSMesaMakeCurrent" 172 GL_SERVICE_LOG("OSMesaMakeCurrent"
164 << "(" << ctx << ", " << static_cast<const void*>(buffer) 173 << "(" << ctx << ", " << static_cast<const void*>(buffer)
165 << ", " << GLEnums::GetStringEnum(type) << ", " << width 174 << ", " << GLEnums::GetStringEnum(type) << ", " << width
166 << ", " << height << ")"); 175 << ", " << height << ")");
176 DCHECK(g_driver_osmesa.debug_fn.OSMesaMakeCurrentFn != nullptr);
167 GLboolean result = g_driver_osmesa.debug_fn.OSMesaMakeCurrentFn( 177 GLboolean result = g_driver_osmesa.debug_fn.OSMesaMakeCurrentFn(
168 ctx, buffer, type, width, height); 178 ctx, buffer, type, width, height);
169 GL_SERVICE_LOG("GL_RESULT: " << result); 179 GL_SERVICE_LOG("GL_RESULT: " << result);
170 return result; 180 return result;
171 } 181 }
172 182
173 static void GL_BINDING_CALL Debug_OSMesaPixelStore(GLint pname, GLint value) { 183 static void GL_BINDING_CALL Debug_OSMesaPixelStore(GLint pname, GLint value) {
174 GL_SERVICE_LOG("OSMesaPixelStore" 184 GL_SERVICE_LOG("OSMesaPixelStore"
175 << "(" << pname << ", " << value << ")"); 185 << "(" << pname << ", " << value << ")");
186 DCHECK(g_driver_osmesa.debug_fn.OSMesaPixelStoreFn != nullptr);
176 g_driver_osmesa.debug_fn.OSMesaPixelStoreFn(pname, value); 187 g_driver_osmesa.debug_fn.OSMesaPixelStoreFn(pname, value);
177 } 188 }
178 } // extern "C" 189 } // extern "C"
179 190
180 void DriverOSMESA::InitializeDebugBindings() { 191 void DriverOSMESA::InitializeDebugBindings() {
181 if (!debug_fn.OSMesaColorClampFn) { 192 if (!debug_fn.OSMesaColorClampFn) {
182 debug_fn.OSMesaColorClampFn = fn.OSMesaColorClampFn; 193 debug_fn.OSMesaColorClampFn = fn.OSMesaColorClampFn;
183 fn.OSMesaColorClampFn = Debug_OSMesaColorClamp; 194 fn.OSMesaColorClampFn = Debug_OSMesaColorClamp;
184 } 195 }
185 if (!debug_fn.OSMesaCreateContextFn) { 196 if (!debug_fn.OSMesaCreateContextFn) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaMakeCurrent") 372 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaMakeCurrent")
362 return osmesa_api_->OSMesaMakeCurrentFn(ctx, buffer, type, width, height); 373 return osmesa_api_->OSMesaMakeCurrentFn(ctx, buffer, type, width, height);
363 } 374 }
364 375
365 void TraceOSMESAApi::OSMesaPixelStoreFn(GLint pname, GLint value) { 376 void TraceOSMESAApi::OSMesaPixelStoreFn(GLint pname, GLint value) {
366 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaPixelStore") 377 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaPixelStore")
367 osmesa_api_->OSMesaPixelStoreFn(pname, value); 378 osmesa_api_->OSMesaPixelStoreFn(pname, value);
368 } 379 }
369 380
370 } // namespace gfx 381 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_bindings_autogen_glx.cc ('k') | ui/gl/gl_bindings_autogen_wgl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698