gallium: rename st_framebuffer_iface -> pipe_frontend_drawable, etc.
authorMarek Olšák <marek.olsak@amd.com>
Sun, 27 Nov 2022 21:46:24 +0000 (16:46 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 9 Dec 2022 13:14:03 +0000 (13:14 +0000)
Also rename:
    iface -> drawable
    stfb -> drawable (where it means dri_drawable and not st_framebuffer)
    stfbi -> drawable or pdrawable (if drawable exists)

pipe_frontend_drawable* is really just dri_drawable* for DRI, and WGL/GLX
have their own variants. This makes it easier to understand what kind of
object is being used.

I always wondered what st_framebuffer_iface, iface, stfbi, iface_stamp,
and iface_ID actually mean. Now those terms are gone forever.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>

23 files changed:
src/egl/drivers/wgl/egl_wgl.c
src/gallium/frontends/dri/dri2.c
src/gallium/frontends/dri/dri_drawable.c
src/gallium/frontends/dri/dri_drawable.h
src/gallium/frontends/dri/drisw.c
src/gallium/frontends/glx/xlib/xm_api.c
src/gallium/frontends/glx/xlib/xm_api.h
src/gallium/frontends/glx/xlib/xm_st.c
src/gallium/frontends/glx/xlib/xm_st.h
src/gallium/frontends/hgl/hgl.c
src/gallium/frontends/hgl/hgl_context.h
src/gallium/frontends/osmesa/osmesa.c
src/gallium/frontends/wgl/stw_context.c
src/gallium/frontends/wgl/stw_framebuffer.c
src/gallium/frontends/wgl/stw_framebuffer.h
src/gallium/frontends/wgl/stw_st.c
src/gallium/frontends/wgl/stw_st.h
src/gallium/include/frontend/api.h
src/gallium/targets/haiku-softpipe/GalliumContext.cpp
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_manager.c
src/mesa/state_tracker/st_manager.h

index 931c28b..a06574a 100644 (file)
@@ -733,7 +733,7 @@ wgl_bind_tex_image(_EGLDisplay *disp, _EGLSurface *surf, EGLint buffer)
    if (!_eglBindTexImage(disp, surf, buffer))
       return EGL_FALSE;
 
-   struct pipe_resource *pres = stw_get_framebuffer_resource(wgl_surf->fb->stfb, ST_ATTACHMENT_FRONT_LEFT);
+   struct pipe_resource *pres = stw_get_framebuffer_resource(wgl_surf->fb->drawable, ST_ATTACHMENT_FRONT_LEFT);
    enum pipe_format format = pres->format;
 
    switch (surf->TextureFormat) {
index 363df20..f6e3bf7 100644 (file)
@@ -455,7 +455,7 @@ handle_in_fence(struct dri_context *ctx, __DRIimage *img)
 }
 
 /*
- * Backend functions for st_framebuffer interface.
+ * Backend functions for pipe_frontend_drawable.
  */
 
 static void
index c036b70..2960c40 100644 (file)
@@ -44,13 +44,13 @@ static uint32_t drifb_ID = 0;
 
 static bool
 dri_st_framebuffer_validate(struct st_context *st,
-                            struct st_framebuffer_iface *stfbi,
+                            struct pipe_frontend_drawable *pdrawable,
                             const enum st_attachment_type *statts,
                             unsigned count,
                             struct pipe_resource **out)
 {
    struct dri_context *ctx = (struct dri_context *)st->frontend_context;
-   struct dri_drawable *drawable = (struct dri_drawable *)stfbi;
+   struct dri_drawable *drawable = (struct dri_drawable *)pdrawable;
    struct dri_screen *screen = drawable->screen;
    unsigned statt_mask, new_mask;
    bool new_stamp;
@@ -112,11 +112,11 @@ dri_st_framebuffer_validate(struct st_context *st,
 
 static bool
 dri_st_framebuffer_flush_front(struct st_context *st,
-                               struct st_framebuffer_iface *stfbi,
+                               struct pipe_frontend_drawable *pdrawable,
                                enum st_attachment_type statt)
 {
    struct dri_context *ctx = (struct dri_context *)st->frontend_context;
-   struct dri_drawable *drawable = (struct dri_drawable *)stfbi;
+   struct dri_drawable *drawable = (struct dri_drawable *)pdrawable;
 
    /* XXX remove this and just set the correct one on the framebuffer */
    return drawable->flush_frontbuffer(ctx, drawable, statt);
@@ -127,10 +127,10 @@ dri_st_framebuffer_flush_front(struct st_context *st,
  */
 static bool
 dri_st_framebuffer_flush_swapbuffers(struct st_context *st,
-                                     struct st_framebuffer_iface *stfbi)
+                                     struct pipe_frontend_drawable *pdrawable)
 {
    struct dri_context *ctx = (struct dri_context *)st->frontend_context;
-   struct dri_drawable *drawable = (struct dri_drawable *)stfbi;
+   struct dri_drawable *drawable = (struct dri_drawable *)pdrawable;
 
    if (drawable->flush_swapbuffers)
       drawable->flush_swapbuffers(ctx, drawable);
@@ -162,7 +162,7 @@ dri_create_drawable(struct dri_screen *screen, const struct gl_config *visual,
 
    dri_fill_st_visual(&drawable->stvis, screen, visual);
 
-   /* setup the st_framebuffer_iface */
+   /* setup the pipe_frontend_drawable */
    drawable->base.visual = &drawable->stvis;
    drawable->base.flush_front = dri_st_framebuffer_flush_front;
    drawable->base.validate = dri_st_framebuffer_validate;
index 86ebf80..dc7e5e3 100644 (file)
 #include "frontend/api.h"
 #include "dri_util.h"
 
-struct pipe_surface;
-struct st_framebuffer;
 struct dri_context;
+struct dri_screen;
 
 struct dri_drawable
 {
-   struct st_framebuffer_iface base;
+   struct pipe_frontend_drawable base;
    struct st_visual stvis;
 
    struct dri_screen *screen;
index ee211eb..aceacc3 100644 (file)
@@ -215,7 +215,7 @@ drisw_copy_to_front(struct pipe_context *pipe,
 }
 
 /*
- * Backend functions for st_framebuffer interface and swap_buffers.
+ * Backend functions for pipe_frontend_drawable and swap_buffers.
  */
 
 static void
index a72dff8..aa6de62 100644 (file)
@@ -541,7 +541,7 @@ create_xmesa_buffer(Drawable d, BufferType type,
    /*
     * Create framebuffer, but we'll plug in our own renderbuffers below.
     */
-   b->stfb = xmesa_create_st_framebuffer(xmdpy, b);
+   b->drawable = xmesa_create_st_framebuffer(xmdpy, b);
 
    /* GLX_EXT_texture_from_pixmap */
    b->TextureTarget = 0;
@@ -599,12 +599,12 @@ xmesa_free_buffer(XMesaBuffer buffer)
          /* Notify the st manager that the associated framebuffer interface
           * object is no longer valid.
           */
-         st_api_destroy_drawable(buffer->stfb);
+         st_api_destroy_drawable(buffer->drawable);
 
          /* XXX we should move the buffer to a delete-pending list and destroy
           * the buffer until it is no longer current.
           */
-         xmesa_destroy_st_framebuffer(buffer->stfb);
+         xmesa_destroy_st_framebuffer(buffer->drawable);
 
          free(buffer);
 
@@ -1231,7 +1231,7 @@ XMesaDestroyBuffer(XMesaBuffer b)
 void
 xmesa_notify_invalid_buffer(XMesaBuffer b)
 {
-   p_atomic_inc(&b->stfb->stamp);
+   p_atomic_inc(&b->drawable->stamp);
 }
 
 
@@ -1292,8 +1292,8 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
       c->xm_read_buffer = readBuffer;
 
       st_api_make_current(c->st,
-                          drawBuffer ? drawBuffer->stfb : NULL,
-                          readBuffer ? readBuffer->stfb : NULL);
+                          drawBuffer ? drawBuffer->drawable : NULL,
+                          readBuffer ? readBuffer->drawable : NULL);
 
       /* Solution to Stephane Rehel's problem with glXReleaseBuffersMESA(): */
       if (drawBuffer)
@@ -1338,7 +1338,7 @@ void XMesaSwapBuffers( XMesaBuffer b )
    /* Need to draw HUD before flushing */
    if (xmctx && xmctx->hud) {
       struct pipe_resource *back =
-         xmesa_get_framebuffer_resource(b->stfb, ST_ATTACHMENT_BACK_LEFT);
+         xmesa_get_framebuffer_resource(b->drawable, ST_ATTACHMENT_BACK_LEFT);
       hud_run(xmctx->hud, NULL, back);
    }
 
@@ -1346,7 +1346,7 @@ void XMesaSwapBuffers( XMesaBuffer b )
       st_context_flush(xmctx->st, ST_FLUSH_FRONT, NULL, NULL, NULL);
    }
 
-   xmesa_swap_st_framebuffer(b->stfb);
+   xmesa_swap_st_framebuffer(b->drawable);
 
    /* TODO: remove this if the framebuffer state doesn't change. */
    st_context_invalidate_state(xmctx->st, ST_INVALIDATE_FB_STATE);
@@ -1363,7 +1363,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
 
    st_context_flush(xmctx->st, ST_FLUSH_FRONT, NULL, NULL, NULL);
 
-   xmesa_copy_st_framebuffer(b->stfb,
+   xmesa_copy_st_framebuffer(b->drawable,
          ST_ATTACHMENT_BACK_LEFT, ST_ATTACHMENT_FRONT_LEFT,
          x, b->height - y - height, width, height);
 }
@@ -1467,7 +1467,7 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
                   const int *attrib_list)
 {
    struct st_context *st = st_api_get_current();
-   struct st_framebuffer_iface* stfbi = drawable->stfb;
+   struct pipe_frontend_drawable* pdrawable = drawable->drawable;
    struct pipe_resource *res;
    int x, y, w, h;
    enum st_attachment_type st_attachment = xmesa_attachment_type(buffer);
@@ -1479,11 +1479,11 @@ XMesaBindTexImage(Display *dpy, XMesaBuffer drawable, int buffer,
 
    /* We need to validate our attachments before using them,
     * in case the texture doesn't exist yet. */
-   xmesa_st_framebuffer_validate_textures(stfbi, w, h, 1 << st_attachment);
-   res = xmesa_get_attachment(stfbi, st_attachment);
+   xmesa_st_framebuffer_validate_textures(pdrawable, w, h, 1 << st_attachment);
+   res = xmesa_get_attachment(pdrawable, st_attachment);
 
    if (res) {
-      struct pipe_context* pipe = xmesa_get_context(stfbi);
+      struct pipe_context* pipe = xmesa_get_context(pdrawable);
       enum pipe_format internal_format = res->format;
       struct pipe_transfer *tex_xfer;
       char *map;
index fa531c4..37face8 100644 (file)
@@ -329,7 +329,7 @@ typedef enum {
  * Basically corresponds to a GLXDrawable.
  */
 struct xmesa_buffer {
-   struct st_framebuffer_iface *stfb;
+   struct pipe_frontend_drawable *drawable;
    struct xlib_drawable ws;
 
    GLboolean wasCurrent;       /* was ever the current buffer? */
index 6f049a7..7eace3f 100644 (file)
@@ -35,7 +35,7 @@
 #include "state_tracker/st_context.h"
 
 struct xmesa_st_framebuffer {
-   struct st_framebuffer_iface base;
+   struct pipe_frontend_drawable base;
 
    XMesaDisplay display;
    XMesaBuffer buffer;
@@ -52,9 +52,9 @@ struct xmesa_st_framebuffer {
 
 
 static inline struct xmesa_st_framebuffer *
-xmesa_st_framebuffer(struct st_framebuffer_iface *stfbi)
+xmesa_st_framebuffer(struct pipe_frontend_drawable *drawable)
 {
-   return (struct xmesa_st_framebuffer *)stfbi;
+   return (struct xmesa_st_framebuffer *)drawable;
 }
 
 
@@ -62,12 +62,12 @@ xmesa_st_framebuffer(struct st_framebuffer_iface *stfbi)
  * Display (present) an attachment to the xlib_drawable of the framebuffer.
  */
 static bool
-xmesa_st_framebuffer_display(struct st_framebuffer_iface *stfbi,
+xmesa_st_framebuffer_display(struct pipe_frontend_drawable *drawable,
                              struct st_context *st,
                              enum st_attachment_type statt,
                              struct pipe_box *box)
 {
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
    struct pipe_resource *ptex = xstfb->textures[statt];
    struct pipe_resource *pres;
    struct pipe_context *pctx = st ? st->pipe : NULL;
@@ -91,13 +91,13 @@ xmesa_st_framebuffer_display(struct st_framebuffer_iface *stfbi,
  * Copy the contents between the attachments.
  */
 static void
-xmesa_st_framebuffer_copy_textures(struct st_framebuffer_iface *stfbi,
+xmesa_st_framebuffer_copy_textures(struct pipe_frontend_drawable *drawable,
                                    enum st_attachment_type src_statt,
                                    enum st_attachment_type dst_statt,
                                    unsigned x, unsigned y,
                                    unsigned width, unsigned height)
 {
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
    struct pipe_resource *src_ptex = xstfb->textures[src_statt];
    struct pipe_resource *dst_ptex = xstfb->textures[dst_statt];
    struct pipe_box src_box;
@@ -106,7 +106,7 @@ xmesa_st_framebuffer_copy_textures(struct st_framebuffer_iface *stfbi,
    if (!src_ptex || !dst_ptex)
       return;
 
-   pipe = xmesa_get_context(stfbi);
+   pipe = xmesa_get_context(drawable);
 
    u_box_2d(x, y, width, height, &src_box);
 
@@ -121,11 +121,11 @@ xmesa_st_framebuffer_copy_textures(struct st_framebuffer_iface *stfbi,
  * This is a helper used during framebuffer validation.
  */
 bool
-xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
+xmesa_st_framebuffer_validate_textures(struct pipe_frontend_drawable *drawable,
                                        unsigned width, unsigned height,
                                        unsigned mask)
 {
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
    struct pipe_resource templ;
    enum st_attachment_type i;
 
@@ -197,7 +197,7 @@ xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
 /**
  * Check that a framebuffer's attachments match the window's size.
  *
- * Called via st_framebuffer_iface::validate()
+ * Called via pipe_frontend_drawable::validate()
  *
  * \param statts  array of framebuffer attachments
  * \param count  number of framebuffer attachments in statts[]
@@ -205,12 +205,12 @@ xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
  */
 static bool
 xmesa_st_framebuffer_validate(struct st_context *st,
-                              struct st_framebuffer_iface *stfbi,
+                              struct pipe_frontend_drawable *drawable,
                               const enum st_attachment_type *statts,
                               unsigned count,
                               struct pipe_resource **out)
 {
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
    unsigned statt_mask, new_mask, i;
    bool resized;
    bool ret;
@@ -234,7 +234,7 @@ xmesa_st_framebuffer_validate(struct st_context *st,
 
    /* revalidate textures */
    if (resized || new_mask) {
-      ret = xmesa_st_framebuffer_validate_textures(stfbi,
+      ret = xmesa_st_framebuffer_validate_textures(drawable,
                   xstfb->buffer->width, xstfb->buffer->height, statt_mask);
       if (!ret)
          return ret;
@@ -248,7 +248,7 @@ xmesa_st_framebuffer_validate(struct st_context *st,
          if ((statt_mask & (1 << back)) &&
              (new_mask & (1 << front)) &&
              !(new_mask & (1 << back))) {
-            xmesa_st_framebuffer_copy_textures(stfbi, back, front,
+            xmesa_st_framebuffer_copy_textures(drawable, back, front,
                   0, 0, xstfb->texture_width, xstfb->texture_height);
          }
       }
@@ -262,20 +262,20 @@ xmesa_st_framebuffer_validate(struct st_context *st,
 
 
 /**
- * Called via st_framebuffer_iface::flush_front()
+ * Called via pipe_frontend_drawable::flush_front()
  */
 static bool
 xmesa_st_framebuffer_flush_front(struct st_context *st,
-                                 struct st_framebuffer_iface *stfbi,
+                                 struct pipe_frontend_drawable *drawable,
                                  enum st_attachment_type statt)
 {
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
    bool ret;
 
    if (statt != ST_ATTACHMENT_FRONT_LEFT)
       return false;
 
-   ret = xmesa_st_framebuffer_display(stfbi, st, statt, NULL);
+   ret = xmesa_st_framebuffer_display(drawable, st, statt, NULL);
 
    if (ret && xmesa_strict_invalidate())
       xmesa_check_buffer_size(xstfb->buffer);
@@ -283,9 +283,9 @@ xmesa_st_framebuffer_flush_front(struct st_context *st,
    return ret;
 }
 
-static uint32_t xmesa_stfbi_ID = 0;
+static uint32_t xmesa_drawable_ID = 0;
 
-struct st_framebuffer_iface *
+struct pipe_frontend_drawable *
 xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b)
 {
    struct xmesa_st_framebuffer *xstfb;
@@ -310,7 +310,7 @@ xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b)
    xstfb->base.visual = &xstfb->stvis;
    xstfb->base.flush_front = xmesa_st_framebuffer_flush_front;
    xstfb->base.validate = xmesa_st_framebuffer_validate;
-   xstfb->base.ID = p_atomic_inc_return(&xmesa_stfbi_ID);
+   xstfb->base.ID = p_atomic_inc_return(&xmesa_drawable_ID);
    xstfb->base.fscreen = xmdpy->fscreen;
    p_atomic_set(&xstfb->base.stamp, 1);
 
@@ -319,9 +319,9 @@ xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b)
 
 
 void
-xmesa_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi)
+xmesa_destroy_st_framebuffer(struct pipe_frontend_drawable *drawable)
 {
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
    int i;
 
    pipe_resource_reference(&xstfb->display_resource, NULL);
@@ -338,21 +338,21 @@ xmesa_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi)
  * framebuffer attachment.
  */
 struct pipe_resource *
-xmesa_get_framebuffer_resource(struct st_framebuffer_iface *stfbi,
+xmesa_get_framebuffer_resource(struct pipe_frontend_drawable *drawable,
                                enum st_attachment_type att)
 {
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
    return xstfb->textures[att];
 }
 
 
 void
-xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi)
+xmesa_swap_st_framebuffer(struct pipe_frontend_drawable *drawable)
 {
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
    bool ret;
 
-   ret = xmesa_st_framebuffer_display(stfbi, NULL, ST_ATTACHMENT_BACK_LEFT, NULL);
+   ret = xmesa_st_framebuffer_display(drawable, NULL, ST_ATTACHMENT_BACK_LEFT, NULL);
    if (ret) {
       struct pipe_resource **front, **back, *tmp;
 
@@ -376,12 +376,12 @@ xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi)
 
 
 void
-xmesa_copy_st_framebuffer(struct st_framebuffer_iface *stfbi,
+xmesa_copy_st_framebuffer(struct pipe_frontend_drawable *drawable,
                           enum st_attachment_type src,
                           enum st_attachment_type dst,
                           int x, int y, int w, int h)
 {
-   xmesa_st_framebuffer_copy_textures(stfbi, src, dst, x, y, w, h);
+   xmesa_st_framebuffer_copy_textures(drawable, src, dst, x, y, w, h);
    if (dst == ST_ATTACHMENT_FRONT_LEFT) {
       struct pipe_box box = {};
 
@@ -389,16 +389,16 @@ xmesa_copy_st_framebuffer(struct st_framebuffer_iface *stfbi,
       box.y = y;
       box.width = w;
       box.height = h;
-      xmesa_st_framebuffer_display(stfbi, NULL, src, &box);
+      xmesa_st_framebuffer_display(drawable, NULL, src, &box);
    }
 }
 
 
 struct pipe_resource*
-xmesa_get_attachment(struct st_framebuffer_iface *stfbi,
+xmesa_get_attachment(struct pipe_frontend_drawable *drawable,
                      enum st_attachment_type st_attachment)
 {
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
    struct pipe_resource *res;
 
    res = xstfb->textures[st_attachment];
@@ -407,10 +407,10 @@ xmesa_get_attachment(struct st_framebuffer_iface *stfbi,
 
 
 struct pipe_context*
-xmesa_get_context(struct st_framebuffer_iface *stfbi)
+xmesa_get_context(struct pipe_frontend_drawable *drawable)
 {
    struct pipe_context *pipe;
-   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(drawable);
 
    pipe = xstfb->display->pipe;
    if (!pipe) {
index 6d92a38..d6817f5 100644 (file)
 
 #include "xm_api.h"
 
-struct st_framebuffer_iface *
+struct pipe_frontend_drawable *
 xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b);
 
 void
-xmesa_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi);
+xmesa_destroy_st_framebuffer(struct pipe_frontend_drawable *drawable);
 
 struct pipe_resource *
-xmesa_get_framebuffer_resource(struct st_framebuffer_iface *stfbi,
+xmesa_get_framebuffer_resource(struct pipe_frontend_drawable *drawable,
                                enum st_attachment_type att);
 
 void
-xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi);
+xmesa_swap_st_framebuffer(struct pipe_frontend_drawable *drawable);
 
 void
-xmesa_copy_st_framebuffer(struct st_framebuffer_iface *stfbi,
+xmesa_copy_st_framebuffer(struct pipe_frontend_drawable *drawable,
                           enum st_attachment_type src,
                           enum st_attachment_type dst,
                           int x, int y, int w, int h);
 
 struct pipe_resource*
-xmesa_get_attachment(struct st_framebuffer_iface *stfbi,
+xmesa_get_attachment(struct pipe_frontend_drawable *drawable,
                      enum st_attachment_type st_attachment);
 
 struct pipe_context*
-xmesa_get_context(struct st_framebuffer_iface* stfbi);
+xmesa_get_context(struct pipe_frontend_drawable* drawable);
 
 bool
-xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
+xmesa_st_framebuffer_validate_textures(struct pipe_frontend_drawable *drawable,
                                        unsigned width, unsigned height,
                                        unsigned mask);
 #endif /* _XM_ST_H_ */
index a0f5ef7..e75d850 100644 (file)
@@ -45,11 +45,11 @@ hgl_st_context(struct st_context *st)
 // Perform a safe void to hgl_buffer cast
 //static inline struct hgl_buffer*
 struct hgl_buffer*
-hgl_st_framebuffer(struct st_framebuffer_iface *stfbi)
+hgl_st_framebuffer(struct pipe_frontend_drawable *drawable)
 {
        struct hgl_buffer* buffer;
-       assert(stfbi);
-       buffer = (struct hgl_buffer*)stfbi;
+       assert(drawable);
+       buffer = (struct hgl_buffer*)drawable;
        assert(buffer);
        return buffer;
 }
@@ -57,11 +57,11 @@ hgl_st_framebuffer(struct st_framebuffer_iface *stfbi)
 
 static bool
 hgl_st_framebuffer_flush_front(struct st_context *st,
-       struct st_framebuffer_iface* stfbi, enum st_attachment_type statt)
+       struct pipe_frontend_drawable* drawable, enum st_attachment_type statt)
 {
        CALLED();
 
-       struct hgl_buffer* buffer = hgl_st_framebuffer(stfbi);
+       struct hgl_buffer* buffer = hgl_st_framebuffer(drawable);
        struct pipe_resource* ptex = buffer->textures[statt];
 
        if (statt != ST_ATTACHMENT_FRONT_LEFT)
@@ -79,7 +79,7 @@ hgl_st_framebuffer_flush_front(struct st_context *st,
 
 
 static bool
-hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
+hgl_st_framebuffer_validate_textures(struct pipe_frontend_drawable *drawable,
        unsigned width, unsigned height, unsigned mask)
 {
        struct hgl_buffer* buffer;
@@ -88,7 +88,7 @@ hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
 
        CALLED();
 
-       buffer = hgl_st_framebuffer(stfbi);
+       buffer = hgl_st_framebuffer(drawable);
 
        if (buffer->width != width || buffer->height != height) {
                TRACE("validate_textures: size changed: %d, %d -> %d, %d\n",
@@ -154,7 +154,7 @@ hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
  */
 static bool
 hgl_st_framebuffer_validate(struct st_context *st,
-       struct st_framebuffer_iface *stfbi, const enum st_attachment_type *statts,
+       struct pipe_frontend_drawable *drawable, const enum st_attachment_type *statts,
        unsigned count, struct pipe_resource **out)
 {
        struct hgl_context* context;
@@ -166,7 +166,7 @@ hgl_st_framebuffer_validate(struct st_context *st,
        CALLED();
 
        context = hgl_st_context(st);
-       buffer = hgl_st_framebuffer(stfbi);
+       buffer = hgl_st_framebuffer(drawable);
 
        // Build mask of current attachments
        stAttachmentMask = 0;
@@ -183,7 +183,7 @@ hgl_st_framebuffer_validate(struct st_context *st,
                TRACE("%s: resize event. old:  %d x %d; new: %d x %d\n", __func__,
                        buffer->width, buffer->height, context->width, context->height);
 
-               ret = hgl_st_framebuffer_validate_textures(stfbi, 
+               ret = hgl_st_framebuffer_validate_textures(drawable,
                        context->width, context->height, stAttachmentMask);
 
                if (!ret)
@@ -231,8 +231,8 @@ hgl_create_st_framebuffer(struct hgl_context* context, void *winsysContext)
        assert(buffer);
 
        // calloc and configure our st_framebuffer interface
-       buffer->stfbi = CALLOC_STRUCT(st_framebuffer_iface);
-       assert(buffer->stfbi);
+       buffer->drawable = CALLOC_STRUCT(pipe_frontend_drawable);
+       assert(buffer->drawable);
 
        // Prepare our buffer
        buffer->visual = context->stVisual;
@@ -245,13 +245,13 @@ hgl_create_st_framebuffer(struct hgl_context* context, void *winsysContext)
                buffer->target = PIPE_TEXTURE_RECT;
 
        // Prepare our frontend interface
-       buffer->stfbi->flush_front = hgl_st_framebuffer_flush_front;
-       buffer->stfbi->validate = hgl_st_framebuffer_validate;
-       buffer->stfbi->visual = context->stVisual;
+       buffer->drawable->flush_front = hgl_st_framebuffer_flush_front;
+       buffer->drawable->validate = hgl_st_framebuffer_validate;
+       buffer->drawable->visual = context->stVisual;
 
-       p_atomic_set(&buffer->stfbi->stamp, 1);
-       buffer->stfbi->ID = p_atomic_inc_return(&hgl_fb_ID);
-       buffer->stfbi->fscreen = context->display->fscreen;
+       p_atomic_set(&buffer->drawable->stamp, 1);
+       buffer->drawable->ID = p_atomic_inc_return(&hgl_fb_ID);
+       buffer->drawable->fscreen = context->display->fscreen;
 
        return buffer;
 }
@@ -266,7 +266,7 @@ hgl_destroy_st_framebuffer(struct hgl_buffer *buffer)
        for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
                pipe_resource_reference(&buffer->textures[i], NULL);
 
-       FREE(buffer->stfbi);
+       FREE(buffer->drawable);
        FREE(buffer);
 }
 
index 04baa74..c75a6db 100644 (file)
@@ -31,7 +31,7 @@ typedef int64 context_id;
 
 struct hgl_buffer
 {
-       struct st_framebuffer_iface *stfbi;
+       struct pipe_frontend_drawable *drawable;
        struct st_visual* visual;
 
        unsigned width;
@@ -76,7 +76,7 @@ struct hgl_context
 };
 
 // hgl_buffer from statetracker interface
-struct hgl_buffer* hgl_st_framebuffer(struct st_framebuffer_iface *stfbi);
+struct hgl_buffer* hgl_st_framebuffer(struct pipe_frontend_drawable *drawable);
 
 // hgl framebuffer
 struct hgl_buffer* hgl_create_st_framebuffer(struct hgl_context* context, void *winsysContext);
index ae67e24..0814c3c 100644 (file)
@@ -83,7 +83,7 @@ osmesa_create_screen(void);
 
 struct osmesa_buffer
 {
-   struct st_framebuffer_iface *stfb;
+   struct pipe_frontend_drawable *drawable;
    struct st_visual visual;
    unsigned width, height;
 
@@ -327,12 +327,12 @@ osmesa_init_st_visual(struct st_visual *vis,
 
 
 /**
- * Return the osmesa_buffer that corresponds to an st_framebuffer_iface.
+ * Return the osmesa_buffer that corresponds to an pipe_frontend_drawable.
  */
 static inline struct osmesa_buffer *
-stfbi_to_osbuffer(struct st_framebuffer_iface *stfbi)
+drawable_to_osbuffer(struct pipe_frontend_drawable *drawable)
 {
-   return (struct osmesa_buffer *)stfbi;
+   return (struct osmesa_buffer *)drawable;
 }
 
 
@@ -342,11 +342,11 @@ stfbi_to_osbuffer(struct st_framebuffer_iface *stfbi)
  */
 static bool
 osmesa_st_framebuffer_flush_front(struct st_context *st,
-                                  struct st_framebuffer_iface *stfbi,
+                                  struct pipe_frontend_drawable *drawable,
                                   enum st_attachment_type statt)
 {
    OSMesaContext osmesa = OSMesaGetCurrentContext();
-   struct osmesa_buffer *osbuffer = stfbi_to_osbuffer(stfbi);
+   struct osmesa_buffer *osbuffer = drawable_to_osbuffer(drawable);
    struct pipe_resource *res = osbuffer->textures[statt];
    unsigned bpp;
    int dst_stride;
@@ -401,14 +401,14 @@ osmesa_st_framebuffer_flush_front(struct st_context *st,
  */
 static bool
 osmesa_st_framebuffer_validate(struct st_context *st,
-                               struct st_framebuffer_iface *stfbi,
+                               struct pipe_frontend_drawable *drawable,
                                const enum st_attachment_type *statts,
                                unsigned count,
                                struct pipe_resource **out)
 {
    struct pipe_screen *screen = get_st_manager()->screen;
    enum st_attachment_type i;
-   struct osmesa_buffer *osbuffer = stfbi_to_osbuffer(stfbi);
+   struct osmesa_buffer *osbuffer = drawable_to_osbuffer(drawable);
    struct pipe_resource templat;
 
    memset(&templat, 0, sizeof(templat));
@@ -461,18 +461,18 @@ osmesa_st_framebuffer_validate(struct st_context *st,
 
 static uint32_t osmesa_fb_ID = 0;
 
-static struct st_framebuffer_iface *
+static struct pipe_frontend_drawable *
 osmesa_create_st_framebuffer(void)
 {
-   struct st_framebuffer_iface *stfbi = CALLOC_STRUCT(st_framebuffer_iface);
-   if (stfbi) {
-      stfbi->flush_front = osmesa_st_framebuffer_flush_front;
-      stfbi->validate = osmesa_st_framebuffer_validate;
-      p_atomic_set(&stfbi->stamp, 1);
-      stfbi->ID = p_atomic_inc_return(&osmesa_fb_ID);
-      stfbi->fscreen = get_st_manager();
+   struct pipe_frontend_drawable *drawable = CALLOC_STRUCT(pipe_frontend_drawable);
+   if (drawable) {
+      drawable->flush_front = osmesa_st_framebuffer_flush_front;
+      drawable->validate = osmesa_st_framebuffer_validate;
+      p_atomic_set(&drawable->stamp, 1);
+      drawable->ID = p_atomic_inc_return(&osmesa_fb_ID);
+      drawable->fscreen = get_st_manager();
    }
-   return stfbi;
+   return drawable;
 }
 
 
@@ -486,8 +486,8 @@ osmesa_create_buffer(enum pipe_format color_format,
 {
    struct osmesa_buffer *osbuffer = CALLOC_STRUCT(osmesa_buffer);
    if (osbuffer) {
-      osbuffer->stfb = osmesa_create_st_framebuffer();
-      osbuffer->stfb->visual = &osbuffer->visual;
+      osbuffer->drawable = osmesa_create_st_framebuffer();
+      osbuffer->drawable->visual = &osbuffer->visual;
 
       osmesa_init_st_visual(&osbuffer->visual, color_format,
                             ds_format, accum_format);
@@ -504,9 +504,9 @@ osmesa_destroy_buffer(struct osmesa_buffer *osbuffer)
     * Notify the state manager that the associated framebuffer interface
     * is no longer valid.
     */
-   st_api_destroy_drawable(osbuffer->stfb);
+   st_api_destroy_drawable(osbuffer->drawable);
 
-   FREE(osbuffer->stfb);
+   FREE(osbuffer->drawable);
    FREE(osbuffer);
 }
 
@@ -783,7 +783,7 @@ OSMesaMakeCurrent(OSMesaContext osmesa, void *buffer, GLenum type,
 
    osmesa->type = type;
 
-   st_api_make_current(osmesa->st, osbuffer->stfb, osbuffer->stfb);
+   st_api_make_current(osmesa->st, osbuffer->drawable, osbuffer->drawable);
 
    /* XXX: We should probably load the current color value into the buffer here
     * to match classic swrast behavior (context's fb starts with the contents of
index fcb41b9..f109867 100644 (file)
@@ -444,7 +444,7 @@ stw_make_current(struct stw_framebuffer *fb, struct stw_framebuffer *fbRead, str
       } else {
          if (old_ctx->shared) {
             if (old_ctx->current_framebuffer) {
-               stw_st_flush(old_ctx->st, old_ctx->current_framebuffer->stfb,
+               stw_st_flush(old_ctx->st, old_ctx->current_framebuffer->drawable,
                             ST_FLUSH_FRONT | ST_FLUSH_WAIT);
             } else {
                struct pipe_fence_handle *fence = NULL;
@@ -454,7 +454,7 @@ stw_make_current(struct stw_framebuffer *fb, struct stw_framebuffer *fbRead, str
             }
          } else {
             if (old_ctx->current_framebuffer)
-               stw_st_flush(old_ctx->st, old_ctx->current_framebuffer->stfb,
+               stw_st_flush(old_ctx->st, old_ctx->current_framebuffer->drawable,
                             ST_FLUSH_FRONT);
             else
                st_context_flush(old_ctx->st, ST_FLUSH_FRONT, NULL, NULL, NULL);
@@ -492,8 +492,8 @@ stw_make_current(struct stw_framebuffer *fb, struct stw_framebuffer *fbRead, str
       ctx->current_read_framebuffer = fbRead;
 
       ret = st_api_make_current(ctx->st,
-                                fb ? fb->stfb : NULL,
-                                fbRead ? fbRead->stfb : NULL);
+                                fb ? fb->drawable : NULL,
+                                fbRead ? fbRead->drawable : NULL);
 
       /* Release the old framebuffers from this context. */
       release_old_framebuffers(old_fb, old_fbRead, ctx);
@@ -614,7 +614,7 @@ stw_make_current_by_handles(HDC hDrawDC, HDC hReadDC, DHGLRC dhglrc)
 void
 stw_notify_current_locked( struct stw_framebuffer *fb )
 {
-   p_atomic_inc(&fb->stfb->stamp);
+   p_atomic_inc(&fb->drawable->stamp);
 }
 
 
index ebd14f9..a2d46ea 100644 (file)
@@ -117,7 +117,7 @@ stw_framebuffer_release_locked(struct stw_framebuffer *fb,
    if (fb->winsys_framebuffer)
       fb->winsys_framebuffer->destroy(fb->winsys_framebuffer, st ? st->pipe : NULL);
 
-   stw_st_destroy_framebuffer_locked(fb->stfb);
+   stw_st_destroy_framebuffer_locked(fb->drawable);
 
    stw_framebuffer_unlock(fb);
 
@@ -295,8 +295,8 @@ stw_framebuffer_create(HWND hWnd, const struct stw_pixelformat_info *pfi, enum s
    fb->owner = owner;
 
    fb->pfi = pfi;
-   fb->stfb = stw_st_create_framebuffer( fb, fscreen );
-   if (!fb->stfb) {
+   fb->drawable = stw_st_create_framebuffer( fb, fscreen );
+   if (!fb->drawable) {
       FREE( fb );
       return NULL;
    }
@@ -373,7 +373,7 @@ stw_framebuffer_unlock(struct stw_framebuffer *fb)
 void
 stw_framebuffer_update(struct stw_framebuffer *fb)
 {
-   assert(fb->stfb);
+   assert(fb->drawable);
    assert(fb->height);
    assert(fb->width);
 
@@ -699,7 +699,7 @@ stw_framebuffer_swap_locked(HDC hdc, struct stw_framebuffer *fb)
       if (ctx->hud) {
          /* Display the HUD */
          struct pipe_resource *back =
-            stw_get_framebuffer_resource(fb->stfb, ST_ATTACHMENT_BACK_LEFT);
+            stw_get_framebuffer_resource(fb->drawable, ST_ATTACHMENT_BACK_LEFT);
          if (back) {
             hud_run(ctx->hud, NULL, back);
          }
@@ -707,7 +707,7 @@ stw_framebuffer_swap_locked(HDC hdc, struct stw_framebuffer *fb)
 
       if (ctx->current_framebuffer == fb) {
          /* flush current context */
-         stw_st_flush(ctx->st, fb->stfb, ST_FLUSH_END_OF_FRAME);
+         stw_st_flush(ctx->st, fb->drawable, ST_FLUSH_END_OF_FRAME);
       }
    }
 
@@ -716,7 +716,7 @@ stw_framebuffer_swap_locked(HDC hdc, struct stw_framebuffer *fb)
       wait_swap_interval(fb, interval);
    }
 
-   return stw_st_swap_framebuffer_locked(hdc, ctx->st, fb->stfb);
+   return stw_st_swap_framebuffer_locked(hdc, ctx->st, fb->drawable);
 }
 
 BOOL APIENTRY
index 3536d77..140e5bd 100644 (file)
@@ -38,7 +38,7 @@
 
 
 struct pipe_resource;
-struct st_framebuffer_iface;
+struct pipe_frontend_drawable;
 struct stw_pixelformat_info;
 struct pipe_frontend_screen;
 
@@ -90,7 +90,7 @@ struct stw_framebuffer
    int iDisplayablePixelFormat;
    enum stw_framebuffer_owner owner;
 
-   struct st_framebuffer_iface *stfb;
+   struct pipe_frontend_drawable *drawable;
 
    /*
     * Mutable members. 
@@ -228,9 +228,9 @@ stw_framebuffer_cleanup(void);
 
 
 static inline struct stw_st_framebuffer *
-stw_st_framebuffer(struct st_framebuffer_iface *stfb)
+stw_st_framebuffer(struct pipe_frontend_drawable *drawable)
 {
-   return (struct stw_st_framebuffer *) stfb;
+   return (struct stw_st_framebuffer *) drawable;
 }
 
 
index 7346869..fc2d872 100644 (file)
@@ -44,7 +44,7 @@
 #endif
 
 struct stw_st_framebuffer {
-   struct st_framebuffer_iface base;
+   struct pipe_frontend_drawable base;
 
    struct stw_framebuffer *fb;
    struct st_visual stvis;
@@ -148,11 +148,11 @@ stw_st_fill_private_loader_data(struct stw_st_framebuffer *stwfb, struct kopper_
  */
 static void
 stw_st_framebuffer_validate_locked(struct st_context *st,
-                                   struct st_framebuffer_iface *stfb,
+                                   struct pipe_frontend_drawable *drawable,
                                    unsigned width, unsigned height,
                                    unsigned mask)
 {
-   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
+   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(drawable);
    struct pipe_resource templ;
    unsigned i;
 
@@ -318,12 +318,12 @@ stw_st_framebuffer_validate_locked(struct st_context *st,
 
 static bool
 stw_st_framebuffer_validate(struct st_context *st,
-                            struct st_framebuffer_iface *stfb,
+                            struct pipe_frontend_drawable *drawable,
                             const enum st_attachment_type *statts,
                             unsigned count,
                             struct pipe_resource **out)
 {
-   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
+   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(drawable);
    unsigned statt_mask, i;
 
    statt_mask = 0x0;
@@ -394,10 +394,10 @@ notify_before_flush_cb(void* _args)
 
 void
 stw_st_flush(struct st_context *st,
-             struct st_framebuffer_iface *stfb,
+             struct pipe_frontend_drawable *drawable,
              unsigned flags)
 {
-   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
+   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(drawable);
    struct notify_before_flush_cb_args args;
    struct pipe_fence_handle **pfence = NULL;
    struct pipe_fence_handle *fence = NULL;
@@ -423,10 +423,10 @@ stw_st_flush(struct st_context *st,
 static bool
 stw_st_framebuffer_present_locked(HDC hdc,
                                   struct st_context *st,
-                                  struct st_framebuffer_iface *stfb,
+                                  struct pipe_frontend_drawable *drawable,
                                   enum st_attachment_type statt)
 {
-   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
+   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(drawable);
    struct pipe_resource *resource;
 
    assert(stw_own_mutex(&stwfb->fb->mutex));
@@ -446,10 +446,10 @@ stw_st_framebuffer_present_locked(HDC hdc,
 
 static bool
 stw_st_framebuffer_flush_front(struct st_context *st,
-                               struct st_framebuffer_iface *stfb,
+                               struct pipe_frontend_drawable *drawable,
                                enum st_attachment_type statt)
 {
-   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
+   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(drawable);
    struct pipe_context *pipe = st->pipe;
    bool ret;
    HDC hDC;
@@ -502,7 +502,7 @@ stw_st_framebuffer_flush_front(struct st_context *st,
 /**
  * Create a framebuffer interface.
  */
-struct st_framebuffer_iface *
+struct pipe_frontend_drawable *
 stw_st_create_framebuffer(struct stw_framebuffer *fb, struct pipe_frontend_screen *fscreen)
 {
    struct stw_st_framebuffer *stwfb;
@@ -528,9 +528,9 @@ stw_st_create_framebuffer(struct stw_framebuffer *fb, struct pipe_frontend_scree
  * Destroy a framebuffer interface.
  */
 void
-stw_st_destroy_framebuffer_locked(struct st_framebuffer_iface *stfb)
+stw_st_destroy_framebuffer_locked(struct pipe_frontend_drawable *drawable)
 {
-   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
+   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(drawable);
    int i;
 
    for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
@@ -552,9 +552,9 @@ stw_st_destroy_framebuffer_locked(struct st_framebuffer_iface *stfb)
  */
 bool
 stw_st_swap_framebuffer_locked(HDC hdc, struct st_context *st,
-                               struct st_framebuffer_iface *stfb)
+                               struct pipe_frontend_drawable *drawable)
 {
-   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
+   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(drawable);
    unsigned front = ST_ATTACHMENT_FRONT_LEFT, back = ST_ATTACHMENT_BACK_LEFT;
    struct pipe_resource *ptex;
    unsigned mask;
@@ -595,9 +595,9 @@ stw_st_swap_framebuffer_locked(HDC hdc, struct st_context *st,
  * Return the pipe_resource that correspond to given buffer.
  */
 struct pipe_resource *
-stw_get_framebuffer_resource(struct st_framebuffer_iface *stfb,
+stw_get_framebuffer_resource(struct pipe_frontend_drawable *drawable,
                              enum st_attachment_type att)
 {
-   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
+   struct stw_st_framebuffer *stwfb = stw_st_framebuffer(drawable);
    return stwfb->textures[att];
 }
index 774c184..8d6ba09 100644 (file)
@@ -38,22 +38,22 @@ struct stw_framebuffer;
 bool
 stw_own_mutex(const CRITICAL_SECTION *cs);
 
-struct st_framebuffer_iface *
+struct pipe_frontend_drawable *
 stw_st_create_framebuffer(struct stw_framebuffer *fb, struct pipe_frontend_screen *fscreen);
 
 void
-stw_st_destroy_framebuffer_locked(struct st_framebuffer_iface *stfb);
+stw_st_destroy_framebuffer_locked(struct pipe_frontend_drawable *drawable);
 
 void
-stw_st_flush(struct st_context *st, struct st_framebuffer_iface *stfb,
+stw_st_flush(struct st_context *st, struct pipe_frontend_drawable *drawable,
              unsigned flags);
 
 bool
 stw_st_swap_framebuffer_locked(HDC hdc, struct st_context *st,
-                               struct st_framebuffer_iface *stfb);
+                               struct pipe_frontend_drawable *drawable);
 
 struct pipe_resource *
-stw_get_framebuffer_resource(struct st_framebuffer_iface *stfb,
+stw_get_framebuffer_resource(struct pipe_frontend_drawable *drawable,
                              enum st_attachment_type att);
 
 #endif /* STW_ST_H */
index 7bb2a31..decf7c0 100644 (file)
@@ -217,7 +217,7 @@ struct pipe_frontend_screen;
  * is used to communicate that the drawable has been changed, and
  * the framebuffer state should be updated.
  */
-struct st_framebuffer_iface
+struct pipe_frontend_drawable
 {
    /**
     * Atomic stamp which changes when framebuffers need to be updated.
@@ -248,7 +248,7 @@ struct st_framebuffer_iface
     * @att is one of the front buffer attachments.
     */
    bool (*flush_front)(struct st_context *st,
-                       struct st_framebuffer_iface *stfbi,
+                       struct pipe_frontend_drawable *drawable,
                        enum st_attachment_type statt);
 
    /**
@@ -268,13 +268,13 @@ struct st_framebuffer_iface
     * the last call might be destroyed.
     */
    bool (*validate)(struct st_context *st,
-                    struct st_framebuffer_iface *stfbi,
+                    struct pipe_frontend_drawable *drawable,
                     const enum st_attachment_type *statts,
                     unsigned count,
                     struct pipe_resource **out);
 
    bool (*flush_swapbuffers)(struct st_context *st,
-                             struct st_framebuffer_iface *stfbi);
+                             struct pipe_frontend_drawable *drawable);
 };
 
 
index 7c4c101..bb80166 100644 (file)
@@ -303,8 +303,8 @@ GalliumContext::SetCurrentContext(bool set, context_id contextID)
        }
 
        // We need to lock and unlock framebuffers before accessing them
-       st_api_make_current(context->st, context->buffer->stfbi,
-               context->buffer->stfbi);
+       st_api_make_current(context->st, context->buffer->drawable,
+               context->buffer->drawable);
        Unlock();
 
        return B_OK;
@@ -335,7 +335,7 @@ GalliumContext::SwapBuffers(context_id contextID)
                buffer->screen->flush_frontbuffer(buffer->screen, NULL, buffer->textures[ST_ATTACHMENT_BACK_LEFT],
                        0, 0, buffer->winsysContext, NULL);
                std::swap(buffer->textures[ST_ATTACHMENT_FRONT_LEFT], buffer->textures[ST_ATTACHMENT_BACK_LEFT]);
-               p_atomic_inc(&buffer->stfbi->stamp);
+               p_atomic_inc(&buffer->drawable->stamp);
        }
 
         /* TODO: remove this if the framebuffer state doesn't change. */
@@ -395,7 +395,7 @@ GalliumContext::Invalidate(uint32 width, uint32 height)
        fContext[fCurrentContext]->height = height + 1;
 
        // Is this the best way to invalidate?
-       p_atomic_inc(&fContext[fCurrentContext]->buffer->stfbi->stamp);
+       p_atomic_inc(&fContext[fCurrentContext]->buffer->drawable->stamp);
 }
 
 
index bcfe6a8..43a7048 100644 (file)
@@ -2769,12 +2769,12 @@ struct gl_framebuffer
    /** Delete this framebuffer */
    void (*Delete)(struct gl_framebuffer *fb);
 
-   struct st_framebuffer_iface *iface;
+   struct pipe_frontend_drawable *drawable;
    enum st_attachment_type statts[ST_ATTACHMENT_COUNT];
    unsigned num_statts;
    int32_t stamp;
-   int32_t iface_stamp;
-   uint32_t iface_ID;
+   int32_t drawable_stamp;
+   uint32_t drawable_ID;
 
    /* list of framebuffer objects */
    struct list_head head;
index 2b35c5b..556e074 100644 (file)
@@ -501,14 +501,14 @@ st_api_create_context(struct pipe_frontend_screen *fscreen,
 
 bool
 st_api_make_current(struct st_context *st,
-                    struct st_framebuffer_iface *stdrawi,
-                    struct st_framebuffer_iface *streadi);
+                    struct pipe_frontend_drawable *stdrawi,
+                    struct pipe_frontend_drawable *streadi);
 
 struct st_context *
 st_api_get_current(void);
 
 void
-st_api_destroy_drawable(struct st_framebuffer_iface *stfbi);
+st_api_destroy_drawable(struct pipe_frontend_drawable *drawable);
 
 void
 st_screen_destroy(struct pipe_frontend_screen *fscreen);
index de8f79f..4ea6347 100644 (file)
@@ -67,7 +67,7 @@ struct hash_table;
 
 struct st_screen
 {
-   struct hash_table *stfbi_ht; /* framebuffer iface objects hash table */
+   struct hash_table *drawable_ht; /* pipe_frontend_drawable objects hash table */
    simple_mtx_t st_mutex;
 };
 
@@ -226,21 +226,21 @@ st_framebuffer_validate(struct gl_framebuffer *stfb,
    bool changed = false;
    int32_t new_stamp;
 
-   new_stamp = p_atomic_read(&stfb->iface->stamp);
-   if (stfb->iface_stamp == new_stamp)
+   new_stamp = p_atomic_read(&stfb->drawable->stamp);
+   if (stfb->drawable_stamp == new_stamp)
       return;
 
    memset(textures, 0, stfb->num_statts * sizeof(textures[0]));
 
    /* validate the fb */
    do {
-      if (!stfb->iface->validate(st, stfb->iface, stfb->statts,
+      if (!stfb->drawable->validate(st, stfb->drawable, stfb->statts,
                                  stfb->num_statts, textures))
          return;
 
-      stfb->iface_stamp = new_stamp;
-      new_stamp = p_atomic_read(&stfb->iface->stamp);
-   } while(stfb->iface_stamp != new_stamp);
+      stfb->drawable_stamp = new_stamp;
+      new_stamp = p_atomic_read(&stfb->drawable->stamp);
+   } while(stfb->drawable_stamp != new_stamp);
 
    width = stfb->Width;
    height = stfb->Height;
@@ -321,7 +321,7 @@ st_framebuffer_update_attachments(struct gl_framebuffer *stfb)
 
       statt = buffer_index_to_attachment(idx);
       if (statt != ST_ATTACHMENT_INVALID &&
-          st_visual_have_buffers(stfb->iface->visual, 1 << statt))
+          st_visual_have_buffers(stfb->drawable->visual, 1 << statt))
          stfb->statts[stfb->num_statts++] = statt;
    }
    stfb->stamp++;
@@ -474,15 +474,15 @@ st_framebuffer_add_renderbuffer(struct gl_framebuffer *stfb,
 
    switch (idx) {
    case BUFFER_DEPTH:
-      format = stfb->iface->visual->depth_stencil_format;
+      format = stfb->drawable->visual->depth_stencil_format;
       sw = false;
       break;
    case BUFFER_ACCUM:
-      format = stfb->iface->visual->accum_format;
+      format = stfb->drawable->visual->accum_format;
       sw = true;
       break;
    default:
-      format = stfb->iface->visual->color_format;
+      format = stfb->drawable->visual->color_format;
       if (prefer_srgb)
          format = util_format_srgb(format);
       sw = false;
@@ -492,7 +492,7 @@ st_framebuffer_add_renderbuffer(struct gl_framebuffer *stfb,
    if (format == PIPE_FORMAT_NONE)
       return false;
 
-   rb = st_new_renderbuffer_fb(format, stfb->iface->visual->samples, sw);
+   rb = st_new_renderbuffer_fb(format, stfb->drawable->visual->samples, sw);
    if (!rb)
       return false;
 
@@ -588,21 +588,21 @@ st_visual_to_context_mode(const struct st_visual *visual,
  */
 static struct gl_framebuffer *
 st_framebuffer_create(struct st_context *st,
-                      struct st_framebuffer_iface *stfbi)
+                      struct pipe_frontend_drawable *drawable)
 {
    struct gl_framebuffer *stfb;
    struct gl_config mode;
    gl_buffer_index idx;
    bool prefer_srgb = false;
 
-   if (!stfbi)
+   if (!drawable)
       return NULL;
 
    stfb = CALLOC_STRUCT(gl_framebuffer);
    if (!stfb)
       return NULL;
 
-   st_visual_to_context_mode(stfbi->visual, &mode);
+   st_visual_to_context_mode(drawable->visual, &mode);
 
    /*
     * For desktop GL, sRGB framebuffer write is controlled by both the
@@ -626,13 +626,13 @@ st_framebuffer_create(struct st_context *st,
    if (_mesa_has_EXT_framebuffer_sRGB(st->ctx)) {
       struct pipe_screen *screen = st->screen;
       const enum pipe_format srgb_format =
-         util_format_srgb(stfbi->visual->color_format);
+         util_format_srgb(drawable->visual->color_format);
 
       if (srgb_format != PIPE_FORMAT_NONE &&
           st_pipe_format_to_mesa_format(srgb_format) != MESA_FORMAT_NONE &&
           screen->is_format_supported(screen, srgb_format,
-                                      PIPE_TEXTURE_2D, stfbi->visual->samples,
-                                      stfbi->visual->samples,
+                                      PIPE_TEXTURE_2D, drawable->visual->samples,
+                                      drawable->visual->samples,
                                       (PIPE_BIND_DISPLAY_TARGET |
                                        PIPE_BIND_RENDER_TARGET))) {
          mode.sRGBCapable = GL_TRUE;
@@ -646,9 +646,9 @@ st_framebuffer_create(struct st_context *st,
 
    _mesa_initialize_window_framebuffer(stfb, &mode);
 
-   stfb->iface = stfbi;
-   stfb->iface_ID = stfbi->ID;
-   stfb->iface_stamp = p_atomic_read(&stfbi->stamp) - 1;
+   stfb->drawable = drawable;
+   stfb->drawable_ID = drawable->ID;
+   stfb->drawable_stamp = p_atomic_read(&drawable->stamp) - 1;
 
    /* add the color buffer */
    idx = stfb->_ColorDrawBufferIndexes[0];
@@ -668,32 +668,32 @@ st_framebuffer_create(struct st_context *st,
 
 
 static uint32_t
-st_framebuffer_iface_hash(const void *key)
+drawable_hash(const void *key)
 {
    return (uintptr_t)key;
 }
 
 
 static bool
-st_framebuffer_iface_equal(const void *a, const void *b)
+drawable_equal(const void *a, const void *b)
 {
-   return (struct st_framebuffer_iface *)a == (struct st_framebuffer_iface *)b;
+   return (struct pipe_frontend_drawable *)a == (struct pipe_frontend_drawable *)b;
 }
 
 
 static bool
-st_framebuffer_iface_lookup(struct pipe_frontend_screen *fscreen,
-                            const struct st_framebuffer_iface *stfbi)
+drawable_lookup(struct pipe_frontend_screen *fscreen,
+                const struct pipe_frontend_drawable *drawable)
 {
    struct st_screen *screen =
       (struct st_screen *)fscreen->st_screen;
    struct hash_entry *entry;
 
    assert(screen);
-   assert(screen->stfbi_ht);
+   assert(screen->drawable_ht);
 
    simple_mtx_lock(&screen->st_mutex);
-   entry = _mesa_hash_table_search(screen->stfbi_ht, stfbi);
+   entry = _mesa_hash_table_search(screen->drawable_ht, drawable);
    simple_mtx_unlock(&screen->st_mutex);
 
    return entry != NULL;
@@ -701,18 +701,18 @@ st_framebuffer_iface_lookup(struct pipe_frontend_screen *fscreen,
 
 
 static bool
-st_framebuffer_iface_insert(struct pipe_frontend_screen *fscreen,
-                            struct st_framebuffer_iface *stfbi)
+drawable_insert(struct pipe_frontend_screen *fscreen,
+                struct pipe_frontend_drawable *drawable)
 {
    struct st_screen *screen =
       (struct st_screen *)fscreen->st_screen;
    struct hash_entry *entry;
 
    assert(screen);
-   assert(screen->stfbi_ht);
+   assert(screen->drawable_ht);
 
    simple_mtx_lock(&screen->st_mutex);
-   entry = _mesa_hash_table_insert(screen->stfbi_ht, stfbi, stfbi);
+   entry = _mesa_hash_table_insert(screen->drawable_ht, drawable, drawable);
    simple_mtx_unlock(&screen->st_mutex);
 
    return entry != NULL;
@@ -720,22 +720,22 @@ st_framebuffer_iface_insert(struct pipe_frontend_screen *fscreen,
 
 
 static void
-st_framebuffer_iface_remove(struct pipe_frontend_screen *fscreen,
-                            struct st_framebuffer_iface *stfbi)
+drawable_remove(struct pipe_frontend_screen *fscreen,
+                struct pipe_frontend_drawable *drawable)
 {
    struct st_screen *screen =
       (struct st_screen *)fscreen->st_screen;
    struct hash_entry *entry;
 
-   if (!screen || !screen->stfbi_ht)
+   if (!screen || !screen->drawable_ht)
       return;
 
    simple_mtx_lock(&screen->st_mutex);
-   entry = _mesa_hash_table_search(screen->stfbi_ht, stfbi);
+   entry = _mesa_hash_table_search(screen->drawable_ht, drawable);
    if (!entry)
       goto unlock;
 
-   _mesa_hash_table_remove(screen->stfbi_ht, entry);
+   _mesa_hash_table_remove(screen->drawable_ht, entry);
 
 unlock:
    simple_mtx_unlock(&screen->st_mutex);
@@ -747,12 +747,12 @@ unlock:
  * Remove the object from the framebuffer interface hash table.
  */
 void
-st_api_destroy_drawable(struct st_framebuffer_iface *stfbi)
+st_api_destroy_drawable(struct pipe_frontend_drawable *drawable)
 {
-   if (!stfbi)
+   if (!drawable)
       return;
 
-   st_framebuffer_iface_remove(stfbi->fscreen, stfbi);
+   drawable_remove(drawable->fscreen, drawable);
 }
 
 
@@ -769,9 +769,9 @@ st_framebuffers_purge(struct st_context *st)
    assert(fscreen);
 
    LIST_FOR_EACH_ENTRY_SAFE_REV(stfb, next, &st->winsys_buffers, head) {
-      struct st_framebuffer_iface *stfbi = stfb->iface;
+      struct pipe_frontend_drawable *drawable = stfb->drawable;
 
-      assert(stfbi);
+      assert(drawable);
 
       /**
        * If the corresponding framebuffer interface object no longer exists,
@@ -779,7 +779,7 @@ st_framebuffers_purge(struct st_context *st)
        * and unreference the framebuffer object, so its resources can be
        * deleted.
        */
-      if (!st_framebuffer_iface_lookup(fscreen, stfbi)) {
+      if (!drawable_lookup(fscreen, drawable)) {
          list_del(&stfb->head);
          _mesa_reference_framebuffer(&stfb, NULL);
       }
@@ -923,8 +923,8 @@ st_screen_destroy(struct pipe_frontend_screen *fscreen)
 {
    struct st_screen *screen = fscreen->st_screen;
 
-   if (screen && screen->stfbi_ht) {
-      _mesa_hash_table_destroy(screen->stfbi_ht, NULL);
+   if (screen && screen->drawable_ht) {
+      _mesa_hash_table_destroy(screen->drawable_ht, NULL);
       simple_mtx_destroy(&screen->st_mutex);
       FREE(screen);
       fscreen->st_screen = NULL;
@@ -956,9 +956,9 @@ st_api_create_context(struct pipe_frontend_screen *fscreen,
 
       screen = CALLOC_STRUCT(st_screen);
       simple_mtx_init(&screen->st_mutex, mtx_plain);
-      screen->stfbi_ht = _mesa_hash_table_create(NULL,
-                                                 st_framebuffer_iface_hash,
-                                                 st_framebuffer_iface_equal);
+      screen->drawable_ht = _mesa_hash_table_create(NULL,
+                                                 drawable_hash,
+                                                 drawable_equal);
       fscreen->st_screen = screen;
    }
 
@@ -1056,18 +1056,18 @@ st_api_get_current(void)
 static struct gl_framebuffer *
 st_framebuffer_reuse_or_create(struct st_context *st,
                                struct gl_framebuffer *fb,
-                               struct st_framebuffer_iface *stfbi)
+                               struct pipe_frontend_drawable *drawable)
 {
    struct gl_framebuffer *cur = NULL, *stfb = NULL;
 
-   if (!stfbi)
+   if (!drawable)
       return NULL;
 
    /* Check if there is already a framebuffer object for the specified
     * framebuffer interface in this context. If there is one, use it.
     */
    LIST_FOR_EACH_ENTRY(cur, &st->winsys_buffers, head) {
-      if (cur->iface_ID == stfbi->ID) {
+      if (cur->drawable_ID == drawable->ID) {
          _mesa_reference_framebuffer(&stfb, cur);
          break;
       }
@@ -1075,13 +1075,13 @@ st_framebuffer_reuse_or_create(struct st_context *st,
 
    /* If there is not already a framebuffer object, create one */
    if (stfb == NULL) {
-      cur = st_framebuffer_create(st, stfbi);
+      cur = st_framebuffer_create(st, drawable);
 
       if (cur) {
          /* add the referenced framebuffer interface object to
           * the framebuffer interface object hash table.
           */
-         if (!st_framebuffer_iface_insert(stfbi->fscreen, stfbi)) {
+         if (!drawable_insert(drawable->fscreen, drawable)) {
             _mesa_reference_framebuffer(&cur, NULL);
             return NULL;
          }
@@ -1104,8 +1104,8 @@ st_framebuffer_reuse_or_create(struct st_context *st,
  */
 bool
 st_api_make_current(struct st_context *st,
-                    struct st_framebuffer_iface *stdrawi,
-                    struct st_framebuffer_iface *streadi)
+                    struct pipe_frontend_drawable *stdrawi,
+                    struct pipe_frontend_drawable *streadi)
 {
    struct gl_framebuffer *stdraw, *stread;
    bool ret;
@@ -1207,7 +1207,7 @@ st_manager_flush_frontbuffer(struct st_context *st)
     * frontbuffer flush?
     */
    if (rb && rb->defined &&
-       stfb->iface->flush_front(st, stfb->iface, statt)) {
+       stfb->drawable->flush_front(st, stfb->drawable, statt)) {
       rb->defined = GL_FALSE;
 
       /* Trigger an update of rb->defined on next draw */
@@ -1248,10 +1248,10 @@ st_manager_flush_swapbuffers(void)
       return;
 
    stfb = st_ws_framebuffer(ctx->DrawBuffer);
-   if (!stfb || !stfb->iface->flush_swapbuffers)
+   if (!stfb || !stfb->drawable->flush_swapbuffers)
       return;
 
-   stfb->iface->flush_swapbuffers(st, stfb->iface);
+   stfb->drawable->flush_swapbuffers(st, stfb->drawable);
 }
 
 
@@ -1296,8 +1296,8 @@ st_manager_add_color_renderbuffer(struct gl_context *ctx,
     * new renderbuffer. It might be that there is a window system
     * renderbuffer available.
     */
-   if (stfb->iface)
-      stfb->iface_stamp = p_atomic_read(&stfb->iface->stamp) - 1;
+   if (stfb->drawable)
+      stfb->drawable_stamp = p_atomic_read(&stfb->drawable->stamp) - 1;
 
    st_invalidate_buffers(st_context(ctx));
 
@@ -1364,7 +1364,7 @@ st_manager_invalidate_drawables(struct gl_context *ctx)
    stread = st_ws_framebuffer(ctx->ReadBuffer);
 
    if (stdraw)
-      stdraw->iface_stamp = p_atomic_read(&stdraw->iface->stamp) - 1;
+      stdraw->drawable_stamp = p_atomic_read(&stdraw->drawable->stamp) - 1;
    if (stread && stread != stdraw)
-      stread->iface_stamp = p_atomic_read(&stread->iface->stamp) - 1;
+      stread->drawable_stamp = p_atomic_read(&stread->drawable->stamp) - 1;
 }
index ec373cf..7c2c4b6 100644 (file)
@@ -35,8 +35,6 @@
 
 
 struct st_context;
-struct st_framebuffer;
-struct st_framebuffer_interface;
 struct gl_renderbuffer;
 struct pipe_surface;
 
@@ -51,9 +49,6 @@ st_manager_add_color_renderbuffer(struct gl_context *ctx, struct gl_framebuffer
                                   gl_buffer_index idx);
 
 void
-st_framebuffer_interface_destroy(struct st_framebuffer_interface *stfbi);
-
-void
 st_manager_flush_swapbuffers(void);
 
 void