diff options
author | Paul Berry <[email protected]> | 2012-07-18 12:54:48 -0700 |
---|---|---|
committer | Paul Berry <[email protected]> | 2012-07-26 10:48:36 -0700 |
commit | c738ea1191cd1b5a0dc60b0e6d05fd918083e961 (patch) | |
tree | f91987757f43432ec049683086e424ffc0ff4ec1 /src/mesa/drivers/dri/intel | |
parent | 284ad9c3b29a6d6f0bade050ea9e949d67967983 (diff) |
intel: Make more consistent use of _mesa_is_{user,winsys}_fbo()
A lot of code was still differentiating between between winsys and
user fbos by testing the fbo's name against zero. This converts
everything in the i915 and 965 drivers over to use _mesa_is_user_fbo()
and _mesa_is_winsys_fbo().
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_blit.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_buffers.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_fbo.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_pixel_copy.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_copy.c | 3 |
6 files changed, 12 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index fd4a86c4e72..36a2c6aadac 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -30,6 +30,7 @@ #include "main/context.h" #include "main/enums.h" #include "main/colormac.h" +#include "main/fbobject.h" #include "intel_blit.h" #include "intel_buffers.h" @@ -248,7 +249,7 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask) } cx = fb->_Xmin; - if (fb->Name == 0) + if (_mesa_is_winsys_fbo(fb)) cy = ctx->DrawBuffer->Height - fb->_Ymax; else cy = fb->_Ymin; diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 2b0276327d2..9a9a259c9e5 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -70,7 +70,7 @@ void intel_check_front_buffer_rendering(struct intel_context *intel) { const struct gl_framebuffer *fb = intel->ctx.DrawBuffer; - if (fb->Name == 0) { + if (_mesa_is_winsys_fbo(fb)) { /* drawing to window system buffer */ if (fb->_NumColorDrawBuffers > 0) { if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) { diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index ac7d6c11665..a53985b1893 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -359,7 +359,7 @@ intel_resize_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, fb->Initialized = true; /* XXX remove someday */ - if (fb->Name != 0) { + if (_mesa_is_user_fbo(fb)) { return; } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 769738c0ec2..954dfc50b14 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -37,6 +37,7 @@ #include "main/state.h" #include "main/texobj.h" #include "main/context.h" +#include "main/fbobject.h" #include "swrast/swrast.h" #include "drivers/common/meta.h" @@ -158,7 +159,7 @@ static GLuint get_bitmap_rect(GLsizei width, GLsizei height, static INLINE int y_flip(struct gl_framebuffer *fb, int y, int height) { - if (fb->Name != 0) + if (_mesa_is_user_fbo(fb)) return y; else return fb->Height - y - height; @@ -265,7 +266,7 @@ do_blit_bitmap( struct gl_context *ctx, w, h, (GLubyte *)stipple, 8, - fb->Name == 0 ? true : false) == 0) + _mesa_is_winsys_fbo(fb)) == 0) continue; if (!intelEmitImmediateColorExpandBlit(intel, diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index 18a807508b3..682a52d97d2 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -30,6 +30,7 @@ #include "main/state.h" #include "main/mtypes.h" #include "main/condrender.h" +#include "main/fbobject.h" #include "drivers/common/meta.h" #include "intel_context.h" @@ -175,14 +176,14 @@ do_blit_copypixels(struct gl_context * ctx, dsty += srcy - orig_srcy; /* Flip dest Y if it's a window system framebuffer. */ - if (fb->Name == 0) { + if (_mesa_is_winsys_fbo(fb)) { /* copypixels to a window system framebuffer */ dsty = fb->Height - dsty - height; flip = !flip; } /* Flip source Y if it's a window system framebuffer. */ - if (read_fb->Name == 0) { + if (_mesa_is_winsys_fbo(read_fb)) { srcy = read_fb->Height - srcy - height; flip = !flip; } diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 0798cec8f3c..6da4ec6da3e 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -30,6 +30,7 @@ #include "main/image.h" #include "main/teximage.h" #include "main/texstate.h" +#include "main/fbobject.h" #include "drivers/common/meta.h" @@ -108,7 +109,7 @@ intel_copy_texsubimage(struct intel_context *intel, return false; } - if (ctx->ReadBuffer->Name == 0) { + if (_mesa_is_winsys_fbo(ctx->ReadBuffer)) { /* Flip vertical orientation for system framebuffers */ y = ctx->ReadBuffer->Height - (y + height); src_pitch = -region->pitch; |