Lines Matching defs:tl

493     CRTextureLevel *tl;
537 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
538 if (!tobj || !tl) {
545 if (xoffset < -tl->border || xoffset + width > tl->width) {
548 dims, xoffset, width, tl->width);
551 if (dims > 1 && (yoffset < -tl->border || yoffset + height > tl->height)) {
554 dims, yoffset, height, tl->height);
557 if (dims > 2 && (zoffset < -tl->border || zoffset + depth > tl->depth)) {
579 CRTextureLevel *tl;
596 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
598 CRASSERT(tl);
601 tl->bytes = 0;
603 tl->bytes = crImageSize(format, type, width, 1);
606 if (tl->bytes)
609 if (tl->img)
610 crFree(tl->img);
611 tl->img = (GLubyte *) crAlloc(tl->bytes);
612 if (!tl->img)
619 crPixelCopy1D((GLvoid *) tl->img, format, type,
624 tl->width = width;
625 tl->height = 1;
626 tl->depth = 1;
627 tl->format = format;
628 tl->border = border;
629 tl->internalFormat = internalFormat;
630 crStateTextureInitTextureFormat(tl, internalFormat);
631 tl->type = type;
632 tl->compressed = GL_FALSE;
634 tl->bytesPerPixel = tl->bytes / width;
636 tl->bytesPerPixel = 0;
643 tl->generateMipmap = GL_FALSE;
650 DIRTY(tl->dirty, g->neg_bitid);
686 CRTextureLevel *tl = NULL;
688 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
690 CRASSERT(tl);
694 tl->bytes = crImageSize(GL_RGBA, GL_UNSIGNED_BYTE, width, height);
696 tl->width = width;
697 tl->height = height;
698 tl->depth = 1;
699 tl->format = GL_RGBA;
700 tl->internalFormat = internalFormat;
701 crStateTextureInitTextureFormat(tl, internalFormat);
702 tl->border = border;
703 tl->type = GL_UNSIGNED_BYTE;
704 tl->compressed = GL_FALSE;
707 tl->bytesPerPixel = tl->bytes / (width * height);
710 tl->bytesPerPixel = 0;
717 tl->generateMipmap = GL_FALSE;
731 CRTextureLevel *tl = NULL;
753 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
755 CRASSERT(tl);
757 if (level==tobj->baseLevel && (tl->width!=width || tl->height!=height))
764 tl->bytes = crStrlen((char *) pixels) + 1;
765 tl->bytes += crImageSize(format, GL_UNSIGNED_BYTE, width, height);
768 tl->bytes = 0;
771 tl->bytes = crImageSize(format, type, width, height);
776 if (tl->bytes)
779 if (tl->img)
780 crFree(tl->img);
781 tl->img = (GLubyte *) crAlloc(tl->bytes);
782 if (!tl->img)
792 crMemcpy((void *) tl->img, (void *) pixels, tl->bytes);
797 (GLvoid *) tl->img, format, type, NULL, /* dst */
804 tl->width = width;
805 tl->height = height;
806 tl->depth = 1;
807 tl->format = format;
808 tl->internalFormat = internalFormat;
809 crStateTextureInitTextureFormat(tl, internalFormat);
810 tl->border = border;
811 tl->type = type;
812 tl->compressed = GL_FALSE;
816 tl->bytesPerPixel = 3; /* only support GL_RGB */
818 tl->bytesPerPixel = tl->bytes / (width * height);
821 tl->bytesPerPixel = 0;
828 tl->generateMipmap = GL_FALSE;
835 DIRTY(tl->dirty, g->neg_bitid);
868 CRTextureLevel *tl = NULL;
885 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
887 CRASSERT(tl);
890 tl->bytes = 0;
892 tl->bytes = crTextureSize(format, type, width, height, depth);
895 if (tl->bytes)
898 if (tl->img)
899 crFree(tl->img);
900 tl->img = (GLubyte *) crAlloc(tl->bytes);
901 if (!tl->img)
908 crPixelCopy3D(width, height, depth, (GLvoid *) (tl->img), format, type,
913 tl->internalFormat = internalFormat;
914 tl->border = border;
915 tl->width = width;
916 tl->height = height;
917 tl->depth = depth;
918 tl->format = format;
919 tl->type = type;
920 tl->compressed = GL_FALSE;
927 tl->generateMipmap = GL_FALSE;
934 DIRTY(tl->dirty, g->neg_bitid);
966 CRTextureLevel *tl = tobj->level[0] + level;
976 CRASSERT(tl->bytes);
977 CRASSERT(tl->height);
978 CRASSERT(tl->width);
979 CRASSERT(tl->depth);
983 xoffset += tl->border;
985 crPixelCopy1D((void *) (tl->img + xoffset * tl->bytesPerPixel),
986 tl->format, tl->type,
995 tl->generateMipmap = GL_FALSE;
1001 DIRTY(tl->dirty, g->neg_bitid);
1016 CRTextureLevel *tl;
1031 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
1033 CRASSERT(tl);
1036 CRASSERT(tl->bytes);
1037 CRASSERT(tl->height);
1038 CRASSERT(tl->width);
1039 CRASSERT(tl->depth);
1043 xoffset += tl->border;
1044 yoffset += tl->border;
1046 subimg = (GLubyte *) crAlloc(crImageSize(tl->format, tl->type, width, height));
1048 crPixelCopy2D(width, height, subimg, tl->format, tl->type, NULL, /* dst */
1051 img = tl->img +
1052 xoffset * tl->bytesPerPixel + yoffset * tl->width * tl->bytesPerPixel;
1059 crMemcpy(img, src, tl->bytesPerPixel * width);
1060 img += tl->width * tl->bytesPerPixel;
1061 src += width * tl->bytesPerPixel;
1072 tl->generateMipmap = GL_FALSE;
1078 DIRTY(tl->dirty, g->neg_bitid);
1112 CRTextureLevel *tl = tobj->level[0] + level;
1129 CRASSERT(tl->bytes);
1130 CRASSERT(tl->height);
1131 CRASSERT(tl->width);
1132 CRASSERT(tl->depth);
1136 xoffset += tl->border;
1137 yoffset += tl->border;
1138 zoffset += tl->border;
1142 crAlloc(crTextureSize(tl->format, tl->type, width, height, depth));
1144 crPixelCopy3D(width, height, depth, subimg, tl->format, tl->type, NULL,
1147 img = tl->img + xoffset * tl->bytesPerPixel +
1148 yoffset * tl->width * tl->bytesPerPixel +
1149 zoffset * tl->width * tl->height * tl->bytesPerPixel;
1156 crMemcpy(img, src, tl->bytesPerPixel * width * height);
1157 img += tl->width * tl->height * tl->bytesPerPixel;
1158 src += width * height * tl->bytesPerPixel;
1169 tl->generateMipmap = GL_FALSE;
1175 DIRTY(tl->dirty, g->neg_bitid);
1190 CRTextureLevel *tl;
1207 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
1209 CRASSERT(tl);
1212 tl->bytes = 0;
1214 tl->bytes = imageSize;
1217 if (tl->bytes)
1220 if (tl->img)
1221 crFree(tl->img);
1222 tl->img = (GLubyte *) crAlloc(tl->bytes);
1223 if (!tl->img)
1230 crMemcpy(tl->img, data, imageSize);
1234 tl->width = width;
1235 tl->height = 1;
1236 tl->depth = 1;
1237 tl->border = border;
1238 tl->format = GL_NONE;
1239 tl->type = GL_NONE;
1240 tl->internalFormat = internalFormat;
1241 crStateTextureInitTextureFormat(tl, internalFormat);
1242 tl->compressed = GL_TRUE;
1243 tl->bytesPerPixel = 0; /* n/a */
1250 tl->generateMipmap = GL_FALSE;
1256 DIRTY(tl->dirty, g->neg_bitid);
1270 CRTextureLevel *tl = NULL;
1287 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
1289 CRASSERT(tl);
1292 tl->bytes = 0;
1294 tl->bytes = imageSize;
1297 if (tl->bytes)
1300 if (tl->img)
1301 crFree(tl->img);
1302 tl->img = (GLubyte *) crAlloc(tl->bytes);
1303 if (!tl->img)
1310 crMemcpy(tl->img, data, imageSize);
1314 tl->width = width;
1315 tl->height = height;
1316 tl->depth = 1;
1317 tl->border = border;
1318 tl->format = GL_NONE;
1319 tl->type = GL_NONE;
1320 tl->internalFormat = internalFormat;
1321 crStateTextureInitTextureFormat(tl, internalFormat);
1322 tl->compressed = GL_TRUE;
1323 tl->bytesPerPixel = 0; /* n/a */
1330 tl->generateMipmap = GL_FALSE;
1337 DIRTY(tl->dirty, g->neg_bitid);
1351 CRTextureLevel *tl = NULL;
1368 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
1370 CRASSERT(tl);
1373 tl->bytes = 0;
1375 tl->bytes = imageSize;
1378 if (tl->bytes)
1381 if (tl->img)
1382 crFree(tl->img);
1383 tl->img = (GLubyte *) crAlloc(tl->bytes);
1384 if (!tl->img)
1391 crMemcpy(tl->img, data, imageSize);
1395 tl->width = width;
1396 tl->height = height;
1397 tl->depth = depth;
1398 tl->border = border;
1399 tl->format = GL_NONE;
1400 tl->type = GL_NONE;
1401 tl->internalFormat = internalFormat;
1402 crStateTextureInitTextureFormat(tl, internalFormat);
1403 tl->compressed = GL_TRUE;
1404 tl->bytesPerPixel = 0; /* n/a */
1411 tl->generateMipmap = GL_FALSE;
1418 DIRTY(tl->dirty, g->neg_bitid);
1434 CRTextureLevel *tl = tobj->level[0] + level;
1444 CRASSERT(tl->bytes);
1445 CRASSERT(tl->height);
1446 CRASSERT(tl->width);
1447 CRASSERT(tl->depth);
1451 xoffset += tl->border;
1453 if (xoffset == 0 && width == tl->width) {
1455 crMemcpy(tl->img, data, imageSize);
1468 tl->generateMipmap = GL_FALSE;
1474 DIRTY(tl->dirty, g->neg_bitid);
1491 CRTextureLevel *tl = tobj->level[0] + level;
1497 CRASSERT(tl->bytes);
1498 CRASSERT(tl->height);
1499 CRASSERT(tl->width);
1500 CRASSERT(tl->depth);
1509 xoffset += tl->border;
1510 yoffset += tl->border;
1512 if (xoffset == 0 && width == tl->width
1513 && yoffset == 0 && height == tl->height)
1516 crMemcpy(tl->img, data, imageSize);
1529 tl->generateMipmap = GL_FALSE;
1535 DIRTY(tl->dirty, g->neg_bitid);
1553 CRTextureLevel *tl = tobj->level[0] + level;
1559 CRASSERT(tl->bytes);
1560 CRASSERT(tl->height);
1561 CRASSERT(tl->width);
1562 CRASSERT(tl->depth);
1571 xoffset += tl->border;
1572 yoffset += tl->border;
1573 zoffset += tl->border;
1575 if (xoffset == 0 && width == tl->width &&
1576 yoffset == 0 && height == tl->height &&
1577 zoffset == 0 && depth == tl->depth) {
1579 crMemcpy(tl->img, data, imageSize);
1592 tl->generateMipmap = GL_FALSE;
1598 DIRTY(tl->dirty, g->neg_bitid);
1608 CRTextureLevel *tl;
1617 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
1618 if (!tobj || !tl) {
1624 if (!tl->compressed) {
1631 CRASSERT(tl->bytes);
1632 CRASSERT(tl->height);
1633 CRASSERT(tl->width);
1634 CRASSERT(tl->depth);
1638 crMemcpy(img, tl->img, tl->bytes);
1652 CRTextureLevel *tl;
1661 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl);
1662 if (!tobj || !tl) {
1668 if (tl->compressed) {
1674 CRASSERT(tl->bytes);
1675 CRASSERT(tl->height);
1676 CRASSERT(tl->width);
1677 CRASSERT(tl->depth);
1717 crPixelCopy3D(tl->width, tl->height, tl->depth, (GLvoid *) pixels, format,
1718 type, NULL, (tl->img), format, type, &(c->pack));
1724 crPixelCopy2D(tl->width, tl->height, (GLvoid *) pixels, format, type, NULL, /* dst */
1725 tl->img, format, type, &(c->pack)); /* src */