Fix search results being clipped in app list.
[chromium-blink-merge.git] / ui / gl / gl_bindings_autogen_osmesa.cc
blob299f9f28ab2c7575858ffac97969933da3f2c181
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
3 // found in the LICENSE file.
4 //
5 // This file is auto-generated from
6 // ui/gl/generate_bindings.py
7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT!
11 #include <string>
13 #include "base/trace_event/trace_event.h"
14 #include "ui/gl/gl_bindings.h"
15 #include "ui/gl/gl_context.h"
16 #include "ui/gl/gl_enums.h"
17 #include "ui/gl/gl_implementation.h"
18 #include "ui/gl/gl_osmesa_api_implementation.h"
19 #include "ui/gl/gl_version_info.h"
21 namespace gfx {
23 static bool g_debugBindingsInitialized;
24 DriverOSMESA g_driver_osmesa;
26 void DriverOSMESA::InitializeStaticBindings() {
27 fn.OSMesaColorClampFn = reinterpret_cast<OSMesaColorClampProc>(
28 GetGLProcAddress("OSMesaColorClamp"));
29 fn.OSMesaCreateContextFn = reinterpret_cast<OSMesaCreateContextProc>(
30 GetGLProcAddress("OSMesaCreateContext"));
31 fn.OSMesaCreateContextExtFn = reinterpret_cast<OSMesaCreateContextExtProc>(
32 GetGLProcAddress("OSMesaCreateContextExt"));
33 fn.OSMesaDestroyContextFn = reinterpret_cast<OSMesaDestroyContextProc>(
34 GetGLProcAddress("OSMesaDestroyContext"));
35 fn.OSMesaGetColorBufferFn = reinterpret_cast<OSMesaGetColorBufferProc>(
36 GetGLProcAddress("OSMesaGetColorBuffer"));
37 fn.OSMesaGetCurrentContextFn = reinterpret_cast<OSMesaGetCurrentContextProc>(
38 GetGLProcAddress("OSMesaGetCurrentContext"));
39 fn.OSMesaGetDepthBufferFn = reinterpret_cast<OSMesaGetDepthBufferProc>(
40 GetGLProcAddress("OSMesaGetDepthBuffer"));
41 fn.OSMesaGetIntegervFn = reinterpret_cast<OSMesaGetIntegervProc>(
42 GetGLProcAddress("OSMesaGetIntegerv"));
43 fn.OSMesaGetProcAddressFn = reinterpret_cast<OSMesaGetProcAddressProc>(
44 GetGLProcAddress("OSMesaGetProcAddress"));
45 fn.OSMesaMakeCurrentFn = reinterpret_cast<OSMesaMakeCurrentProc>(
46 GetGLProcAddress("OSMesaMakeCurrent"));
47 fn.OSMesaPixelStoreFn = reinterpret_cast<OSMesaPixelStoreProc>(
48 GetGLProcAddress("OSMesaPixelStore"));
49 std::string extensions(GetPlatformExtensions());
50 extensions += " ";
51 ALLOW_UNUSED_LOCAL(extensions);
53 if (g_debugBindingsInitialized)
54 InitializeDebugBindings();
57 extern "C" {
59 static void GL_BINDING_CALL Debug_OSMesaColorClamp(GLboolean enable) {
60 GL_SERVICE_LOG("OSMesaColorClamp"
61 << "(" << GLEnums::GetStringBool(enable) << ")");
62 g_driver_osmesa.debug_fn.OSMesaColorClampFn(enable);
65 static OSMesaContext GL_BINDING_CALL
66 Debug_OSMesaCreateContext(GLenum format, OSMesaContext sharelist) {
67 GL_SERVICE_LOG("OSMesaCreateContext"
68 << "(" << GLEnums::GetStringEnum(format) << ", " << sharelist
69 << ")");
70 OSMesaContext result =
71 g_driver_osmesa.debug_fn.OSMesaCreateContextFn(format, sharelist);
72 GL_SERVICE_LOG("GL_RESULT: " << result);
73 return result;
76 static OSMesaContext GL_BINDING_CALL
77 Debug_OSMesaCreateContextExt(GLenum format,
78 GLint depthBits,
79 GLint stencilBits,
80 GLint accumBits,
81 OSMesaContext sharelist) {
82 GL_SERVICE_LOG("OSMesaCreateContextExt"
83 << "(" << GLEnums::GetStringEnum(format) << ", " << depthBits
84 << ", " << stencilBits << ", " << accumBits << ", "
85 << sharelist << ")");
86 OSMesaContext result = g_driver_osmesa.debug_fn.OSMesaCreateContextExtFn(
87 format, depthBits, stencilBits, accumBits, sharelist);
88 GL_SERVICE_LOG("GL_RESULT: " << result);
89 return result;
92 static void GL_BINDING_CALL Debug_OSMesaDestroyContext(OSMesaContext ctx) {
93 GL_SERVICE_LOG("OSMesaDestroyContext"
94 << "(" << ctx << ")");
95 g_driver_osmesa.debug_fn.OSMesaDestroyContextFn(ctx);
98 static GLboolean GL_BINDING_CALL Debug_OSMesaGetColorBuffer(OSMesaContext c,
99 GLint* width,
100 GLint* height,
101 GLint* format,
102 void** buffer) {
103 GL_SERVICE_LOG("OSMesaGetColorBuffer"
104 << "(" << c << ", " << static_cast<const void*>(width) << ", "
105 << static_cast<const void*>(height) << ", "
106 << static_cast<const void*>(format) << ", " << buffer << ")");
107 GLboolean result = g_driver_osmesa.debug_fn.OSMesaGetColorBufferFn(
108 c, width, height, format, buffer);
109 GL_SERVICE_LOG("GL_RESULT: " << result);
110 return result;
113 static OSMesaContext GL_BINDING_CALL Debug_OSMesaGetCurrentContext(void) {
114 GL_SERVICE_LOG("OSMesaGetCurrentContext"
115 << "("
116 << ")");
117 OSMesaContext result = g_driver_osmesa.debug_fn.OSMesaGetCurrentContextFn();
118 GL_SERVICE_LOG("GL_RESULT: " << result);
119 return result;
122 static GLboolean GL_BINDING_CALL
123 Debug_OSMesaGetDepthBuffer(OSMesaContext c,
124 GLint* width,
125 GLint* height,
126 GLint* bytesPerValue,
127 void** buffer) {
128 GL_SERVICE_LOG("OSMesaGetDepthBuffer"
129 << "(" << c << ", " << static_cast<const void*>(width) << ", "
130 << static_cast<const void*>(height) << ", "
131 << static_cast<const void*>(bytesPerValue) << ", " << buffer
132 << ")");
133 GLboolean result = g_driver_osmesa.debug_fn.OSMesaGetDepthBufferFn(
134 c, width, height, bytesPerValue, buffer);
135 GL_SERVICE_LOG("GL_RESULT: " << result);
136 return result;
139 static void GL_BINDING_CALL Debug_OSMesaGetIntegerv(GLint pname, GLint* value) {
140 GL_SERVICE_LOG("OSMesaGetIntegerv"
141 << "(" << pname << ", " << static_cast<const void*>(value)
142 << ")");
143 g_driver_osmesa.debug_fn.OSMesaGetIntegervFn(pname, value);
146 static OSMESAproc GL_BINDING_CALL
147 Debug_OSMesaGetProcAddress(const char* funcName) {
148 GL_SERVICE_LOG("OSMesaGetProcAddress"
149 << "(" << funcName << ")");
150 OSMESAproc result = g_driver_osmesa.debug_fn.OSMesaGetProcAddressFn(funcName);
151 GL_SERVICE_LOG("GL_RESULT: " << result);
152 return result;
155 static GLboolean GL_BINDING_CALL Debug_OSMesaMakeCurrent(OSMesaContext ctx,
156 void* buffer,
157 GLenum type,
158 GLsizei width,
159 GLsizei height) {
160 GL_SERVICE_LOG("OSMesaMakeCurrent"
161 << "(" << ctx << ", " << static_cast<const void*>(buffer)
162 << ", " << GLEnums::GetStringEnum(type) << ", " << width
163 << ", " << height << ")");
164 GLboolean result = g_driver_osmesa.debug_fn.OSMesaMakeCurrentFn(
165 ctx, buffer, type, width, height);
166 GL_SERVICE_LOG("GL_RESULT: " << result);
167 return result;
170 static void GL_BINDING_CALL Debug_OSMesaPixelStore(GLint pname, GLint value) {
171 GL_SERVICE_LOG("OSMesaPixelStore"
172 << "(" << pname << ", " << value << ")");
173 g_driver_osmesa.debug_fn.OSMesaPixelStoreFn(pname, value);
175 } // extern "C"
177 void DriverOSMESA::InitializeDebugBindings() {
178 if (!debug_fn.OSMesaColorClampFn) {
179 debug_fn.OSMesaColorClampFn = fn.OSMesaColorClampFn;
180 fn.OSMesaColorClampFn = Debug_OSMesaColorClamp;
182 if (!debug_fn.OSMesaCreateContextFn) {
183 debug_fn.OSMesaCreateContextFn = fn.OSMesaCreateContextFn;
184 fn.OSMesaCreateContextFn = Debug_OSMesaCreateContext;
186 if (!debug_fn.OSMesaCreateContextExtFn) {
187 debug_fn.OSMesaCreateContextExtFn = fn.OSMesaCreateContextExtFn;
188 fn.OSMesaCreateContextExtFn = Debug_OSMesaCreateContextExt;
190 if (!debug_fn.OSMesaDestroyContextFn) {
191 debug_fn.OSMesaDestroyContextFn = fn.OSMesaDestroyContextFn;
192 fn.OSMesaDestroyContextFn = Debug_OSMesaDestroyContext;
194 if (!debug_fn.OSMesaGetColorBufferFn) {
195 debug_fn.OSMesaGetColorBufferFn = fn.OSMesaGetColorBufferFn;
196 fn.OSMesaGetColorBufferFn = Debug_OSMesaGetColorBuffer;
198 if (!debug_fn.OSMesaGetCurrentContextFn) {
199 debug_fn.OSMesaGetCurrentContextFn = fn.OSMesaGetCurrentContextFn;
200 fn.OSMesaGetCurrentContextFn = Debug_OSMesaGetCurrentContext;
202 if (!debug_fn.OSMesaGetDepthBufferFn) {
203 debug_fn.OSMesaGetDepthBufferFn = fn.OSMesaGetDepthBufferFn;
204 fn.OSMesaGetDepthBufferFn = Debug_OSMesaGetDepthBuffer;
206 if (!debug_fn.OSMesaGetIntegervFn) {
207 debug_fn.OSMesaGetIntegervFn = fn.OSMesaGetIntegervFn;
208 fn.OSMesaGetIntegervFn = Debug_OSMesaGetIntegerv;
210 if (!debug_fn.OSMesaGetProcAddressFn) {
211 debug_fn.OSMesaGetProcAddressFn = fn.OSMesaGetProcAddressFn;
212 fn.OSMesaGetProcAddressFn = Debug_OSMesaGetProcAddress;
214 if (!debug_fn.OSMesaMakeCurrentFn) {
215 debug_fn.OSMesaMakeCurrentFn = fn.OSMesaMakeCurrentFn;
216 fn.OSMesaMakeCurrentFn = Debug_OSMesaMakeCurrent;
218 if (!debug_fn.OSMesaPixelStoreFn) {
219 debug_fn.OSMesaPixelStoreFn = fn.OSMesaPixelStoreFn;
220 fn.OSMesaPixelStoreFn = Debug_OSMesaPixelStore;
222 g_debugBindingsInitialized = true;
225 void DriverOSMESA::ClearBindings() {
226 memset(this, 0, sizeof(*this));
229 void OSMESAApiBase::OSMesaColorClampFn(GLboolean enable) {
230 driver_->fn.OSMesaColorClampFn(enable);
233 OSMesaContext OSMESAApiBase::OSMesaCreateContextFn(GLenum format,
234 OSMesaContext sharelist) {
235 return driver_->fn.OSMesaCreateContextFn(format, sharelist);
238 OSMesaContext OSMESAApiBase::OSMesaCreateContextExtFn(GLenum format,
239 GLint depthBits,
240 GLint stencilBits,
241 GLint accumBits,
242 OSMesaContext sharelist) {
243 return driver_->fn.OSMesaCreateContextExtFn(format, depthBits, stencilBits,
244 accumBits, sharelist);
247 void OSMESAApiBase::OSMesaDestroyContextFn(OSMesaContext ctx) {
248 driver_->fn.OSMesaDestroyContextFn(ctx);
251 GLboolean OSMESAApiBase::OSMesaGetColorBufferFn(OSMesaContext c,
252 GLint* width,
253 GLint* height,
254 GLint* format,
255 void** buffer) {
256 return driver_->fn.OSMesaGetColorBufferFn(c, width, height, format, buffer);
259 OSMesaContext OSMESAApiBase::OSMesaGetCurrentContextFn(void) {
260 return driver_->fn.OSMesaGetCurrentContextFn();
263 GLboolean OSMESAApiBase::OSMesaGetDepthBufferFn(OSMesaContext c,
264 GLint* width,
265 GLint* height,
266 GLint* bytesPerValue,
267 void** buffer) {
268 return driver_->fn.OSMesaGetDepthBufferFn(c, width, height, bytesPerValue,
269 buffer);
272 void OSMESAApiBase::OSMesaGetIntegervFn(GLint pname, GLint* value) {
273 driver_->fn.OSMesaGetIntegervFn(pname, value);
276 OSMESAproc OSMESAApiBase::OSMesaGetProcAddressFn(const char* funcName) {
277 return driver_->fn.OSMesaGetProcAddressFn(funcName);
280 GLboolean OSMESAApiBase::OSMesaMakeCurrentFn(OSMesaContext ctx,
281 void* buffer,
282 GLenum type,
283 GLsizei width,
284 GLsizei height) {
285 return driver_->fn.OSMesaMakeCurrentFn(ctx, buffer, type, width, height);
288 void OSMESAApiBase::OSMesaPixelStoreFn(GLint pname, GLint value) {
289 driver_->fn.OSMesaPixelStoreFn(pname, value);
292 void TraceOSMESAApi::OSMesaColorClampFn(GLboolean enable) {
293 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaColorClamp")
294 osmesa_api_->OSMesaColorClampFn(enable);
297 OSMesaContext TraceOSMESAApi::OSMesaCreateContextFn(GLenum format,
298 OSMesaContext sharelist) {
299 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaCreateContext")
300 return osmesa_api_->OSMesaCreateContextFn(format, sharelist);
303 OSMesaContext TraceOSMESAApi::OSMesaCreateContextExtFn(
304 GLenum format,
305 GLint depthBits,
306 GLint stencilBits,
307 GLint accumBits,
308 OSMesaContext sharelist) {
309 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaCreateContextExt")
310 return osmesa_api_->OSMesaCreateContextExtFn(format, depthBits, stencilBits,
311 accumBits, sharelist);
314 void TraceOSMESAApi::OSMesaDestroyContextFn(OSMesaContext ctx) {
315 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaDestroyContext")
316 osmesa_api_->OSMesaDestroyContextFn(ctx);
319 GLboolean TraceOSMESAApi::OSMesaGetColorBufferFn(OSMesaContext c,
320 GLint* width,
321 GLint* height,
322 GLint* format,
323 void** buffer) {
324 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaGetColorBuffer")
325 return osmesa_api_->OSMesaGetColorBufferFn(c, width, height, format, buffer);
328 OSMesaContext TraceOSMESAApi::OSMesaGetCurrentContextFn(void) {
329 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaGetCurrentContext")
330 return osmesa_api_->OSMesaGetCurrentContextFn();
333 GLboolean TraceOSMESAApi::OSMesaGetDepthBufferFn(OSMesaContext c,
334 GLint* width,
335 GLint* height,
336 GLint* bytesPerValue,
337 void** buffer) {
338 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaGetDepthBuffer")
339 return osmesa_api_->OSMesaGetDepthBufferFn(c, width, height, bytesPerValue,
340 buffer);
343 void TraceOSMESAApi::OSMesaGetIntegervFn(GLint pname, GLint* value) {
344 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaGetIntegerv")
345 osmesa_api_->OSMesaGetIntegervFn(pname, value);
348 OSMESAproc TraceOSMESAApi::OSMesaGetProcAddressFn(const char* funcName) {
349 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaGetProcAddress")
350 return osmesa_api_->OSMesaGetProcAddressFn(funcName);
353 GLboolean TraceOSMESAApi::OSMesaMakeCurrentFn(OSMesaContext ctx,
354 void* buffer,
355 GLenum type,
356 GLsizei width,
357 GLsizei height) {
358 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaMakeCurrent")
359 return osmesa_api_->OSMesaMakeCurrentFn(ctx, buffer, type, width, height);
362 void TraceOSMESAApi::OSMesaPixelStoreFn(GLint pname, GLint value) {
363 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::OSMesaPixelStore")
364 osmesa_api_->OSMesaPixelStoreFn(pname, value);
367 } // namespace gfx