From 96c6637a1360f146bbf49ffb207ae943ecbbdf49 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 28 Nov 2010 01:37:35 +0800 Subject: st/vega: Use st_framebuffer for fb width/height. This allows us to eventually make g3d states opaque. --- src/gallium/state_trackers/vega/api_images.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/gallium/state_trackers/vega/api_images.c') diff --git a/src/gallium/state_trackers/vega/api_images.c b/src/gallium/state_trackers/vega/api_images.c index e9f038c5f9..23ab37513f 100644 --- a/src/gallium/state_trackers/vega/api_images.c +++ b/src/gallium/state_trackers/vega/api_images.c @@ -399,7 +399,6 @@ void vegaReadPixels(void * data, VGint dataStride, struct st_framebuffer *stfb = ctx->draw_buffer; struct st_renderbuffer *strb = stfb->strb; - struct pipe_framebuffer_state *fb = &ctx->state.g3d.fb; VGfloat temp[VEGA_MAX_IMAGE_WIDTH][4]; VGfloat *df = (VGfloat*)temp; @@ -435,21 +434,21 @@ void vegaReadPixels(void * data, VGint dataStride, sy = 0; } - if (sx + width > fb->width || sy + height > fb->height) { - width = fb->width - sx; - height = fb->height - sy; + if (sx + width > stfb->width || sy + height > stfb->height) { + width = stfb->width - sx; + height = stfb->height - sy; /* nothing to read */ if (width <= 0 || height <= 0) return; } { - VGint y = (fb->height - sy) - 1, yStep = -1; + VGint y = (stfb->height - sy) - 1, yStep = -1; struct pipe_transfer *transfer; transfer = pipe_get_transfer(pipe, strb->texture, 0, 0, 0, PIPE_TRANSFER_READ, - 0, 0, sx + width, fb->height - sy); + 0, 0, sx + width, stfb->height - sy); /* Do a row at a time to flip image data vertically */ for (i = 0; i < height; i++) { @@ -472,8 +471,8 @@ void vegaCopyPixels(VGint dx, VGint dy, VGint width, VGint height) { struct vg_context *ctx = vg_current_context(); - struct pipe_framebuffer_state *fb = &ctx->state.g3d.fb; - struct st_renderbuffer *strb = ctx->draw_buffer->strb; + struct st_framebuffer *stfb = ctx->draw_buffer; + struct st_renderbuffer *strb = stfb->strb; if (width <= 0 || height <= 0) { vg_set_error(ctx, VG_ILLEGAL_ARGUMENT_ERROR); @@ -481,8 +480,8 @@ void vegaCopyPixels(VGint dx, VGint dy, } /* do nothing if we copy from outside the fb */ - if (dx >= (VGint)fb->width || dy >= (VGint)fb->height || - sx >= (VGint)fb->width || sy >= (VGint)fb->height) + if (dx >= (VGint)stfb->width || dy >= (VGint)stfb->height || + sx >= (VGint)stfb->width || sy >= (VGint)stfb->height) return; vg_validate_state(ctx); -- cgit v1.2.3