Lines Matching refs:osmesa

145    (DST)[osmesa->rInd] = R;		\
146 (DST)[osmesa->gInd] = G; \
147 (DST)[osmesa->bInd] = B; \
148 (DST)[osmesa->aInd] = A; \
151 #define PIXELADDR4(X,Y) ((GLchan *) osmesa->rowaddr[Y] + 4 * (X))
160 const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); \
181 const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); \
205 const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); in osmesa_choose_line_function() local
225 if (osmesa->format != OSMESA_RGBA && in osmesa_choose_line_function()
226 osmesa->format != OSMESA_BGRA && in osmesa_choose_line_function()
227 osmesa->format != OSMESA_ARGB) { in osmesa_choose_line_function()
260 const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
290 const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); \
318 const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); in osmesa_choose_triangle_function() local
336 if (osmesa->format != OSMESA_RGBA && in osmesa_choose_triangle_function()
337 osmesa->format != OSMESA_BGRA && in osmesa_choose_triangle_function()
338 osmesa->format != OSMESA_ARGB) { in osmesa_choose_triangle_function()
394 compute_row_addresses( OSMesaContext osmesa ) in compute_row_addresses() argument
397 GLubyte *origin = (GLubyte *) osmesa->srb->Buffer; in compute_row_addresses()
399 GLint height = osmesa->srb->Base.Height; in compute_row_addresses()
401 if (osmesa->userRowLength) in compute_row_addresses()
402 rowlength = osmesa->userRowLength; in compute_row_addresses()
404 rowlength = osmesa->srb->Base.Width; in compute_row_addresses()
406 bytesPerRow = rowlength * _mesa_get_format_bytes(osmesa->srb->Base.Format); in compute_row_addresses()
408 if (osmesa->yup) { in compute_row_addresses()
411 osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + i * bytesPerRow); in compute_row_addresses()
418 osmesa->rowaddr[i] = (GLvoid *) ((GLubyte *) origin + j * bytesPerRow); in compute_row_addresses()
444 const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); in osmesa_renderbuffer_storage() local
456 if (osmesa->format == OSMESA_RGBA) { in osmesa_renderbuffer_storage()
457 if (osmesa->DataType == GL_UNSIGNED_BYTE) { in osmesa_renderbuffer_storage()
463 else if (osmesa->DataType == GL_UNSIGNED_SHORT) { in osmesa_renderbuffer_storage()
470 else if (osmesa->format == OSMESA_BGRA) { in osmesa_renderbuffer_storage()
471 if (osmesa->DataType == GL_UNSIGNED_BYTE) { in osmesa_renderbuffer_storage()
477 else if (osmesa->DataType == GL_UNSIGNED_SHORT) { in osmesa_renderbuffer_storage()
486 else if (osmesa->format == OSMESA_ARGB) { in osmesa_renderbuffer_storage()
487 if (osmesa->DataType == GL_UNSIGNED_BYTE) { in osmesa_renderbuffer_storage()
493 else if (osmesa->DataType == GL_UNSIGNED_SHORT) { in osmesa_renderbuffer_storage()
502 else if (osmesa->format == OSMESA_RGB) { in osmesa_renderbuffer_storage()
503 if (osmesa->DataType == GL_UNSIGNED_BYTE) { in osmesa_renderbuffer_storage()
506 else if (osmesa->DataType == GL_UNSIGNED_SHORT) { in osmesa_renderbuffer_storage()
515 else if (osmesa->format == OSMESA_BGR) { in osmesa_renderbuffer_storage()
516 if (osmesa->DataType == GL_UNSIGNED_BYTE) { in osmesa_renderbuffer_storage()
519 else if (osmesa->DataType == GL_UNSIGNED_SHORT) { in osmesa_renderbuffer_storage()
528 else if (osmesa->format == OSMESA_RGB_565) { in osmesa_renderbuffer_storage()
529 assert(osmesa->DataType == GL_UNSIGNED_BYTE); in osmesa_renderbuffer_storage()
539 compute_row_addresses( osmesa ); in osmesa_renderbuffer_storage()
578 const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); in osmesa_MapRenderbuffer() local
586 if (osmesa->userRowLength) in osmesa_MapRenderbuffer()
587 rowStride = osmesa->userRowLength * bpp; in osmesa_MapRenderbuffer()
591 if (!osmesa->yup) { in osmesa_MapRenderbuffer()
677 OSMesaContext osmesa; in OSMesaCreateContextAttribs() local
812 osmesa = (OSMesaContext) CALLOC_STRUCT(osmesa_context); in OSMesaCreateContextAttribs()
813 if (osmesa) { in OSMesaCreateContextAttribs()
814 osmesa->gl_visual = _mesa_create_visual( GL_FALSE, /* double buffer */ in OSMesaCreateContextAttribs()
828 if (!osmesa->gl_visual) { in OSMesaCreateContextAttribs()
829 free(osmesa); in OSMesaCreateContextAttribs()
839 if (!_mesa_initialize_context(&osmesa->mesa, in OSMesaCreateContextAttribs()
841 osmesa->gl_visual, in OSMesaCreateContextAttribs()
845 _mesa_destroy_visual( osmesa->gl_visual ); in OSMesaCreateContextAttribs()
846 free(osmesa); in OSMesaCreateContextAttribs()
850 _mesa_enable_sw_extensions(&(osmesa->mesa)); in OSMesaCreateContextAttribs()
852 osmesa->gl_buffer = _mesa_create_framebuffer(osmesa->gl_visual); in OSMesaCreateContextAttribs()
853 if (!osmesa->gl_buffer) { in OSMesaCreateContextAttribs()
854 _mesa_destroy_visual( osmesa->gl_visual ); in OSMesaCreateContextAttribs()
855 _mesa_free_context_data( &osmesa->mesa ); in OSMesaCreateContextAttribs()
856 free(osmesa); in OSMesaCreateContextAttribs()
863 _swrast_add_soft_renderbuffers(osmesa->gl_buffer, in OSMesaCreateContextAttribs()
865 osmesa->gl_visual->haveDepthBuffer, in OSMesaCreateContextAttribs()
866 osmesa->gl_visual->haveStencilBuffer, in OSMesaCreateContextAttribs()
867 osmesa->gl_visual->haveAccumBuffer, in OSMesaCreateContextAttribs()
871 osmesa->format = format; in OSMesaCreateContextAttribs()
872 osmesa->userRowLength = 0; in OSMesaCreateContextAttribs()
873 osmesa->yup = GL_TRUE; in OSMesaCreateContextAttribs()
874 osmesa->rInd = rind; in OSMesaCreateContextAttribs()
875 osmesa->gInd = gind; in OSMesaCreateContextAttribs()
876 osmesa->bInd = bind; in OSMesaCreateContextAttribs()
877 osmesa->aInd = aind; in OSMesaCreateContextAttribs()
879 _mesa_meta_init(&osmesa->mesa); in OSMesaCreateContextAttribs()
883 struct gl_context *ctx = &osmesa->mesa; in OSMesaCreateContextAttribs()
891 _mesa_destroy_visual(osmesa->gl_visual); in OSMesaCreateContextAttribs()
893 free(osmesa); in OSMesaCreateContextAttribs()
919 _mesa_destroy_visual(osmesa->gl_visual); in OSMesaCreateContextAttribs()
921 free(osmesa); in OSMesaCreateContextAttribs()
930 return osmesa; in OSMesaCreateContextAttribs()
940 OSMesaDestroyContext( OSMesaContext osmesa ) in OSMesaDestroyContext() argument
942 if (osmesa) { in OSMesaDestroyContext()
943 if (osmesa->srb) in OSMesaDestroyContext()
944 _mesa_reference_renderbuffer((struct gl_renderbuffer **) &osmesa->srb, NULL); in OSMesaDestroyContext()
946 _mesa_meta_free( &osmesa->mesa ); in OSMesaDestroyContext()
948 _swsetup_DestroyContext( &osmesa->mesa ); in OSMesaDestroyContext()
949 _tnl_DestroyContext( &osmesa->mesa ); in OSMesaDestroyContext()
950 _vbo_DestroyContext( &osmesa->mesa ); in OSMesaDestroyContext()
951 _swrast_DestroyContext( &osmesa->mesa ); in OSMesaDestroyContext()
953 _mesa_destroy_visual( osmesa->gl_visual ); in OSMesaDestroyContext()
954 _mesa_reference_framebuffer( &osmesa->gl_buffer, NULL ); in OSMesaDestroyContext()
956 _mesa_free_context_data( &osmesa->mesa ); in OSMesaDestroyContext()
957 free( osmesa ); in OSMesaDestroyContext()
992 OSMesaMakeCurrent( OSMesaContext osmesa, void *buffer, GLenum type, in OSMesaMakeCurrent() argument
995 if (!osmesa && !buffer) { in OSMesaMakeCurrent()
999 if (!osmesa || !buffer || in OSMesaMakeCurrent()
1005 if (osmesa->format == OSMESA_RGB_565 && type != GL_UNSIGNED_SHORT_5_6_5) { in OSMesaMakeCurrent()
1018 osmesa_update_state( &osmesa->mesa, 0 ); in OSMesaMakeCurrent()
1034 if (!osmesa->srb) { in OSMesaMakeCurrent()
1035 osmesa->srb = new_osmesa_renderbuffer(&osmesa->mesa, osmesa->format, type); in OSMesaMakeCurrent()
1036 _mesa_remove_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT); in OSMesaMakeCurrent()
1037 _mesa_attach_and_reference_rb(osmesa->gl_buffer, BUFFER_FRONT_LEFT, in OSMesaMakeCurrent()
1038 &osmesa->srb->Base); in OSMesaMakeCurrent()
1039 assert(osmesa->srb->Base.RefCount == 2); in OSMesaMakeCurrent()
1042 osmesa->DataType = type; in OSMesaMakeCurrent()
1047 osmesa->srb->Buffer = buffer; in OSMesaMakeCurrent()
1048 osmesa->srb->Base.Width = osmesa->srb->Base.Height = 0; in OSMesaMakeCurrent()
1053 _mesa_resize_framebuffer(&osmesa->mesa, osmesa->gl_buffer, width, height); in OSMesaMakeCurrent()
1055 _mesa_make_current( &osmesa->mesa, osmesa->gl_buffer, osmesa->gl_buffer ); in OSMesaMakeCurrent()
1060 _mesa_remove_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT); in OSMesaMakeCurrent()
1061 _mesa_attach_and_reference_rb(osmesa->gl_buffer, BUFFER_FRONT_LEFT, in OSMesaMakeCurrent()
1062 &osmesa->srb->Base); in OSMesaMakeCurrent()
1066 _mesa_update_framebuffer_visual(&osmesa->mesa, osmesa->gl_buffer); in OSMesaMakeCurrent()
1069 _mesa_resize_framebuffer(&osmesa->mesa, osmesa->gl_buffer, width, height); in OSMesaMakeCurrent()
1091 OSMesaContext osmesa = OSMesaGetCurrentContext(); in OSMesaPixelStore() local
1096 _mesa_error( &osmesa->mesa, GL_INVALID_VALUE, in OSMesaPixelStore()
1100 osmesa->userRowLength = value; in OSMesaPixelStore()
1103 osmesa->yup = value ? GL_TRUE : GL_FALSE; in OSMesaPixelStore()
1106 _mesa_error( &osmesa->mesa, GL_INVALID_ENUM, "OSMesaPixelStore(pname)" ); in OSMesaPixelStore()
1110 compute_row_addresses( osmesa ); in OSMesaPixelStore()
1117 OSMesaContext osmesa = OSMesaGetCurrentContext(); in OSMesaGetIntegerv() local
1121 if (osmesa->gl_buffer) in OSMesaGetIntegerv()
1122 *value = osmesa->gl_buffer->Width; in OSMesaGetIntegerv()
1127 if (osmesa->gl_buffer) in OSMesaGetIntegerv()
1128 *value = osmesa->gl_buffer->Height; in OSMesaGetIntegerv()
1133 *value = osmesa->format; in OSMesaGetIntegerv()
1137 *value = osmesa->DataType; in OSMesaGetIntegerv()
1140 *value = osmesa->userRowLength; in OSMesaGetIntegerv()
1143 *value = osmesa->yup; in OSMesaGetIntegerv()
1152 _mesa_error(&osmesa->mesa, GL_INVALID_ENUM, "OSMesaGetIntergerv(pname)"); in OSMesaGetIntegerv()
1205 OSMesaGetColorBuffer( OSMesaContext osmesa, GLint *width, in OSMesaGetColorBuffer() argument
1208 if (osmesa->srb && osmesa->srb->Buffer) { in OSMesaGetColorBuffer()
1209 *width = osmesa->srb->Base.Width; in OSMesaGetColorBuffer()
1210 *height = osmesa->srb->Base.Height; in OSMesaGetColorBuffer()
1211 *format = osmesa->format; in OSMesaGetColorBuffer()
1212 *buffer = (void *) osmesa->srb->Buffer; in OSMesaGetColorBuffer()
1264 OSMesaContext osmesa = OSMesaGetCurrentContext(); in OSMesaColorClamp() local
1267 osmesa->mesa.Color.ClampFragmentColor = GL_TRUE; in OSMesaColorClamp()
1270 osmesa->mesa.Color.ClampFragmentColor = GL_FIXED_ONLY_ARB; in OSMesaColorClamp()
1276 OSMesaPostprocess(OSMesaContext osmesa, const char *filter, in OSMesaPostprocess() argument