1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Mesa 3-D graphics library
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
5bf215546Sopenharmony_ci *
6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
8bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
9bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
11bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
12bf215546Sopenharmony_ci *
13bf215546Sopenharmony_ci * The above copyright notice and this permission notice shall be included
14bf215546Sopenharmony_ci * in all copies or substantial portions of the Software.
15bf215546Sopenharmony_ci *
16bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17bf215546Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20bf215546Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21bf215546Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22bf215546Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
23bf215546Sopenharmony_ci */
24bf215546Sopenharmony_ci
25bf215546Sopenharmony_ci
26bf215546Sopenharmony_ci
27bf215546Sopenharmony_ci/* Sample Usage:
28bf215546Sopenharmony_ci
29bf215546Sopenharmony_ciIn addition to the usual X calls to select a visual, create a colormap
30bf215546Sopenharmony_ciand create a window, you must do the following to use the X/Mesa interface:
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_ci1. Call XMesaCreateVisual() to make an XMesaVisual from an XVisualInfo.
33bf215546Sopenharmony_ci
34bf215546Sopenharmony_ci2. Call XMesaCreateContext() to create an X/Mesa rendering context, given
35bf215546Sopenharmony_ci   the XMesaVisual.
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ci3. Call XMesaCreateWindowBuffer() to create an XMesaBuffer from an X window
38bf215546Sopenharmony_ci   and XMesaVisual.
39bf215546Sopenharmony_ci
40bf215546Sopenharmony_ci4. Call XMesaMakeCurrent() to bind the XMesaBuffer to an XMesaContext and
41bf215546Sopenharmony_ci   to make the context the current one.
42bf215546Sopenharmony_ci
43bf215546Sopenharmony_ci5. Make gl* calls to render your graphics.
44bf215546Sopenharmony_ci
45bf215546Sopenharmony_ci6. Use XMesaSwapBuffers() when double buffering to swap front/back buffers.
46bf215546Sopenharmony_ci
47bf215546Sopenharmony_ci7. Before the X window is destroyed, call XMesaDestroyBuffer().
48bf215546Sopenharmony_ci
49bf215546Sopenharmony_ci8. Before exiting, call XMesaDestroyVisual and XMesaDestroyContext.
50bf215546Sopenharmony_ci
51bf215546Sopenharmony_ci*/
52bf215546Sopenharmony_ci
53bf215546Sopenharmony_ci
54bf215546Sopenharmony_ci
55bf215546Sopenharmony_ci
56bf215546Sopenharmony_ci#ifndef XM_API_H
57bf215546Sopenharmony_ci#define XM_API_H
58bf215546Sopenharmony_ci
59bf215546Sopenharmony_ci
60bf215546Sopenharmony_ci#include <stdbool.h>
61bf215546Sopenharmony_ci#include "main/glconfig.h" /* for gl_config */
62bf215546Sopenharmony_ci#include "frontend/api.h"
63bf215546Sopenharmony_ci#include "os/os_thread.h"
64bf215546Sopenharmony_ci
65bf215546Sopenharmony_ci#include "frontend/xlibsw_api.h"
66bf215546Sopenharmony_ci
67bf215546Sopenharmony_ci# include <X11/Xlib.h>
68bf215546Sopenharmony_ci# include <X11/Xlibint.h>
69bf215546Sopenharmony_ci# include <X11/Xutil.h>
70bf215546Sopenharmony_ci
71bf215546Sopenharmony_cistruct hud_context;
72bf215546Sopenharmony_ci
73bf215546Sopenharmony_citypedef struct xmesa_display *XMesaDisplay;
74bf215546Sopenharmony_citypedef struct xmesa_buffer *XMesaBuffer;
75bf215546Sopenharmony_citypedef struct xmesa_context *XMesaContext;
76bf215546Sopenharmony_citypedef struct xmesa_visual *XMesaVisual;
77bf215546Sopenharmony_ci
78bf215546Sopenharmony_ci
79bf215546Sopenharmony_cistruct xmesa_display {
80bf215546Sopenharmony_ci   mtx_t mutex;
81bf215546Sopenharmony_ci
82bf215546Sopenharmony_ci   Display *display;
83bf215546Sopenharmony_ci   struct pipe_screen *screen;
84bf215546Sopenharmony_ci   struct st_manager *smapi;
85bf215546Sopenharmony_ci
86bf215546Sopenharmony_ci   struct pipe_context *pipe;
87bf215546Sopenharmony_ci};
88bf215546Sopenharmony_ci
89bf215546Sopenharmony_ci
90bf215546Sopenharmony_ci/*
91bf215546Sopenharmony_ci * Create a new X/Mesa visual.
92bf215546Sopenharmony_ci * Input:  display - X11 display
93bf215546Sopenharmony_ci *         visinfo - an XVisualInfo pointer
94bf215546Sopenharmony_ci *         rgb_flag - GL_TRUE = RGB mode,
95bf215546Sopenharmony_ci *                    GL_FALSE = color index mode
96bf215546Sopenharmony_ci *         alpha_flag - alpha buffer requested?
97bf215546Sopenharmony_ci *         db_flag - GL_TRUE = double-buffered,
98bf215546Sopenharmony_ci *                   GL_FALSE = single buffered
99bf215546Sopenharmony_ci *         stereo_flag - stereo visual?
100bf215546Sopenharmony_ci *         ximage_flag - GL_TRUE = use an XImage for back buffer,
101bf215546Sopenharmony_ci *                       GL_FALSE = use an off-screen pixmap for back buffer
102bf215546Sopenharmony_ci *         depth_size - requested bits/depth values, or zero
103bf215546Sopenharmony_ci *         stencil_size - requested bits/stencil values, or zero
104bf215546Sopenharmony_ci *         accum_red_size - requested bits/red accum values, or zero
105bf215546Sopenharmony_ci *         accum_green_size - requested bits/green accum values, or zero
106bf215546Sopenharmony_ci *         accum_blue_size - requested bits/blue accum values, or zero
107bf215546Sopenharmony_ci *         accum_alpha_size - requested bits/alpha accum values, or zero
108bf215546Sopenharmony_ci *         num_samples - number of samples/pixel if multisampling, or zero
109bf215546Sopenharmony_ci *         level - visual level, usually 0
110bf215546Sopenharmony_ci *         visualCaveat - ala the GLX extension, usually GLX_NONE_EXT
111bf215546Sopenharmony_ci * Return;  a new XMesaVisual or 0 if error.
112bf215546Sopenharmony_ci */
113bf215546Sopenharmony_ciextern XMesaVisual XMesaCreateVisual( Display *display,
114bf215546Sopenharmony_ci                                      XVisualInfo * visinfo,
115bf215546Sopenharmony_ci                                      GLboolean rgb_flag,
116bf215546Sopenharmony_ci                                      GLboolean alpha_flag,
117bf215546Sopenharmony_ci                                      GLboolean db_flag,
118bf215546Sopenharmony_ci                                      GLboolean stereo_flag,
119bf215546Sopenharmony_ci                                      GLboolean ximage_flag,
120bf215546Sopenharmony_ci                                      GLint depth_size,
121bf215546Sopenharmony_ci                                      GLint stencil_size,
122bf215546Sopenharmony_ci                                      GLint accum_red_size,
123bf215546Sopenharmony_ci                                      GLint accum_green_size,
124bf215546Sopenharmony_ci                                      GLint accum_blue_size,
125bf215546Sopenharmony_ci                                      GLint accum_alpha_size,
126bf215546Sopenharmony_ci                                      GLint num_samples,
127bf215546Sopenharmony_ci                                      GLint level,
128bf215546Sopenharmony_ci                                      GLint visualCaveat );
129bf215546Sopenharmony_ci
130bf215546Sopenharmony_ci/*
131bf215546Sopenharmony_ci * Destroy an XMesaVisual, but not the associated XVisualInfo.
132bf215546Sopenharmony_ci */
133bf215546Sopenharmony_ciextern void XMesaDestroyVisual( XMesaVisual v );
134bf215546Sopenharmony_ci
135bf215546Sopenharmony_ci
136bf215546Sopenharmony_ci
137bf215546Sopenharmony_ci/*
138bf215546Sopenharmony_ci * Create a new XMesaContext for rendering into an X11 window.
139bf215546Sopenharmony_ci *
140bf215546Sopenharmony_ci * Input:  visual - an XMesaVisual
141bf215546Sopenharmony_ci *         share_list - another XMesaContext with which to share display
142bf215546Sopenharmony_ci *                      lists or NULL if no sharing is wanted.
143bf215546Sopenharmony_ci * Return:  an XMesaContext or NULL if error.
144bf215546Sopenharmony_ci */
145bf215546Sopenharmony_ciextern XMesaContext XMesaCreateContext( XMesaVisual v,
146bf215546Sopenharmony_ci					XMesaContext share_list,
147bf215546Sopenharmony_ci                                        GLuint major, GLuint minor,
148bf215546Sopenharmony_ci                                        GLuint profileMask,
149bf215546Sopenharmony_ci                                        GLuint contextFlags);
150bf215546Sopenharmony_ci
151bf215546Sopenharmony_ci
152bf215546Sopenharmony_ci/*
153bf215546Sopenharmony_ci * Destroy a rendering context as returned by XMesaCreateContext()
154bf215546Sopenharmony_ci */
155bf215546Sopenharmony_ciextern void XMesaDestroyContext( XMesaContext c );
156bf215546Sopenharmony_ci
157bf215546Sopenharmony_ci
158bf215546Sopenharmony_ci
159bf215546Sopenharmony_ci/*
160bf215546Sopenharmony_ci * Create an XMesaBuffer from an X window.
161bf215546Sopenharmony_ci */
162bf215546Sopenharmony_ciextern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, Window w );
163bf215546Sopenharmony_ci
164bf215546Sopenharmony_ci
165bf215546Sopenharmony_ci/*
166bf215546Sopenharmony_ci * Create an XMesaBuffer from an X pixmap.
167bf215546Sopenharmony_ci */
168bf215546Sopenharmony_ciextern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
169bf215546Sopenharmony_ci					    Pixmap p,
170bf215546Sopenharmony_ci					    Colormap cmap );
171bf215546Sopenharmony_ci
172bf215546Sopenharmony_ci
173bf215546Sopenharmony_ci/*
174bf215546Sopenharmony_ci * Destroy an XMesaBuffer, but not the corresponding window or pixmap.
175bf215546Sopenharmony_ci */
176bf215546Sopenharmony_ciextern void XMesaDestroyBuffer( XMesaBuffer b );
177bf215546Sopenharmony_ci
178bf215546Sopenharmony_ci
179bf215546Sopenharmony_ci/*
180bf215546Sopenharmony_ci * Return the XMesaBuffer handle which corresponds to an X drawable, if any.
181bf215546Sopenharmony_ci *
182bf215546Sopenharmony_ci * New in Mesa 2.3.
183bf215546Sopenharmony_ci */
184bf215546Sopenharmony_ciextern XMesaBuffer XMesaFindBuffer( Display *dpy,
185bf215546Sopenharmony_ci				    Drawable d );
186bf215546Sopenharmony_ci
187bf215546Sopenharmony_ci
188bf215546Sopenharmony_ci
189bf215546Sopenharmony_ci/*
190bf215546Sopenharmony_ci * Bind two buffers (read and draw) to a context and make the
191bf215546Sopenharmony_ci * context the current one.
192bf215546Sopenharmony_ci * New in Mesa 3.3
193bf215546Sopenharmony_ci */
194bf215546Sopenharmony_ciextern GLboolean XMesaMakeCurrent2( XMesaContext c,
195bf215546Sopenharmony_ci                                    XMesaBuffer drawBuffer,
196bf215546Sopenharmony_ci                                    XMesaBuffer readBuffer );
197bf215546Sopenharmony_ci
198bf215546Sopenharmony_ci
199bf215546Sopenharmony_ci/*
200bf215546Sopenharmony_ci * Unbind the current context from its buffer.
201bf215546Sopenharmony_ci */
202bf215546Sopenharmony_ciextern GLboolean XMesaUnbindContext( XMesaContext c );
203bf215546Sopenharmony_ci
204bf215546Sopenharmony_ci
205bf215546Sopenharmony_ci/*
206bf215546Sopenharmony_ci * Return a handle to the current context.
207bf215546Sopenharmony_ci */
208bf215546Sopenharmony_ciextern XMesaContext XMesaGetCurrentContext( void );
209bf215546Sopenharmony_ci
210bf215546Sopenharmony_ci
211bf215546Sopenharmony_ci/*
212bf215546Sopenharmony_ci * Swap the front and back buffers for the given buffer.  No action is
213bf215546Sopenharmony_ci * taken if the buffer is not double buffered.
214bf215546Sopenharmony_ci */
215bf215546Sopenharmony_ciextern void XMesaSwapBuffers( XMesaBuffer b );
216bf215546Sopenharmony_ci
217bf215546Sopenharmony_ci
218bf215546Sopenharmony_ci/*
219bf215546Sopenharmony_ci * Copy a sub-region of the back buffer to the front buffer.
220bf215546Sopenharmony_ci *
221bf215546Sopenharmony_ci * New in Mesa 2.6
222bf215546Sopenharmony_ci */
223bf215546Sopenharmony_ciextern void XMesaCopySubBuffer( XMesaBuffer b,
224bf215546Sopenharmony_ci				int x,
225bf215546Sopenharmony_ci				int y,
226bf215546Sopenharmony_ci				int width,
227bf215546Sopenharmony_ci				int height );
228bf215546Sopenharmony_ci
229bf215546Sopenharmony_ci
230bf215546Sopenharmony_ci
231bf215546Sopenharmony_ci
232bf215546Sopenharmony_ci
233bf215546Sopenharmony_ci/*
234bf215546Sopenharmony_ci * Flush/sync a context
235bf215546Sopenharmony_ci */
236bf215546Sopenharmony_ciextern void XMesaFlush( XMesaContext c );
237bf215546Sopenharmony_ci
238bf215546Sopenharmony_ci
239bf215546Sopenharmony_ci
240bf215546Sopenharmony_ci/*
241bf215546Sopenharmony_ci * Scan for XMesaBuffers whose window/pixmap has been destroyed, then free
242bf215546Sopenharmony_ci * any memory used by that buffer.
243bf215546Sopenharmony_ci *
244bf215546Sopenharmony_ci * New in Mesa 2.3.
245bf215546Sopenharmony_ci */
246bf215546Sopenharmony_ciextern void XMesaGarbageCollect( void );
247bf215546Sopenharmony_ci
248bf215546Sopenharmony_ci
249bf215546Sopenharmony_ci
250bf215546Sopenharmony_ci/*
251bf215546Sopenharmony_ci * Create a pbuffer.
252bf215546Sopenharmony_ci * New in Mesa 4.1
253bf215546Sopenharmony_ci */
254bf215546Sopenharmony_ciextern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, Colormap cmap,
255bf215546Sopenharmony_ci                                      unsigned int width, unsigned int height);
256bf215546Sopenharmony_ci
257bf215546Sopenharmony_ci
258bf215546Sopenharmony_ci
259bf215546Sopenharmony_ci/*
260bf215546Sopenharmony_ci * Texture from Pixmap
261bf215546Sopenharmony_ci * New in Mesa 7.1
262bf215546Sopenharmony_ci */
263bf215546Sopenharmony_ciextern void
264bf215546Sopenharmony_ciXMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
265bf215546Sopenharmony_ci                  const int *attrib_list);
266bf215546Sopenharmony_ci
267bf215546Sopenharmony_ciextern void
268bf215546Sopenharmony_ciXMesaReleaseTexImage(Display *dpy, XMesaBuffer drawable, int buffer);
269bf215546Sopenharmony_ci
270bf215546Sopenharmony_ci
271bf215546Sopenharmony_ciextern XMesaBuffer
272bf215546Sopenharmony_ciXMesaCreatePixmapTextureBuffer(XMesaVisual v, Pixmap p,
273bf215546Sopenharmony_ci                               Colormap cmap,
274bf215546Sopenharmony_ci                               int format, int target, int mipmap);
275bf215546Sopenharmony_ci
276bf215546Sopenharmony_ci
277bf215546Sopenharmony_ciextern void
278bf215546Sopenharmony_ciXMesaCopyContext(XMesaContext src, XMesaContext dst, unsigned long mask);
279bf215546Sopenharmony_ci
280bf215546Sopenharmony_ci
281bf215546Sopenharmony_ci/***********************************************************************
282bf215546Sopenharmony_ci */
283bf215546Sopenharmony_ci
284bf215546Sopenharmony_ci/**
285bf215546Sopenharmony_ci * Visual inforation, derived from GLvisual.
286bf215546Sopenharmony_ci * Basically corresponds to an XVisualInfo.
287bf215546Sopenharmony_ci */
288bf215546Sopenharmony_cistruct xmesa_visual {
289bf215546Sopenharmony_ci   struct gl_config mesa_visual;/* Device independent visual parameters */
290bf215546Sopenharmony_ci   int screen, visualID, visualType;
291bf215546Sopenharmony_ci   Display *display;	/* The X11 display */
292bf215546Sopenharmony_ci   XVisualInfo * visinfo;	/* X's visual info (pointer to private copy) */
293bf215546Sopenharmony_ci   XVisualInfo *vishandle;	/* Only used in fakeglx.c */
294bf215546Sopenharmony_ci   GLint BitsPerPixel;		/* True bits per pixel for XImages */
295bf215546Sopenharmony_ci
296bf215546Sopenharmony_ci   GLboolean ximage_flag;	/* Use XImage for back buffer (not pixmap)? */
297bf215546Sopenharmony_ci
298bf215546Sopenharmony_ci   struct st_visual stvis;
299bf215546Sopenharmony_ci};
300bf215546Sopenharmony_ci
301bf215546Sopenharmony_ci
302bf215546Sopenharmony_ci/**
303bf215546Sopenharmony_ci * Context info, derived from st_context.
304bf215546Sopenharmony_ci * Basically corresponds to a GLXContext.
305bf215546Sopenharmony_ci */
306bf215546Sopenharmony_cistruct xmesa_context {
307bf215546Sopenharmony_ci   struct st_context_iface *st;
308bf215546Sopenharmony_ci   XMesaVisual xm_visual;	/** pixel format info */
309bf215546Sopenharmony_ci   XMesaBuffer xm_buffer;	/** current drawbuffer */
310bf215546Sopenharmony_ci   XMesaBuffer xm_read_buffer;  /** current readbuffer */
311bf215546Sopenharmony_ci   struct hud_context *hud;
312bf215546Sopenharmony_ci};
313bf215546Sopenharmony_ci
314bf215546Sopenharmony_ci
315bf215546Sopenharmony_ci/**
316bf215546Sopenharmony_ci * Types of X/GLX drawables we might render into.
317bf215546Sopenharmony_ci */
318bf215546Sopenharmony_citypedef enum {
319bf215546Sopenharmony_ci   WINDOW,          /* An X window */
320bf215546Sopenharmony_ci   GLXWINDOW,       /* GLX window */
321bf215546Sopenharmony_ci   PIXMAP,          /* GLX pixmap */
322bf215546Sopenharmony_ci   PBUFFER          /* GLX Pbuffer */
323bf215546Sopenharmony_ci} BufferType;
324bf215546Sopenharmony_ci
325bf215546Sopenharmony_ci
326bf215546Sopenharmony_ci/**
327bf215546Sopenharmony_ci * Framebuffer information, derived from.
328bf215546Sopenharmony_ci * Basically corresponds to a GLXDrawable.
329bf215546Sopenharmony_ci */
330bf215546Sopenharmony_cistruct xmesa_buffer {
331bf215546Sopenharmony_ci   struct st_framebuffer_iface *stfb;
332bf215546Sopenharmony_ci   struct xlib_drawable ws;
333bf215546Sopenharmony_ci
334bf215546Sopenharmony_ci   GLboolean wasCurrent;	/* was ever the current buffer? */
335bf215546Sopenharmony_ci   XMesaVisual xm_visual;	/* the X/Mesa visual */
336bf215546Sopenharmony_ci   Colormap cmap;		/* the X colormap */
337bf215546Sopenharmony_ci   BufferType type;             /* window, pixmap, pbuffer or glxwindow */
338bf215546Sopenharmony_ci
339bf215546Sopenharmony_ci   GLboolean largestPbuffer;    /**< for pbuffers */
340bf215546Sopenharmony_ci   GLboolean preservedContents; /**< for pbuffers */
341bf215546Sopenharmony_ci
342bf215546Sopenharmony_ci   XImage *tempImage;
343bf215546Sopenharmony_ci   unsigned long selectedEvents;/* for pbuffers only */
344bf215546Sopenharmony_ci
345bf215546Sopenharmony_ci
346bf215546Sopenharmony_ci   GC gc;			/* scratch GC for span, line, tri drawing */
347bf215546Sopenharmony_ci
348bf215546Sopenharmony_ci   /* GLX_EXT_texture_from_pixmap */
349bf215546Sopenharmony_ci   GLint TextureTarget; /** GLX_TEXTURE_1D_EXT, for example */
350bf215546Sopenharmony_ci   GLint TextureFormat; /** GLX_TEXTURE_FORMAT_RGB_EXT, for example */
351bf215546Sopenharmony_ci   GLint TextureMipmap; /** 0 or 1 */
352bf215546Sopenharmony_ci
353bf215546Sopenharmony_ci   struct xmesa_buffer *Next;	/* Linked list pointer: */
354bf215546Sopenharmony_ci
355bf215546Sopenharmony_ci   unsigned width, height;
356bf215546Sopenharmony_ci};
357bf215546Sopenharmony_ci
358bf215546Sopenharmony_ci
359bf215546Sopenharmony_ci
360bf215546Sopenharmony_ciextern const char *
361bf215546Sopenharmony_cixmesa_get_name(void);
362bf215546Sopenharmony_ci
363bf215546Sopenharmony_ciextern int
364bf215546Sopenharmony_cixmesa_init(Display *dpy);
365bf215546Sopenharmony_ci
366bf215546Sopenharmony_ciextern XMesaBuffer
367bf215546Sopenharmony_cixmesa_find_buffer(Display *dpy, Colormap cmap, XMesaBuffer notThis);
368bf215546Sopenharmony_ci
369bf215546Sopenharmony_ciextern void
370bf215546Sopenharmony_cixmesa_get_window_size(Display *dpy, XMesaBuffer b,
371bf215546Sopenharmony_ci                      GLuint *width, GLuint *height);
372bf215546Sopenharmony_ci
373bf215546Sopenharmony_ciextern void
374bf215546Sopenharmony_cixmesa_notify_invalid_buffer(XMesaBuffer b);
375bf215546Sopenharmony_ci
376bf215546Sopenharmony_ciextern void
377bf215546Sopenharmony_cixmesa_check_buffer_size(XMesaBuffer b);
378bf215546Sopenharmony_ci
379bf215546Sopenharmony_ciextern void
380bf215546Sopenharmony_cixmesa_destroy_buffers_on_display(Display *dpy);
381bf215546Sopenharmony_ci
382bf215546Sopenharmony_ciextern void
383bf215546Sopenharmony_cixmesa_close_display(Display *dpy);
384bf215546Sopenharmony_ci
385bf215546Sopenharmony_cistatic inline GLuint
386bf215546Sopenharmony_cixmesa_buffer_width(XMesaBuffer b)
387bf215546Sopenharmony_ci{
388bf215546Sopenharmony_ci   return b->width;
389bf215546Sopenharmony_ci}
390bf215546Sopenharmony_ci
391bf215546Sopenharmony_cistatic inline GLuint
392bf215546Sopenharmony_cixmesa_buffer_height(XMesaBuffer b)
393bf215546Sopenharmony_ci{
394bf215546Sopenharmony_ci   return b->height;
395bf215546Sopenharmony_ci}
396bf215546Sopenharmony_ci
397bf215546Sopenharmony_ciextern boolean xmesa_strict_invalidate;
398bf215546Sopenharmony_ci
399bf215546Sopenharmony_ci#endif
400