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

Unified Diff: ui/gl/gl_bindings_autogen_wgl.cc

Issue 871763002: Make GL bindings conditional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments, try fix broken builds Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ui/gl/gl_bindings_autogen_wgl.cc
diff --git a/ui/gl/gl_bindings_autogen_wgl.cc b/ui/gl/gl_bindings_autogen_wgl.cc
index a28aaf66f44623579d221ad5272dd8deb8049532..04fcb0ffe970a5fba5dd863597c758c189e9e56f 100644
--- a/ui/gl/gl_bindings_autogen_wgl.cc
+++ b/ui/gl/gl_bindings_autogen_wgl.cc
@@ -23,21 +23,61 @@ namespace gfx {
static bool g_debugBindingsInitialized;
DriverWGL g_driver_wgl;
+BOOL wglChoosePixelFormatARBNotBound(HDC dc,
+ const int* int_attrib_list,
+ const float* float_attrib_list,
+ UINT max_formats,
+ int* formats,
+ UINT* num_formats) {
+ NOTREACHED();
+ return 0;
+}
+HPBUFFERARB wglCreatePbufferARBNotBound(HDC hDC,
+ int iPixelFormat,
+ int iWidth,
+ int iHeight,
+ const int* piAttribList) {
+ NOTREACHED();
+ return 0;
+}
+BOOL wglDestroyPbufferARBNotBound(HPBUFFERARB hPbuffer) {
+ NOTREACHED();
+ return 0;
+}
+HDC wglGetPbufferDCARBNotBound(HPBUFFERARB hPbuffer) {
+ NOTREACHED();
+ return 0;
+}
+BOOL wglQueryPbufferARBNotBound(HPBUFFERARB hPbuffer,
+ int iAttribute,
+ int* piValue) {
+ NOTREACHED();
+ return 0;
+}
+int wglReleasePbufferDCARBNotBound(HPBUFFERARB hPbuffer, HDC hDC) {
+ NOTREACHED();
+ return 0;
+}
+BOOL wglSwapIntervalEXTNotBound(int interval) {
+ NOTREACHED();
+ return 0;
+}
+
void DriverWGL::InitializeStaticBindings() {
fn.wglChoosePixelFormatARBFn = reinterpret_cast<wglChoosePixelFormatARBProc>(
- GetGLProcAddress("wglChoosePixelFormatARB"));
+ wglChoosePixelFormatARBNotBound);
fn.wglCopyContextFn =
reinterpret_cast<wglCopyContextProc>(GetGLProcAddress("wglCopyContext"));
fn.wglCreateContextFn = reinterpret_cast<wglCreateContextProc>(
GetGLProcAddress("wglCreateContext"));
fn.wglCreateLayerContextFn = reinterpret_cast<wglCreateLayerContextProc>(
GetGLProcAddress("wglCreateLayerContext"));
- fn.wglCreatePbufferARBFn = reinterpret_cast<wglCreatePbufferARBProc>(
- GetGLProcAddress("wglCreatePbufferARB"));
+ fn.wglCreatePbufferARBFn =
+ reinterpret_cast<wglCreatePbufferARBProc>(wglCreatePbufferARBNotBound);
fn.wglDeleteContextFn = reinterpret_cast<wglDeleteContextProc>(
GetGLProcAddress("wglDeleteContext"));
- fn.wglDestroyPbufferARBFn = reinterpret_cast<wglDestroyPbufferARBProc>(
- GetGLProcAddress("wglDestroyPbufferARB"));
+ fn.wglDestroyPbufferARBFn =
+ reinterpret_cast<wglDestroyPbufferARBProc>(wglDestroyPbufferARBNotBound);
fn.wglGetCurrentContextFn = reinterpret_cast<wglGetCurrentContextProc>(
GetGLProcAddress("wglGetCurrentContext"));
fn.wglGetCurrentDCFn = reinterpret_cast<wglGetCurrentDCProc>(
@@ -48,27 +88,22 @@ void DriverWGL::InitializeStaticBindings() {
fn.wglGetExtensionsStringEXTFn =
reinterpret_cast<wglGetExtensionsStringEXTProc>(
GetGLProcAddress("wglGetExtensionsStringEXT"));
- fn.wglGetPbufferDCARBFn = reinterpret_cast<wglGetPbufferDCARBProc>(
- GetGLProcAddress("wglGetPbufferDCARB"));
+ fn.wglGetPbufferDCARBFn =
+ reinterpret_cast<wglGetPbufferDCARBProc>(wglGetPbufferDCARBNotBound);
fn.wglMakeCurrentFn =
reinterpret_cast<wglMakeCurrentProc>(GetGLProcAddress("wglMakeCurrent"));
- fn.wglQueryPbufferARBFn = reinterpret_cast<wglQueryPbufferARBProc>(
- GetGLProcAddress("wglQueryPbufferARB"));
+ fn.wglQueryPbufferARBFn =
+ reinterpret_cast<wglQueryPbufferARBProc>(wglQueryPbufferARBNotBound);
fn.wglReleasePbufferDCARBFn = reinterpret_cast<wglReleasePbufferDCARBProc>(
- GetGLProcAddress("wglReleasePbufferDCARB"));
+ wglReleasePbufferDCARBNotBound);
fn.wglShareListsFn =
reinterpret_cast<wglShareListsProc>(GetGLProcAddress("wglShareLists"));
- fn.wglSwapIntervalEXTFn = reinterpret_cast<wglSwapIntervalEXTProc>(
- GetGLProcAddress("wglSwapIntervalEXT"));
+ fn.wglSwapIntervalEXTFn =
+ reinterpret_cast<wglSwapIntervalEXTProc>(wglSwapIntervalEXTNotBound);
fn.wglSwapLayerBuffersFn = reinterpret_cast<wglSwapLayerBuffersProc>(
GetGLProcAddress("wglSwapLayerBuffers"));
-}
-
-void DriverWGL::InitializeDynamicBindings(GLContext* context) {
- DCHECK(context && context->IsCurrent(NULL));
- const GLVersionInfo* ver = context->GetVersionInfo();
- ALLOW_UNUSED_LOCAL(ver);
- std::string extensions = context->GetExtensions() + " ";
+ std::string extensions(GetPlatformExtensions());
+ extensions += " ";
ALLOW_UNUSED_LOCAL(extensions);
ext.b_WGL_ARB_extensions_string =
@@ -82,6 +117,56 @@ void DriverWGL::InitializeDynamicBindings(GLContext* context) {
ext.b_WGL_EXT_swap_control =
extensions.find("WGL_EXT_swap_control ") != std::string::npos;
+ debug_fn.wglChoosePixelFormatARBFn = 0;
+ if (ext.b_WGL_ARB_pixel_format) {
+ fn.wglChoosePixelFormatARBFn =
+ reinterpret_cast<wglChoosePixelFormatARBProc>(
+ GetGLProcAddress("wglChoosePixelFormatARB"));
+ }
+ DCHECK(fn.wglChoosePixelFormatARBFn);
+
+ debug_fn.wglCreatePbufferARBFn = 0;
+ if (ext.b_WGL_ARB_pbuffer) {
+ fn.wglCreatePbufferARBFn = reinterpret_cast<wglCreatePbufferARBProc>(
+ GetGLProcAddress("wglCreatePbufferARB"));
+ }
+ DCHECK(fn.wglCreatePbufferARBFn);
+
+ debug_fn.wglDestroyPbufferARBFn = 0;
+ if (ext.b_WGL_ARB_pbuffer) {
+ fn.wglDestroyPbufferARBFn = reinterpret_cast<wglDestroyPbufferARBProc>(
+ GetGLProcAddress("wglDestroyPbufferARB"));
+ }
+ DCHECK(fn.wglDestroyPbufferARBFn);
+
+ debug_fn.wglGetPbufferDCARBFn = 0;
+ if (ext.b_WGL_ARB_pbuffer) {
+ fn.wglGetPbufferDCARBFn = reinterpret_cast<wglGetPbufferDCARBProc>(
+ GetGLProcAddress("wglGetPbufferDCARB"));
+ }
+ DCHECK(fn.wglGetPbufferDCARBFn);
+
+ debug_fn.wglQueryPbufferARBFn = 0;
+ if (ext.b_WGL_ARB_pbuffer) {
+ fn.wglQueryPbufferARBFn = reinterpret_cast<wglQueryPbufferARBProc>(
+ GetGLProcAddress("wglQueryPbufferARB"));
+ }
+ DCHECK(fn.wglQueryPbufferARBFn);
+
+ debug_fn.wglReleasePbufferDCARBFn = 0;
+ if (ext.b_WGL_ARB_pbuffer) {
+ fn.wglReleasePbufferDCARBFn = reinterpret_cast<wglReleasePbufferDCARBProc>(
+ GetGLProcAddress("wglReleasePbufferDCARB"));
+ }
+ DCHECK(fn.wglReleasePbufferDCARBFn);
+
+ debug_fn.wglSwapIntervalEXTFn = 0;
+ if (ext.b_WGL_EXT_swap_control) {
+ fn.wglSwapIntervalEXTFn = reinterpret_cast<wglSwapIntervalEXTProc>(
+ GetGLProcAddress("wglSwapIntervalEXT"));
+ }
+ DCHECK(fn.wglSwapIntervalEXTFn);
+
if (g_debugBindingsInitialized)
InitializeDebugBindings();
}

Powered by Google App Engine
This is Rietveld 408576698