Lines Matching refs:gpdata

1055 static int allocateSpaceForGP(GPData* gpdata, int npoints, int ncontours) {
1067 if (gpdata->pointTypes == NULL || gpdata->pointCoords == NULL) {
1068 gpdata->lenTypes = maxTypes;
1069 gpdata->lenCoords = maxCoords;
1070 gpdata->pointTypes = (jbyte*)
1071 malloc(gpdata->lenTypes*sizeof(jbyte));
1072 gpdata->pointCoords = (jfloat*)
1073 malloc(gpdata->lenCoords*sizeof(jfloat));
1074 gpdata->numTypes = 0;
1075 gpdata->numCoords = 0;
1076 gpdata->wr = WIND_NON_ZERO; /* By default, outlines are filled
1080 if (gpdata->lenTypes - gpdata->numTypes < maxTypes) {
1081 gpdata->lenTypes += maxTypes;
1082 gpdata->pointTypes = (jbyte*)
1083 realloc(gpdata->pointTypes, gpdata->lenTypes*sizeof(jbyte));
1086 if (gpdata->lenCoords - gpdata->numCoords < maxCoords) {
1087 gpdata->lenCoords += maxCoords;
1088 gpdata->pointCoords = (jfloat*)
1089 realloc(gpdata->pointCoords, gpdata->lenCoords*sizeof(jfloat));
1094 if (gpdata->pointTypes == NULL || gpdata->pointCoords == NULL)
1100 static void addToGP(GPData* gpdata, FT_Outline*outline) {
1116 gpdata->pointTypes[gpdata->numTypes++] = SEG_MOVETO;
1119 gpdata->pointTypes[gpdata->numTypes++] = current_type;
1131 gpdata->pointTypes[gpdata->numTypes++] = SEG_MOVETO;
1147 gpdata->pointCoords[gpdata->numCoords++] =
1150 gpdata->pointCoords[gpdata->numCoords++] =
1153 gpdata->pointTypes[gpdata->numTypes++] = SEG_QUADTO;
1158 gpdata->pointCoords[gpdata->numCoords++] = x;
1159 gpdata->pointCoords[gpdata->numCoords++] = y;
1162 gpdata->pointTypes[gpdata->numTypes++] = current_type;
1165 gpdata->pointCoords[gpdata->numCoords++] =
1167 gpdata->pointCoords[gpdata->numCoords++] =
1170 gpdata->pointCoords[gpdata->numCoords++] =
1172 gpdata->pointCoords[gpdata->numCoords++] =
1175 gpdata->pointTypes[gpdata->numTypes++] = SEG_CLOSE;
1183 gpdata->wr = WIND_EVEN_ODD;
1187 static void freeGP(GPData* gpdata) {
1188 if (gpdata->pointCoords != NULL) {
1189 free(gpdata->pointCoords);
1190 gpdata->pointCoords = NULL;
1191 gpdata->numCoords = 0;
1192 gpdata->lenCoords = 0;
1194 if (gpdata->pointTypes != NULL) {
1195 free(gpdata->pointTypes);
1196 gpdata->pointTypes = NULL;
1197 gpdata->numTypes = 0;
1198 gpdata->lenTypes = 0;
1210 GPData gpdata;
1219 gpdata.pointTypes = NULL;
1220 gpdata.pointCoords = NULL;
1221 if (!allocateSpaceForGP(&gpdata, outline->n_points, outline->n_contours)) {
1225 addToGP(&gpdata, outline);
1227 types = (*env)->NewByteArray(env, gpdata.numTypes);
1228 coords = (*env)->NewFloatArray(env, gpdata.numCoords);
1232 gpdata.numTypes,
1233 gpdata.pointTypes);
1235 gpdata.numCoords,
1236 gpdata.pointCoords);
1240 gpdata.wr,
1242 gpdata.numTypes,
1244 gpdata.numCoords);
1247 freeGP(&gpdata);
1345 GPData gpdata;
1369 gpdata.numCoords = 0;
1385 gpdata.pointTypes = NULL;
1386 gpdata.pointCoords = NULL;
1387 if (!allocateSpaceForGP(&gpdata, outline->n_points,
1392 addToGP(&gpdata, outline);
1396 if (gpdata.numCoords != 0) {
1397 types = (*env)->NewByteArray(env, gpdata.numTypes);
1398 coords = (*env)->NewFloatArray(env, gpdata.numCoords);
1402 gpdata.numTypes, gpdata.pointTypes);
1404 gpdata.numCoords, gpdata.pointCoords);
1409 gpdata.wr,
1411 gpdata.numTypes,
1413 gpdata.numCoords);