diff options
author | Brian Paul <[email protected]> | 2009-01-29 16:05:39 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-01-30 16:03:32 -0700 |
commit | 2d5b86be25a7ccb729e746aa5e1bdd537d76df68 (patch) | |
tree | 88380b58a36d3b3596da08703d180ac6678ace50 /src/mesa/swrast/s_context.h | |
parent | 81ca8b93f212d1946c70660041ce97d98f352608 (diff) |
swrast: replace RENDER_START/FINISH macros with inline functions
Diffstat (limited to 'src/mesa/swrast/s_context.h')
-rw-r--r-- | src/mesa/swrast/s_context.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 46a5fa24f85..cdd6fa5048d 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -253,19 +253,28 @@ CONST_SWRAST_CONTEXT(const GLcontext *ctx) } -#define RENDER_START(SWctx, GLctx) \ - do { \ - if ((SWctx)->Driver.SpanRenderStart) { \ - (*(SWctx)->Driver.SpanRenderStart)(GLctx); \ - } \ - } while (0) - -#define RENDER_FINISH(SWctx, GLctx) \ - do { \ - if ((SWctx)->Driver.SpanRenderFinish) { \ - (*(SWctx)->Driver.SpanRenderFinish)(GLctx); \ - } \ - } while (0) +/** + * Called prior to framebuffer reading/writing. + * For drivers that rely on swrast for fallback rendering, this is the + * driver's opportunity to map renderbuffers and textures. + */ +static INLINE void +swrast_render_start(GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + if (swrast->Driver.SpanRenderStart) + swrast->Driver.SpanRenderStart(ctx); +} + + +/** Called after framebuffer reading/writing */ +static INLINE void +swrast_render_finish(GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + if (swrast->Driver.SpanRenderFinish) + swrast->Driver.SpanRenderFinish(ctx); +} |