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) {
}
/*
- * Backend functions for st_framebuffer interface.
+ * Backend functions for pipe_frontend_drawable.
*/
static void
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;
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);
*/
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);
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;
#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;
}
/*
- * Backend functions for st_framebuffer interface and swap_buffers.
+ * Backend functions for pipe_frontend_drawable and swap_buffers.
*/
static void
/*
* 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;
/* 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);
void
xmesa_notify_invalid_buffer(XMesaBuffer b)
{
- p_atomic_inc(&b->stfb->stamp);
+ p_atomic_inc(&b->drawable->stamp);
}
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)
/* 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);
}
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);
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);
}
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);
/* 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;
* 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? */
#include "state_tracker/st_context.h"
struct xmesa_st_framebuffer {
- struct st_framebuffer_iface base;
+ struct pipe_frontend_drawable base;
XMesaDisplay display;
XMesaBuffer buffer;
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;
}
* 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;
* 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;
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);
* 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;
/**
* 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[]
*/
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;
/* 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;
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);
}
}
/**
- * 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);
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;
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);
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);
* 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;
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 = {};
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];
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) {
#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_ */
// 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;
}
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)
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;
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",
*/
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;
CALLED();
context = hgl_st_context(st);
- buffer = hgl_st_framebuffer(stfbi);
+ buffer = hgl_st_framebuffer(drawable);
// Build mask of current attachments
stAttachmentMask = 0;
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)
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;
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;
}
for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
pipe_resource_reference(&buffer->textures[i], NULL);
- FREE(buffer->stfbi);
+ FREE(buffer->drawable);
FREE(buffer);
}
struct hgl_buffer
{
- struct st_framebuffer_iface *stfbi;
+ struct pipe_frontend_drawable *drawable;
struct st_visual* visual;
unsigned width;
};
// 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);
struct osmesa_buffer
{
- struct st_framebuffer_iface *stfb;
+ struct pipe_frontend_drawable *drawable;
struct st_visual visual;
unsigned width, height;
/**
- * 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;
}
*/
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;
*/
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));
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;
}
{
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);
* 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);
}
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
} 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;
}
} 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);
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);
void
stw_notify_current_locked( struct stw_framebuffer *fb )
{
- p_atomic_inc(&fb->stfb->stamp);
+ p_atomic_inc(&fb->drawable->stamp);
}
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);
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;
}
void
stw_framebuffer_update(struct stw_framebuffer *fb)
{
- assert(fb->stfb);
+ assert(fb->drawable);
assert(fb->height);
assert(fb->width);
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);
}
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);
}
}
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
struct pipe_resource;
-struct st_framebuffer_iface;
+struct pipe_frontend_drawable;
struct stw_pixelformat_info;
struct pipe_frontend_screen;
int iDisplayablePixelFormat;
enum stw_framebuffer_owner owner;
- struct st_framebuffer_iface *stfb;
+ struct pipe_frontend_drawable *drawable;
/*
* Mutable members.
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;
}
#endif
struct stw_st_framebuffer {
- struct st_framebuffer_iface base;
+ struct pipe_frontend_drawable base;
struct stw_framebuffer *fb;
struct st_visual stvis;
*/
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;
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;
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;
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));
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;
/**
* 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;
* 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++) {
*/
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;
* 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];
}
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 */
* 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.
* @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);
/**
* 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);
};
}
// 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;
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. */
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);
}
/** 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;
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);
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;
};
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;
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++;
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;
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;
*/
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
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;
_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];
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;
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;
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);
* 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);
}
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,
* 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);
}
{
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;
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;
}
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;
}
/* 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;
}
*/
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;
* 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 */
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);
}
* 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));
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;
}
struct st_context;
-struct st_framebuffer;
-struct st_framebuffer_interface;
struct gl_renderbuffer;
struct pipe_surface;
st_manager_add_color_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
gl_buffer_index idx);
-void
-st_framebuffer_interface_destroy(struct st_framebuffer_interface *stfbi);
-
void
st_manager_flush_swapbuffers(void);