e:/XFree86 for RH 8.0/XFree86-4.2.0/xc/programs/Xserver/GL/glx/rensize.c File Reference

Go to the source code of this file.

Functions

int __glXCallListsReqSize (GLbyte *pc, Bool swap)
int __glXFogivReqSize (GLbyte *pc, Bool swap)
int __glXFogfvReqSize (GLbyte *pc, Bool swap)
int __glXLightfvReqSize (GLbyte *pc, Bool swap)
int __glXLightivReqSize (GLbyte *pc, Bool swap)
int __glXLightModelfvReqSize (GLbyte *pc, Bool swap)
int __glXLightModelivReqSize (GLbyte *pc, Bool swap)
int __glXMaterialfvReqSize (GLbyte *pc, Bool swap)
int __glXMaterialivReqSize (GLbyte *pc, Bool swap)
int __glXTexGendvReqSize (GLbyte *pc, Bool swap)
int __glXTexGenfvReqSize (GLbyte *pc, Bool swap)
int __glXTexGenivReqSize (GLbyte *pc, Bool swap)
int __glXTexParameterfvReqSize (GLbyte *pc, Bool swap)
int __glXTexParameterivReqSize (GLbyte *pc, Bool swap)
int __glXTexEnvfvReqSize (GLbyte *pc, Bool swap)
int __glXTexEnvivReqSize (GLbyte *pc, Bool swap)
int Map1Size (GLint k, GLint order)
int __glXMap1dReqSize (GLbyte *pc, Bool swap)
int __glXMap1fReqSize (GLbyte *pc, Bool swap)
int Map2Size (int k, int majorOrder, int minorOrder)
int __glXMap2dReqSize (GLbyte *pc, Bool swap)
int __glXMap2fReqSize (GLbyte *pc, Bool swap)
int __glXPixelMapfvReqSize (GLbyte *pc, Bool swap)
int __glXPixelMapuivReqSize (GLbyte *pc, Bool swap)
int __glXPixelMapusvReqSize (GLbyte *pc, Bool swap)
int __glXImageSize (GLenum format, GLenum type, GLsizei w, GLsizei h, GLint rowLength, GLint skipRows, GLint alignment)
int __glXImage3DSize (GLenum format, GLenum type, GLsizei w, GLsizei h, GLsizei d, GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows, GLint alignment)
int __glXDrawPixelsReqSize (GLbyte *pc, Bool swap)
int __glXBitmapReqSize (GLbyte *pc, Bool swap)
int __glXTexImage1DReqSize (GLbyte *pc, Bool swap)
int __glXTexImage2DReqSize (GLbyte *pc, Bool swap)
int __glXTypeSize (GLenum enm)
int __glXDrawArraysSize (GLbyte *pc, Bool swap)
int __glXPrioritizeTexturesReqSize (GLbyte *pc, Bool swap)
int __glXTexSubImage1DReqSize (GLbyte *pc, Bool swap)
int __glXTexSubImage2DReqSize (GLbyte *pc, Bool swap)
int __glXTexImage3DReqSize (GLbyte *pc, Bool swap)
int __glXTexSubImage3DReqSize (GLbyte *pc, Bool swap)
int __glXConvolutionFilter1DReqSize (GLbyte *pc, Bool swap)
int __glXConvolutionFilter2DReqSize (GLbyte *pc, Bool swap)
int __glXConvolutionParameterivSize (GLenum pname)
int __glXConvolutionParameterfvSize (GLenum pname)
int __glXConvolutionParameterivReqSize (GLbyte *pc, Bool swap)
int __glXConvolutionParameterfvReqSize (GLbyte *pc, Bool swap)
int __glXSeparableFilter2DReqSize (GLbyte *pc, Bool swap)
int __glXColorTableParameterfvSize (GLenum pname)
int __glXColorTableParameterivSize (GLenum pname)
int __glXColorTableReqSize (GLbyte *pc, Bool swap)
int __glXColorSubTableReqSize (GLbyte *pc, Bool swap)
int __glXColorTableParameterfvReqSize (GLbyte *pc, Bool swap)
int __glXColorTableParameterivReqSize (GLbyte *pc, Bool swap)


Function Documentation

int __glXCallListsReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 47 of file rensize.c.

References __glCallLists_size(), n, swap, and type.

00048 { 00049 GLsizei n = *(GLsizei *)(pc + 0); 00050 GLenum type = *(GLenum *)(pc + 4); 00051 00052 if (swap) { 00053 n = SWAPL( n ); 00054 type = SWAPL( type ); 00055 } 00056 return __glCallLists_size( n, type ); /* defined in samplegl lib */ 00057 }

int __glXFogivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 59 of file rensize.c.

References __glFogiv_size(), and swap.

Referenced by __glXFogfvReqSize().

00060 { 00061 GLenum pname = *(GLenum *)(pc + 0); 00062 if (swap) { 00063 pname = SWAPL( pname ); 00064 } 00065 return 4 * __glFogiv_size( pname ); /* defined in samplegl lib */ 00066 }

int __glXFogfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 68 of file rensize.c.

References __glXFogivReqSize(), and swap.

00069 { 00070 return __glXFogivReqSize( pc, swap ); 00071 }

int __glXLightfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 73 of file rensize.c.

References __glLightfv_size(), and swap.

Referenced by __glXLightivReqSize().

