*/
st_notify_swapbuffers(b->stfb);
- surf = st_get_framebuffer_surface(b->stfb, ST_SURFACE_BACK_LEFT);
+ st_get_framebuffer_surface(b->stfb, ST_SURFACE_BACK_LEFT, &surf);
if (surf) {
driver.display_surface(b, surf);
}
*/
void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
{
- struct pipe_surface *surf_front
- = st_get_framebuffer_surface(b->stfb, ST_SURFACE_FRONT_LEFT);
- struct pipe_surface *surf_back
- = st_get_framebuffer_surface(b->stfb, ST_SURFACE_BACK_LEFT);
+ struct pipe_surface *surf_front;
+ struct pipe_surface *surf_back;
struct pipe_context *pipe = NULL; /* XXX fix */
+ st_get_framebuffer_surface(b->stfb, ST_SURFACE_FRONT_LEFT, &surf_front);
+ st_get_framebuffer_surface(b->stfb, ST_SURFACE_BACK_LEFT, &surf_back);
+
if (!surf_front || !surf_back)
return;
if (st->frontbuffer_status == FRONT_STATUS_COPY_OF_BACK) {
/* copy back color buffer to front color buffer */
struct st_framebuffer *stfb = (struct st_framebuffer *) fb;
- struct pipe_surface *surf_front
- = st_get_framebuffer_surface(stfb, ST_SURFACE_FRONT_LEFT);
- struct pipe_surface *surf_back
- = st_get_framebuffer_surface(stfb, ST_SURFACE_BACK_LEFT);
+ struct pipe_surface *surf_front, *surf_back;
+ (void) st_get_framebuffer_surface(stfb, ST_SURFACE_FRONT_LEFT, &surf_front);
+ (void) st_get_framebuffer_surface(stfb, ST_SURFACE_BACK_LEFT, &surf_back);
st->pipe->surface_copy(st->pipe,
FALSE,
#include "main/matrix.h"
#include "main/renderbuffer.h"
#include "main/scissor.h"
-#include "st_public.h"
#include "st_context.h"
#include "st_cb_fbo.h"
+#include "st_public.h"
#include "pipe/p_defines.h"
#include "pipe/p_context.h"
#include "pipe/p_inlines.h"
/**
* Return the pipe_surface for the given renderbuffer.
*/
-struct pipe_surface *
-st_get_framebuffer_surface(struct st_framebuffer *stfb, uint surfIndex)
+int
+st_get_framebuffer_surface(struct st_framebuffer *stfb, uint surfIndex, struct pipe_surface **surface)
{
struct st_renderbuffer *strb;
assert(ST_SURFACE_BACK_RIGHT == BUFFER_BACK_RIGHT);
strb = st_renderbuffer(stfb->Base.Attachment[surfIndex].Renderbuffer);
- if (strb)
- return strb->surface;
- return NULL;
+ if (strb) {
+ *surface = strb->surface;
+ return GL_TRUE;
+ }
+
+ *surface = NULL;
+ return GL_FALSE;
}
-struct pipe_texture *
-st_get_framebuffer_texture(struct st_framebuffer *stfb, uint surfIndex)
+int
+st_get_framebuffer_texture(struct st_framebuffer *stfb, uint surfIndex, struct pipe_texture **texture)
{
struct st_renderbuffer *strb;
assert(ST_SURFACE_BACK_RIGHT == BUFFER_BACK_RIGHT);
strb = st_renderbuffer(stfb->Base.Attachment[surfIndex].Renderbuffer);
- if (strb)
- return strb->texture;
- return NULL;
+ if (strb) {
+ *texture = strb->texture;
+ return GL_TRUE;
+ }
+
+ *texture = NULL;
+ return GL_FALSE;
}
/**
void st_get_framebuffer_dimensions( struct st_framebuffer *stfb,
uint *width, uint *height);
-struct pipe_surface *st_get_framebuffer_surface(struct st_framebuffer *stfb,
- uint surfIndex);
+int st_get_framebuffer_surface(struct st_framebuffer *stfb,
+ uint surfIndex, struct pipe_surface **surface);
-struct pipe_texture *st_get_framebuffer_texture(struct st_framebuffer *stfb,
- uint surfIndex);
+int st_get_framebuffer_texture(struct st_framebuffer *stfb,
+ uint surfIndex, struct pipe_texture **texture);
void *st_framebuffer_private( struct st_framebuffer *stfb );