• Home
  • Raw
  • Download

Lines Matching refs:ctx

48    GET_CURRENT_CONTEXT(ctx);  in _mesa_PixelZoom()
50 if (ctx->Pixel.ZoomX == xfactor && in _mesa_PixelZoom()
51 ctx->Pixel.ZoomY == yfactor) in _mesa_PixelZoom()
54 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelZoom()
55 ctx->Pixel.ZoomX = xfactor; in _mesa_PixelZoom()
56 ctx->Pixel.ZoomY = yfactor; in _mesa_PixelZoom()
69 get_pixelmap(struct gl_context *ctx, GLenum map) in get_pixelmap() argument
73 return &ctx->PixelMaps.ItoI; in get_pixelmap()
75 return &ctx->PixelMaps.StoS; in get_pixelmap()
77 return &ctx->PixelMaps.ItoR; in get_pixelmap()
79 return &ctx->PixelMaps.ItoG; in get_pixelmap()
81 return &ctx->PixelMaps.ItoB; in get_pixelmap()
83 return &ctx->PixelMaps.ItoA; in get_pixelmap()
85 return &ctx->PixelMaps.RtoR; in get_pixelmap()
87 return &ctx->PixelMaps.GtoG; in get_pixelmap()
89 return &ctx->PixelMaps.BtoB; in get_pixelmap()
91 return &ctx->PixelMaps.AtoA; in get_pixelmap()
102 store_pixelmap(struct gl_context *ctx, GLenum map, GLsizei mapsize, in store_pixelmap() argument
106 struct gl_pixelmap *pm = get_pixelmap(ctx, map); in store_pixelmap()
108 _mesa_error(ctx, GL_INVALID_ENUM, "glPixelMap(map)"); in store_pixelmap()
115 ctx->PixelMaps.StoS.Size = mapsize; in store_pixelmap()
117 ctx->PixelMaps.StoS.Map[i] = (GLfloat)IROUND(values[i]); in store_pixelmap()
122 ctx->PixelMaps.ItoI.Size = mapsize; in store_pixelmap()
124 ctx->PixelMaps.ItoI.Map[i] = values[i]; in store_pixelmap()
142 validate_pbo_access(struct gl_context *ctx, in validate_pbo_access() argument
150 _mesa_reference_buffer_object(ctx, in validate_pbo_access()
151 &ctx->DefaultPacking.BufferObj, in validate_pbo_access()
154 ok = _mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, in validate_pbo_access()
158 _mesa_reference_buffer_object(ctx, in validate_pbo_access()
159 &ctx->DefaultPacking.BufferObj, in validate_pbo_access()
160 ctx->Shared->NullBufferObj); in validate_pbo_access()
164 _mesa_error(ctx, GL_INVALID_OPERATION, in validate_pbo_access()
167 _mesa_error(ctx, GL_INVALID_OPERATION, in validate_pbo_access()
179 GET_CURRENT_CONTEXT(ctx); in _mesa_PixelMapfv()
183 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" ); in _mesa_PixelMapfv()
190 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" ); in _mesa_PixelMapfv()
195 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelMapfv()
197 if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, in _mesa_PixelMapfv()
202 values = (const GLfloat *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); in _mesa_PixelMapfv()
204 if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { in _mesa_PixelMapfv()
205 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_PixelMapfv()
211 store_pixelmap(ctx, map, mapsize, values); in _mesa_PixelMapfv()
213 _mesa_unmap_pbo_source(ctx, &ctx->Unpack); in _mesa_PixelMapfv()
221 GET_CURRENT_CONTEXT(ctx); in _mesa_PixelMapuiv()
224 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); in _mesa_PixelMapuiv()
231 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); in _mesa_PixelMapuiv()
236 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelMapuiv()
238 if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, in _mesa_PixelMapuiv()
243 values = (const GLuint *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); in _mesa_PixelMapuiv()
245 if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { in _mesa_PixelMapuiv()
246 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_PixelMapuiv()
266 _mesa_unmap_pbo_source(ctx, &ctx->Unpack); in _mesa_PixelMapuiv()
268 store_pixelmap(ctx, map, mapsize, fvalues); in _mesa_PixelMapuiv()
276 GET_CURRENT_CONTEXT(ctx); in _mesa_PixelMapusv()
279 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapusv(mapsize)" ); in _mesa_PixelMapusv()
286 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); in _mesa_PixelMapusv()
291 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelMapusv()
293 if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, in _mesa_PixelMapusv()
298 values = (const GLushort *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); in _mesa_PixelMapusv()
300 if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { in _mesa_PixelMapusv()
301 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_PixelMapusv()
321 _mesa_unmap_pbo_source(ctx, &ctx->Unpack); in _mesa_PixelMapusv()
323 store_pixelmap(ctx, map, mapsize, fvalues); in _mesa_PixelMapusv()
330 GET_CURRENT_CONTEXT(ctx); in _mesa_GetnPixelMapfvARB()
334 pm = get_pixelmap(ctx, map); in _mesa_GetnPixelMapfvARB()
336 _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapfv(map)"); in _mesa_GetnPixelMapfvARB()
342 if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, in _mesa_GetnPixelMapfvARB()
347 values = (GLfloat *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); in _mesa_GetnPixelMapfvARB()
349 if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { in _mesa_GetnPixelMapfvARB()
350 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_GetnPixelMapfvARB()
359 values[i] = (GLfloat) ctx->PixelMaps.StoS.Map[i]; in _mesa_GetnPixelMapfvARB()
366 _mesa_unmap_pbo_dest(ctx, &ctx->Pack); in _mesa_GetnPixelMapfvARB()
379 GET_CURRENT_CONTEXT(ctx); in _mesa_GetnPixelMapuivARB()
383 pm = get_pixelmap(ctx, map); in _mesa_GetnPixelMapuivARB()
385 _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapuiv(map)"); in _mesa_GetnPixelMapuivARB()
391 if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, in _mesa_GetnPixelMapuivARB()
396 values = (GLuint *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); in _mesa_GetnPixelMapuivARB()
398 if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { in _mesa_GetnPixelMapuivARB()
399 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_GetnPixelMapuivARB()
407 memcpy(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint)); in _mesa_GetnPixelMapuivARB()
415 _mesa_unmap_pbo_dest(ctx, &ctx->Pack); in _mesa_GetnPixelMapuivARB()
428 GET_CURRENT_CONTEXT(ctx); in _mesa_GetnPixelMapusvARB()
432 pm = get_pixelmap(ctx, map); in _mesa_GetnPixelMapusvARB()
434 _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapusv(map)"); in _mesa_GetnPixelMapusvARB()
440 if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, in _mesa_GetnPixelMapusvARB()
445 values = (GLushort *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); in _mesa_GetnPixelMapusvARB()
447 if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { in _mesa_GetnPixelMapusvARB()
448 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_GetnPixelMapusvARB()
458 values[i] = (GLushort) CLAMP(ctx->PixelMaps.ItoI.Map[i], 0.0F, 65535.0F); in _mesa_GetnPixelMapusvARB()
463 values[i] = (GLushort) CLAMP(ctx->PixelMaps.StoS.Map[i], 0.0F, 65535.0F); in _mesa_GetnPixelMapusvARB()
472 _mesa_unmap_pbo_dest(ctx, &ctx->Pack); in _mesa_GetnPixelMapusvARB()
495 GET_CURRENT_CONTEXT(ctx); in _mesa_PixelTransferf()
499 if (ctx->Pixel.MapColorFlag == (param ? GL_TRUE : GL_FALSE)) in _mesa_PixelTransferf()
501 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
502 ctx->Pixel.MapColorFlag = param ? GL_TRUE : GL_FALSE; in _mesa_PixelTransferf()
505 if (ctx->Pixel.MapStencilFlag == (param ? GL_TRUE : GL_FALSE)) in _mesa_PixelTransferf()
507 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
508 ctx->Pixel.MapStencilFlag = param ? GL_TRUE : GL_FALSE; in _mesa_PixelTransferf()
511 if (ctx->Pixel.IndexShift == (GLint) param) in _mesa_PixelTransferf()
513 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
514 ctx->Pixel.IndexShift = (GLint) param; in _mesa_PixelTransferf()
517 if (ctx->Pixel.IndexOffset == (GLint) param) in _mesa_PixelTransferf()
519 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
520 ctx->Pixel.IndexOffset = (GLint) param; in _mesa_PixelTransferf()
523 if (ctx->Pixel.RedScale == param) in _mesa_PixelTransferf()
525 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
526 ctx->Pixel.RedScale = param; in _mesa_PixelTransferf()
529 if (ctx->Pixel.RedBias == param) in _mesa_PixelTransferf()
531 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
532 ctx->Pixel.RedBias = param; in _mesa_PixelTransferf()
535 if (ctx->Pixel.GreenScale == param) in _mesa_PixelTransferf()
537 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
538 ctx->Pixel.GreenScale = param; in _mesa_PixelTransferf()
541 if (ctx->Pixel.GreenBias == param) in _mesa_PixelTransferf()
543 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
544 ctx->Pixel.GreenBias = param; in _mesa_PixelTransferf()
547 if (ctx->Pixel.BlueScale == param) in _mesa_PixelTransferf()
549 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
550 ctx->Pixel.BlueScale = param; in _mesa_PixelTransferf()
553 if (ctx->Pixel.BlueBias == param) in _mesa_PixelTransferf()
555 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
556 ctx->Pixel.BlueBias = param; in _mesa_PixelTransferf()
559 if (ctx->Pixel.AlphaScale == param) in _mesa_PixelTransferf()
561 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
562 ctx->Pixel.AlphaScale = param; in _mesa_PixelTransferf()
565 if (ctx->Pixel.AlphaBias == param) in _mesa_PixelTransferf()
567 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
568 ctx->Pixel.AlphaBias = param; in _mesa_PixelTransferf()
571 if (ctx->Pixel.DepthScale == param) in _mesa_PixelTransferf()
573 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
574 ctx->Pixel.DepthScale = param; in _mesa_PixelTransferf()
577 if (ctx->Pixel.DepthBias == param) in _mesa_PixelTransferf()
579 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
580 ctx->Pixel.DepthBias = param; in _mesa_PixelTransferf()
583 _mesa_error( ctx, GL_INVALID_ENUM, "glPixelTransfer(pname)" ); in _mesa_PixelTransferf()
606 update_image_transfer_state(struct gl_context *ctx) in update_image_transfer_state() argument
610 if (ctx->Pixel.RedScale != 1.0F || ctx->Pixel.RedBias != 0.0F || in update_image_transfer_state()
611 ctx->Pixel.GreenScale != 1.0F || ctx->Pixel.GreenBias != 0.0F || in update_image_transfer_state()
612 ctx->Pixel.BlueScale != 1.0F || ctx->Pixel.BlueBias != 0.0F || in update_image_transfer_state()
613 ctx->Pixel.AlphaScale != 1.0F || ctx->Pixel.AlphaBias != 0.0F) in update_image_transfer_state()
616 if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) in update_image_transfer_state()
619 if (ctx->Pixel.MapColorFlag) in update_image_transfer_state()
622 ctx->_ImageTransferState = mask; in update_image_transfer_state()
629 void _mesa_update_pixel( struct gl_context *ctx, GLuint new_state ) in _mesa_update_pixel() argument
632 update_image_transfer_state(ctx); in _mesa_update_pixel()
652 _mesa_init_pixel( struct gl_context *ctx ) in _mesa_init_pixel() argument
655 ctx->Pixel.RedBias = 0.0; in _mesa_init_pixel()
656 ctx->Pixel.RedScale = 1.0; in _mesa_init_pixel()
657 ctx->Pixel.GreenBias = 0.0; in _mesa_init_pixel()
658 ctx->Pixel.GreenScale = 1.0; in _mesa_init_pixel()
659 ctx->Pixel.BlueBias = 0.0; in _mesa_init_pixel()
660 ctx->Pixel.BlueScale = 1.0; in _mesa_init_pixel()
661 ctx->Pixel.AlphaBias = 0.0; in _mesa_init_pixel()
662 ctx->Pixel.AlphaScale = 1.0; in _mesa_init_pixel()
663 ctx->Pixel.DepthBias = 0.0; in _mesa_init_pixel()
664 ctx->Pixel.DepthScale = 1.0; in _mesa_init_pixel()
665 ctx->Pixel.IndexOffset = 0; in _mesa_init_pixel()
666 ctx->Pixel.IndexShift = 0; in _mesa_init_pixel()
667 ctx->Pixel.ZoomX = 1.0; in _mesa_init_pixel()
668 ctx->Pixel.ZoomY = 1.0; in _mesa_init_pixel()
669 ctx->Pixel.MapColorFlag = GL_FALSE; in _mesa_init_pixel()
670 ctx->Pixel.MapStencilFlag = GL_FALSE; in _mesa_init_pixel()
671 init_pixelmap(&ctx->PixelMaps.StoS); in _mesa_init_pixel()
672 init_pixelmap(&ctx->PixelMaps.ItoI); in _mesa_init_pixel()
673 init_pixelmap(&ctx->PixelMaps.ItoR); in _mesa_init_pixel()
674 init_pixelmap(&ctx->PixelMaps.ItoG); in _mesa_init_pixel()
675 init_pixelmap(&ctx->PixelMaps.ItoB); in _mesa_init_pixel()
676 init_pixelmap(&ctx->PixelMaps.ItoA); in _mesa_init_pixel()
677 init_pixelmap(&ctx->PixelMaps.RtoR); in _mesa_init_pixel()
678 init_pixelmap(&ctx->PixelMaps.GtoG); in _mesa_init_pixel()
679 init_pixelmap(&ctx->PixelMaps.BtoB); in _mesa_init_pixel()
680 init_pixelmap(&ctx->PixelMaps.AtoA); in _mesa_init_pixel()
682 if (ctx->Visual.doubleBufferMode) { in _mesa_init_pixel()
683 ctx->Pixel.ReadBuffer = GL_BACK; in _mesa_init_pixel()
686 ctx->Pixel.ReadBuffer = GL_FRONT; in _mesa_init_pixel()
690 ctx->_ImageTransferState = 0; in _mesa_init_pixel()