gl_bindings_autogen_glx.cc 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. // Copyright 2016 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!
  10. #include <string>
  11. #include "base/trace_event/trace_event.h"
  12. #include "ui/gl/gl_bindings.h"
  13. #include "ui/gl/gl_context.h"
  14. #include "ui/gl/gl_enums.h"
  15. #include "ui/gl/gl_glx_api_implementation.h"
  16. #include "ui/gl/gl_implementation.h"
  17. #include "ui/gl/gl_version_info.h"
  18. namespace gl {
  19. DriverGLX g_driver_glx; // Exists in .bss
  20. void DriverGLX::InitializeStaticBindings() {
  21. // Ensure struct has been zero-initialized.
  22. char* this_bytes = reinterpret_cast<char*>(this);
  23. DCHECK(this_bytes[0] == 0);
  24. DCHECK(memcmp(this_bytes, this_bytes + 1, sizeof(*this) - 1) == 0);
  25. fn.glXChooseFBConfigFn = reinterpret_cast<glXChooseFBConfigProc>(
  26. GetGLProcAddress("glXChooseFBConfig"));
  27. fn.glXChooseVisualFn = reinterpret_cast<glXChooseVisualProc>(
  28. GetGLProcAddress("glXChooseVisual"));
  29. fn.glXCopyContextFn =
  30. reinterpret_cast<glXCopyContextProc>(GetGLProcAddress("glXCopyContext"));
  31. fn.glXCreateContextFn = reinterpret_cast<glXCreateContextProc>(
  32. GetGLProcAddress("glXCreateContext"));
  33. fn.glXCreateGLXPixmapFn = reinterpret_cast<glXCreateGLXPixmapProc>(
  34. GetGLProcAddress("glXCreateGLXPixmap"));
  35. fn.glXCreateNewContextFn = reinterpret_cast<glXCreateNewContextProc>(
  36. GetGLProcAddress("glXCreateNewContext"));
  37. fn.glXCreatePbufferFn = reinterpret_cast<glXCreatePbufferProc>(
  38. GetGLProcAddress("glXCreatePbuffer"));
  39. fn.glXCreatePixmapFn = reinterpret_cast<glXCreatePixmapProc>(
  40. GetGLProcAddress("glXCreatePixmap"));
  41. fn.glXCreateWindowFn = reinterpret_cast<glXCreateWindowProc>(
  42. GetGLProcAddress("glXCreateWindow"));
  43. fn.glXDestroyContextFn = reinterpret_cast<glXDestroyContextProc>(
  44. GetGLProcAddress("glXDestroyContext"));
  45. fn.glXDestroyGLXPixmapFn = reinterpret_cast<glXDestroyGLXPixmapProc>(
  46. GetGLProcAddress("glXDestroyGLXPixmap"));
  47. fn.glXDestroyPbufferFn = reinterpret_cast<glXDestroyPbufferProc>(
  48. GetGLProcAddress("glXDestroyPbuffer"));
  49. fn.glXDestroyPixmapFn = reinterpret_cast<glXDestroyPixmapProc>(
  50. GetGLProcAddress("glXDestroyPixmap"));
  51. fn.glXDestroyWindowFn = reinterpret_cast<glXDestroyWindowProc>(
  52. GetGLProcAddress("glXDestroyWindow"));
  53. fn.glXGetClientStringFn = reinterpret_cast<glXGetClientStringProc>(
  54. GetGLProcAddress("glXGetClientString"));
  55. fn.glXGetConfigFn =
  56. reinterpret_cast<glXGetConfigProc>(GetGLProcAddress("glXGetConfig"));
  57. fn.glXGetCurrentContextFn = reinterpret_cast<glXGetCurrentContextProc>(
  58. GetGLProcAddress("glXGetCurrentContext"));
  59. fn.glXGetCurrentDisplayFn = reinterpret_cast<glXGetCurrentDisplayProc>(
  60. GetGLProcAddress("glXGetCurrentDisplay"));
  61. fn.glXGetCurrentDrawableFn = reinterpret_cast<glXGetCurrentDrawableProc>(
  62. GetGLProcAddress("glXGetCurrentDrawable"));
  63. fn.glXGetCurrentReadDrawableFn =
  64. reinterpret_cast<glXGetCurrentReadDrawableProc>(
  65. GetGLProcAddress("glXGetCurrentReadDrawable"));
  66. fn.glXGetFBConfigAttribFn = reinterpret_cast<glXGetFBConfigAttribProc>(
  67. GetGLProcAddress("glXGetFBConfigAttrib"));
  68. fn.glXGetFBConfigsFn = reinterpret_cast<glXGetFBConfigsProc>(
  69. GetGLProcAddress("glXGetFBConfigs"));
  70. fn.glXGetSelectedEventFn = reinterpret_cast<glXGetSelectedEventProc>(
  71. GetGLProcAddress("glXGetSelectedEvent"));
  72. fn.glXGetVisualFromFBConfigFn =
  73. reinterpret_cast<glXGetVisualFromFBConfigProc>(
  74. GetGLProcAddress("glXGetVisualFromFBConfig"));
  75. fn.glXIsDirectFn =
  76. reinterpret_cast<glXIsDirectProc>(GetGLProcAddress("glXIsDirect"));
  77. fn.glXMakeContextCurrentFn = reinterpret_cast<glXMakeContextCurrentProc>(
  78. GetGLProcAddress("glXMakeContextCurrent"));
  79. fn.glXMakeCurrentFn =
  80. reinterpret_cast<glXMakeCurrentProc>(GetGLProcAddress("glXMakeCurrent"));
  81. fn.glXQueryContextFn = reinterpret_cast<glXQueryContextProc>(
  82. GetGLProcAddress("glXQueryContext"));
  83. fn.glXQueryDrawableFn = reinterpret_cast<glXQueryDrawableProc>(
  84. GetGLProcAddress("glXQueryDrawable"));
  85. fn.glXQueryExtensionFn = reinterpret_cast<glXQueryExtensionProc>(
  86. GetGLProcAddress("glXQueryExtension"));
  87. fn.glXQueryExtensionsStringFn =
  88. reinterpret_cast<glXQueryExtensionsStringProc>(
  89. GetGLProcAddress("glXQueryExtensionsString"));
  90. fn.glXQueryServerStringFn = reinterpret_cast<glXQueryServerStringProc>(
  91. GetGLProcAddress("glXQueryServerString"));
  92. fn.glXQueryVersionFn = reinterpret_cast<glXQueryVersionProc>(
  93. GetGLProcAddress("glXQueryVersion"));
  94. fn.glXSelectEventFn =
  95. reinterpret_cast<glXSelectEventProc>(GetGLProcAddress("glXSelectEvent"));
  96. fn.glXSwapBuffersFn =
  97. reinterpret_cast<glXSwapBuffersProc>(GetGLProcAddress("glXSwapBuffers"));
  98. fn.glXUseXFontFn =
  99. reinterpret_cast<glXUseXFontProc>(GetGLProcAddress("glXUseXFont"));
  100. fn.glXWaitGLFn =
  101. reinterpret_cast<glXWaitGLProc>(GetGLProcAddress("glXWaitGL"));
  102. fn.glXWaitXFn = reinterpret_cast<glXWaitXProc>(GetGLProcAddress("glXWaitX"));
  103. }
  104. void DriverGLX::InitializeExtensionBindings() {
  105. std::string platform_extensions(GetPlatformExtensions());
  106. [[maybe_unused]] gfx::ExtensionSet extensions(
  107. gfx::MakeExtensionSet(platform_extensions));
  108. ext.b_GLX_ARB_create_context =
  109. gfx::HasExtension(extensions, "GLX_ARB_create_context");
  110. ext.b_GLX_EXT_swap_control =
  111. gfx::HasExtension(extensions, "GLX_EXT_swap_control");
  112. ext.b_GLX_EXT_texture_from_pixmap =
  113. gfx::HasExtension(extensions, "GLX_EXT_texture_from_pixmap");
  114. ext.b_GLX_MESA_copy_sub_buffer =
  115. gfx::HasExtension(extensions, "GLX_MESA_copy_sub_buffer");
  116. ext.b_GLX_MESA_swap_control =
  117. gfx::HasExtension(extensions, "GLX_MESA_swap_control");
  118. ext.b_GLX_OML_sync_control =
  119. gfx::HasExtension(extensions, "GLX_OML_sync_control");
  120. ext.b_GLX_SGIX_fbconfig = gfx::HasExtension(extensions, "GLX_SGIX_fbconfig");
  121. ext.b_GLX_SGI_video_sync =
  122. gfx::HasExtension(extensions, "GLX_SGI_video_sync");
  123. if (ext.b_GLX_EXT_texture_from_pixmap) {
  124. fn.glXBindTexImageEXTFn = reinterpret_cast<glXBindTexImageEXTProc>(
  125. GetGLProcAddress("glXBindTexImageEXT"));
  126. }
  127. if (ext.b_GLX_MESA_copy_sub_buffer) {
  128. fn.glXCopySubBufferMESAFn = reinterpret_cast<glXCopySubBufferMESAProc>(
  129. GetGLProcAddress("glXCopySubBufferMESA"));
  130. }
  131. if (ext.b_GLX_ARB_create_context) {
  132. fn.glXCreateContextAttribsARBFn =
  133. reinterpret_cast<glXCreateContextAttribsARBProc>(
  134. GetGLProcAddress("glXCreateContextAttribsARB"));
  135. }
  136. if (ext.b_GLX_SGIX_fbconfig) {
  137. fn.glXGetFBConfigFromVisualSGIXFn =
  138. reinterpret_cast<glXGetFBConfigFromVisualSGIXProc>(
  139. GetGLProcAddress("glXGetFBConfigFromVisualSGIX"));
  140. }
  141. if (ext.b_GLX_OML_sync_control) {
  142. fn.glXGetMscRateOMLFn = reinterpret_cast<glXGetMscRateOMLProc>(
  143. GetGLProcAddress("glXGetMscRateOML"));
  144. }
  145. if (ext.b_GLX_OML_sync_control) {
  146. fn.glXGetSyncValuesOMLFn = reinterpret_cast<glXGetSyncValuesOMLProc>(
  147. GetGLProcAddress("glXGetSyncValuesOML"));
  148. }
  149. if (ext.b_GLX_EXT_texture_from_pixmap) {
  150. fn.glXReleaseTexImageEXTFn = reinterpret_cast<glXReleaseTexImageEXTProc>(
  151. GetGLProcAddress("glXReleaseTexImageEXT"));
  152. }
  153. if (ext.b_GLX_EXT_swap_control) {
  154. fn.glXSwapIntervalEXTFn = reinterpret_cast<glXSwapIntervalEXTProc>(
  155. GetGLProcAddress("glXSwapIntervalEXT"));
  156. }
  157. if (ext.b_GLX_MESA_swap_control) {
  158. fn.glXSwapIntervalMESAFn = reinterpret_cast<glXSwapIntervalMESAProc>(
  159. GetGLProcAddress("glXSwapIntervalMESA"));
  160. }
  161. if (ext.b_GLX_SGI_video_sync) {
  162. fn.glXWaitVideoSyncSGIFn = reinterpret_cast<glXWaitVideoSyncSGIProc>(
  163. GetGLProcAddress("glXWaitVideoSyncSGI"));
  164. }
  165. }
  166. void DriverGLX::ClearBindings() {
  167. memset(this, 0, sizeof(*this));
  168. }
  169. void GLXApiBase::glXBindTexImageEXTFn(Display* dpy,
  170. GLXDrawable drawable,
  171. int buffer,
  172. int* attribList) {
  173. driver_->fn.glXBindTexImageEXTFn(dpy, drawable, buffer, attribList);
  174. }
  175. GLXFBConfig* GLXApiBase::glXChooseFBConfigFn(Display* dpy,
  176. int screen,
  177. const int* attribList,
  178. int* nitems) {
  179. return driver_->fn.glXChooseFBConfigFn(dpy, screen, attribList, nitems);
  180. }
  181. XVisualInfo* GLXApiBase::glXChooseVisualFn(Display* dpy,
  182. int screen,
  183. int* attribList) {
  184. return driver_->fn.glXChooseVisualFn(dpy, screen, attribList);
  185. }
  186. void GLXApiBase::glXCopyContextFn(Display* dpy,
  187. GLXContext src,
  188. GLXContext dst,
  189. unsigned long mask) {
  190. driver_->fn.glXCopyContextFn(dpy, src, dst, mask);
  191. }
  192. void GLXApiBase::glXCopySubBufferMESAFn(Display* dpy,
  193. GLXDrawable drawable,
  194. int x,
  195. int y,
  196. int width,
  197. int height) {
  198. driver_->fn.glXCopySubBufferMESAFn(dpy, drawable, x, y, width, height);
  199. }
  200. GLXContext GLXApiBase::glXCreateContextFn(Display* dpy,
  201. XVisualInfo* vis,
  202. GLXContext shareList,
  203. int direct) {
  204. return driver_->fn.glXCreateContextFn(dpy, vis, shareList, direct);
  205. }
  206. GLXContext GLXApiBase::glXCreateContextAttribsARBFn(Display* dpy,
  207. GLXFBConfig config,
  208. GLXContext share_context,
  209. int direct,
  210. const int* attrib_list) {
  211. return driver_->fn.glXCreateContextAttribsARBFn(dpy, config, share_context,
  212. direct, attrib_list);
  213. }
  214. GLXPixmap GLXApiBase::glXCreateGLXPixmapFn(Display* dpy,
  215. XVisualInfo* visual,
  216. Pixmap pixmap) {
  217. return driver_->fn.glXCreateGLXPixmapFn(dpy, visual, pixmap);
  218. }
  219. GLXContext GLXApiBase::glXCreateNewContextFn(Display* dpy,
  220. GLXFBConfig config,
  221. int renderType,
  222. GLXContext shareList,
  223. int direct) {
  224. return driver_->fn.glXCreateNewContextFn(dpy, config, renderType, shareList,
  225. direct);
  226. }
  227. GLXPbuffer GLXApiBase::glXCreatePbufferFn(Display* dpy,
  228. GLXFBConfig config,
  229. const int* attribList) {
  230. return driver_->fn.glXCreatePbufferFn(dpy, config, attribList);
  231. }
  232. GLXPixmap GLXApiBase::glXCreatePixmapFn(Display* dpy,
  233. GLXFBConfig config,
  234. Pixmap pixmap,
  235. const int* attribList) {
  236. return driver_->fn.glXCreatePixmapFn(dpy, config, pixmap, attribList);
  237. }
  238. GLXWindow GLXApiBase::glXCreateWindowFn(Display* dpy,
  239. GLXFBConfig config,
  240. Window win,
  241. const int* attribList) {
  242. return driver_->fn.glXCreateWindowFn(dpy, config, win, attribList);
  243. }
  244. void GLXApiBase::glXDestroyContextFn(Display* dpy, GLXContext ctx) {
  245. driver_->fn.glXDestroyContextFn(dpy, ctx);
  246. }
  247. void GLXApiBase::glXDestroyGLXPixmapFn(Display* dpy, GLXPixmap pixmap) {
  248. driver_->fn.glXDestroyGLXPixmapFn(dpy, pixmap);
  249. }
  250. void GLXApiBase::glXDestroyPbufferFn(Display* dpy, GLXPbuffer pbuf) {
  251. driver_->fn.glXDestroyPbufferFn(dpy, pbuf);
  252. }
  253. void GLXApiBase::glXDestroyPixmapFn(Display* dpy, GLXPixmap pixmap) {
  254. driver_->fn.glXDestroyPixmapFn(dpy, pixmap);
  255. }
  256. void GLXApiBase::glXDestroyWindowFn(Display* dpy, GLXWindow window) {
  257. driver_->fn.glXDestroyWindowFn(dpy, window);
  258. }
  259. const char* GLXApiBase::glXGetClientStringFn(Display* dpy, int name) {
  260. return driver_->fn.glXGetClientStringFn(dpy, name);
  261. }
  262. int GLXApiBase::glXGetConfigFn(Display* dpy,
  263. XVisualInfo* visual,
  264. int attrib,
  265. int* value) {
  266. return driver_->fn.glXGetConfigFn(dpy, visual, attrib, value);
  267. }
  268. GLXContext GLXApiBase::glXGetCurrentContextFn(void) {
  269. return driver_->fn.glXGetCurrentContextFn();
  270. }
  271. Display* GLXApiBase::glXGetCurrentDisplayFn(void) {
  272. return driver_->fn.glXGetCurrentDisplayFn();
  273. }
  274. GLXDrawable GLXApiBase::glXGetCurrentDrawableFn(void) {
  275. return driver_->fn.glXGetCurrentDrawableFn();
  276. }
  277. GLXDrawable GLXApiBase::glXGetCurrentReadDrawableFn(void) {
  278. return driver_->fn.glXGetCurrentReadDrawableFn();
  279. }
  280. int GLXApiBase::glXGetFBConfigAttribFn(Display* dpy,
  281. GLXFBConfig config,
  282. int attribute,
  283. int* value) {
  284. return driver_->fn.glXGetFBConfigAttribFn(dpy, config, attribute, value);
  285. }
  286. GLXFBConfig GLXApiBase::glXGetFBConfigFromVisualSGIXFn(
  287. Display* dpy,
  288. XVisualInfo* visualInfo) {
  289. return driver_->fn.glXGetFBConfigFromVisualSGIXFn(dpy, visualInfo);
  290. }
  291. GLXFBConfig* GLXApiBase::glXGetFBConfigsFn(Display* dpy,
  292. int screen,
  293. int* nelements) {
  294. return driver_->fn.glXGetFBConfigsFn(dpy, screen, nelements);
  295. }
  296. bool GLXApiBase::glXGetMscRateOMLFn(Display* dpy,
  297. GLXDrawable drawable,
  298. int32_t* numerator,
  299. int32_t* denominator) {
  300. return driver_->fn.glXGetMscRateOMLFn(dpy, drawable, numerator, denominator);
  301. }
  302. void GLXApiBase::glXGetSelectedEventFn(Display* dpy,
  303. GLXDrawable drawable,
  304. unsigned long* mask) {
  305. driver_->fn.glXGetSelectedEventFn(dpy, drawable, mask);
  306. }
  307. bool GLXApiBase::glXGetSyncValuesOMLFn(Display* dpy,
  308. GLXDrawable drawable,
  309. int64_t* ust,
  310. int64_t* msc,
  311. int64_t* sbc) {
  312. return driver_->fn.glXGetSyncValuesOMLFn(dpy, drawable, ust, msc, sbc);
  313. }
  314. XVisualInfo* GLXApiBase::glXGetVisualFromFBConfigFn(Display* dpy,
  315. GLXFBConfig config) {
  316. return driver_->fn.glXGetVisualFromFBConfigFn(dpy, config);
  317. }
  318. int GLXApiBase::glXIsDirectFn(Display* dpy, GLXContext ctx) {
  319. return driver_->fn.glXIsDirectFn(dpy, ctx);
  320. }
  321. int GLXApiBase::glXMakeContextCurrentFn(Display* dpy,
  322. GLXDrawable draw,
  323. GLXDrawable read,
  324. GLXContext ctx) {
  325. return driver_->fn.glXMakeContextCurrentFn(dpy, draw, read, ctx);
  326. }
  327. int GLXApiBase::glXMakeCurrentFn(Display* dpy,
  328. GLXDrawable drawable,
  329. GLXContext ctx) {
  330. return driver_->fn.glXMakeCurrentFn(dpy, drawable, ctx);
  331. }
  332. int GLXApiBase::glXQueryContextFn(Display* dpy,
  333. GLXContext ctx,
  334. int attribute,
  335. int* value) {
  336. return driver_->fn.glXQueryContextFn(dpy, ctx, attribute, value);
  337. }
  338. void GLXApiBase::glXQueryDrawableFn(Display* dpy,
  339. GLXDrawable draw,
  340. int attribute,
  341. unsigned int* value) {
  342. driver_->fn.glXQueryDrawableFn(dpy, draw, attribute, value);
  343. }
  344. int GLXApiBase::glXQueryExtensionFn(Display* dpy, int* errorb, int* event) {
  345. return driver_->fn.glXQueryExtensionFn(dpy, errorb, event);
  346. }
  347. const char* GLXApiBase::glXQueryExtensionsStringFn(Display* dpy, int screen) {
  348. return driver_->fn.glXQueryExtensionsStringFn(dpy, screen);
  349. }
  350. const char* GLXApiBase::glXQueryServerStringFn(Display* dpy,
  351. int screen,
  352. int name) {
  353. return driver_->fn.glXQueryServerStringFn(dpy, screen, name);
  354. }
  355. int GLXApiBase::glXQueryVersionFn(Display* dpy, int* maj, int* min) {
  356. return driver_->fn.glXQueryVersionFn(dpy, maj, min);
  357. }
  358. void GLXApiBase::glXReleaseTexImageEXTFn(Display* dpy,
  359. GLXDrawable drawable,
  360. int buffer) {
  361. driver_->fn.glXReleaseTexImageEXTFn(dpy, drawable, buffer);
  362. }
  363. void GLXApiBase::glXSelectEventFn(Display* dpy,
  364. GLXDrawable drawable,
  365. unsigned long mask) {
  366. driver_->fn.glXSelectEventFn(dpy, drawable, mask);
  367. }
  368. void GLXApiBase::glXSwapBuffersFn(Display* dpy, GLXDrawable drawable) {
  369. driver_->fn.glXSwapBuffersFn(dpy, drawable);
  370. }
  371. void GLXApiBase::glXSwapIntervalEXTFn(Display* dpy,
  372. GLXDrawable drawable,
  373. int interval) {
  374. driver_->fn.glXSwapIntervalEXTFn(dpy, drawable, interval);
  375. }
  376. void GLXApiBase::glXSwapIntervalMESAFn(unsigned int interval) {
  377. driver_->fn.glXSwapIntervalMESAFn(interval);
  378. }
  379. void GLXApiBase::glXUseXFontFn(Font font, int first, int count, int list) {
  380. driver_->fn.glXUseXFontFn(font, first, count, list);
  381. }
  382. void GLXApiBase::glXWaitGLFn(void) {
  383. driver_->fn.glXWaitGLFn();
  384. }
  385. int GLXApiBase::glXWaitVideoSyncSGIFn(int divisor,
  386. int remainder,
  387. unsigned int* count) {
  388. return driver_->fn.glXWaitVideoSyncSGIFn(divisor, remainder, count);
  389. }
  390. void GLXApiBase::glXWaitXFn(void) {
  391. driver_->fn.glXWaitXFn();
  392. }
  393. void TraceGLXApi::glXBindTexImageEXTFn(Display* dpy,
  394. GLXDrawable drawable,
  395. int buffer,
  396. int* attribList) {
  397. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXBindTexImageEXT");
  398. glx_api_->glXBindTexImageEXTFn(dpy, drawable, buffer, attribList);
  399. }
  400. GLXFBConfig* TraceGLXApi::glXChooseFBConfigFn(Display* dpy,
  401. int screen,
  402. const int* attribList,
  403. int* nitems) {
  404. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXChooseFBConfig");
  405. return glx_api_->glXChooseFBConfigFn(dpy, screen, attribList, nitems);
  406. }
  407. XVisualInfo* TraceGLXApi::glXChooseVisualFn(Display* dpy,
  408. int screen,
  409. int* attribList) {
  410. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXChooseVisual");
  411. return glx_api_->glXChooseVisualFn(dpy, screen, attribList);
  412. }
  413. void TraceGLXApi::glXCopyContextFn(Display* dpy,
  414. GLXContext src,
  415. GLXContext dst,
  416. unsigned long mask) {
  417. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXCopyContext");
  418. glx_api_->glXCopyContextFn(dpy, src, dst, mask);
  419. }
  420. void TraceGLXApi::glXCopySubBufferMESAFn(Display* dpy,
  421. GLXDrawable drawable,
  422. int x,
  423. int y,
  424. int width,
  425. int height) {
  426. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXCopySubBufferMESA");
  427. glx_api_->glXCopySubBufferMESAFn(dpy, drawable, x, y, width, height);
  428. }
  429. GLXContext TraceGLXApi::glXCreateContextFn(Display* dpy,
  430. XVisualInfo* vis,
  431. GLXContext shareList,
  432. int direct) {
  433. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXCreateContext");
  434. return glx_api_->glXCreateContextFn(dpy, vis, shareList, direct);
  435. }
  436. GLXContext TraceGLXApi::glXCreateContextAttribsARBFn(Display* dpy,
  437. GLXFBConfig config,
  438. GLXContext share_context,
  439. int direct,
  440. const int* attrib_list) {
  441. TRACE_EVENT_BINARY_EFFICIENT0("gpu",
  442. "TraceGLXAPI::glXCreateContextAttribsARB");
  443. return glx_api_->glXCreateContextAttribsARBFn(dpy, config, share_context,
  444. direct, attrib_list);
  445. }
  446. GLXPixmap TraceGLXApi::glXCreateGLXPixmapFn(Display* dpy,
  447. XVisualInfo* visual,
  448. Pixmap pixmap) {
  449. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXCreateGLXPixmap");
  450. return glx_api_->glXCreateGLXPixmapFn(dpy, visual, pixmap);
  451. }
  452. GLXContext TraceGLXApi::glXCreateNewContextFn(Display* dpy,
  453. GLXFBConfig config,
  454. int renderType,
  455. GLXContext shareList,
  456. int direct) {
  457. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXCreateNewContext");
  458. return glx_api_->glXCreateNewContextFn(dpy, config, renderType, shareList,
  459. direct);
  460. }
  461. GLXPbuffer TraceGLXApi::glXCreatePbufferFn(Display* dpy,
  462. GLXFBConfig config,
  463. const int* attribList) {
  464. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXCreatePbuffer");
  465. return glx_api_->glXCreatePbufferFn(dpy, config, attribList);
  466. }
  467. GLXPixmap TraceGLXApi::glXCreatePixmapFn(Display* dpy,
  468. GLXFBConfig config,
  469. Pixmap pixmap,
  470. const int* attribList) {
  471. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXCreatePixmap");
  472. return glx_api_->glXCreatePixmapFn(dpy, config, pixmap, attribList);
  473. }
  474. GLXWindow TraceGLXApi::glXCreateWindowFn(Display* dpy,
  475. GLXFBConfig config,
  476. Window win,
  477. const int* attribList) {
  478. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXCreateWindow");
  479. return glx_api_->glXCreateWindowFn(dpy, config, win, attribList);
  480. }
  481. void TraceGLXApi::glXDestroyContextFn(Display* dpy, GLXContext ctx) {
  482. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXDestroyContext");
  483. glx_api_->glXDestroyContextFn(dpy, ctx);
  484. }
  485. void TraceGLXApi::glXDestroyGLXPixmapFn(Display* dpy, GLXPixmap pixmap) {
  486. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXDestroyGLXPixmap");
  487. glx_api_->glXDestroyGLXPixmapFn(dpy, pixmap);
  488. }
  489. void TraceGLXApi::glXDestroyPbufferFn(Display* dpy, GLXPbuffer pbuf) {
  490. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXDestroyPbuffer");
  491. glx_api_->glXDestroyPbufferFn(dpy, pbuf);
  492. }
  493. void TraceGLXApi::glXDestroyPixmapFn(Display* dpy, GLXPixmap pixmap) {
  494. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXDestroyPixmap");
  495. glx_api_->glXDestroyPixmapFn(dpy, pixmap);
  496. }
  497. void TraceGLXApi::glXDestroyWindowFn(Display* dpy, GLXWindow window) {
  498. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXDestroyWindow");
  499. glx_api_->glXDestroyWindowFn(dpy, window);
  500. }
  501. const char* TraceGLXApi::glXGetClientStringFn(Display* dpy, int name) {
  502. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetClientString");
  503. return glx_api_->glXGetClientStringFn(dpy, name);
  504. }
  505. int TraceGLXApi::glXGetConfigFn(Display* dpy,
  506. XVisualInfo* visual,
  507. int attrib,
  508. int* value) {
  509. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetConfig");
  510. return glx_api_->glXGetConfigFn(dpy, visual, attrib, value);
  511. }
  512. GLXContext TraceGLXApi::glXGetCurrentContextFn(void) {
  513. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetCurrentContext");
  514. return glx_api_->glXGetCurrentContextFn();
  515. }
  516. Display* TraceGLXApi::glXGetCurrentDisplayFn(void) {
  517. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetCurrentDisplay");
  518. return glx_api_->glXGetCurrentDisplayFn();
  519. }
  520. GLXDrawable TraceGLXApi::glXGetCurrentDrawableFn(void) {
  521. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetCurrentDrawable");
  522. return glx_api_->glXGetCurrentDrawableFn();
  523. }
  524. GLXDrawable TraceGLXApi::glXGetCurrentReadDrawableFn(void) {
  525. TRACE_EVENT_BINARY_EFFICIENT0("gpu",
  526. "TraceGLXAPI::glXGetCurrentReadDrawable");
  527. return glx_api_->glXGetCurrentReadDrawableFn();
  528. }
  529. int TraceGLXApi::glXGetFBConfigAttribFn(Display* dpy,
  530. GLXFBConfig config,
  531. int attribute,
  532. int* value) {
  533. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetFBConfigAttrib");
  534. return glx_api_->glXGetFBConfigAttribFn(dpy, config, attribute, value);
  535. }
  536. GLXFBConfig TraceGLXApi::glXGetFBConfigFromVisualSGIXFn(
  537. Display* dpy,
  538. XVisualInfo* visualInfo) {
  539. TRACE_EVENT_BINARY_EFFICIENT0("gpu",
  540. "TraceGLXAPI::glXGetFBConfigFromVisualSGIX");
  541. return glx_api_->glXGetFBConfigFromVisualSGIXFn(dpy, visualInfo);
  542. }
  543. GLXFBConfig* TraceGLXApi::glXGetFBConfigsFn(Display* dpy,
  544. int screen,
  545. int* nelements) {
  546. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetFBConfigs");
  547. return glx_api_->glXGetFBConfigsFn(dpy, screen, nelements);
  548. }
  549. bool TraceGLXApi::glXGetMscRateOMLFn(Display* dpy,
  550. GLXDrawable drawable,
  551. int32_t* numerator,
  552. int32_t* denominator) {
  553. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetMscRateOML");
  554. return glx_api_->glXGetMscRateOMLFn(dpy, drawable, numerator, denominator);
  555. }
  556. void TraceGLXApi::glXGetSelectedEventFn(Display* dpy,
  557. GLXDrawable drawable,
  558. unsigned long* mask) {
  559. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetSelectedEvent");
  560. glx_api_->glXGetSelectedEventFn(dpy, drawable, mask);
  561. }
  562. bool TraceGLXApi::glXGetSyncValuesOMLFn(Display* dpy,
  563. GLXDrawable drawable,
  564. int64_t* ust,
  565. int64_t* msc,
  566. int64_t* sbc) {
  567. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetSyncValuesOML");
  568. return glx_api_->glXGetSyncValuesOMLFn(dpy, drawable, ust, msc, sbc);
  569. }
  570. XVisualInfo* TraceGLXApi::glXGetVisualFromFBConfigFn(Display* dpy,
  571. GLXFBConfig config) {
  572. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXGetVisualFromFBConfig");
  573. return glx_api_->glXGetVisualFromFBConfigFn(dpy, config);
  574. }
  575. int TraceGLXApi::glXIsDirectFn(Display* dpy, GLXContext ctx) {
  576. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXIsDirect");
  577. return glx_api_->glXIsDirectFn(dpy, ctx);
  578. }
  579. int TraceGLXApi::glXMakeContextCurrentFn(Display* dpy,
  580. GLXDrawable draw,
  581. GLXDrawable read,
  582. GLXContext ctx) {
  583. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXMakeContextCurrent");
  584. return glx_api_->glXMakeContextCurrentFn(dpy, draw, read, ctx);
  585. }
  586. int TraceGLXApi::glXMakeCurrentFn(Display* dpy,
  587. GLXDrawable drawable,
  588. GLXContext ctx) {
  589. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXMakeCurrent");
  590. return glx_api_->glXMakeCurrentFn(dpy, drawable, ctx);
  591. }
  592. int TraceGLXApi::glXQueryContextFn(Display* dpy,
  593. GLXContext ctx,
  594. int attribute,
  595. int* value) {
  596. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXQueryContext");
  597. return glx_api_->glXQueryContextFn(dpy, ctx, attribute, value);
  598. }
  599. void TraceGLXApi::glXQueryDrawableFn(Display* dpy,
  600. GLXDrawable draw,
  601. int attribute,
  602. unsigned int* value) {
  603. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXQueryDrawable");
  604. glx_api_->glXQueryDrawableFn(dpy, draw, attribute, value);
  605. }
  606. int TraceGLXApi::glXQueryExtensionFn(Display* dpy, int* errorb, int* event) {
  607. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXQueryExtension");
  608. return glx_api_->glXQueryExtensionFn(dpy, errorb, event);
  609. }
  610. const char* TraceGLXApi::glXQueryExtensionsStringFn(Display* dpy, int screen) {
  611. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXQueryExtensionsString");
  612. return glx_api_->glXQueryExtensionsStringFn(dpy, screen);
  613. }
  614. const char* TraceGLXApi::glXQueryServerStringFn(Display* dpy,
  615. int screen,
  616. int name) {
  617. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXQueryServerString");
  618. return glx_api_->glXQueryServerStringFn(dpy, screen, name);
  619. }
  620. int TraceGLXApi::glXQueryVersionFn(Display* dpy, int* maj, int* min) {
  621. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXQueryVersion");
  622. return glx_api_->glXQueryVersionFn(dpy, maj, min);
  623. }
  624. void TraceGLXApi::glXReleaseTexImageEXTFn(Display* dpy,
  625. GLXDrawable drawable,
  626. int buffer) {
  627. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXReleaseTexImageEXT");
  628. glx_api_->glXReleaseTexImageEXTFn(dpy, drawable, buffer);
  629. }
  630. void TraceGLXApi::glXSelectEventFn(Display* dpy,
  631. GLXDrawable drawable,
  632. unsigned long mask) {
  633. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXSelectEvent");
  634. glx_api_->glXSelectEventFn(dpy, drawable, mask);
  635. }
  636. void TraceGLXApi::glXSwapBuffersFn(Display* dpy, GLXDrawable drawable) {
  637. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXSwapBuffers");
  638. glx_api_->glXSwapBuffersFn(dpy, drawable);
  639. }
  640. void TraceGLXApi::glXSwapIntervalEXTFn(Display* dpy,
  641. GLXDrawable drawable,
  642. int interval) {
  643. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXSwapIntervalEXT");
  644. glx_api_->glXSwapIntervalEXTFn(dpy, drawable, interval);
  645. }
  646. void TraceGLXApi::glXSwapIntervalMESAFn(unsigned int interval) {
  647. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXSwapIntervalMESA");
  648. glx_api_->glXSwapIntervalMESAFn(interval);
  649. }
  650. void TraceGLXApi::glXUseXFontFn(Font font, int first, int count, int list) {
  651. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXUseXFont");
  652. glx_api_->glXUseXFontFn(font, first, count, list);
  653. }
  654. void TraceGLXApi::glXWaitGLFn(void) {
  655. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXWaitGL");
  656. glx_api_->glXWaitGLFn();
  657. }
  658. int TraceGLXApi::glXWaitVideoSyncSGIFn(int divisor,
  659. int remainder,
  660. unsigned int* count) {
  661. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXWaitVideoSyncSGI");
  662. return glx_api_->glXWaitVideoSyncSGIFn(divisor, remainder, count);
  663. }
  664. void TraceGLXApi::glXWaitXFn(void) {
  665. TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLXAPI::glXWaitX");
  666. glx_api_->glXWaitXFn();
  667. }
  668. void LogGLXApi::glXBindTexImageEXTFn(Display* dpy,
  669. GLXDrawable drawable,
  670. int buffer,
  671. int* attribList) {
  672. GL_SERVICE_LOG("glXBindTexImageEXT"
  673. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  674. << ", " << buffer << ", "
  675. << static_cast<const void*>(attribList) << ")");
  676. glx_api_->glXBindTexImageEXTFn(dpy, drawable, buffer, attribList);
  677. }
  678. GLXFBConfig* LogGLXApi::glXChooseFBConfigFn(Display* dpy,
  679. int screen,
  680. const int* attribList,
  681. int* nitems) {
  682. GL_SERVICE_LOG("glXChooseFBConfig"
  683. << "(" << static_cast<const void*>(dpy) << ", " << screen
  684. << ", " << static_cast<const void*>(attribList) << ", "
  685. << static_cast<const void*>(nitems) << ")");
  686. GLXFBConfig* result =
  687. glx_api_->glXChooseFBConfigFn(dpy, screen, attribList, nitems);
  688. GL_SERVICE_LOG("GL_RESULT: " << result);
  689. return result;
  690. }
  691. XVisualInfo* LogGLXApi::glXChooseVisualFn(Display* dpy,
  692. int screen,
  693. int* attribList) {
  694. GL_SERVICE_LOG("glXChooseVisual"
  695. << "(" << static_cast<const void*>(dpy) << ", " << screen
  696. << ", " << static_cast<const void*>(attribList) << ")");
  697. XVisualInfo* result = glx_api_->glXChooseVisualFn(dpy, screen, attribList);
  698. GL_SERVICE_LOG("GL_RESULT: " << result);
  699. return result;
  700. }
  701. void LogGLXApi::glXCopyContextFn(Display* dpy,
  702. GLXContext src,
  703. GLXContext dst,
  704. unsigned long mask) {
  705. GL_SERVICE_LOG("glXCopyContext"
  706. << "(" << static_cast<const void*>(dpy) << ", " << src << ", "
  707. << dst << ", " << mask << ")");
  708. glx_api_->glXCopyContextFn(dpy, src, dst, mask);
  709. }
  710. void LogGLXApi::glXCopySubBufferMESAFn(Display* dpy,
  711. GLXDrawable drawable,
  712. int x,
  713. int y,
  714. int width,
  715. int height) {
  716. GL_SERVICE_LOG("glXCopySubBufferMESA"
  717. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  718. << ", " << x << ", " << y << ", " << width << ", " << height
  719. << ")");
  720. glx_api_->glXCopySubBufferMESAFn(dpy, drawable, x, y, width, height);
  721. }
  722. GLXContext LogGLXApi::glXCreateContextFn(Display* dpy,
  723. XVisualInfo* vis,
  724. GLXContext shareList,
  725. int direct) {
  726. GL_SERVICE_LOG("glXCreateContext"
  727. << "(" << static_cast<const void*>(dpy) << ", "
  728. << static_cast<const void*>(vis) << ", " << shareList << ", "
  729. << direct << ")");
  730. GLXContext result = glx_api_->glXCreateContextFn(dpy, vis, shareList, direct);
  731. GL_SERVICE_LOG("GL_RESULT: " << result);
  732. return result;
  733. }
  734. GLXContext LogGLXApi::glXCreateContextAttribsARBFn(Display* dpy,
  735. GLXFBConfig config,
  736. GLXContext share_context,
  737. int direct,
  738. const int* attrib_list) {
  739. GL_SERVICE_LOG("glXCreateContextAttribsARB"
  740. << "(" << static_cast<const void*>(dpy) << ", " << config
  741. << ", " << share_context << ", " << direct << ", "
  742. << static_cast<const void*>(attrib_list) << ")");
  743. GLXContext result = glx_api_->glXCreateContextAttribsARBFn(
  744. dpy, config, share_context, direct, attrib_list);
  745. GL_SERVICE_LOG("GL_RESULT: " << result);
  746. return result;
  747. }
  748. GLXPixmap LogGLXApi::glXCreateGLXPixmapFn(Display* dpy,
  749. XVisualInfo* visual,
  750. Pixmap pixmap) {
  751. GL_SERVICE_LOG("glXCreateGLXPixmap"
  752. << "(" << static_cast<const void*>(dpy) << ", "
  753. << static_cast<const void*>(visual) << ", " << pixmap << ")");
  754. GLXPixmap result = glx_api_->glXCreateGLXPixmapFn(dpy, visual, pixmap);
  755. GL_SERVICE_LOG("GL_RESULT: " << result);
  756. return result;
  757. }
  758. GLXContext LogGLXApi::glXCreateNewContextFn(Display* dpy,
  759. GLXFBConfig config,
  760. int renderType,
  761. GLXContext shareList,
  762. int direct) {
  763. GL_SERVICE_LOG("glXCreateNewContext"
  764. << "(" << static_cast<const void*>(dpy) << ", " << config
  765. << ", " << renderType << ", " << shareList << ", " << direct
  766. << ")");
  767. GLXContext result = glx_api_->glXCreateNewContextFn(dpy, config, renderType,
  768. shareList, direct);
  769. GL_SERVICE_LOG("GL_RESULT: " << result);
  770. return result;
  771. }
  772. GLXPbuffer LogGLXApi::glXCreatePbufferFn(Display* dpy,
  773. GLXFBConfig config,
  774. const int* attribList) {
  775. GL_SERVICE_LOG("glXCreatePbuffer"
  776. << "(" << static_cast<const void*>(dpy) << ", " << config
  777. << ", " << static_cast<const void*>(attribList) << ")");
  778. GLXPbuffer result = glx_api_->glXCreatePbufferFn(dpy, config, attribList);
  779. GL_SERVICE_LOG("GL_RESULT: " << result);
  780. return result;
  781. }
  782. GLXPixmap LogGLXApi::glXCreatePixmapFn(Display* dpy,
  783. GLXFBConfig config,
  784. Pixmap pixmap,
  785. const int* attribList) {
  786. GL_SERVICE_LOG("glXCreatePixmap"
  787. << "(" << static_cast<const void*>(dpy) << ", " << config
  788. << ", " << pixmap << ", "
  789. << static_cast<const void*>(attribList) << ")");
  790. GLXPixmap result =
  791. glx_api_->glXCreatePixmapFn(dpy, config, pixmap, attribList);
  792. GL_SERVICE_LOG("GL_RESULT: " << result);
  793. return result;
  794. }
  795. GLXWindow LogGLXApi::glXCreateWindowFn(Display* dpy,
  796. GLXFBConfig config,
  797. Window win,
  798. const int* attribList) {
  799. GL_SERVICE_LOG("glXCreateWindow"
  800. << "(" << static_cast<const void*>(dpy) << ", " << config
  801. << ", " << win << ", " << static_cast<const void*>(attribList)
  802. << ")");
  803. GLXWindow result = glx_api_->glXCreateWindowFn(dpy, config, win, attribList);
  804. GL_SERVICE_LOG("GL_RESULT: " << result);
  805. return result;
  806. }
  807. void LogGLXApi::glXDestroyContextFn(Display* dpy, GLXContext ctx) {
  808. GL_SERVICE_LOG("glXDestroyContext"
  809. << "(" << static_cast<const void*>(dpy) << ", " << ctx << ")");
  810. glx_api_->glXDestroyContextFn(dpy, ctx);
  811. }
  812. void LogGLXApi::glXDestroyGLXPixmapFn(Display* dpy, GLXPixmap pixmap) {
  813. GL_SERVICE_LOG("glXDestroyGLXPixmap"
  814. << "(" << static_cast<const void*>(dpy) << ", " << pixmap
  815. << ")");
  816. glx_api_->glXDestroyGLXPixmapFn(dpy, pixmap);
  817. }
  818. void LogGLXApi::glXDestroyPbufferFn(Display* dpy, GLXPbuffer pbuf) {
  819. GL_SERVICE_LOG("glXDestroyPbuffer"
  820. << "(" << static_cast<const void*>(dpy) << ", " << pbuf
  821. << ")");
  822. glx_api_->glXDestroyPbufferFn(dpy, pbuf);
  823. }
  824. void LogGLXApi::glXDestroyPixmapFn(Display* dpy, GLXPixmap pixmap) {
  825. GL_SERVICE_LOG("glXDestroyPixmap"
  826. << "(" << static_cast<const void*>(dpy) << ", " << pixmap
  827. << ")");
  828. glx_api_->glXDestroyPixmapFn(dpy, pixmap);
  829. }
  830. void LogGLXApi::glXDestroyWindowFn(Display* dpy, GLXWindow window) {
  831. GL_SERVICE_LOG("glXDestroyWindow"
  832. << "(" << static_cast<const void*>(dpy) << ", " << window
  833. << ")");
  834. glx_api_->glXDestroyWindowFn(dpy, window);
  835. }
  836. const char* LogGLXApi::glXGetClientStringFn(Display* dpy, int name) {
  837. GL_SERVICE_LOG("glXGetClientString"
  838. << "(" << static_cast<const void*>(dpy) << ", " << name
  839. << ")");
  840. const char* result = glx_api_->glXGetClientStringFn(dpy, name);
  841. GL_SERVICE_LOG("GL_RESULT: " << result);
  842. return result;
  843. }
  844. int LogGLXApi::glXGetConfigFn(Display* dpy,
  845. XVisualInfo* visual,
  846. int attrib,
  847. int* value) {
  848. GL_SERVICE_LOG("glXGetConfig"
  849. << "(" << static_cast<const void*>(dpy) << ", "
  850. << static_cast<const void*>(visual) << ", " << attrib << ", "
  851. << static_cast<const void*>(value) << ")");
  852. int result = glx_api_->glXGetConfigFn(dpy, visual, attrib, value);
  853. GL_SERVICE_LOG("GL_RESULT: " << result);
  854. return result;
  855. }
  856. GLXContext LogGLXApi::glXGetCurrentContextFn(void) {
  857. GL_SERVICE_LOG("glXGetCurrentContext"
  858. << "("
  859. << ")");
  860. GLXContext result = glx_api_->glXGetCurrentContextFn();
  861. GL_SERVICE_LOG("GL_RESULT: " << result);
  862. return result;
  863. }
  864. Display* LogGLXApi::glXGetCurrentDisplayFn(void) {
  865. GL_SERVICE_LOG("glXGetCurrentDisplay"
  866. << "("
  867. << ")");
  868. Display* result = glx_api_->glXGetCurrentDisplayFn();
  869. GL_SERVICE_LOG("GL_RESULT: " << result);
  870. return result;
  871. }
  872. GLXDrawable LogGLXApi::glXGetCurrentDrawableFn(void) {
  873. GL_SERVICE_LOG("glXGetCurrentDrawable"
  874. << "("
  875. << ")");
  876. GLXDrawable result = glx_api_->glXGetCurrentDrawableFn();
  877. GL_SERVICE_LOG("GL_RESULT: " << result);
  878. return result;
  879. }
  880. GLXDrawable LogGLXApi::glXGetCurrentReadDrawableFn(void) {
  881. GL_SERVICE_LOG("glXGetCurrentReadDrawable"
  882. << "("
  883. << ")");
  884. GLXDrawable result = glx_api_->glXGetCurrentReadDrawableFn();
  885. GL_SERVICE_LOG("GL_RESULT: " << result);
  886. return result;
  887. }
  888. int LogGLXApi::glXGetFBConfigAttribFn(Display* dpy,
  889. GLXFBConfig config,
  890. int attribute,
  891. int* value) {
  892. GL_SERVICE_LOG("glXGetFBConfigAttrib"
  893. << "(" << static_cast<const void*>(dpy) << ", " << config
  894. << ", " << attribute << ", " << static_cast<const void*>(value)
  895. << ")");
  896. int result = glx_api_->glXGetFBConfigAttribFn(dpy, config, attribute, value);
  897. GL_SERVICE_LOG("GL_RESULT: " << result);
  898. return result;
  899. }
  900. GLXFBConfig LogGLXApi::glXGetFBConfigFromVisualSGIXFn(Display* dpy,
  901. XVisualInfo* visualInfo) {
  902. GL_SERVICE_LOG("glXGetFBConfigFromVisualSGIX"
  903. << "(" << static_cast<const void*>(dpy) << ", "
  904. << static_cast<const void*>(visualInfo) << ")");
  905. GLXFBConfig result =
  906. glx_api_->glXGetFBConfigFromVisualSGIXFn(dpy, visualInfo);
  907. GL_SERVICE_LOG("GL_RESULT: " << result);
  908. return result;
  909. }
  910. GLXFBConfig* LogGLXApi::glXGetFBConfigsFn(Display* dpy,
  911. int screen,
  912. int* nelements) {
  913. GL_SERVICE_LOG("glXGetFBConfigs"
  914. << "(" << static_cast<const void*>(dpy) << ", " << screen
  915. << ", " << static_cast<const void*>(nelements) << ")");
  916. GLXFBConfig* result = glx_api_->glXGetFBConfigsFn(dpy, screen, nelements);
  917. GL_SERVICE_LOG("GL_RESULT: " << result);
  918. return result;
  919. }
  920. bool LogGLXApi::glXGetMscRateOMLFn(Display* dpy,
  921. GLXDrawable drawable,
  922. int32_t* numerator,
  923. int32_t* denominator) {
  924. GL_SERVICE_LOG("glXGetMscRateOML"
  925. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  926. << ", " << static_cast<const void*>(numerator) << ", "
  927. << static_cast<const void*>(denominator) << ")");
  928. bool result =
  929. glx_api_->glXGetMscRateOMLFn(dpy, drawable, numerator, denominator);
  930. GL_SERVICE_LOG("GL_RESULT: " << result);
  931. return result;
  932. }
  933. void LogGLXApi::glXGetSelectedEventFn(Display* dpy,
  934. GLXDrawable drawable,
  935. unsigned long* mask) {
  936. GL_SERVICE_LOG("glXGetSelectedEvent"
  937. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  938. << ", " << static_cast<const void*>(mask) << ")");
  939. glx_api_->glXGetSelectedEventFn(dpy, drawable, mask);
  940. }
  941. bool LogGLXApi::glXGetSyncValuesOMLFn(Display* dpy,
  942. GLXDrawable drawable,
  943. int64_t* ust,
  944. int64_t* msc,
  945. int64_t* sbc) {
  946. GL_SERVICE_LOG("glXGetSyncValuesOML"
  947. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  948. << ", " << static_cast<const void*>(ust) << ", "
  949. << static_cast<const void*>(msc) << ", "
  950. << static_cast<const void*>(sbc) << ")");
  951. bool result = glx_api_->glXGetSyncValuesOMLFn(dpy, drawable, ust, msc, sbc);
  952. GL_SERVICE_LOG("GL_RESULT: " << result);
  953. return result;
  954. }
  955. XVisualInfo* LogGLXApi::glXGetVisualFromFBConfigFn(Display* dpy,
  956. GLXFBConfig config) {
  957. GL_SERVICE_LOG("glXGetVisualFromFBConfig"
  958. << "(" << static_cast<const void*>(dpy) << ", " << config
  959. << ")");
  960. XVisualInfo* result = glx_api_->glXGetVisualFromFBConfigFn(dpy, config);
  961. GL_SERVICE_LOG("GL_RESULT: " << result);
  962. return result;
  963. }
  964. int LogGLXApi::glXIsDirectFn(Display* dpy, GLXContext ctx) {
  965. GL_SERVICE_LOG("glXIsDirect"
  966. << "(" << static_cast<const void*>(dpy) << ", " << ctx << ")");
  967. int result = glx_api_->glXIsDirectFn(dpy, ctx);
  968. GL_SERVICE_LOG("GL_RESULT: " << result);
  969. return result;
  970. }
  971. int LogGLXApi::glXMakeContextCurrentFn(Display* dpy,
  972. GLXDrawable draw,
  973. GLXDrawable read,
  974. GLXContext ctx) {
  975. GL_SERVICE_LOG("glXMakeContextCurrent"
  976. << "(" << static_cast<const void*>(dpy) << ", " << draw << ", "
  977. << read << ", " << ctx << ")");
  978. int result = glx_api_->glXMakeContextCurrentFn(dpy, draw, read, ctx);
  979. GL_SERVICE_LOG("GL_RESULT: " << result);
  980. return result;
  981. }
  982. int LogGLXApi::glXMakeCurrentFn(Display* dpy,
  983. GLXDrawable drawable,
  984. GLXContext ctx) {
  985. GL_SERVICE_LOG("glXMakeCurrent"
  986. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  987. << ", " << ctx << ")");
  988. int result = glx_api_->glXMakeCurrentFn(dpy, drawable, ctx);
  989. GL_SERVICE_LOG("GL_RESULT: " << result);
  990. return result;
  991. }
  992. int LogGLXApi::glXQueryContextFn(Display* dpy,
  993. GLXContext ctx,
  994. int attribute,
  995. int* value) {
  996. GL_SERVICE_LOG("glXQueryContext"
  997. << "(" << static_cast<const void*>(dpy) << ", " << ctx << ", "
  998. << attribute << ", " << static_cast<const void*>(value)
  999. << ")");
  1000. int result = glx_api_->glXQueryContextFn(dpy, ctx, attribute, value);
  1001. GL_SERVICE_LOG("GL_RESULT: " << result);
  1002. return result;
  1003. }
  1004. void LogGLXApi::glXQueryDrawableFn(Display* dpy,
  1005. GLXDrawable draw,
  1006. int attribute,
  1007. unsigned int* value) {
  1008. GL_SERVICE_LOG("glXQueryDrawable"
  1009. << "(" << static_cast<const void*>(dpy) << ", " << draw << ", "
  1010. << attribute << ", " << static_cast<const void*>(value)
  1011. << ")");
  1012. glx_api_->glXQueryDrawableFn(dpy, draw, attribute, value);
  1013. }
  1014. int LogGLXApi::glXQueryExtensionFn(Display* dpy, int* errorb, int* event) {
  1015. GL_SERVICE_LOG("glXQueryExtension"
  1016. << "(" << static_cast<const void*>(dpy) << ", "
  1017. << static_cast<const void*>(errorb) << ", "
  1018. << static_cast<const void*>(event) << ")");
  1019. int result = glx_api_->glXQueryExtensionFn(dpy, errorb, event);
  1020. GL_SERVICE_LOG("GL_RESULT: " << result);
  1021. return result;
  1022. }
  1023. const char* LogGLXApi::glXQueryExtensionsStringFn(Display* dpy, int screen) {
  1024. GL_SERVICE_LOG("glXQueryExtensionsString"
  1025. << "(" << static_cast<const void*>(dpy) << ", " << screen
  1026. << ")");
  1027. const char* result = glx_api_->glXQueryExtensionsStringFn(dpy, screen);
  1028. GL_SERVICE_LOG("GL_RESULT: " << result);
  1029. return result;
  1030. }
  1031. const char* LogGLXApi::glXQueryServerStringFn(Display* dpy,
  1032. int screen,
  1033. int name) {
  1034. GL_SERVICE_LOG("glXQueryServerString"
  1035. << "(" << static_cast<const void*>(dpy) << ", " << screen
  1036. << ", " << name << ")");
  1037. const char* result = glx_api_->glXQueryServerStringFn(dpy, screen, name);
  1038. GL_SERVICE_LOG("GL_RESULT: " << result);
  1039. return result;
  1040. }
  1041. int LogGLXApi::glXQueryVersionFn(Display* dpy, int* maj, int* min) {
  1042. GL_SERVICE_LOG("glXQueryVersion"
  1043. << "(" << static_cast<const void*>(dpy) << ", "
  1044. << static_cast<const void*>(maj) << ", "
  1045. << static_cast<const void*>(min) << ")");
  1046. int result = glx_api_->glXQueryVersionFn(dpy, maj, min);
  1047. GL_SERVICE_LOG("GL_RESULT: " << result);
  1048. return result;
  1049. }
  1050. void LogGLXApi::glXReleaseTexImageEXTFn(Display* dpy,
  1051. GLXDrawable drawable,
  1052. int buffer) {
  1053. GL_SERVICE_LOG("glXReleaseTexImageEXT"
  1054. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  1055. << ", " << buffer << ")");
  1056. glx_api_->glXReleaseTexImageEXTFn(dpy, drawable, buffer);
  1057. }
  1058. void LogGLXApi::glXSelectEventFn(Display* dpy,
  1059. GLXDrawable drawable,
  1060. unsigned long mask) {
  1061. GL_SERVICE_LOG("glXSelectEvent"
  1062. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  1063. << ", " << mask << ")");
  1064. glx_api_->glXSelectEventFn(dpy, drawable, mask);
  1065. }
  1066. void LogGLXApi::glXSwapBuffersFn(Display* dpy, GLXDrawable drawable) {
  1067. GL_SERVICE_LOG("glXSwapBuffers"
  1068. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  1069. << ")");
  1070. glx_api_->glXSwapBuffersFn(dpy, drawable);
  1071. }
  1072. void LogGLXApi::glXSwapIntervalEXTFn(Display* dpy,
  1073. GLXDrawable drawable,
  1074. int interval) {
  1075. GL_SERVICE_LOG("glXSwapIntervalEXT"
  1076. << "(" << static_cast<const void*>(dpy) << ", " << drawable
  1077. << ", " << interval << ")");
  1078. glx_api_->glXSwapIntervalEXTFn(dpy, drawable, interval);
  1079. }
  1080. void LogGLXApi::glXSwapIntervalMESAFn(unsigned int interval) {
  1081. GL_SERVICE_LOG("glXSwapIntervalMESA"
  1082. << "(" << interval << ")");
  1083. glx_api_->glXSwapIntervalMESAFn(interval);
  1084. }
  1085. void LogGLXApi::glXUseXFontFn(Font font, int first, int count, int list) {
  1086. GL_SERVICE_LOG("glXUseXFont"
  1087. << "(" << font << ", " << first << ", " << count << ", "
  1088. << list << ")");
  1089. glx_api_->glXUseXFontFn(font, first, count, list);
  1090. }
  1091. void LogGLXApi::glXWaitGLFn(void) {
  1092. GL_SERVICE_LOG("glXWaitGL"
  1093. << "("
  1094. << ")");
  1095. glx_api_->glXWaitGLFn();
  1096. }
  1097. int LogGLXApi::glXWaitVideoSyncSGIFn(int divisor,
  1098. int remainder,
  1099. unsigned int* count) {
  1100. GL_SERVICE_LOG("glXWaitVideoSyncSGI"
  1101. << "(" << divisor << ", " << remainder << ", "
  1102. << static_cast<const void*>(count) << ")");
  1103. int result = glx_api_->glXWaitVideoSyncSGIFn(divisor, remainder, count);
  1104. GL_SERVICE_LOG("GL_RESULT: " << result);
  1105. return result;
  1106. }
  1107. void LogGLXApi::glXWaitXFn(void) {
  1108. GL_SERVICE_LOG("glXWaitX"
  1109. << "("
  1110. << ")");
  1111. glx_api_->glXWaitXFn();
  1112. }
  1113. } // namespace gl