00074 { 00075 GLenum pname = *(GLenum *)(pc + 4); 00076 if (swap) { 00077 pname = SWAPL( pname ); 00078 } 00079 return 4 * __glLightfv_size( pname ); /* defined in samplegl lib */ 00080 }

int __glXLightivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 82 of file rensize.c.

References __glXLightfvReqSize(), and swap.

00083 { 00084 return __glXLightfvReqSize( pc, swap ); 00085 }

int __glXLightModelfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 87 of file rensize.c.

References __glLightModelfv_size(), and swap.

Referenced by __glXLightModelivReqSize().

00088 { 00089 GLenum pname = *(GLenum *)(pc + 0); 00090 if (swap) { 00091 pname = SWAPL( pname ); 00092 } 00093 return 4 * __glLightModelfv_size( pname ); /* defined in samplegl lib */ 00094 }

int __glXLightModelivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 96 of file rensize.c.

References __glXLightModelfvReqSize(), and swap.

00097 { 00098 return __glXLightModelfvReqSize( pc, swap ); 00099 }

int __glXMaterialfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 101 of file rensize.c.

References __glMaterialfv_size(), and swap.

Referenced by __glXMaterialivReqSize().

00102 { 00103 GLenum pname = *(GLenum *)(pc + 4); 00104 if (swap) { 00105 pname = SWAPL( pname ); 00106 } 00107 return 4 * __glMaterialfv_size( pname ); /* defined in samplegl lib */ 00108 }

int __glXMaterialivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 110 of file rensize.c.

References __glXMaterialfvReqSize(), and swap.

00111 { 00112 return __glXMaterialfvReqSize( pc, swap ); 00113 }

int __glXTexGendvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 115 of file rensize.c.

References __glTexGendv_size(), and swap.

00116 { 00117 GLenum pname = *(GLenum *)(pc + 4); 00118 if (swap) { 00119 pname = SWAPL( pname ); 00120 } 00121 return 8 * __glTexGendv_size( pname ); /* defined in samplegl lib */ 00122 }

int __glXTexGenfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 124 of file rensize.c.

References __glTexGenfv_size(), and swap.

Referenced by __glXTexGenivReqSize().

00125 { 00126 GLenum pname = *(GLenum *)(pc + 4); 00127 if (swap) { 00128 pname = SWAPL( pname ); 00129 } 00130 return 4 * __glTexGenfv_size( pname ); /* defined in samplegl lib */ 00131 }

int __glXTexGenivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 133 of file rensize.c.

References __glXTexGenfvReqSize(), and swap.

00134 { 00135 return __glXTexGenfvReqSize( pc, swap ); 00136 }

int __glXTexParameterfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 138 of file rensize.c.

References __glTexParameterfv_size(), and swap.

Referenced by __glXTexParameterivReqSize().

00139 { 00140 GLenum pname = *(GLenum *)(pc + 4); 00141 if (swap) { 00142 pname = SWAPL( pname ); 00143 } 00144 return 4 * __glTexParameterfv_size( pname ); /* defined in samplegl lib */ 00145 }

int __glXTexParameterivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 147 of file rensize.c.

References __glXTexParameterfvReqSize(), and swap.

00148 { 00149 return __glXTexParameterfvReqSize( pc, swap ); 00150 }

int __glXTexEnvfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 152 of file rensize.c.

References __glTexEnvfv_size(), and swap.

Referenced by __glXTexEnvivReqSize().

00153 { 00154 GLenum pname = *(GLenum *)(pc + 4); 00155 if (swap) { 00156 pname = SWAPL( pname ); 00157 } 00158 return 4 * __glTexEnvfv_size( pname ); /* defined in samplegl lib */ 00159 }

int __glXTexEnvivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 161 of file rensize.c.

References __glXTexEnvfvReqSize(), and swap.

00162 { 00163 return __glXTexEnvfvReqSize( pc, swap ); 00164 }

int Map1Size GLint  k,
GLint  order
[static]
 

Definition at line 166 of file rensize.c.

References k, and order.

Referenced by __glXMap1dReqSize(), and __glXMap1fReqSize().

00167 { 00168 if (order <= 0 || k < 0) return -1; 00169 return k * order; 00170 }

int __glXMap1dReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 172 of file rensize.c.

References __glEvalComputeK(), k, Map1Size(), order, swap, and target.

00173 { 00174 GLenum target; 00175 GLint order, k; 00176 00177 target = *(GLenum*) (pc + 16); 00178 order = *(GLint*) (pc + 20); 00179 if (swap) { 00180 target = SWAPL( target ); 00181 order = SWAPL( order ); 00182 } 00183 k = __glEvalComputeK( target ); 00184 return 8 * Map1Size( k, order ); 00185 }

int __glXMap1fReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 187 of file rensize.c.

References __glEvalComputeK(), k, Map1Size(), order, swap, and target.

00188 { 00189 GLenum target; 00190 GLint order, k; 00191 00192 target = *(GLenum *)(pc + 0); 00193 order = *(GLint *)(pc + 12); 00194 if (swap) { 00195 target = SWAPL( target ); 00196 order = SWAPL( order ); 00197 } 00198 k = __glEvalComputeK(target); 00199 return 4 * Map1Size(k, order); 00200 }

int Map2Size int  k,
int  majorOrder,
int  minorOrder
[static]
 

Definition at line 202 of file rensize.c.

References k.

