diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2001-03-19 02:25:35 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2001-03-19 02:25:35 +0000 |
commit | 709892459922a32096fe9dd8261d0d92337bb02f (patch) | |
tree | 87782215d4531207c97b236a5dfa0d15c45aef8a /src/mesa/main/colortab.c | |
parent | d9bf6ccce9f5fea22d6a478c4afafea3c3c525c5 (diff) |
Split driver struct into swrast/tnl/core components.
Diffstat (limited to 'src/mesa/main/colortab.c')
-rw-r--r-- | src/mesa/main/colortab.c | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index eae856b300..5a50ae50e6 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -1,4 +1,4 @@ -/* $Id: colortab.c,v 1.37 2001/03/12 00:48:37 gareth Exp $ */ +/* $Id: colortab.c,v 1.38 2001/03/19 02:25:35 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -609,28 +609,11 @@ void _mesa_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { - GLchan data[MAX_WIDTH][4]; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* Select buffer to read from */ - (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer, - ctx->Pixel.DriverReadBuffer ); - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - /* read the data from framebuffer */ - RENDER_START(ctx); - _mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data ); - RENDER_FINISH(ctx); - - /* Restore reading from draw buffer (the default) */ - (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, - ctx->Color.DriverDrawBuffer ); - - _mesa_ColorTable(target, internalformat, width, - GL_RGBA, GL_UNSIGNED_BYTE, data); + ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width ); } @@ -640,27 +623,10 @@ void _mesa_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) { - GLchan data[MAX_WIDTH][4]; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - /* Select buffer to read from */ - (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer, - ctx->Pixel.DriverReadBuffer ); - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - /* read the data from framebuffer */ - RENDER_START(ctx); - _mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data ); - RENDER_FINISH(ctx); - - /* Restore reading from draw buffer (the default) */ - (*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, - ctx->Color.DriverDrawBuffer ); - - _mesa_ColorSubTable(target, start, width, GL_RGBA, GL_UNSIGNED_BYTE, data); + ctx->Driver.CopyColorSubTable( ctx, target, start, x, y, width ); } |