1. 29 Oct, 2016 1 commit
  2. 22 Apr, 2015 1 commit
  3. 27 Jan, 2015 2 commits
  4. 08 Nov, 2014 1 commit
  5. 19 Sep, 2013 1 commit
  6. 29 Oct, 2012 4 commits
  7. 19 Oct, 2012 1 commit
  8. 29 Aug, 2012 1 commit
    • Chad Versace's avatar
      waffle: Fix waffle_*_get_native functions · b072d9ee
      Chad Versace authored
      This patch fixes all waffle_*_get_native functions for glx, x11_egl, and
      wayland. The functions never did work because I incorrectly implemented
      them like this:
      
          union waffle_native_display*
          glx_display_get_native(...)
          {
              struct waffle_glx_display *n_dpy = malloc(sizeof(*n_dpy));
              [fill n_dpy];
              return (union waffle_native_display*) n_dpy;
          }
      
      That implementation would have been correct if the union were defined as:
      
          union waffle_native_display {
              struct waffle_glx_display glx;
              ...
          };
      
      Instead, the union is defined as:
      
          union waffle_native_display {
              struct waffle_glx_display *glx;
              ...
          };
      
      Therefore, the correct implementation looks like this, modulo error
      checking:
      
          union waffle_native_display*
          glx_display_get_native(...)
          {
              union waffle_native_display *n_dpy = malloc(sizeof(*n_dpy));
              n_dpy->glx = malloc(sizeof(*n_dpy->glx));
              [fill n_dpy->glx];
              return n_dpy;
          }
      Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
      b072d9ee
  9. 23 Aug, 2012 1 commit
  10. 05 Jun, 2012 2 commits
  11. 03 Jun, 2012 1 commit
    • Chad Versace's avatar
      all: Replace tagged unions with a more traditional object model · 602fc904
      Chad Versace authored
      This rewrites the bulk of Waffle's code.
      
      When I first began writing Waffle, I wanted to experiment with
      a non-traditional object model that used tagged unions. Very soon I began
      to abhor the "innovative" decision. This patch replaces the tagged-union
      model with a more traditional object model (as found in the Linux kernel
      [1], Google's NaCl, libdrm, and many other places) that uses vtables and
      embedded structures.
      
      [1] Neil Brown. LWN, 2011 June 1. Object-oriented design patterns in the kernel.
          (Part 1: http://lwn.net/Articles/444910/).
          (Part 2: http://lwn.net/Articles/446317/).
      
      As an example of the new object model, below is an outline of how
      waffle_window_swap_buffers() is now implemeneted.
      
      // file: waffle_window.c
      
      bool
      waffle_window_swap_buffers(struct waffle_window *self)
      {
          struct wcore_window *wc_self = wcore_window(self); // safe cast
          // Check preconditions ...
          return wc_self->vtbl->swap_buffers(wc_self);
      }
      
      // file: wcore_window.h
      
      struct wcore_window_vtbl {
          bool
          (*swap_buffers)(struct wcore_window *self);
          // More member functions ...
      };
      
      struct wcore_window {
          const struct wcore_window_vtbl *vtbl;
          struct waffle_window {} wfl;
          // More members ...
      };
      
      // file: glx_window.h
      
      struct glx_window {
          struct wcore_window wcore;
          // More members ...
      };
      
      // file: glx_window.c
      
      static bool
      glx_window_swap_buffers(struct wcore_window *wc_self)
      {
          struct glx_window *self = glx_window(wc_self); // safe cast
          // Call glXSwapBuffers ...
          return true;
      }
      
      static const struct wcore_window_vtbl glx_window_wcore_vtbl = {
          .swap_buffers = glx_window_swap_buffers,
          // More members ...
      };
      Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
      602fc904
  12. 31 May, 2012 1 commit
  13. 23 May, 2012 1 commit
  14. 17 May, 2012 1 commit
  15. 12 May, 2012 1 commit
  16. 08 Apr, 2012 1 commit
    • Chad Versace's avatar
      xegl: Add xegl platform · 9730478f
      Chad Versace authored
      Define the following types:
          struct xegl_config
          struct xegl_context
          struct xegl_display
          struct xegl_platform
          struct xegl_window
      
      Implement the following functions, which includes all entries in the
      native dispatch table:
          xegl_config_choose
          xegl_config_destroy
          xegl_context_create
          xegl_context_destroy
          xegl_display_connect
          xegl_display_disconnect
          xegl_dlsym_gl
          xegl_get_proc_address
          xegl_make_current
          xegl_platform_create
          xegl_platform_destroy
          xegl_window_create
          xegl_window_destroy
          xegl_window_swap_buffers
      Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
      9730478f