Referenced by __glXMap2dReqSize(), and __glXMap2fReqSize().

00203 { 00204 if (majorOrder <= 0 || minorOrder <= 0 || k < 0) return -1; 00205 return k * majorOrder * minorOrder; 00206 }

int __glXMap2dReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 208 of file rensize.c.

References __glEvalComputeK(), k, Map2Size(), swap, and target.

00209 { 00210 GLenum target; 00211 GLint uorder, vorder, k; 00212 00213 target = *(GLenum *)(pc + 32); 00214 uorder = *(GLint *)(pc + 36); 00215 vorder = *(GLint *)(pc + 40); 00216 if (swap) { 00217 target = SWAPL( target ); 00218 uorder = SWAPL( uorder ); 00219 vorder = SWAPL( vorder ); 00220 } 00221 k = __glEvalComputeK( target ); 00222 return 8 * Map2Size( k, uorder, vorder ); 00223 }

int __glXMap2fReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 225 of file rensize.c.

References __glEvalComputeK(), k, Map2Size(), swap, and target.

00226 { 00227 GLenum target; 00228 GLint uorder, vorder, k; 00229 00230 target = *(GLenum *)(pc + 0); 00231 uorder = *(GLint *)(pc + 12); 00232 vorder = *(GLint *)(pc + 24); 00233 if (swap) { 00234 target = SWAPL( target ); 00235 uorder = SWAPL( uorder ); 00236 vorder = SWAPL( vorder ); 00237 } 00238 k = __glEvalComputeK( target ); 00239 return 4 * Map2Size( k, uorder, vorder ); 00240 }

int __glXPixelMapfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 242 of file rensize.c.

References swap.

Referenced by __glXPixelMapuivReqSize().

00243 { 00244 GLint mapsize; 00245 mapsize = *(GLint *)(pc + 4); 00246 if (swap) { 00247 mapsize = SWAPL( mapsize ); 00248 } 00249 return 4 * mapsize; 00250 }

int __glXPixelMapuivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 252 of file rensize.c.

References __glXPixelMapfvReqSize(), and swap.

00253 { 00254 return __glXPixelMapfvReqSize( pc, swap ); 00255 }

int __glXPixelMapusvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 257 of file rensize.c.

References swap.

00258 { 00259 GLint mapsize; 00260 mapsize = *(GLint *)(pc + 4); 00261 if (swap) { 00262 mapsize = SWAPL( mapsize ); 00263 } 00264 return 2 * mapsize; 00265 }

int __glXImageSize GLenum  format,
GLenum  type,
GLsizei  w,
GLsizei  h,
GLint  rowLength,
GLint  skipRows,
GLint  alignment
 

Definition at line 267 of file rensize.c.

References format, h, type, and w.

Referenced by __glXBitmapReqSize(), __glXColorSubTableReqSize(), __glXColorTableReqSize(), __glXConvolutionFilter1DReqSize(), __glXConvolutionFilter2DReqSize(), __glXDisp_SeparableFilter2D(), __glXDispSwap_SeparableFilter2D(), __glXDrawPixelsReqSize(), __glXSeparableFilter2DReqSize(), __glXTexImage1DReqSize(), __glXTexImage2DReqSize(), __glXTexSubImage1DReqSize(), and __glXTexSubImage2DReqSize().

