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

Side by Side Diff: ui/gl/gl_implementation.h

Issue 2189233003: Move last of platform dependent init from //ui/gl to //ui/gl/init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix return values. Created 4 years, 4 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_glx_api_implementation.h ('k') | ui/gl/gl_implementation_android.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_GL_GL_IMPLEMENTATION_H_ 5 #ifndef UI_GL_GL_IMPLEMENTATION_H_
6 #define UI_GL_GL_IMPLEMENTATION_H_ 6 #define UI_GL_GL_IMPLEMENTATION_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 19 matching lines...) Expand all
30 }; 30 };
31 31
32 struct GL_EXPORT GLWindowSystemBindingInfo { 32 struct GL_EXPORT GLWindowSystemBindingInfo {
33 GLWindowSystemBindingInfo(); 33 GLWindowSystemBindingInfo();
34 std::string vendor; 34 std::string vendor;
35 std::string version; 35 std::string version;
36 std::string extensions; 36 std::string extensions;
37 bool direct_rendering; 37 bool direct_rendering;
38 }; 38 };
39 39
40 GL_EXPORT void GetAllowedGLImplementations(
41 std::vector<GLImplementation>* impls);
42
43 #if defined(OS_WIN) 40 #if defined(OS_WIN)
44 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); 41 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name);
45 #else 42 #else
46 typedef void* (*GLGetProcAddressProc)(const char* name); 43 typedef void* (*GLGetProcAddressProc)(const char* name);
47 #endif 44 #endif
48 45
49 // Initialize stub methods for drawing operations in the GL bindings. The 46 // Initialize stub methods for drawing operations in the GL bindings. The
50 // null draw bindings default to enabled, so that draw operations do nothing. 47 // null draw bindings default to enabled, so that draw operations do nothing.
51 GL_EXPORT void InitializeNullDrawGLBindings(); 48 GL_EXPORT void InitializeNullDrawGLBindings();
52 49
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 96
100 // Find an entry point in the current GL implementation. Note that the function 97 // Find an entry point in the current GL implementation. Note that the function
101 // may return a non-null pointer to something else than the GL function if an 98 // may return a non-null pointer to something else than the GL function if an
102 // unsupported function is queried. Spec-compliant eglGetProcAddress and 99 // unsupported function is queried. Spec-compliant eglGetProcAddress and
103 // glxGetProcAddress are allowed to return garbage for unsupported functions, 100 // glxGetProcAddress are allowed to return garbage for unsupported functions,
104 // and when querying functions from the EGL library supplied by Android, it may 101 // and when querying functions from the EGL library supplied by Android, it may
105 // return a function that prints a log message about the function being 102 // return a function that prints a log message about the function being
106 // unsupported. 103 // unsupported.
107 GL_EXPORT void* GetGLProcAddress(const char* name); 104 GL_EXPORT void* GetGLProcAddress(const char* name);
108 105
109 // Return information about the GL window system binding implementation (e.g.,
110 // EGL, GLX, WGL). Returns true if the information was retrieved successfully.
111 GL_EXPORT bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info);
112
113 // Helper for fetching the OpenGL extensions from the current context. 106 // Helper for fetching the OpenGL extensions from the current context.
114 // This helper abstracts over differences between the desktop OpenGL 107 // This helper abstracts over differences between the desktop OpenGL
115 // core profile, and OpenGL ES and the compatibility profile. It's 108 // core profile, and OpenGL ES and the compatibility profile. It's
116 // intended for users of the bindings, not the implementation of the 109 // intended for users of the bindings, not the implementation of the
117 // bindings themselves. This is a relatively expensive call, so 110 // bindings themselves. This is a relatively expensive call, so
118 // callers should cache the result. 111 // callers should cache the result.
119 GL_EXPORT std::string GetGLExtensionsFromCurrentContext(); 112 GL_EXPORT std::string GetGLExtensionsFromCurrentContext();
120 113
121 // Helper for the GL bindings implementation to understand whether 114 // Helper for the GL bindings implementation to understand whether
122 // glGetString(GL_EXTENSIONS) or glGetStringi(GL_EXTENSIONS, i) will 115 // glGetString(GL_EXTENSIONS) or glGetStringi(GL_EXTENSIONS, i) will
123 // be used in the function above. 116 // be used in the function above.
124 GL_EXPORT bool WillUseGLGetStringForExtensions(); 117 GL_EXPORT bool WillUseGLGetStringForExtensions();
125 118
126 // Helpers to load a library and log error on failure. 119 // Helpers to load a library and log error on failure.
127 GL_EXPORT base::NativeLibrary LoadLibraryAndPrintError( 120 GL_EXPORT base::NativeLibrary LoadLibraryAndPrintError(
128 const base::FilePath::CharType* filename); 121 const base::FilePath::CharType* filename);
129 GL_EXPORT base::NativeLibrary LoadLibraryAndPrintError( 122 GL_EXPORT base::NativeLibrary LoadLibraryAndPrintError(
130 const base::FilePath& filename); 123 const base::FilePath& filename);
131 124
132 } // namespace gl 125 } // namespace gl
133 126
134 #endif // UI_GL_GL_IMPLEMENTATION_H_ 127 #endif // UI_GL_GL_IMPLEMENTATION_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_glx_api_implementation.h ('k') | ui/gl/gl_implementation_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698