* Contributors: Details at https://graphviz.org
*************************************************************************/
+#include <cgraph/alloc.h>
#include <glcomp/glcomptexture.h>
#include <glcomp/glpangofont.h>
int is2D)
{
int Er, offset, ind;
- glCompTex *t;
unsigned char *tarData;
unsigned char *srcData;
return NULL;
Er = 0;
- t = NEW(glCompTex);
+ glCompTex *t = gv_alloc(sizeof(glCompTex));
if (!is2D) { /*use opengl texture */
glEnable(GL_TEXTURE_2D);
glShadeModel(GL_FLAT);
}
}
if (is2D && !Er) {
- t->data = N_NEW(4 * width * height, unsigned char);
+ t->data = gv_calloc(4 * width * height, sizeof(unsigned char));
offset = 4; //RGBA mod,TO DO implement other modes
/*data upside down because of pango gl coord system */
for (ind = 0; ind < height; ind++) {
t->height = (GLfloat) height;
if(s)
{
- s->textureCount++;
s->textures =
- realloc(s->textures, s->textureCount * sizeof(glCompTex *));
+ gv_recalloc(s->textures, s->textureCount, s->textureCount + 1, sizeof(glCompTex *));
+ s->textureCount++;
s->textures[s->textureCount - 1] = t;
}
return t;