00269 { 00270 GLint bytesPerElement, elementsPerGroup, groupsPerRow; 00271 GLint groupSize, rowSize, padding; 00272 00273 if (w < 0 || h < 0 || 00274 (type == GL_BITMAP && 00275 (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) { 00276 return -1; 00277 } 00278 if (w==0 || h==0) return 0; 00279 00280 if (type == GL_BITMAP) { 00281 if (rowLength > 0) { 00282 groupsPerRow = rowLength; 00283 } else { 00284 groupsPerRow = w; 00285 } 00286 rowSize = (groupsPerRow + 7) >> 3; 00287 padding = (rowSize % alignment); 00288 if (padding) { 00289 rowSize += alignment - padding; 00290 } 00291 return ((h + skipRows) * rowSize); 00292 } else { 00293 switch(format) { 00294 case GL_COLOR_INDEX: 00295 case GL_STENCIL_INDEX: 00296 case GL_DEPTH_COMPONENT: 00297 elementsPerGroup = 1; 00298 break; 00299 case GL_RED: 00300 case GL_GREEN: 00301 case GL_BLUE: 00302 case GL_ALPHA: 00303 case GL_LUMINANCE: 00304 elementsPerGroup = 1; 00305 break; 00306 case GL_LUMINANCE_ALPHA: 00307 elementsPerGroup = 2; 00308 break; 00309 case GL_RGB: 00310 case GL_BGR: 00311 elementsPerGroup = 3; 00312 break; 00313 case GL_RGBA: 00314 case GL_BGRA: 00315 case GL_ABGR_EXT: 00316 elementsPerGroup = 4; 00317 break; 00318 default: 00319 return -1; 00320 } 00321 switch(type) { 00322 case GL_UNSIGNED_BYTE: 00323 case GL_BYTE: 00324 bytesPerElement = 1; 00325 break; 00326 case GL_UNSIGNED_BYTE_3_3_2: 00327 case GL_UNSIGNED_BYTE_2_3_3_REV: 00328 bytesPerElement = 1; 00329 elementsPerGroup = 1; 00330 break; 00331 case GL_UNSIGNED_SHORT: 00332 case GL_SHORT: 00333 bytesPerElement = 2; 00334 break; 00335 case GL_UNSIGNED_SHORT_5_6_5: 00336 case GL_UNSIGNED_SHORT_5_6_5_REV: 00337 case GL_UNSIGNED_SHORT_4_4_4_4: 00338 case GL_UNSIGNED_SHORT_4_4_4_4_REV: 00339 case GL_UNSIGNED_SHORT_5_5_5_1: 00340 case GL_UNSIGNED_SHORT_1_5_5_5_REV: 00341 bytesPerElement = 2; 00342 elementsPerGroup = 1; 00343 break; 00344 case GL_INT: 00345 case GL_UNSIGNED_INT: 00346 case GL_FLOAT: 00347 bytesPerElement = 4; 00348 break; 00349 case GL_UNSIGNED_INT_8_8_8_8: 00350 case GL_UNSIGNED_INT_8_8_8_8_REV: 00351 case GL_UNSIGNED_INT_10_10_10_2: 00352 case GL_UNSIGNED_INT_2_10_10_10_REV: 00353 bytesPerElement = 4; 00354 elementsPerGroup = 1; 00355 break; 00356 default: 00357 return -1; 00358 } 00359 groupSize = bytesPerElement * elementsPerGroup; 00360 if (rowLength > 0) { 00361 groupsPerRow = rowLength; 00362 } else { 00363 groupsPerRow = w; 00364 } 00365 rowSize = groupsPerRow * groupSize; 00366 padding = (rowSize % alignment); 00367 if (padding) { 00368 rowSize += alignment - padding; 00369 } 00370 return ((h + skipRows) * rowSize); 00371 } 00372 }

int __glXImage3DSize GLenum  format,
GLenum  type,
GLsizei  w,
GLsizei  h,
GLsizei  d,
GLint  imageHeight,
GLint  rowLength,
GLint  skipImages,
GLint  skipRows,
GLint  alignment
 

Definition at line 377 of file rensize.c.

References d, format, h, type, and w.

Referenced by __glXTexImage3DReqSize(), and __glXTexSubImage3DReqSize().

00380 { 00381 GLint bytesPerElement, elementsPerGroup, groupsPerRow; 00382 GLint groupSize, rowSize, padding, imageSize; 00383 00384 if (w < 0 || h < 0 || d < 0 || 00385 (type == GL_BITMAP && 00386 (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX))) { 00387 return -1; 00388 } 00389 if (w==0 || h==0 || d == 0) return 0; 00390 00391 if (type == GL_BITMAP) { 00392 if (rowLength > 0) { 00393 groupsPerRow = rowLength; 00394 } else { 00395 groupsPerRow = w; 00396 } 00397 rowSize = (groupsPerRow + 7) >> 3; 00398 padding = (rowSize % alignment); 00399 if (padding) { 00400 rowSize += alignment - padding; 00401 } 00402 return ((h + skipRows) * rowSize); 00403 } else { 00404 switch(format) { 00405 case GL_COLOR_INDEX: 00406 case GL_STENCIL_INDEX: 00407 case GL_DEPTH_COMPONENT: 00408 elementsPerGroup = 1; 00409 break; 00410 case GL_RED: 00411 case GL_GREEN: 00412 case GL_BLUE: 00413 case GL_ALPHA: 00414 case GL_LUMINANCE: 00415 elementsPerGroup = 1; 00416 break; 00417 case GL_LUMINANCE_ALPHA: 00418 elementsPerGroup = 2; 00419 break; 00420 case GL_RGB: 00421 case GL_BGR: 00422 elementsPerGroup = 3; 00423 break; 00424 case GL_RGBA: 00425 case GL_BGRA: 00426 case GL_ABGR_EXT: 00427 elementsPerGroup = 4; 00428 break; 00429 default: 00430 return -1; 00431 } 00432 switch(type) { 00433 case GL_UNSIGNED_BYTE: 00434 case GL_BYTE: 00435 bytesPerElement = 1; 00436 break; 00437 case GL_UNSIGNED_BYTE_3_3_2: 00438 case GL_UNSIGNED_BYTE_2_3_3_REV: 00439 bytesPerElement = 1; 00440 elementsPerGroup = 1; 00441 break; 00442 case GL_UNSIGNED_SHORT: 00443 case GL_SHORT: 00444 bytesPerElement = 2; 00445 break; 00446 case GL_UNSIGNED_SHORT_5_6_5: 00447 case GL_UNSIGNED_SHORT_5_6_5_REV: 00448 case GL_UNSIGNED_SHORT_4_4_4_4: 00449 case GL_UNSIGNED_SHORT_4_4_4_4_REV: 00450 case GL_UNSIGNED_SHORT_5_5_5_1: 00451 case GL_UNSIGNED_SHORT_1_5_5_5_REV: 00452 bytesPerElement = 2; 00453 elementsPerGroup = 1; 00454 break; 00455 case GL_INT: 00456 case GL_UNSIGNED_INT: 00457 case GL_FLOAT: 00458 bytesPerElement = 4; 00459 break; 00460 case GL_UNSIGNED_INT_8_8_8_8: 00461 case GL_UNSIGNED_INT_8_8_8_8_REV: 00462 case GL_UNSIGNED_INT_10_10_10_2: 00463 case GL_UNSIGNED_INT_2_10_10_10_REV: 00464 bytesPerElement = 4; 00465 elementsPerGroup = 1; 00466 break; 00467 default: 00468 return -1; 00469 } 00470 groupSize = bytesPerElement * elementsPerGroup; 00471 if (rowLength > 0) { 00472 groupsPerRow = rowLength; 00473 } else { 00474 groupsPerRow = w; 00475 } 00476 rowSize = groupsPerRow * groupSize; 00477 padding = (rowSize % alignment); 00478 if (padding) { 00479 rowSize += alignment - padding; 00480 } 00481 if (imageHeight > 0) { 00482 imageSize = (imageHeight + skipRows) * rowSize; 00483 } else { 00484 imageSize = (h + skipRows) * rowSize; 00485 } 00486 return ((d + skipImages) * imageSize); 00487 } 00488 }

int __glXDrawPixelsReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 491 of file rensize.c.

References __glXImageSize(), format, h, swap, type, and w.

00492 { 00493 __GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc; 00494 GLenum format = hdr->format; 00495 GLenum type = hdr->type; 00496 GLint w = hdr->width; 00497 GLint h = hdr->height; 00498 GLint rowLength = hdr->rowLength; 00499 GLint skipRows = hdr->skipRows; 00500 GLint alignment = hdr->alignment; 00501 00502 if (swap) { 00503 format = SWAPL( format ); 00504 type = SWAPL( type ); 00505 w = SWAPL( w ); 00506 h = SWAPL( h ); 00507 rowLength = SWAPL( rowLength ); 00508 skipRows = SWAPL( skipRows ); 00509 alignment = SWAPL( alignment ); 00510 } 00511 return __glXImageSize( format, type, w, h, rowLength, skipRows, alignment ); 00512 }

int __glXBitmapReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 514 of file rensize.c.

References __glXImageSize(), h, swap, and w.

00515 { 00516 __GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc; 00517 GLint w = hdr->width; 00518 GLint h = hdr->height; 00519 GLint rowLength = hdr->rowLength; 00520 GLint skipRows = hdr->skipRows; 00521 GLint alignment = hdr->alignment; 00522 00523 if (swap) { 00524 w = SWAPL( w ); 00525 h = SWAPL( h ); 00526 rowLength = SWAPL( rowLength ); 00527 skipRows = SWAPL( skipRows ); 00528 alignment = SWAPL( alignment ); 00529 } 00530 return __glXImageSize( GL_COLOR_INDEX, GL_BITMAP, w, h, 00531 rowLength, skipRows, alignment ); 00532 }

int __glXTexImage1DReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 534 of file rensize.c.

References __glXImageSize(), format, swap, target, type, and w.

00535 { 00536 __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc; 00537 GLenum target = hdr->target; 00538 GLenum format = hdr->format; 00539 GLenum type = hdr->type; 00540 GLint w = hdr->width; 00541 GLint rowLength = hdr->rowLength; 00542 GLint skipRows = hdr->skipRows; 00543 GLint alignment = hdr->alignment; 00544 00545 if (swap) { 00546 target = SWAPL( target ); 00547 format = SWAPL( format ); 00548 type = SWAPL( type ); 00549 w = SWAPL( w ); 00550 rowLength = SWAPL( rowLength ); 00551 skipRows = SWAPL( skipRows ); 00552 alignment = SWAPL( alignment ); 00553 } 00554 if (target == GL_PROXY_TEXTURE_1D) { 00555 return 0; 00556 } else if (format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT) { 00557 return -1; 00558 } 00559 return __glXImageSize( format, type, w, 1, rowLength, skipRows, alignment ); 00560 }

int __glXTexImage2DReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 562 of file rensize.c.

References __glXImageSize(), format, h, swap, target, type, and w.

00563 { 00564 __GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc; 00565 GLenum target = hdr->target; 00566 GLenum format = hdr->format; 00567 GLenum type = hdr->type; 00568 GLint w = hdr->width; 00569 GLint h = hdr->height; 00570 GLint rowLength = hdr->rowLength; 00571 GLint skipRows = hdr->skipRows; 00572 GLint alignment = hdr->alignment; 00573 00574 if (swap) { 00575 target = SWAPL( target ); 00576 format = SWAPL( format ); 00577 type = SWAPL( type ); 00578 w = SWAPL( w ); 00579 h = SWAPL( h ); 00580 rowLength = SWAPL( rowLength ); 00581 skipRows = SWAPL( skipRows ); 00582 alignment = SWAPL( alignment ); 00583 } 00584 if (target == GL_PROXY_TEXTURE_2D) { 00585 return 0; 00586 } else if (format == GL_STENCIL_INDEX || format == GL_DEPTH_COMPONENT) { 00587 return -1; 00588 } 00589 return __glXImageSize( format, type, w, h, rowLength, skipRows, alignment ); 00590 }

int __glXTypeSize GLenum  enm  ) 
 

Definition at line 593 of file rensize.c.

Referenced by __glXDisp_DrawArrays(), __glXDispSwap_DrawArrays(), and __glXDrawArraysSize().

00594 { 00595 switch(enm) { 00596 case GL_BYTE: return sizeof(GLbyte); 00597 case GL_UNSIGNED_BYTE: return sizeof(GLubyte); 00598 case GL_SHORT: return sizeof(GLshort); 00599 case GL_UNSIGNED_SHORT: return sizeof(GLushort); 00600 case GL_INT: return sizeof(GLint); 00601 case GL_UNSIGNED_INT: return sizeof(GLint); 00602 case GL_FLOAT: return sizeof(GLfloat); 00603 case GL_DOUBLE: return sizeof(GLdouble); 00604 default: return -1; 00605 } 00606 }

int __glXDrawArraysSize GLbyte *  pc,
Bool  swap
 

Definition at line 608 of file rensize.c.

References __glXTypeSize(), i, and swap.

00609 { 00610 __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc; 00611 __GLXdispatchDrawArraysComponentHeader *compHeader; 00612 GLint numVertexes = hdr->numVertexes; 00613 GLint numComponents = hdr->numComponents; 00614 GLint arrayElementSize = 0; 00615 int i; 00616 00617 if (swap) { 00618 numVertexes = SWAPL( numVertexes ); 00619 numComponents = SWAPL( numComponents ); 00620 } 00621 00622 pc += sizeof(__GLXdispatchDrawArraysHeader); 00623 compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc; 00624 00625 for (i=0; i<numComponents; i++) { 00626 GLenum datatype = compHeader[i].datatype; 00627 GLint numVals = compHeader[i].numVals; 00628 GLint component = compHeader[i].component; 00629 00630 if (swap) { 00631 datatype = SWAPL( datatype ); 00632 numVals = SWAPL( numVals ); 00633 component = SWAPL( component ); 00634 } 00635 00636 switch (component) { 00637 case GL_VERTEX_ARRAY: 00638 case GL_COLOR_ARRAY: 00639 case GL_TEXTURE_COORD_ARRAY: 00640 break; 00641 case GL_NORMAL_ARRAY: 00642 if (numVals != 3) { 00643 /* bad size */ 00644 return -1; 00645 } 00646 break; 00647 case GL_INDEX_ARRAY: 00648 if (numVals != 1) { 00649 /* bad size */ 00650 return -1; 00651 } 00652 break; 00653 case GL_EDGE_FLAG_ARRAY: 00654 if ((numVals != 1) && (datatype != GL_UNSIGNED_BYTE)) { 00655 /* bad size or bad type */ 00656 return -1; 00657 } 00658 break; 00659 default: 00660 /* unknown component type */ 00661 return -1; 00662 } 00663 00664 arrayElementSize += __GLX_PAD(numVals * __glXTypeSize(datatype)); 00665 00666 pc += sizeof(__GLXdispatchDrawArraysComponentHeader); 00667 } 00668 00669 return ((numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader)) + 00670 (numVertexes * arrayElementSize)); 00671 }

int __glXPrioritizeTexturesReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 673 of file rensize.c.

References n, and swap.

00674 { 00675 GLint n = *(GLsizei *)(pc + 0); 00676 if (swap) n = SWAPL(n); 00677 return(8*n); /* 4*n for textures, 4*n for priorities */ 00678 }

int __glXTexSubImage1DReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 680 of file rensize.c.

References __glXImageSize(), format, swap, type, and w.

00681 { 00682 __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc; 00683 GLenum format = hdr->format; 00684 GLenum type = hdr->type; 00685 GLint w = hdr->width; 00686 GLint rowLength = hdr->rowLength; 00687 GLint skipRows = hdr->skipRows; 00688 GLint alignment = hdr->alignment; 00689 00690 if (swap) { 00691 format = SWAPL( format ); 00692 type = SWAPL( type ); 00693 w = SWAPL( w ); 00694 rowLength = SWAPL( rowLength ); 00695 skipRows = SWAPL( skipRows ); 00696 alignment = SWAPL( alignment ); 00697 } 00698 return __glXImageSize( format, type, w, 1, rowLength, skipRows, alignment ); 00699 }

int __glXTexSubImage2DReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 701 of file rensize.c.

References __glXImageSize(), format, h, swap, type, and w.

00702 { 00703 __GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc; 00704 GLenum format = hdr->format; 00705 GLenum type = hdr->type; 00706 GLint w = hdr->width; 00707 GLint h = hdr->height; 00708 GLint rowLength = hdr->rowLength; 00709 GLint skipRows = hdr->skipRows; 00710 GLint alignment = hdr->alignment; 00711 00712 if (swap) { 00713 format = SWAPL( format ); 00714 type = SWAPL( type ); 00715 w = SWAPL( w ); 00716 h = SWAPL( h ); 00717 rowLength = SWAPL( rowLength ); 00718 skipRows = SWAPL( skipRows ); 00719 alignment = SWAPL( alignment ); 00720 } 00721 return __glXImageSize( format, type, w, h, rowLength, skipRows, alignment ); 00722 }

