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

Side by Side Diff: ui/gl/gl_bindings_autogen_wgl.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_osmesa.cc ('k') | no next file » | 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const float* float_attrib_list, 128 const float* float_attrib_list,
129 UINT max_formats, 129 UINT max_formats,
130 int* formats, 130 int* formats,
131 UINT* num_formats) { 131 UINT* num_formats) {
132 GL_SERVICE_LOG("wglChoosePixelFormatARB" 132 GL_SERVICE_LOG("wglChoosePixelFormatARB"
133 << "(" << dc << ", " 133 << "(" << dc << ", "
134 << static_cast<const void*>(int_attrib_list) << ", " 134 << static_cast<const void*>(int_attrib_list) << ", "
135 << static_cast<const void*>(float_attrib_list) << ", " 135 << static_cast<const void*>(float_attrib_list) << ", "
136 << max_formats << ", " << static_cast<const void*>(formats) 136 << max_formats << ", " << static_cast<const void*>(formats)
137 << ", " << static_cast<const void*>(num_formats) << ")"); 137 << ", " << static_cast<const void*>(num_formats) << ")");
138 DCHECK(g_driver_wgl.debug_fn.wglChoosePixelFormatARBFn != nullptr);
138 BOOL result = g_driver_wgl.debug_fn.wglChoosePixelFormatARBFn( 139 BOOL result = g_driver_wgl.debug_fn.wglChoosePixelFormatARBFn(
139 dc, int_attrib_list, float_attrib_list, max_formats, formats, 140 dc, int_attrib_list, float_attrib_list, max_formats, formats,
140 num_formats); 141 num_formats);
141 GL_SERVICE_LOG("GL_RESULT: " << result); 142 GL_SERVICE_LOG("GL_RESULT: " << result);
142 return result; 143 return result;
143 } 144 }
144 145
145 static BOOL GL_BINDING_CALL Debug_wglCopyContext(HGLRC hglrcSrc, 146 static BOOL GL_BINDING_CALL Debug_wglCopyContext(HGLRC hglrcSrc,
146 HGLRC hglrcDst, 147 HGLRC hglrcDst,
147 UINT mask) { 148 UINT mask) {
148 GL_SERVICE_LOG("wglCopyContext" 149 GL_SERVICE_LOG("wglCopyContext"
149 << "(" << hglrcSrc << ", " << hglrcDst << ", " << mask << ")"); 150 << "(" << hglrcSrc << ", " << hglrcDst << ", " << mask << ")");
151 DCHECK(g_driver_wgl.debug_fn.wglCopyContextFn != nullptr);
150 BOOL result = 152 BOOL result =
151 g_driver_wgl.debug_fn.wglCopyContextFn(hglrcSrc, hglrcDst, mask); 153 g_driver_wgl.debug_fn.wglCopyContextFn(hglrcSrc, hglrcDst, mask);
152 GL_SERVICE_LOG("GL_RESULT: " << result); 154 GL_SERVICE_LOG("GL_RESULT: " << result);
153 return result; 155 return result;
154 } 156 }
155 157
156 static HGLRC GL_BINDING_CALL Debug_wglCreateContext(HDC hdc) { 158 static HGLRC GL_BINDING_CALL Debug_wglCreateContext(HDC hdc) {
157 GL_SERVICE_LOG("wglCreateContext" 159 GL_SERVICE_LOG("wglCreateContext"
158 << "(" << hdc << ")"); 160 << "(" << hdc << ")");
161 DCHECK(g_driver_wgl.debug_fn.wglCreateContextFn != nullptr);
159 HGLRC result = g_driver_wgl.debug_fn.wglCreateContextFn(hdc); 162 HGLRC result = g_driver_wgl.debug_fn.wglCreateContextFn(hdc);
160 GL_SERVICE_LOG("GL_RESULT: " << result); 163 GL_SERVICE_LOG("GL_RESULT: " << result);
161 return result; 164 return result;
162 } 165 }
163 166
164 static HGLRC GL_BINDING_CALL Debug_wglCreateLayerContext(HDC hdc, 167 static HGLRC GL_BINDING_CALL Debug_wglCreateLayerContext(HDC hdc,
165 int iLayerPlane) { 168 int iLayerPlane) {
166 GL_SERVICE_LOG("wglCreateLayerContext" 169 GL_SERVICE_LOG("wglCreateLayerContext"
167 << "(" << hdc << ", " << iLayerPlane << ")"); 170 << "(" << hdc << ", " << iLayerPlane << ")");
171 DCHECK(g_driver_wgl.debug_fn.wglCreateLayerContextFn != nullptr);
168 HGLRC result = 172 HGLRC result =
169 g_driver_wgl.debug_fn.wglCreateLayerContextFn(hdc, iLayerPlane); 173 g_driver_wgl.debug_fn.wglCreateLayerContextFn(hdc, iLayerPlane);
170 GL_SERVICE_LOG("GL_RESULT: " << result); 174 GL_SERVICE_LOG("GL_RESULT: " << result);
171 return result; 175 return result;
172 } 176 }
173 177
174 static HPBUFFERARB GL_BINDING_CALL 178 static HPBUFFERARB GL_BINDING_CALL
175 Debug_wglCreatePbufferARB(HDC hDC, 179 Debug_wglCreatePbufferARB(HDC hDC,
176 int iPixelFormat, 180 int iPixelFormat,
177 int iWidth, 181 int iWidth,
178 int iHeight, 182 int iHeight,
179 const int* piAttribList) { 183 const int* piAttribList) {
180 GL_SERVICE_LOG("wglCreatePbufferARB" 184 GL_SERVICE_LOG("wglCreatePbufferARB"
181 << "(" << hDC << ", " << iPixelFormat << ", " << iWidth << ", " 185 << "(" << hDC << ", " << iPixelFormat << ", " << iWidth << ", "
182 << iHeight << ", " << static_cast<const void*>(piAttribList) 186 << iHeight << ", " << static_cast<const void*>(piAttribList)
183 << ")"); 187 << ")");
188 DCHECK(g_driver_wgl.debug_fn.wglCreatePbufferARBFn != nullptr);
184 HPBUFFERARB result = g_driver_wgl.debug_fn.wglCreatePbufferARBFn( 189 HPBUFFERARB result = g_driver_wgl.debug_fn.wglCreatePbufferARBFn(
185 hDC, iPixelFormat, iWidth, iHeight, piAttribList); 190 hDC, iPixelFormat, iWidth, iHeight, piAttribList);
186 GL_SERVICE_LOG("GL_RESULT: " << result); 191 GL_SERVICE_LOG("GL_RESULT: " << result);
187 return result; 192 return result;
188 } 193 }
189 194
190 static BOOL GL_BINDING_CALL Debug_wglDeleteContext(HGLRC hglrc) { 195 static BOOL GL_BINDING_CALL Debug_wglDeleteContext(HGLRC hglrc) {
191 GL_SERVICE_LOG("wglDeleteContext" 196 GL_SERVICE_LOG("wglDeleteContext"
192 << "(" << hglrc << ")"); 197 << "(" << hglrc << ")");
198 DCHECK(g_driver_wgl.debug_fn.wglDeleteContextFn != nullptr);
193 BOOL result = g_driver_wgl.debug_fn.wglDeleteContextFn(hglrc); 199 BOOL result = g_driver_wgl.debug_fn.wglDeleteContextFn(hglrc);
194 GL_SERVICE_LOG("GL_RESULT: " << result); 200 GL_SERVICE_LOG("GL_RESULT: " << result);
195 return result; 201 return result;
196 } 202 }
197 203
198 static BOOL GL_BINDING_CALL Debug_wglDestroyPbufferARB(HPBUFFERARB hPbuffer) { 204 static BOOL GL_BINDING_CALL Debug_wglDestroyPbufferARB(HPBUFFERARB hPbuffer) {
199 GL_SERVICE_LOG("wglDestroyPbufferARB" 205 GL_SERVICE_LOG("wglDestroyPbufferARB"
200 << "(" << hPbuffer << ")"); 206 << "(" << hPbuffer << ")");
207 DCHECK(g_driver_wgl.debug_fn.wglDestroyPbufferARBFn != nullptr);
201 BOOL result = g_driver_wgl.debug_fn.wglDestroyPbufferARBFn(hPbuffer); 208 BOOL result = g_driver_wgl.debug_fn.wglDestroyPbufferARBFn(hPbuffer);
202 GL_SERVICE_LOG("GL_RESULT: " << result); 209 GL_SERVICE_LOG("GL_RESULT: " << result);
203 return result; 210 return result;
204 } 211 }
205 212
206 static HGLRC GL_BINDING_CALL Debug_wglGetCurrentContext() { 213 static HGLRC GL_BINDING_CALL Debug_wglGetCurrentContext() {
207 GL_SERVICE_LOG("wglGetCurrentContext" 214 GL_SERVICE_LOG("wglGetCurrentContext"
208 << "(" 215 << "("
209 << ")"); 216 << ")");
217 DCHECK(g_driver_wgl.debug_fn.wglGetCurrentContextFn != nullptr);
210 HGLRC result = g_driver_wgl.debug_fn.wglGetCurrentContextFn(); 218 HGLRC result = g_driver_wgl.debug_fn.wglGetCurrentContextFn();
211 GL_SERVICE_LOG("GL_RESULT: " << result); 219 GL_SERVICE_LOG("GL_RESULT: " << result);
212 return result; 220 return result;
213 } 221 }
214 222
215 static HDC GL_BINDING_CALL Debug_wglGetCurrentDC() { 223 static HDC GL_BINDING_CALL Debug_wglGetCurrentDC() {
216 GL_SERVICE_LOG("wglGetCurrentDC" 224 GL_SERVICE_LOG("wglGetCurrentDC"
217 << "(" 225 << "("
218 << ")"); 226 << ")");
227 DCHECK(g_driver_wgl.debug_fn.wglGetCurrentDCFn != nullptr);
219 HDC result = g_driver_wgl.debug_fn.wglGetCurrentDCFn(); 228 HDC result = g_driver_wgl.debug_fn.wglGetCurrentDCFn();
220 GL_SERVICE_LOG("GL_RESULT: " << result); 229 GL_SERVICE_LOG("GL_RESULT: " << result);
221 return result; 230 return result;
222 } 231 }
223 232
224 static const char* GL_BINDING_CALL Debug_wglGetExtensionsStringARB(HDC hDC) { 233 static const char* GL_BINDING_CALL Debug_wglGetExtensionsStringARB(HDC hDC) {
225 GL_SERVICE_LOG("wglGetExtensionsStringARB" 234 GL_SERVICE_LOG("wglGetExtensionsStringARB"
226 << "(" << hDC << ")"); 235 << "(" << hDC << ")");
236 DCHECK(g_driver_wgl.debug_fn.wglGetExtensionsStringARBFn != nullptr);
227 const char* result = g_driver_wgl.debug_fn.wglGetExtensionsStringARBFn(hDC); 237 const char* result = g_driver_wgl.debug_fn.wglGetExtensionsStringARBFn(hDC);
228 GL_SERVICE_LOG("GL_RESULT: " << result); 238 GL_SERVICE_LOG("GL_RESULT: " << result);
229 return result; 239 return result;
230 } 240 }
231 241
232 static const char* GL_BINDING_CALL Debug_wglGetExtensionsStringEXT() { 242 static const char* GL_BINDING_CALL Debug_wglGetExtensionsStringEXT() {
233 GL_SERVICE_LOG("wglGetExtensionsStringEXT" 243 GL_SERVICE_LOG("wglGetExtensionsStringEXT"
234 << "(" 244 << "("
235 << ")"); 245 << ")");
246 DCHECK(g_driver_wgl.debug_fn.wglGetExtensionsStringEXTFn != nullptr);
236 const char* result = g_driver_wgl.debug_fn.wglGetExtensionsStringEXTFn(); 247 const char* result = g_driver_wgl.debug_fn.wglGetExtensionsStringEXTFn();
237 GL_SERVICE_LOG("GL_RESULT: " << result); 248 GL_SERVICE_LOG("GL_RESULT: " << result);
238 return result; 249 return result;
239 } 250 }
240 251
241 static HDC GL_BINDING_CALL Debug_wglGetPbufferDCARB(HPBUFFERARB hPbuffer) { 252 static HDC GL_BINDING_CALL Debug_wglGetPbufferDCARB(HPBUFFERARB hPbuffer) {
242 GL_SERVICE_LOG("wglGetPbufferDCARB" 253 GL_SERVICE_LOG("wglGetPbufferDCARB"
243 << "(" << hPbuffer << ")"); 254 << "(" << hPbuffer << ")");
255 DCHECK(g_driver_wgl.debug_fn.wglGetPbufferDCARBFn != nullptr);
244 HDC result = g_driver_wgl.debug_fn.wglGetPbufferDCARBFn(hPbuffer); 256 HDC result = g_driver_wgl.debug_fn.wglGetPbufferDCARBFn(hPbuffer);
245 GL_SERVICE_LOG("GL_RESULT: " << result); 257 GL_SERVICE_LOG("GL_RESULT: " << result);
246 return result; 258 return result;
247 } 259 }
248 260
249 static BOOL GL_BINDING_CALL Debug_wglMakeCurrent(HDC hdc, HGLRC hglrc) { 261 static BOOL GL_BINDING_CALL Debug_wglMakeCurrent(HDC hdc, HGLRC hglrc) {
250 GL_SERVICE_LOG("wglMakeCurrent" 262 GL_SERVICE_LOG("wglMakeCurrent"
251 << "(" << hdc << ", " << hglrc << ")"); 263 << "(" << hdc << ", " << hglrc << ")");
264 DCHECK(g_driver_wgl.debug_fn.wglMakeCurrentFn != nullptr);
252 BOOL result = g_driver_wgl.debug_fn.wglMakeCurrentFn(hdc, hglrc); 265 BOOL result = g_driver_wgl.debug_fn.wglMakeCurrentFn(hdc, hglrc);
253 GL_SERVICE_LOG("GL_RESULT: " << result); 266 GL_SERVICE_LOG("GL_RESULT: " << result);
254 return result; 267 return result;
255 } 268 }
256 269
257 static BOOL GL_BINDING_CALL Debug_wglQueryPbufferARB(HPBUFFERARB hPbuffer, 270 static BOOL GL_BINDING_CALL Debug_wglQueryPbufferARB(HPBUFFERARB hPbuffer,
258 int iAttribute, 271 int iAttribute,
259 int* piValue) { 272 int* piValue) {
260 GL_SERVICE_LOG("wglQueryPbufferARB" 273 GL_SERVICE_LOG("wglQueryPbufferARB"
261 << "(" << hPbuffer << ", " << iAttribute << ", " 274 << "(" << hPbuffer << ", " << iAttribute << ", "
262 << static_cast<const void*>(piValue) << ")"); 275 << static_cast<const void*>(piValue) << ")");
276 DCHECK(g_driver_wgl.debug_fn.wglQueryPbufferARBFn != nullptr);
263 BOOL result = 277 BOOL result =
264 g_driver_wgl.debug_fn.wglQueryPbufferARBFn(hPbuffer, iAttribute, piValue); 278 g_driver_wgl.debug_fn.wglQueryPbufferARBFn(hPbuffer, iAttribute, piValue);
265 GL_SERVICE_LOG("GL_RESULT: " << result); 279 GL_SERVICE_LOG("GL_RESULT: " << result);
266 return result; 280 return result;
267 } 281 }
268 282
269 static int GL_BINDING_CALL Debug_wglReleasePbufferDCARB(HPBUFFERARB hPbuffer, 283 static int GL_BINDING_CALL Debug_wglReleasePbufferDCARB(HPBUFFERARB hPbuffer,
270 HDC hDC) { 284 HDC hDC) {
271 GL_SERVICE_LOG("wglReleasePbufferDCARB" 285 GL_SERVICE_LOG("wglReleasePbufferDCARB"
272 << "(" << hPbuffer << ", " << hDC << ")"); 286 << "(" << hPbuffer << ", " << hDC << ")");
287 DCHECK(g_driver_wgl.debug_fn.wglReleasePbufferDCARBFn != nullptr);
273 int result = g_driver_wgl.debug_fn.wglReleasePbufferDCARBFn(hPbuffer, hDC); 288 int result = g_driver_wgl.debug_fn.wglReleasePbufferDCARBFn(hPbuffer, hDC);
274 GL_SERVICE_LOG("GL_RESULT: " << result); 289 GL_SERVICE_LOG("GL_RESULT: " << result);
275 return result; 290 return result;
276 } 291 }
277 292
278 static BOOL GL_BINDING_CALL Debug_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { 293 static BOOL GL_BINDING_CALL Debug_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) {
279 GL_SERVICE_LOG("wglShareLists" 294 GL_SERVICE_LOG("wglShareLists"
280 << "(" << hglrc1 << ", " << hglrc2 << ")"); 295 << "(" << hglrc1 << ", " << hglrc2 << ")");
296 DCHECK(g_driver_wgl.debug_fn.wglShareListsFn != nullptr);
281 BOOL result = g_driver_wgl.debug_fn.wglShareListsFn(hglrc1, hglrc2); 297 BOOL result = g_driver_wgl.debug_fn.wglShareListsFn(hglrc1, hglrc2);
282 GL_SERVICE_LOG("GL_RESULT: " << result); 298 GL_SERVICE_LOG("GL_RESULT: " << result);
283 return result; 299 return result;
284 } 300 }
285 301
286 static BOOL GL_BINDING_CALL Debug_wglSwapIntervalEXT(int interval) { 302 static BOOL GL_BINDING_CALL Debug_wglSwapIntervalEXT(int interval) {
287 GL_SERVICE_LOG("wglSwapIntervalEXT" 303 GL_SERVICE_LOG("wglSwapIntervalEXT"
288 << "(" << interval << ")"); 304 << "(" << interval << ")");
305 DCHECK(g_driver_wgl.debug_fn.wglSwapIntervalEXTFn != nullptr);
289 BOOL result = g_driver_wgl.debug_fn.wglSwapIntervalEXTFn(interval); 306 BOOL result = g_driver_wgl.debug_fn.wglSwapIntervalEXTFn(interval);
290 GL_SERVICE_LOG("GL_RESULT: " << result); 307 GL_SERVICE_LOG("GL_RESULT: " << result);
291 return result; 308 return result;
292 } 309 }
293 310
294 static BOOL GL_BINDING_CALL Debug_wglSwapLayerBuffers(HDC hdc, UINT fuPlanes) { 311 static BOOL GL_BINDING_CALL Debug_wglSwapLayerBuffers(HDC hdc, UINT fuPlanes) {
295 GL_SERVICE_LOG("wglSwapLayerBuffers" 312 GL_SERVICE_LOG("wglSwapLayerBuffers"
296 << "(" << hdc << ", " << fuPlanes << ")"); 313 << "(" << hdc << ", " << fuPlanes << ")");
314 DCHECK(g_driver_wgl.debug_fn.wglSwapLayerBuffersFn != nullptr);
297 BOOL result = g_driver_wgl.debug_fn.wglSwapLayerBuffersFn(hdc, fuPlanes); 315 BOOL result = g_driver_wgl.debug_fn.wglSwapLayerBuffersFn(hdc, fuPlanes);
298 GL_SERVICE_LOG("GL_RESULT: " << result); 316 GL_SERVICE_LOG("GL_RESULT: " << result);
299 return result; 317 return result;
300 } 318 }
301 } // extern "C" 319 } // extern "C"
302 320
303 void DriverWGL::InitializeDebugBindings() { 321 void DriverWGL::InitializeDebugBindings() {
304 if (!debug_fn.wglChoosePixelFormatARBFn) { 322 if (!debug_fn.wglChoosePixelFormatARBFn) {
305 debug_fn.wglChoosePixelFormatARBFn = fn.wglChoosePixelFormatARBFn; 323 debug_fn.wglChoosePixelFormatARBFn = fn.wglChoosePixelFormatARBFn;
306 fn.wglChoosePixelFormatARBFn = Debug_wglChoosePixelFormatARB; 324 fn.wglChoosePixelFormatARBFn = Debug_wglChoosePixelFormatARB;
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapIntervalEXT") 582 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapIntervalEXT")
565 return wgl_api_->wglSwapIntervalEXTFn(interval); 583 return wgl_api_->wglSwapIntervalEXTFn(interval);
566 } 584 }
567 585
568 BOOL TraceWGLApi::wglSwapLayerBuffersFn(HDC hdc, UINT fuPlanes) { 586 BOOL TraceWGLApi::wglSwapLayerBuffersFn(HDC hdc, UINT fuPlanes) {
569 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapLayerBuffers") 587 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::wglSwapLayerBuffers")
570 return wgl_api_->wglSwapLayerBuffersFn(hdc, fuPlanes); 588 return wgl_api_->wglSwapLayerBuffersFn(hdc, fuPlanes);
571 } 589 }
572 590
573 } // namespace gfx 591 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_bindings_autogen_osmesa.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698