Lines Matching full:ctx
53 finish_or_flush( struct gl_context *ctx )
55 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
66 color_mask(struct gl_context *ctx,
69 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
74 if (_mesa_is_user_fbo(ctx->DrawBuffer))
77 xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
105 clear_pixmap(struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
108 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
109 XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
125 clear_16bit_ximage( struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
128 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
147 clear_24bit_ximage(struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
150 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
180 clear_32bit_ximage(struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
183 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
224 clear_nbit_ximage(struct gl_context *ctx, struct xmesa_renderbuffer *xrb,
227 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
243 clear_buffers(struct gl_context *ctx, GLbitfield buffers)
245 if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
247 const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask[0];
248 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
249 XMesaBuffer b = XMESA_BUFFER(ctx->DrawBuffer);
250 const GLint x = ctx->DrawBuffer->_Xmin;
251 const GLint y = ctx->DrawBuffer->_Ymin;
252 const GLint width = ctx->DrawBuffer->_Xmax - x;
253 const GLint height = ctx->DrawBuffer->_Ymax - y;
256 ctx->Color.ClearColor.f);
257 xmesa->clearpixel = xmesa_color_to_pixel(ctx,
266 if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) {
270 = ctx->DrawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
273 b->frontxrb->clearFunc(ctx, b->frontxrb, x, y, width, height);
283 = ctx->DrawBuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
286 b->backxrb->clearFunc(ctx, b->backxrb, x, y, width, height);
293 _swrast_Clear(ctx, buffers);
304 can_do_DrawPixels_8R8G8B(struct gl_context *ctx, GLenum format, GLenum type)
308 ctx->DrawBuffer &&
309 _mesa_is_winsys_fbo(ctx->DrawBuffer) &&
310 ctx->Pixel.ZoomX == 1.0 && /* no zooming */
311 ctx->Pixel.ZoomY == 1.0 &&
312 ctx->_ImageTransferState == 0 /* no color tables, scale/bias, etc */) {
313 const SWcontext *swrast = SWRAST_CONTEXT(ctx);
316 _swrast_validate_derived( ctx );
319 struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
340 xmesa_DrawPixels_8R8G8B( struct gl_context *ctx,
346 if (can_do_DrawPixels_8R8G8B(ctx, format, type)) {
347 const SWcontext *swrast = SWRAST_CONTEXT( ctx );
355 _swrast_validate_derived( ctx );
362 _mesa_error(ctx, GL_INVALID_OPERATION,
366 buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0,
372 _mesa_error(ctx, GL_INVALID_OPERATION,
379 if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &clippedUnpack)) {
380 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
382 XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
385 = xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
420 ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj);
425 _swrast_DrawPixels(ctx, x, y, width, height,
436 can_do_DrawPixels_5R6G5B(struct gl_context *ctx, GLenum format, GLenum type)
440 !ctx->Color.DitherFlag && /* no dithering */
441 ctx->DrawBuffer &&
442 _mesa_is_winsys_fbo(ctx->DrawBuffer) &&
443 ctx->Pixel.ZoomX == 1.0 && /* no zooming */
444 ctx->Pixel.ZoomY == 1.0 &&
445 ctx->_ImageTransferState == 0 /* no color tables, scale/bias, etc */) {
446 const SWcontext *swrast = SWRAST_CONTEXT(ctx);
449 _swrast_validate_derived( ctx );
452 struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
474 xmesa_DrawPixels_5R6G5B( struct gl_context *ctx,
480 if (can_do_DrawPixels_5R6G5B(ctx, format, type)) {
481 const SWcontext *swrast = SWRAST_CONTEXT( ctx );
489 _swrast_validate_derived( ctx );
496 _mesa_error(ctx, GL_INVALID_OPERATION,
500 buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0,
506 _mesa_error(ctx, GL_INVALID_OPERATION,
513 if (_mesa_clip_drawpixels(ctx, &dstX, &dstY, &w, &h, &clippedUnpack)) {
514 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
516 XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
519 = xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
553 ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj);
558 _swrast_DrawPixels(ctx, x, y, width, height,
568 can_do_CopyPixels(struct gl_context *ctx, GLenum type)
571 ctx->_ImageTransferState == 0 && /* no color tables, scale/bias, etc */
572 ctx->Pixel.ZoomX == 1.0 && /* no zooming */
573 ctx->Pixel.ZoomY == 1.0 &&
574 ctx->Color.DrawBuffer[0] == GL_FRONT && /* copy to front buf */
575 ctx->Pixel.ReadBuffer == GL_FRONT && /* copy from front buf */
576 ctx->ReadBuffer->_ColorReadBuffer &&
577 ctx->DrawBuffer->_ColorDrawBuffers[0]) {
578 const SWcontext *swrast = SWRAST_CONTEXT( ctx );
581 _swrast_validate_derived( ctx );
584 ctx->ReadBuffer &&
585 ctx->ReadBuffer->_ColorReadBuffer &&
586 ctx->DrawBuffer &&
587 ctx->DrawBuffer->_ColorDrawBuffers[0]) {
589 = xmesa_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
591 = xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
607 xmesa_CopyPixels( struct gl_context *ctx,
611 if (can_do_CopyPixels(ctx, type)) {
612 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
614 XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
617 = xmesa_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
619 = xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]);
633 _swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type );
645 get_string( struct gl_context *ctx, GLenum name )
647 (void) ctx;
664 enable( struct gl_context *ctx, GLenum pname, GLboolean state )
666 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
686 xmesa_update_state( struct gl_context *ctx, GLbitfield new_state )
688 const XMesaContext xmesa = XMESA_CONTEXT(ctx);
693 _swrast_InvalidateState( ctx, new_state );
694 _tnl_InvalidateState( ctx, new_state );
695 _vbo_InvalidateState( ctx, new_state );
696 _swsetup_InvalidateState( ctx, new_state );
698 if (_mesa_is_user_fbo(ctx->DrawBuffer))
707 XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
753 xmesa_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
755 XMesaContext xmctx = XMESA_CONTEXT(ctx);
756 XMesaBuffer xmdrawbuf = XMESA_BUFFER(ctx->WinSysDrawBuffer);
757 XMesaBuffer xmreadbuf = XMESA_BUFFER(ctx->WinSysReadBuffer);
783 xmesa_new_query_object(struct gl_context *ctx, GLuint id)
795 xmesa_begin_query(struct gl_context *ctx, struct gl_query_object *q)
822 xmesa_end_query(struct gl_context *ctx, struct gl_query_object *q)
910 void xmesa_register_swrast_functions( struct gl_context *ctx )
912 SWcontext *swrast = SWRAST_CONTEXT( ctx );