int __glXTexImage3DReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 724 of file rensize.c.

References __glXImage3DSize(), d, format, h, swap, target, type, and w.

00725 { 00726 __GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc; 00727 GLenum target = hdr->target; 00728 GLenum format = hdr->format; 00729 GLenum type = hdr->type; 00730 GLint w = hdr->width; 00731 GLint h = hdr->height; 00732 GLint d = hdr->depth; 00733 GLint imageHeight = hdr->imageHeight; 00734 GLint rowLength = hdr->rowLength; 00735 GLint skipImages = hdr->skipImages; 00736 GLint skipRows = hdr->skipRows; 00737 GLint alignment = hdr->alignment; 00738 GLint nullImage = hdr->nullimage; 00739 00740 if (swap) { 00741 target = SWAPL( target ); 00742 format = SWAPL( format ); 00743 type = SWAPL( type ); 00744 w = SWAPL( w ); 00745 h = SWAPL( h ); 00746 d = SWAPL( d ); 00747 imageHeight = SWAPL( imageHeight ); 00748 rowLength = SWAPL( rowLength ); 00749 skipImages = SWAPL( skipImages ); 00750 skipRows = SWAPL( skipRows ); 00751 alignment = SWAPL( alignment ); 00752 } 00753 if (target == GL_PROXY_TEXTURE_3D || nullImage) { 00754 return 0; 00755 } else { 00756 return __glXImage3DSize( format, type, w, h, d, imageHeight, 00757 rowLength, skipImages, skipRows, 00758 alignment); 00759 } 00760 }

