diff options
author | Chia-I Wu <[email protected]> | 2010-11-28 01:37:35 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-12-01 11:23:50 +0800 |
commit | 96c6637a1360f146bbf49ffb207ae943ecbbdf49 (patch) | |
tree | 1189ca0bdede78540ba2377801c325c9152f40bd /src/gallium/state_trackers/vega/mask.c | |
parent | 438359597cd4254558f4d2fd5b54eb32c03e1b4c (diff) |
st/vega: Use st_framebuffer for fb width/height.
This allows us to eventually make g3d states opaque.
Diffstat (limited to 'src/gallium/state_trackers/vega/mask.c')
-rw-r--r-- | src/gallium/state_trackers/vega/mask.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c index 3bd9a1e5989..3b042cec0e4 100644 --- a/src/gallium/state_trackers/vega/mask.c +++ b/src/gallium/state_trackers/vega/mask.c @@ -114,11 +114,10 @@ static void read_alpha_mask(void * data, VGint dataStride, struct st_framebuffer *stfb = ctx->draw_buffer; struct st_renderbuffer *strb = stfb->alpha_mask; - struct pipe_framebuffer_state *fb = &ctx->state.g3d.fb; VGfloat temp[VEGA_MAX_IMAGE_WIDTH][4]; VGfloat *df = (VGfloat*)temp; - VGint y = (fb->height - sy) - 1, yStep = -1; + VGint y = (stfb->height - sy) - 1, yStep = -1; VGint i; VGubyte *dst = (VGubyte *)data; VGint xoffset = 0, yoffset = 0; @@ -135,7 +134,7 @@ static void read_alpha_mask(void * data, VGint dataStride, yoffset = -sy; height += sy; sy = 0; - y = (fb->height - sy) - 1; + y = (stfb->height - sy) - 1; yoffset *= dataStride; } @@ -164,23 +163,23 @@ static void read_alpha_mask(void * data, VGint dataStride, void save_alpha_to_file(const char *filename) { struct vg_context *ctx = vg_current_context(); - struct pipe_framebuffer_state *fb = &ctx->state.g3d.fb; + struct st_framebuffer *stfb = ctx->draw_buffer; VGint *data; int i, j; - data = malloc(sizeof(int) * fb->width * fb->height); - read_alpha_mask(data, fb->width * sizeof(int), + data = malloc(sizeof(int) * stfb->width * stfb->height); + read_alpha_mask(data, stfb->width * sizeof(int), VG_sRGBA_8888, - 0, 0, fb->width, fb->height); + 0, 0, stfb->width, stfb->height); fprintf(stderr, "/*---------- start */\n"); fprintf(stderr, "const int image_width = %d;\n", - fb->width); + stfb->width); fprintf(stderr, "const int image_height = %d;\n", - fb->height); + stfb->height); fprintf(stderr, "const int image_data = {\n"); - for (i = 0; i < fb->height; ++i) { - for (j = 0; j < fb->width; ++j) { - int rgba = data[i * fb->height + j]; + for (i = 0; i < stfb->height; ++i) { + for (j = 0; j < stfb->width; ++j) { + int rgba = data[i * stfb->height + j]; int argb = 0; argb = (rgba >> 8); argb |= ((rgba & 0xff) << 24); |