]> git.cworth.org Git - apitrace/blobdiff - retrace/glws_egl_xlib.cpp
stash: Trace and replay of gnome-shell works
[apitrace] / retrace / glws_egl_xlib.cpp
index 58824c29b2b897765e0af4c8fe36753e907ef79e..9c233f969b6f48574097031ad7d1c11b1cff3e5c 100644 (file)
@@ -92,8 +92,9 @@ public:
     EGLSurface surface;
     EGLint api;
 
-    EglDrawable(const Visual *vis, int w, int h) :
-        Drawable(vis, w, h), api(EGL_OPENGL_ES_API)
+    EglDrawable(const Visual *vis, int w, int h, bool pbuffer) :
+        Drawable(vis, w, h, pbuffer),
+        api(EGL_OPENGL_ES_API)
     {
         XVisualInfo *visinfo = static_cast<const EglVisual *>(visual)->visinfo;
 
@@ -393,9 +394,9 @@ createVisual(bool doubleBuffer, Profile profile) {
 }
 
 Drawable *
-createDrawable(const Visual *visual, int width, int height)
+createDrawable(const Visual *visual, int width, int height, bool pbuffer)
 {
-    return new EglDrawable(visual, width, height);
+    return new EglDrawable(visual, width, height, pbuffer);
 }
 
 Context *
@@ -480,5 +481,30 @@ processEvents(void) {
     return true;
 }
 
+void
+createWindow(Drawable *drawable, const Visual *_visual)
+{
+    EglDrawable *eglDrawable = static_cast<EglDrawable *>(drawable);
+    const EglVisual *visual = static_cast<const EglVisual *>(_visual);
+
+    eglDrawable->surface = eglCreateWindowSurface(display, visual->config,
+                                                  eglDrawable->window, NULL);
+}
+
+void
+destroyWindow(Drawable *drawable)
+{
+    EglDrawable *eglDrawable = static_cast<EglDrawable *>(drawable);
+
+    eglDestroySurface(display, eglDrawable->surface);
+}
+
+Pixmap
+createPixmap(unsigned width, unsigned height, unsigned depth)
+{
+    return XCreatePixmap(display, DefaultRootWindow(display),
+                         width, height, depth);
+}
+
 
 } /* namespace glws */