int __glXTexSubImage3DReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 762 of file rensize.c.

References __glXImage3DSize(), d, format, h, swap, target, type, and w.

00763 { 00764 __GLXdispatchTexSubImage3DHeader *hdr = 00765 (__GLXdispatchTexSubImage3DHeader *) pc; 00766 GLenum target = hdr->target; 00767 GLenum format = hdr->format; 00768 GLenum type = hdr->type; 00769 GLint w = hdr->width; 00770 GLint h = hdr->height; 00771 GLint d = hdr->depth; 00772 GLint imageHeight = hdr->imageHeight; 00773 GLint rowLength = hdr->rowLength; 00774 GLint skipImages = hdr->skipImages; 00775 GLint skipRows = hdr->skipRows; 00776 GLint alignment = hdr->alignment; 00777 00778 if (swap) { 00779 target = SWAPL( target ); 00780 format = SWAPL( format ); 00781 type = SWAPL( type ); 00782 w = SWAPL( w ); 00783 h = SWAPL( h ); 00784 d = SWAPL( d ); 00785 imageHeight = SWAPL( imageHeight ); 00786 rowLength = SWAPL( rowLength ); 00787 skipImages = SWAPL( skipImages ); 00788 skipRows = SWAPL( skipRows ); 00789 alignment = SWAPL( alignment ); 00790 } 00791 if (target == GL_PROXY_TEXTURE_3D) { 00792 return 0; 00793 } else { 00794 return __glXImage3DSize( format, type, w, h, d, imageHeight, 00795 rowLength, skipImages, skipRows, 00796 alignment); 00797 } 00798 }

int __glXConvolutionFilter1DReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 800 of file rensize.c.

References __glXImageSize(), format, swap, type, and w.

00801 { 00802 __GLXdispatchConvolutionFilterHeader *hdr = 00803 (__GLXdispatchConvolutionFilterHeader *) pc; 00804 00805 GLenum format = hdr->format; 00806 GLenum type = hdr->type; 00807 GLint w = hdr->width; 00808 GLint rowLength = hdr->rowLength; 00809 GLint alignment = hdr->alignment; 00810 00811 if (swap) { 00812 format = SWAPL( format ); 00813 type = SWAPL( type ); 00814 w = SWAPL( w ); 00815 rowLength = SWAPL( rowLength ); 00816 alignment = SWAPL( alignment ); 00817 } 00818 00819 return __glXImageSize ( format, type, w, 1, rowLength, 0, alignment ); 00820 }

int __glXConvolutionFilter2DReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 822 of file rensize.c.

References __glXImageSize(), format, h, swap, type, and w.

00823 { 00824 __GLXdispatchConvolutionFilterHeader *hdr = 00825 (__GLXdispatchConvolutionFilterHeader *) pc; 00826 00827 GLenum format = hdr->format; 00828 GLenum type = hdr->type; 00829 GLint w = hdr->width; 00830 GLint h = hdr->height; 00831 GLint rowLength = hdr->rowLength; 00832 GLint skipRows = hdr->skipRows; 00833 GLint alignment = hdr->alignment; 00834 00835 if (swap) { 00836 format = SWAPL( format ); 00837 type = SWAPL( type ); 00838 w = SWAPL( w ); 00839 h = SWAPL( h ); 00840 rowLength = SWAPL( rowLength ); 00841 skipRows = SWAPL( skipRows ); 00842 alignment = SWAPL( alignment ); 00843 } 00844 00845 return __glXImageSize ( format, type, w, h, rowLength, skipRows, alignment ); 00846 }

int __glXConvolutionParameterivSize GLenum  pname  ) 
 

Definition at line 848 of file rensize.c.

Referenced by __glXConvolutionParameterfvSize(), and __glXConvolutionParameterivReqSize().

00849 { 00850 switch (pname) { 00851 case GL_CONVOLUTION_BORDER_COLOR: 00852 case GL_CONVOLUTION_FILTER_SCALE: 00853 case GL_CONVOLUTION_FILTER_BIAS: 00854 return 4; 00855 case GL_CONVOLUTION_BORDER_MODE: 00856 return 1; 00857 default: 00858 return -1; 00859 } 00860 }

int __glXConvolutionParameterfvSize GLenum  pname  ) 
 

Definition at line 862 of file rensize.c.

References __glXConvolutionParameterivSize().

00863 { 00864 return __glXConvolutionParameterivSize(pname); 00865 }

int __glXConvolutionParameterivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 867 of file rensize.c.

References __glXConvolutionParameterivSize(), and swap.

Referenced by __glXConvolutionParameterfvReqSize().

