2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 #include "histogram.h"
36 #include "s_context.h"
38 #include "s_pixeltex.h"
40 #include "s_stencil.h"
41 #include "s_texture.h"
47 * Determine if there's overlap in an image copy.
48 * This test also compensates for the fact that copies are done from
49 * bottom to top and overlaps can sometimes be handled correctly
50 * without making a temporary image copy.
53 regions_overlap(GLint srcx
, GLint srcy
,
54 GLint dstx
, GLint dsty
,
55 GLint width
, GLint height
,
56 GLfloat zoomX
, GLfloat zoomY
)
58 if (zoomX
== 1.0 && zoomY
== 1.0) {
60 if (srcx
>= dstx
+ width
|| (srcx
+ width
<= dstx
)) {
63 else if (srcy
< dsty
) { /* this is OK */
66 else if (srcy
> dsty
+ height
) {
74 /* add one pixel of slop when zooming, just to be safe */
75 if ((srcx
> dstx
+ (width
* zoomX
) + 1) || (srcx
+ width
+ 1 < dstx
)) {
78 else if ((srcy
< dsty
) && (srcy
+ height
< dsty
+ (height
* zoomY
))) {
81 else if ((srcy
> dsty
) && (srcy
+ height
> dsty
+ (height
* zoomY
))) {
92 * Convert GLfloat[n][4] colors to GLchan[n][4].
93 * XXX maybe move into image.c
96 float_span_to_chan(GLuint n
, CONST GLfloat in
[][4], GLchan out
[][4])
99 for (i
= 0; i
< n
; i
++) {
100 UNCLAMPED_FLOAT_TO_CHAN(out
[i
][RCOMP
], in
[i
][RCOMP
]);
101 UNCLAMPED_FLOAT_TO_CHAN(out
[i
][GCOMP
], in
[i
][GCOMP
]);
102 UNCLAMPED_FLOAT_TO_CHAN(out
[i
][BCOMP
], in
[i
][BCOMP
]);
103 UNCLAMPED_FLOAT_TO_CHAN(out
[i
][ACOMP
], in
[i
][ACOMP
]);
109 * Convert GLchan[n][4] colors to GLfloat[n][4].
110 * XXX maybe move into image.c
113 chan_span_to_float(GLuint n
, CONST GLchan in
[][4], GLfloat out
[][4])
116 for (i
= 0; i
< n
; i
++) {
117 out
[i
][RCOMP
] = CHAN_TO_FLOAT(in
[i
][RCOMP
]);
118 out
[i
][GCOMP
] = CHAN_TO_FLOAT(in
[i
][GCOMP
]);
119 out
[i
][BCOMP
] = CHAN_TO_FLOAT(in
[i
][BCOMP
]);
120 out
[i
][ACOMP
] = CHAN_TO_FLOAT(in
[i
][ACOMP
]);
127 * RGBA copypixels with convolution.
130 copy_conv_rgba_pixels(GLcontext
*ctx
, GLint srcx
, GLint srcy
,
131 GLint width
, GLint height
, GLint destx
, GLint desty
)
133 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
134 struct gl_renderbuffer
*drawRb
= NULL
;
135 GLboolean quick_draw
;
137 GLboolean changeBuffer
;
138 const GLboolean zoom
= ctx
->Pixel
.ZoomX
!= 1.0F
|| ctx
->Pixel
.ZoomY
!= 1.0F
;
139 const GLuint transferOps
= ctx
->_ImageTransferState
;
140 GLfloat
*dest
, *tmpImage
, *convImage
;
143 INIT_SPAN(span
, GL_BITMAP
, 0, 0, SPAN_RGBA
);
146 _swrast_span_default_z(ctx
, &span
);
147 if (ctx
->Fog
.Enabled
)
148 _swrast_span_default_fog(ctx
, &span
);
151 if (SWRAST_CONTEXT(ctx
)->_RasterMask
== 0
154 && destx
+ width
<= (GLint
) ctx
->DrawBuffer
->Width
) {
155 quick_draw
= GL_TRUE
;
156 drawRb
= ctx
->DrawBuffer
->_ColorDrawBuffers
[0][0];
159 quick_draw
= GL_FALSE
;
162 /* If read and draw buffer are different we must do buffer switching */
163 changeBuffer
= ctx
->Pixel
.ReadBuffer
!= ctx
->Color
.DrawBuffer
[0]
164 || ctx
->DrawBuffer
!= ctx
->ReadBuffer
;
167 /* allocate space for GLfloat image */
168 tmpImage
= (GLfloat
*) MALLOC(width
* height
* 4 * sizeof(GLfloat
));
170 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCopyPixels");
173 convImage
= (GLfloat
*) MALLOC(width
* height
* 4 * sizeof(GLfloat
));
176 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCopyPixels");
181 /* choose the read buffer */
182 _swrast_use_read_buffer(ctx
);
185 /* read source image */
187 for (row
= 0; row
< height
; row
++) {
188 GLchan rgba
[MAX_WIDTH
][4];
189 /* Read GLchan and convert to GLfloat */
190 _swrast_read_rgba_span(ctx
, ctx
->ReadBuffer
->_ColorReadBuffer
,
191 width
, srcx
, srcy
+ row
, rgba
);
192 chan_span_to_float(width
, (CONST
GLchan (*)[4]) rgba
,
193 (GLfloat (*)[4]) dest
);
198 /* restore default src/dst buffer */
199 _swrast_use_draw_buffer(ctx
);
202 /* do the image transfer ops which preceed convolution */
203 for (row
= 0; row
< height
; row
++) {
204 GLfloat (*rgba
)[4] = (GLfloat (*)[4]) (tmpImage
+ row
* width
* 4);
205 _mesa_apply_rgba_transfer_ops(ctx
,
206 transferOps
& IMAGE_PRE_CONVOLUTION_BITS
,
211 if (ctx
->Pixel
.Convolution2DEnabled
) {
212 _mesa_convolve_2d_image(ctx
, &width
, &height
, tmpImage
, convImage
);
215 ASSERT(ctx
->Pixel
.Separable2DEnabled
);
216 _mesa_convolve_sep_image(ctx
, &width
, &height
, tmpImage
, convImage
);
220 /* do remaining post-convolution image transfer ops */
221 for (row
= 0; row
< height
; row
++) {
222 GLfloat (*rgba
)[4] = (GLfloat (*)[4]) (convImage
+ row
* width
* 4);
223 _mesa_apply_rgba_transfer_ops(ctx
,
224 transferOps
& IMAGE_POST_CONVOLUTION_BITS
,
228 /* write the new image */
229 for (row
= 0; row
< height
; row
++) {
230 const GLfloat
*src
= convImage
+ row
* width
* 4;
233 /* convert floats back to chan */
234 float_span_to_chan(width
, (const GLfloat (*)[4]) src
, span
.array
->rgba
);
236 if (ctx
->Pixel
.PixelTextureEnabled
&& ctx
->Texture
._EnabledUnits
) {
238 _swrast_pixel_texture(ctx
, &span
);
241 /* write row to framebuffer */
244 if (quick_draw
&& dy
>= 0 && dy
< (GLint
) ctx
->DrawBuffer
->Height
) {
246 if (swrast
->Driver
.WriteRGBASpan
)
247 swrast
->Driver
.WriteRGBASpan(ctx
, drawRb
, width
, destx
, dy
,
248 (const GLchan (*)[4]) span
.array
->rgba
, NULL
);
251 drawRb
->PutRow(ctx
, drawRb
, width
, destx
, dy
,
252 span
.array
->rgba
, NULL
);
258 _swrast_write_zoomed_rgba_span(ctx
, &span
,
259 (CONST
GLchan (*)[4])span
.array
->rgba
,
266 _swrast_write_rgba_span(ctx
, &span
);
278 copy_rgba_pixels(GLcontext
*ctx
, GLint srcx
, GLint srcy
,
279 GLint width
, GLint height
, GLint destx
, GLint desty
)
281 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
282 struct gl_renderbuffer
*drawRb
;
284 GLboolean quick_draw
;
285 GLint sy
, dy
, stepy
, j
;
286 GLboolean changeBuffer
;
287 const GLboolean zoom
= ctx
->Pixel
.ZoomX
!= 1.0F
|| ctx
->Pixel
.ZoomY
!= 1.0F
;
289 const GLuint transferOps
= ctx
->_ImageTransferState
;
292 if (!ctx
->ReadBuffer
->_ColorReadBuffer
) {
293 /* no readbuffer - OK */
297 INIT_SPAN(span
, GL_BITMAP
, 0, 0, SPAN_RGBA
);
299 if (ctx
->Pixel
.Convolution2DEnabled
|| ctx
->Pixel
.Separable2DEnabled
) {
300 copy_conv_rgba_pixels(ctx
, srcx
, srcy
, width
, height
, destx
, desty
);
304 /* Determine if copy should be done bottom-to-top or top-to-bottom */
306 /* top-down max-to-min */
307 sy
= srcy
+ height
- 1;
308 dy
= desty
+ height
- 1;
312 /* bottom-up min-to-max */
318 if (ctx
->DrawBuffer
== ctx
->ReadBuffer
) {
319 overlapping
= regions_overlap(srcx
, srcy
, destx
, desty
, width
, height
,
320 ctx
->Pixel
.ZoomX
, ctx
->Pixel
.ZoomY
);
323 overlapping
= GL_FALSE
;
327 _swrast_span_default_z(ctx
, &span
);
328 if (ctx
->Fog
.Enabled
)
329 _swrast_span_default_fog(ctx
, &span
);
331 if (SWRAST_CONTEXT(ctx
)->_RasterMask
== 0
334 && destx
+ width
<= (GLint
) ctx
->DrawBuffer
->Width
) {
335 quick_draw
= GL_TRUE
;
336 drawRb
= ctx
->DrawBuffer
->_ColorDrawBuffers
[0][0];
339 quick_draw
= GL_FALSE
;
343 /* If read and draw buffer are different we must do buffer switching */
344 changeBuffer
= ctx
->Pixel
.ReadBuffer
!= ctx
->Color
.DrawBuffer
[0]
345 || ctx
->DrawBuffer
!= ctx
->ReadBuffer
;
349 tmpImage
= (GLchan
*) MALLOC(width
* height
* sizeof(GLchan
) * 4);
351 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "glCopyPixels" );
356 _swrast_use_read_buffer(ctx
);
357 /* read the source image */
359 for (j
= 0; j
< height
; j
++, ssy
+= stepy
) {
360 _swrast_read_rgba_span( ctx
, ctx
->ReadBuffer
->_ColorReadBuffer
,
361 width
, srcx
, ssy
, (GLchan (*)[4]) p
);
367 _swrast_use_draw_buffer(ctx
);
368 changeBuffer
= GL_FALSE
;
372 tmpImage
= NULL
; /* silence compiler warnings */
376 for (j
= 0; j
< height
; j
++, sy
+= stepy
, dy
+= stepy
) {
377 /* Get source pixels */
379 /* get from buffered image */
380 ASSERT(width
< MAX_WIDTH
);
381 MEMCPY(span
.array
->rgba
, p
, width
* sizeof(GLchan
) * 4);
385 /* get from framebuffer */
387 _swrast_use_read_buffer(ctx
);
388 ASSERT(width
< MAX_WIDTH
);
389 _swrast_read_rgba_span( ctx
, ctx
->ReadBuffer
->_ColorReadBuffer
,
390 width
, srcx
, sy
, span
.array
->rgba
);
392 _swrast_use_draw_buffer(ctx
);
396 DEFMARRAY(GLfloat
, rgbaFloat
, MAX_WIDTH
, 4); /* mac 32k limitation */
397 CHECKARRAY(rgbaFloat
, return);
399 /* convert to float, transfer, convert back to chan */
400 chan_span_to_float(width
, (CONST
GLchan (*)[4]) span
.array
->rgba
,
402 _mesa_apply_rgba_transfer_ops(ctx
, transferOps
, width
, rgbaFloat
);
403 float_span_to_chan(width
, (CONST
GLfloat (*)[4]) rgbaFloat
,
406 UNDEFARRAY(rgbaFloat
); /* mac 32k limitation */
409 if (ctx
->Pixel
.PixelTextureEnabled
&& ctx
->Texture
._EnabledUnits
) {
411 _swrast_pixel_texture(ctx
, &span
);
414 /* Write color span */
415 if (quick_draw
&& dy
>= 0 && dy
< (GLint
) ctx
->DrawBuffer
->Height
) {
417 if (swrast
->Driver
.WriteRGBASpan
)
418 swrast
->Driver
.WriteRGBASpan(ctx
, drawRb
, width
, destx
, dy
,
419 (const GLchan (*)[4])span
.array
->rgba
, NULL
);
422 drawRb
->PutRow(ctx
, drawRb
, width
, destx
, dy
, span
.array
->rgba
, NULL
);
429 _swrast_write_zoomed_rgba_span(ctx
, &span
,
430 (CONST
GLchan (*)[4]) span
.array
->rgba
,
437 _swrast_write_rgba_span(ctx
, &span
);
447 copy_ci_pixels( GLcontext
*ctx
, GLint srcx
, GLint srcy
,
448 GLint width
, GLint height
,
449 GLint destx
, GLint desty
)
454 GLboolean changeBuffer
;
455 const GLboolean zoom
= ctx
->Pixel
.ZoomX
!= 1.0F
|| ctx
->Pixel
.ZoomY
!= 1.0F
;
456 const GLboolean shift_or_offset
= ctx
->Pixel
.IndexShift
|| ctx
->Pixel
.IndexOffset
;
460 if (!ctx
->ReadBuffer
->_ColorReadBuffer
) {
461 /* no readbuffer - OK */
465 INIT_SPAN(span
, GL_BITMAP
, 0, 0, SPAN_INDEX
);
467 /* Determine if copy should be bottom-to-top or top-to-bottom */
469 /* top-down max-to-min */
470 sy
= srcy
+ height
- 1;
471 dy
= desty
+ height
- 1;
475 /* bottom-up min-to-max */
481 if (ctx
->DrawBuffer
== ctx
->ReadBuffer
) {
482 overlapping
= regions_overlap(srcx
, srcy
, destx
, desty
, width
, height
,
483 ctx
->Pixel
.ZoomX
, ctx
->Pixel
.ZoomY
);
486 overlapping
= GL_FALSE
;
490 _swrast_span_default_z(ctx
, &span
);
491 if (ctx
->Fog
.Enabled
)
492 _swrast_span_default_fog(ctx
, &span
);
494 /* If read and draw buffer are different we must do buffer switching */
495 changeBuffer
= ctx
->Pixel
.ReadBuffer
!= ctx
->Color
.DrawBuffer
[0]
496 || ctx
->DrawBuffer
!= ctx
->ReadBuffer
;
500 tmpImage
= (GLuint
*) MALLOC(width
* height
* sizeof(GLuint
));
502 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "glCopyPixels" );
507 _swrast_use_read_buffer(ctx
);
510 for (j
= 0; j
< height
; j
++, ssy
+= stepy
) {
511 _swrast_read_index_span( ctx
, ctx
->ReadBuffer
->_ColorReadBuffer
,
512 width
, srcx
, ssy
, p
);
516 /* restore to draw buffer */
518 _swrast_use_draw_buffer(ctx
);
519 changeBuffer
= GL_FALSE
;
523 tmpImage
= NULL
; /* silence compiler warning */
527 for (j
= 0; j
< height
; j
++, sy
+= stepy
, dy
+= stepy
) {
528 /* Get color indexes */
530 MEMCPY(span
.array
->index
, p
, width
* sizeof(GLuint
));
535 _swrast_use_read_buffer(ctx
);
536 _swrast_read_index_span( ctx
, ctx
->ReadBuffer
->_ColorReadBuffer
,
537 width
, srcx
, sy
, span
.array
->index
);
539 _swrast_use_draw_buffer(ctx
);
542 /* Apply shift, offset, look-up table */
543 if (shift_or_offset
) {
544 _mesa_shift_and_offset_ci( ctx
, width
, span
.array
->index
);
546 if (ctx
->Pixel
.MapColorFlag
) {
547 _mesa_map_ci( ctx
, width
, span
.array
->index
);
550 /* write color indexes */
555 _swrast_write_zoomed_index_span(ctx
, &span
, desty
, 0);
557 _swrast_write_index_span(ctx
, &span
);
570 copy_depth_pixels( GLcontext
*ctx
, GLint srcx
, GLint srcy
,
571 GLint width
, GLint height
,
572 GLint destx
, GLint desty
)
574 const GLfloat depthMax
= ctx
->DrawBuffer
->_DepthMaxF
;
575 struct gl_renderbuffer
*readRb
576 = ctx
->ReadBuffer
->Attachment
[BUFFER_DEPTH
].Renderbuffer
;
577 GLfloat
*p
, *tmpImage
;
580 const GLboolean zoom
= ctx
->Pixel
.ZoomX
!= 1.0F
|| ctx
->Pixel
.ZoomY
!= 1.0F
;
585 /* no readbuffer - OK */
589 INIT_SPAN(span
, GL_BITMAP
, 0, 0, SPAN_Z
);
591 if (!ctx
->Visual
.depthBits
) {
592 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glCopyPixels" );
596 /* Determine if copy should be bottom-to-top or top-to-bottom */
598 /* top-down max-to-min */
599 sy
= srcy
+ height
- 1;
600 dy
= desty
+ height
- 1;
604 /* bottom-up min-to-max */
610 if (ctx
->DrawBuffer
== ctx
->ReadBuffer
) {
611 overlapping
= regions_overlap(srcx
, srcy
, destx
, desty
, width
, height
,
612 ctx
->Pixel
.ZoomX
, ctx
->Pixel
.ZoomY
);
615 overlapping
= GL_FALSE
;
618 _swrast_span_default_color(ctx
, &span
);
619 if (ctx
->Fog
.Enabled
)
620 _swrast_span_default_fog(ctx
, &span
);
624 tmpImage
= (GLfloat
*) MALLOC(width
* height
* sizeof(GLfloat
));
626 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "glCopyPixels" );
630 for (j
= 0; j
< height
; j
++, ssy
+= stepy
) {
631 _swrast_read_depth_span_float(ctx
, readRb
, width
, srcx
, ssy
, p
);
637 tmpImage
= NULL
; /* silence compiler warning */
641 for (j
= 0; j
< height
; j
++, sy
+= stepy
, dy
+= stepy
) {
642 GLfloat depth
[MAX_WIDTH
];
644 /* get depth values */
646 MEMCPY(depth
, p
, width
* sizeof(GLfloat
));
650 _swrast_read_depth_span_float(ctx
, readRb
, width
, srcx
, sy
, depth
);
653 /* apply scale and bias */
654 for (i
= 0; i
< width
; i
++) {
655 GLfloat d
= depth
[i
] * ctx
->Pixel
.DepthScale
+ ctx
->Pixel
.DepthBias
;
657 span
.array
->z
[i
] = (GLdepth
) (CLAMP(d
, 0.0F
, 1.0F
) * depthMax
);
660 /* write depth values */
664 if (ctx
->Visual
.rgbMode
) {
666 _swrast_write_zoomed_rgba_span( ctx
, &span
,
667 (const GLchan (*)[4])span
.array
->rgba
, desty
, 0 );
669 _swrast_write_rgba_span(ctx
, &span
);
673 _swrast_write_zoomed_index_span( ctx
, &span
, desty
, 0 );
675 _swrast_write_index_span(ctx
, &span
);
686 copy_stencil_pixels( GLcontext
*ctx
, GLint srcx
, GLint srcy
,
687 GLint width
, GLint height
,
688 GLint destx
, GLint desty
)
690 struct gl_renderbuffer
*rb
691 = ctx
->ReadBuffer
->Attachment
[BUFFER_STENCIL
].Renderbuffer
;
694 GLstencil
*p
, *tmpImage
;
695 const GLboolean zoom
= ctx
->Pixel
.ZoomX
!= 1.0F
|| ctx
->Pixel
.ZoomY
!= 1.0F
;
696 const GLboolean shift_or_offset
= ctx
->Pixel
.IndexShift
|| ctx
->Pixel
.IndexOffset
;
699 if (!ctx
->Visual
.stencilBits
) {
700 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glCopyPixels" );
705 /* no readbuffer - OK */
709 /* Determine if copy should be bottom-to-top or top-to-bottom */
711 /* top-down max-to-min */
712 sy
= srcy
+ height
- 1;
713 dy
= desty
+ height
- 1;
717 /* bottom-up min-to-max */
723 if (ctx
->DrawBuffer
== ctx
->ReadBuffer
) {
724 overlapping
= regions_overlap(srcx
, srcy
, destx
, desty
, width
, height
,
725 ctx
->Pixel
.ZoomX
, ctx
->Pixel
.ZoomY
);
728 overlapping
= GL_FALSE
;
733 tmpImage
= (GLstencil
*) MALLOC(width
* height
* sizeof(GLstencil
));
735 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "glCopyPixels" );
739 for (j
= 0; j
< height
; j
++, ssy
+= stepy
) {
740 _swrast_read_stencil_span( ctx
, rb
, width
, srcx
, ssy
, p
);
746 tmpImage
= NULL
; /* silence compiler warning */
750 for (j
= 0; j
< height
; j
++, sy
+= stepy
, dy
+= stepy
) {
751 GLstencil stencil
[MAX_WIDTH
];
753 /* Get stencil values */
755 MEMCPY(stencil
, p
, width
* sizeof(GLstencil
));
759 _swrast_read_stencil_span( ctx
, rb
, width
, srcx
, sy
, stencil
);
762 /* Apply shift, offset, look-up table */
763 if (shift_or_offset
) {
764 _mesa_shift_and_offset_stencil( ctx
, width
, stencil
);
766 if (ctx
->Pixel
.MapStencilFlag
) {
767 _mesa_map_stencil( ctx
, width
, stencil
);
770 /* Write stencil values */
772 _swrast_write_zoomed_stencil_span( ctx
, width
, destx
, dy
,
776 _swrast_write_stencil_span( ctx
, width
, destx
, dy
, stencil
);
787 _swrast_CopyPixels( GLcontext
*ctx
,
788 GLint srcx
, GLint srcy
, GLsizei width
, GLsizei height
,
789 GLint destx
, GLint desty
,
792 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
793 RENDER_START(swrast
,ctx
);
795 if (swrast
->NewState
)
796 _swrast_validate_derived( ctx
);
798 if (type
== GL_COLOR
&& ctx
->Visual
.rgbMode
) {
799 copy_rgba_pixels( ctx
, srcx
, srcy
, width
, height
, destx
, desty
);
801 else if (type
== GL_COLOR
&& !ctx
->Visual
.rgbMode
) {
802 copy_ci_pixels( ctx
, srcx
, srcy
, width
, height
, destx
, desty
);
804 else if (type
== GL_DEPTH
) {
805 copy_depth_pixels( ctx
, srcx
, srcy
, width
, height
, destx
, desty
);
807 else if (type
== GL_STENCIL
) {
808 copy_stencil_pixels( ctx
, srcx
, srcy
, width
, height
, destx
, desty
);
811 _mesa_error( ctx
, GL_INVALID_ENUM
, "glCopyPixels" );
814 RENDER_FINISH(swrast
,ctx
);