Home | History | Annotate | Download | only in swrast

Lines Matching full:ctx

99 copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
104 const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
106 GLuint transferOps = ctx->_ImageTransferState;
109 if (!ctx->ReadBuffer->_ColorReadBuffer) {
114 if (ctx->DrawBuffer == ctx->ReadBuffer) {
116 ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
137 _swrast_span_default_attribs(ctx, &span);
144 _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
150 _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
174 _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer,
179 _mesa_apply_rgba_transfer_ops(ctx, transferOps, width,
189 _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba);
192 _swrast_write_rgba_span(ctx, &span);
208 scale_and_bias_z(struct gl_context *ctx, GLuint width,
211 const GLuint depthMax = ctx->DrawBuffer->_DepthMax;
215 ctx->Pixel.DepthScale == 1.0 &&
216 ctx->Pixel.DepthBias == 0.0) {
218 const GLfloat depthMaxF = ctx->DrawBuffer->_DepthMaxF;
225 const GLdouble depthMaxF = ctx->DrawBuffer->_DepthMaxF;
227 GLdouble d = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias;
243 copy_depth_pixels( struct gl_context *ctx, GLint srcx, GLint srcy,
247 struct gl_framebuffer *fb = ctx->ReadBuffer;
252 const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
262 _swrast_span_default_attribs(ctx, &span);
265 if (ctx->DrawBuffer == ctx->ReadBuffer) {
267 ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
291 _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
296 _swrast_read_depth_span_float(ctx, readRb, width, srcx, ssy, p);
308 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels()");
319 _swrast_read_depth_span_float(ctx, readRb, width, srcx, sy, depth);
323 scale_and_bias_z(ctx, width, depth, span.array->z);
330 _swrast_write_zoomed_depth_span(ctx, destx, desty, &span);
332 _swrast_write_rgba_span(ctx, &span);
345 copy_stencil_pixels( struct gl_context *ctx, GLint srcx, GLint srcy,
349 struct gl_framebuffer *fb = ctx->ReadBuffer;
354 const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
362 if (ctx->DrawBuffer == ctx->ReadBuffer) {
364 ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
388 _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" );
393 _swrast_read_stencil_span( ctx, rb, width, srcx, ssy, p );
405 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels()");
416 _swrast_read_stencil_span( ctx, rb, width, srcx, sy, stencil );
419 _mesa_apply_stencil_transfer_ops(ctx, width, stencil);
423 _swrast_write_zoomed_stencil_span(ctx, destx, desty, width,
427 _swrast_write_stencil_span( ctx, width, destx, dy, stencil );
444 swrast_fast_copy_pixels(struct gl_context *ctx,
448 struct gl_framebuffer *srcFb = ctx->ReadBuffer;
449 struct gl_framebuffer *dstFb = ctx->DrawBuffer;
514 ctx->Driver.MapRenderbuffer(ctx, srcRb, 0, 0,
519 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels");
542 ctx->Driver.MapRenderbuffer(ctx, srcRb, srcX, srcY,
546 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels");
549 ctx->Driver.MapRenderbuffer(ctx, dstRb, dstX, dstY,
553 ctx->Driver.UnmapRenderbuffer(ctx, srcRb);
554 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels");
566 ctx->Driver.UnmapRenderbuffer(ctx, srcRb);
568 ctx->Driver.UnmapRenderbuffer(ctx, dstRb);
581 map_readbuffer(struct gl_context *ctx, GLenum type)
583 struct gl_framebuffer *fb = ctx->ReadBuffer;
609 ctx->Driver.MapRenderbuffer(ctx, rb,
623 _swrast_CopyPixels( struct gl_context *ctx,
627 SWcontext *swrast = SWRAST_CONTEXT(ctx);
630 if (!_mesa_check_conditional_render(ctx))
634 _swrast_validate_derived( ctx );
636 if (!(SWRAST_CONTEXT(ctx)->_RasterMask != 0x0 ||
637 ctx->Pixel.ZoomX != 1.0F ||
638 ctx->Pixel.ZoomY != 1.0F ||
639 ctx->_ImageTransferState) &&
640 swrast_fast_copy_pixels(ctx, srcx, srcy, width, height, destx, desty,
646 swrast_render_start(ctx);
647 rb = map_readbuffer(ctx, type);
651 copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty );
654 copy_depth_pixels( ctx, srcx, srcy, width, height, destx, desty );
657 copy_stencil_pixels( ctx, srcx, srcy, width, height, destx, desty );
661 copy_depth_pixels(ctx, srcx, srcy, width, height, destx, desty);
662 copy_stencil_pixels(ctx, srcx, srcy, width, height, destx, desty);
665 _mesa_problem(ctx, "unexpected type in _swrast_CopyPixels");
668 swrast_render_finish(ctx);
672 ctx->Driver.UnmapRenderbuffer(ctx, rb);