00868 { 00869 GLenum pname = *(GLenum *)(pc + 4); 00870 if (swap) { 00871 pname = SWAPL( pname ); 00872 } 00873 return 4 * __glXConvolutionParameterivSize( pname ); 00874 }

int __glXConvolutionParameterfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 876 of file rensize.c.

References __glXConvolutionParameterivReqSize(), and swap.

00877 { 00878 return __glXConvolutionParameterivReqSize( pc, swap ); 00879 }

int __glXSeparableFilter2DReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 881 of file rensize.c.

References __glXImageSize(), format, h, swap, type, and w.

00882 { 00883 __GLXdispatchConvolutionFilterHeader *hdr = 00884 (__GLXdispatchConvolutionFilterHeader *) pc; 00885 00886 GLint image1size, image2size; 00887 GLenum format = hdr->format; 00888 GLenum type = hdr->type; 00889 GLint w = hdr->width; 00890 GLint h = hdr->height; 00891 GLint rowLength = hdr->rowLength; 00892 GLint alignment = hdr->alignment; 00893 00894 if (swap) { 00895 format = SWAPL( format ); 00896 type = SWAPL( type ); 00897 w = SWAPL( w ); 00898 h = SWAPL( h ); 00899 rowLength = SWAPL( rowLength ); 00900 alignment = SWAPL( alignment ); 00901 } 00902 00903 /* XXX Should rowLength be used for either or both image? */ 00904 image1size = __glXImageSize ( format, type, w, 1, rowLength, 0, alignment ); 00905 image1size = __GLX_PAD(image1size); 00906 image2size = __glXImageSize ( format, type, h, 1, rowLength, 0, alignment ); 00907 return image1size + image2size; 00908 00909 }

int __glXColorTableParameterfvSize GLenum  pname  ) 
 

Definition at line 911 of file rensize.c.

Referenced by __glXColorTableParameterfvReqSize(), and __glXColorTableParameterivSize().

00912 { 00913 /* currently, only scale and bias are supported; return RGBA */ 00914 switch(pname) { 00915 case GL_COLOR_TABLE_SCALE: 00916 case GL_COLOR_TABLE_BIAS: 00917 return 4; 00918 default: 00919 return 0; 00920 } 00921 }

int __glXColorTableParameterivSize GLenum  pname  ) 
 

Definition at line 923 of file rensize.c.

References __glXColorTableParameterfvSize().

00924 { 00925 /* fv and iv are the same in this context */ 00926 return __glXColorTableParameterfvSize(pname); 00927 }

int __glXColorTableReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 929 of file rensize.c.

References __glXImageSize(), format, swap, target, type, and w.

00930 { 00931 __GLXdispatchColorTableHeader *hdr = 00932 (__GLXdispatchColorTableHeader *) pc; 00933 00934 GLenum target = hdr->target; 00935 GLenum format = hdr->format; 00936 GLenum type = hdr->type; 00937 GLint w = hdr->width; 00938 GLint rowLength = hdr->rowLength; 00939 GLint alignment = hdr->alignment; 00940 00941 switch (target) { 00942 case GL_PROXY_TEXTURE_1D: 00943 case GL_PROXY_TEXTURE_2D: 00944 case GL_PROXY_TEXTURE_3D: 00945 case GL_PROXY_COLOR_TABLE: 00946 case GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: 00947 case GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: 00948 return 0; 00949 } 00950 00951 if (swap) { 00952 format = SWAPL( format ); 00953 type = SWAPL( type ); 00954 w = SWAPL( w ); 00955 rowLength = SWAPL( rowLength ); 00956 alignment = SWAPL( alignment ); 00957 } 00958 00959 return __glXImageSize ( format, type, w, 1, rowLength, 0, alignment ); 00960 }

int __glXColorSubTableReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 962 of file rensize.c.

References __glXImageSize(), count, format, swap, and type.

00963 { 00964 __GLXdispatchColorSubTableHeader *hdr = 00965 (__GLXdispatchColorSubTableHeader *) pc; 00966 00967 GLenum format = hdr->format; 00968 GLenum type = hdr->type; 00969 GLint count = hdr->count; 00970 GLint rowLength = hdr->rowLength; 00971 GLint alignment = hdr->alignment; 00972 00973 if (swap) { 00974 format = SWAPL( format ); 00975 type = SWAPL( type ); 00976 count = SWAPL( count ); 00977 rowLength = SWAPL( rowLength ); 00978 alignment = SWAPL( alignment ); 00979 } 00980 00981 return __glXImageSize ( format, type, count, 1, rowLength, 0, alignment ); 00982 }

int __glXColorTableParameterfvReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 984 of file rensize.c.

References __glXColorTableParameterfvSize(), and swap.

Referenced by __glXColorTableParameterivReqSize().

00985 { 00986 GLenum pname = *(GLenum *)(pc + 4); 00987 if (swap) { 00988 pname = SWAPL( pname ); 00989 } 00990 return 4 * __glXColorTableParameterfvSize(pname); 00991 }

int __glXColorTableParameterivReqSize GLbyte *  pc,
Bool  swap
 

Definition at line 993 of file rensize.c.

References __glXColorTableParameterfvReqSize(), and swap.

00994 { 00995 /* no difference between fv and iv versions */ 00996 return __glXColorTableParameterfvReqSize(pc, swap); 00997 }


Generated on Tue May 11 00:34:32 2004 for XFree86 by doxygen 1.3.7