Lines Matching refs:ctx

53    GET_CURRENT_CONTEXT(ctx);  in _mesa_PixelZoom()
55 ASSERT_OUTSIDE_BEGIN_END(ctx); in _mesa_PixelZoom()
57 if (ctx->Pixel.ZoomX == xfactor && in _mesa_PixelZoom()
58 ctx->Pixel.ZoomY == yfactor) in _mesa_PixelZoom()
61 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelZoom()
62 ctx->Pixel.ZoomX = xfactor; in _mesa_PixelZoom()
63 ctx->Pixel.ZoomY = yfactor; in _mesa_PixelZoom()
76 get_pixelmap(struct gl_context *ctx, GLenum map) in get_pixelmap() argument
80 return &ctx->PixelMaps.ItoI; in get_pixelmap()
82 return &ctx->PixelMaps.StoS; in get_pixelmap()
84 return &ctx->PixelMaps.ItoR; in get_pixelmap()
86 return &ctx->PixelMaps.ItoG; in get_pixelmap()
88 return &ctx->PixelMaps.ItoB; in get_pixelmap()
90 return &ctx->PixelMaps.ItoA; in get_pixelmap()
92 return &ctx->PixelMaps.RtoR; in get_pixelmap()
94 return &ctx->PixelMaps.GtoG; in get_pixelmap()
96 return &ctx->PixelMaps.BtoB; in get_pixelmap()
98 return &ctx->PixelMaps.AtoA; in get_pixelmap()
109 store_pixelmap(struct gl_context *ctx, GLenum map, GLsizei mapsize, in store_pixelmap() argument
113 struct gl_pixelmap *pm = get_pixelmap(ctx, map); in store_pixelmap()
115 _mesa_error(ctx, GL_INVALID_ENUM, "glPixelMap(map)"); in store_pixelmap()
122 ctx->PixelMaps.StoS.Size = mapsize; in store_pixelmap()
124 ctx->PixelMaps.StoS.Map[i] = (GLfloat)IROUND(values[i]); in store_pixelmap()
129 ctx->PixelMaps.ItoI.Size = mapsize; in store_pixelmap()
131 ctx->PixelMaps.ItoI.Map[i] = values[i]; in store_pixelmap()
149 validate_pbo_access(struct gl_context *ctx, in validate_pbo_access() argument
157 _mesa_reference_buffer_object(ctx, in validate_pbo_access()
158 &ctx->DefaultPacking.BufferObj, in validate_pbo_access()
161 ok = _mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, in validate_pbo_access()
165 _mesa_reference_buffer_object(ctx, in validate_pbo_access()
166 &ctx->DefaultPacking.BufferObj, in validate_pbo_access()
167 ctx->Shared->NullBufferObj); in validate_pbo_access()
171 _mesa_error(ctx, GL_INVALID_OPERATION, in validate_pbo_access()
174 _mesa_error(ctx, GL_INVALID_OPERATION, in validate_pbo_access()
186 GET_CURRENT_CONTEXT(ctx); in _mesa_PixelMapfv()
187 ASSERT_OUTSIDE_BEGIN_END(ctx); in _mesa_PixelMapfv()
191 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" ); in _mesa_PixelMapfv()
198 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapfv(mapsize)" ); in _mesa_PixelMapfv()
203 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelMapfv()
205 if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, in _mesa_PixelMapfv()
210 values = (const GLfloat *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); in _mesa_PixelMapfv()
212 if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { in _mesa_PixelMapfv()
213 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_PixelMapfv()
219 store_pixelmap(ctx, map, mapsize, values); in _mesa_PixelMapfv()
221 _mesa_unmap_pbo_source(ctx, &ctx->Unpack); in _mesa_PixelMapfv()
229 GET_CURRENT_CONTEXT(ctx); in _mesa_PixelMapuiv()
230 ASSERT_OUTSIDE_BEGIN_END(ctx); in _mesa_PixelMapuiv()
233 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); in _mesa_PixelMapuiv()
240 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); in _mesa_PixelMapuiv()
245 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelMapuiv()
247 if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, in _mesa_PixelMapuiv()
252 values = (const GLuint *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); in _mesa_PixelMapuiv()
254 if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { in _mesa_PixelMapuiv()
255 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_PixelMapuiv()
275 _mesa_unmap_pbo_source(ctx, &ctx->Unpack); in _mesa_PixelMapuiv()
277 store_pixelmap(ctx, map, mapsize, fvalues); in _mesa_PixelMapuiv()
285 GET_CURRENT_CONTEXT(ctx); in _mesa_PixelMapusv()
286 ASSERT_OUTSIDE_BEGIN_END(ctx); in _mesa_PixelMapusv()
289 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapusv(mapsize)" ); in _mesa_PixelMapusv()
296 _mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" ); in _mesa_PixelMapusv()
301 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelMapusv()
303 if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, in _mesa_PixelMapusv()
308 values = (const GLushort *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); in _mesa_PixelMapusv()
310 if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { in _mesa_PixelMapusv()
311 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_PixelMapusv()
331 _mesa_unmap_pbo_source(ctx, &ctx->Unpack); in _mesa_PixelMapusv()
333 store_pixelmap(ctx, map, mapsize, fvalues); in _mesa_PixelMapusv()
340 GET_CURRENT_CONTEXT(ctx); in _mesa_GetnPixelMapfvARB()
344 ASSERT_OUTSIDE_BEGIN_END(ctx); in _mesa_GetnPixelMapfvARB()
346 pm = get_pixelmap(ctx, map); in _mesa_GetnPixelMapfvARB()
348 _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapfv(map)"); in _mesa_GetnPixelMapfvARB()
354 if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, in _mesa_GetnPixelMapfvARB()
359 values = (GLfloat *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); in _mesa_GetnPixelMapfvARB()
361 if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { in _mesa_GetnPixelMapfvARB()
362 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_GetnPixelMapfvARB()
371 values[i] = (GLfloat) ctx->PixelMaps.StoS.Map[i]; in _mesa_GetnPixelMapfvARB()
378 _mesa_unmap_pbo_dest(ctx, &ctx->Pack); in _mesa_GetnPixelMapfvARB()
391 GET_CURRENT_CONTEXT(ctx); in _mesa_GetnPixelMapuivARB()
395 ASSERT_OUTSIDE_BEGIN_END(ctx); in _mesa_GetnPixelMapuivARB()
397 pm = get_pixelmap(ctx, map); in _mesa_GetnPixelMapuivARB()
399 _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapuiv(map)"); in _mesa_GetnPixelMapuivARB()
405 if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, in _mesa_GetnPixelMapuivARB()
410 values = (GLuint *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); in _mesa_GetnPixelMapuivARB()
412 if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { in _mesa_GetnPixelMapuivARB()
413 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_GetnPixelMapuivARB()
421 memcpy(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint)); in _mesa_GetnPixelMapuivARB()
429 _mesa_unmap_pbo_dest(ctx, &ctx->Pack); in _mesa_GetnPixelMapuivARB()
442 GET_CURRENT_CONTEXT(ctx); in _mesa_GetnPixelMapusvARB()
446 ASSERT_OUTSIDE_BEGIN_END(ctx); in _mesa_GetnPixelMapusvARB()
448 pm = get_pixelmap(ctx, map); in _mesa_GetnPixelMapusvARB()
450 _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapusv(map)"); in _mesa_GetnPixelMapusvARB()
456 if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, in _mesa_GetnPixelMapusvARB()
461 values = (GLushort *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); in _mesa_GetnPixelMapusvARB()
463 if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { in _mesa_GetnPixelMapusvARB()
464 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_GetnPixelMapusvARB()
474 values[i] = (GLushort) CLAMP(ctx->PixelMaps.ItoI.Map[i], 0.0, 65535.); in _mesa_GetnPixelMapusvARB()
479 values[i] = (GLushort) CLAMP(ctx->PixelMaps.StoS.Map[i], 0.0, 65535.); in _mesa_GetnPixelMapusvARB()
488 _mesa_unmap_pbo_dest(ctx, &ctx->Pack); in _mesa_GetnPixelMapusvARB()
511 GET_CURRENT_CONTEXT(ctx); in _mesa_PixelTransferf()
512 ASSERT_OUTSIDE_BEGIN_END(ctx); in _mesa_PixelTransferf()
516 if (ctx->Pixel.MapColorFlag == (param ? GL_TRUE : GL_FALSE)) in _mesa_PixelTransferf()
518 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
519 ctx->Pixel.MapColorFlag = param ? GL_TRUE : GL_FALSE; in _mesa_PixelTransferf()
522 if (ctx->Pixel.MapStencilFlag == (param ? GL_TRUE : GL_FALSE)) in _mesa_PixelTransferf()
524 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
525 ctx->Pixel.MapStencilFlag = param ? GL_TRUE : GL_FALSE; in _mesa_PixelTransferf()
528 if (ctx->Pixel.IndexShift == (GLint) param) in _mesa_PixelTransferf()
530 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
531 ctx->Pixel.IndexShift = (GLint) param; in _mesa_PixelTransferf()
534 if (ctx->Pixel.IndexOffset == (GLint) param) in _mesa_PixelTransferf()
536 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
537 ctx->Pixel.IndexOffset = (GLint) param; in _mesa_PixelTransferf()
540 if (ctx->Pixel.RedScale == param) in _mesa_PixelTransferf()
542 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
543 ctx->Pixel.RedScale = param; in _mesa_PixelTransferf()
546 if (ctx->Pixel.RedBias == param) in _mesa_PixelTransferf()
548 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
549 ctx->Pixel.RedBias = param; in _mesa_PixelTransferf()
552 if (ctx->Pixel.GreenScale == param) in _mesa_PixelTransferf()
554 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
555 ctx->Pixel.GreenScale = param; in _mesa_PixelTransferf()
558 if (ctx->Pixel.GreenBias == param) in _mesa_PixelTransferf()
560 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
561 ctx->Pixel.GreenBias = param; in _mesa_PixelTransferf()
564 if (ctx->Pixel.BlueScale == param) in _mesa_PixelTransferf()
566 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
567 ctx->Pixel.BlueScale = param; in _mesa_PixelTransferf()
570 if (ctx->Pixel.BlueBias == param) in _mesa_PixelTransferf()
572 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
573 ctx->Pixel.BlueBias = param; in _mesa_PixelTransferf()
576 if (ctx->Pixel.AlphaScale == param) in _mesa_PixelTransferf()
578 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
579 ctx->Pixel.AlphaScale = param; in _mesa_PixelTransferf()
582 if (ctx->Pixel.AlphaBias == param) in _mesa_PixelTransferf()
584 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
585 ctx->Pixel.AlphaBias = param; in _mesa_PixelTransferf()
588 if (ctx->Pixel.DepthScale == param) in _mesa_PixelTransferf()
590 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
591 ctx->Pixel.DepthScale = param; in _mesa_PixelTransferf()
594 if (ctx->Pixel.DepthBias == param) in _mesa_PixelTransferf()
596 FLUSH_VERTICES(ctx, _NEW_PIXEL); in _mesa_PixelTransferf()
597 ctx->Pixel.DepthBias = param; in _mesa_PixelTransferf()
600 _mesa_error( ctx, GL_INVALID_ENUM, "glPixelTransfer(pname)" ); in _mesa_PixelTransferf()
623 update_image_transfer_state(struct gl_context *ctx) in update_image_transfer_state() argument
627 if (ctx->Pixel.RedScale != 1.0F || ctx->Pixel.RedBias != 0.0F || in update_image_transfer_state()
628 ctx->Pixel.GreenScale != 1.0F || ctx->Pixel.GreenBias != 0.0F || in update_image_transfer_state()
629 ctx->Pixel.BlueScale != 1.0F || ctx->Pixel.BlueBias != 0.0F || in update_image_transfer_state()
630 ctx->Pixel.AlphaScale != 1.0F || ctx->Pixel.AlphaBias != 0.0F) in update_image_transfer_state()
633 if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) in update_image_transfer_state()
636 if (ctx->Pixel.MapColorFlag) in update_image_transfer_state()
639 ctx->_ImageTransferState = mask; in update_image_transfer_state()
646 void _mesa_update_pixel( struct gl_context *ctx, GLuint new_state ) in _mesa_update_pixel() argument
649 update_image_transfer_state(ctx); in _mesa_update_pixel()
692 _mesa_init_pixel( struct gl_context *ctx ) in _mesa_init_pixel() argument
695 ctx->Pixel.RedBias = 0.0; in _mesa_init_pixel()
696 ctx->Pixel.RedScale = 1.0; in _mesa_init_pixel()
697 ctx->Pixel.GreenBias = 0.0; in _mesa_init_pixel()
698 ctx->Pixel.GreenScale = 1.0; in _mesa_init_pixel()
699 ctx->Pixel.BlueBias = 0.0; in _mesa_init_pixel()
700 ctx->Pixel.BlueScale = 1.0; in _mesa_init_pixel()
701 ctx->Pixel.AlphaBias = 0.0; in _mesa_init_pixel()
702 ctx->Pixel.AlphaScale = 1.0; in _mesa_init_pixel()
703 ctx->Pixel.DepthBias = 0.0; in _mesa_init_pixel()
704 ctx->Pixel.DepthScale = 1.0; in _mesa_init_pixel()
705 ctx->Pixel.IndexOffset = 0; in _mesa_init_pixel()
706 ctx->Pixel.IndexShift = 0; in _mesa_init_pixel()
707 ctx->Pixel.ZoomX = 1.0; in _mesa_init_pixel()
708 ctx->Pixel.ZoomY = 1.0; in _mesa_init_pixel()
709 ctx->Pixel.MapColorFlag = GL_FALSE; in _mesa_init_pixel()
710 ctx->Pixel.MapStencilFlag = GL_FALSE; in _mesa_init_pixel()
711 init_pixelmap(&ctx->PixelMaps.StoS); in _mesa_init_pixel()
712 init_pixelmap(&ctx->PixelMaps.ItoI); in _mesa_init_pixel()
713 init_pixelmap(&ctx->PixelMaps.ItoR); in _mesa_init_pixel()
714 init_pixelmap(&ctx->PixelMaps.ItoG); in _mesa_init_pixel()
715 init_pixelmap(&ctx->PixelMaps.ItoB); in _mesa_init_pixel()
716 init_pixelmap(&ctx->PixelMaps.ItoA); in _mesa_init_pixel()
717 init_pixelmap(&ctx->PixelMaps.RtoR); in _mesa_init_pixel()
718 init_pixelmap(&ctx->PixelMaps.GtoG); in _mesa_init_pixel()
719 init_pixelmap(&ctx->PixelMaps.BtoB); in _mesa_init_pixel()
720 init_pixelmap(&ctx->PixelMaps.AtoA); in _mesa_init_pixel()
722 if (ctx->Visual.doubleBufferMode) { in _mesa_init_pixel()
723 ctx->Pixel.ReadBuffer = GL_BACK; in _mesa_init_pixel()
726 ctx->Pixel.ReadBuffer = GL_FRONT; in _mesa_init_pixel()
730 ctx->_ImageTransferState = 0; in _mesa_init_pixel()