aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-25 14:46:17 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-25 14:46:17 +0000
commit1fa803d6b4cb9d32dcfc5808af1ab654045a2592 (patch)
tree69f4dab3908031dd55e9f03d9e30682b433df50d /third_party
parent8887ede82465687355c7a1c51e4553e99b2fb15a (diff)
Rename glu libtess symbols. When enabled in WebKit, the internal_glu libtess
symbols in skia will collide with the same internal_ implementation in WebKit. Rename the glu entry points with an Sk_ prefix instead. Also, unfork the changes to the libtess source as much as possible (the same as was done in http://trac.webkit.org/changeset/87178). Review URL: http://codereview.appspot.com/4536080/ git-svn-id: http://skia.googlecode.com/svn/trunk@1419 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'third_party')
-rw-r--r--third_party/glu/README.skia9
-rw-r--r--third_party/glu/gluos.h12
-rw-r--r--third_party/glu/libtess/geom.c2
-rw-r--r--third_party/glu/libtess/memalloc.c2
-rw-r--r--third_party/glu/libtess/mesh.c6
-rw-r--r--third_party/glu/libtess/mesh.h2
-rw-r--r--third_party/glu/libtess/normal.c8
-rw-r--r--third_party/glu/libtess/priorityq-heap.c4
-rw-r--r--third_party/glu/libtess/priorityq.c4
-rw-r--r--third_party/glu/libtess/render.c4
-rw-r--r--third_party/glu/libtess/sweep.c12
-rw-r--r--third_party/glu/libtess/tess.c37
-rw-r--r--third_party/glu/libtess/tess.h5
-rw-r--r--third_party/glu/libtess/tessmono.c5
-rw-r--r--third_party/glu/sk_glu.h (renamed from third_party/glu/internal_glu.h)28
15 files changed, 74 insertions, 66 deletions
diff --git a/third_party/glu/README.skia b/third_party/glu/README.skia
index eff4abe4a7..e97261c24c 100644
--- a/third_party/glu/README.skia
+++ b/third_party/glu/README.skia
@@ -8,13 +8,12 @@ LICENSE.txt in this directory.
The following changes were made in order to incorporate this code:
- The addition of a simplified gluos.h to eliminate operating system
- dependencies.
+ dependencies. The entry points to the tessellator were prefixed with
+ Sk_ to avoid symbol collisions with any host OS version of GLU via
+ #defines in gluos.h.
- The removal of inclusion of GL/glu.h and replacement with an
- include of internal_glu.h.
-
- - The entry points to the tessellator were prefixed with internal_
- to avoid symbol collisions with any host OS version of GLU.
+ include of sk_glu.h.
- In tess.c, the obsolete entry points gluBeginPolygon,
gluNextContour and gluEndPolygon in tess.c were #if 0'd out.
diff --git a/third_party/glu/gluos.h b/third_party/glu/gluos.h
index 6380cb2377..3b651e9908 100644
--- a/third_party/glu/gluos.h
+++ b/third_party/glu/gluos.h
@@ -42,6 +42,18 @@ typedef unsigned int GLenum;
typedef float GLfloat;
typedef void GLvoid;
+#define gluNewTess Sk_gluNewTess
+#define gluDeleteTess Sk_gluDeleteTess
+#define gluTessProperty Sk_gluTessProperty
+#define gluGetTessProperty Sk_gluGetTessProperty
+#define gluTessNormal Sk_gluTessNormal
+#define gluTessCallback Sk_gluTessCallback
+#define gluTessVertex Sk_gluTessVertex
+#define gluTessBeginPolygon Sk_gluTessBeginPolygon
+#define gluTessBeginContour Sk_gluTessBeginContour
+#define gluTessEndContour Sk_gluTessEndContour
+#define gluTessEndPolygon Sk_gluTessEndPolygon
+
#undef MIN
#undef MAX
diff --git a/third_party/glu/libtess/geom.c b/third_party/glu/libtess/geom.c
index 1bc112a8ab..461d8b4a20 100644
--- a/third_party/glu/libtess/geom.c
+++ b/third_party/glu/libtess/geom.c
@@ -39,8 +39,8 @@
** $Header: //depot/main/gfx/lib/glu/libtess/geom.c#5 $
*/
+#include "gluos.h"
#include <assert.h>
-#include <gluos.h>
#include "mesh.h"
#include "geom.h"
diff --git a/third_party/glu/libtess/memalloc.c b/third_party/glu/libtess/memalloc.c
index 242f040620..bd5b4ac798 100644
--- a/third_party/glu/libtess/memalloc.c
+++ b/third_party/glu/libtess/memalloc.c
@@ -39,8 +39,8 @@
** $Header: //depot/main/gfx/lib/glu/libtess/memalloc.c#5 $
*/
-#include "string.h"
#include "memalloc.h"
+#include "string.h"
int __gl_memInit( size_t maxFast )
{
diff --git a/third_party/glu/libtess/mesh.c b/third_party/glu/libtess/mesh.c
index a897f5092d..7305fab1d2 100644
--- a/third_party/glu/libtess/mesh.c
+++ b/third_party/glu/libtess/mesh.c
@@ -39,11 +39,11 @@
** $Header: //depot/main/gfx/lib/glu/libtess/mesh.c#6 $
*/
-#include <assert.h>
+#include "gluos.h"
#include <stddef.h>
-#include <gluos.h>
-#include "memalloc.h"
+#include <assert.h>
#include "mesh.h"
+#include "memalloc.h"
#define TRUE 1
#define FALSE 0
diff --git a/third_party/glu/libtess/mesh.h b/third_party/glu/libtess/mesh.h
index a92de0e963..da149d7b58 100644
--- a/third_party/glu/libtess/mesh.h
+++ b/third_party/glu/libtess/mesh.h
@@ -42,7 +42,7 @@
#ifndef __mesh_h_
#define __mesh_h_
-#include <internal_glu.h>
+#include <sk_glu.h>
typedef struct GLUmesh GLUmesh;
diff --git a/third_party/glu/libtess/normal.c b/third_party/glu/libtess/normal.c
index 1c29a0acaa..8fb22f1de7 100644
--- a/third_party/glu/libtess/normal.c
+++ b/third_party/glu/libtess/normal.c
@@ -39,12 +39,12 @@
** $Header: //depot/main/gfx/lib/glu/libtess/normal.c#5 $
*/
-#include <assert.h>
-#include <math.h>
-#include <gluos.h>
+#include "gluos.h"
#include "mesh.h"
-#include "normal.h"
#include "tess.h"
+#include "normal.h"
+#include <math.h>
+#include <assert.h>
#define TRUE 1
#define FALSE 0
diff --git a/third_party/glu/libtess/priorityq-heap.c b/third_party/glu/libtess/priorityq-heap.c
index 984cb40e5c..163bde6a8d 100644
--- a/third_party/glu/libtess/priorityq-heap.c
+++ b/third_party/glu/libtess/priorityq-heap.c
@@ -39,11 +39,11 @@
** $Header: //depot/main/gfx/lib/glu/libtess/priorityq-heap.c#5 $
*/
+#include <stddef.h>
#include <assert.h>
#include <limits.h>
-#include <stddef.h>
-#include "memalloc.h"
#include "priorityq-heap.h"
+#include "memalloc.h"
#define INIT_SIZE 32
diff --git a/third_party/glu/libtess/priorityq.c b/third_party/glu/libtess/priorityq.c
index be045dbecf..4b9e1aeae0 100644
--- a/third_party/glu/libtess/priorityq.c
+++ b/third_party/glu/libtess/priorityq.c
@@ -39,10 +39,10 @@
** $Header: //depot/main/gfx/lib/glu/libtess/priorityq.c#5 $
*/
+#include "gluos.h"
+#include <stddef.h>
#include <assert.h>
#include <limits.h> /* LONG_MAX */
-#include <stddef.h>
-#include <gluos.h>
#include "memalloc.h"
/* Include all the code for the regular heap-based queue here. */
diff --git a/third_party/glu/libtess/render.c b/third_party/glu/libtess/render.c
index 5d7ca2920b..aff1298426 100644
--- a/third_party/glu/libtess/render.c
+++ b/third_party/glu/libtess/render.c
@@ -39,12 +39,12 @@
** $Header: //depot/main/gfx/lib/glu/libtess/render.c#5 $
*/
+#include "gluos.h"
#include <assert.h>
#include <stddef.h>
-#include <gluos.h>
#include "mesh.h"
-#include "render.h"
#include "tess.h"
+#include "render.h"
#define TRUE 1
#define FALSE 0
diff --git a/third_party/glu/libtess/sweep.c b/third_party/glu/libtess/sweep.c
index ca2fc5e069..6fe8a478f5 100644
--- a/third_party/glu/libtess/sweep.c
+++ b/third_party/glu/libtess/sweep.c
@@ -39,19 +39,19 @@
** $Header: //depot/main/gfx/lib/glu/libtess/sweep.c#5 $
*/
+#include "gluos.h"
#include <assert.h>
+#include <stddef.h>
#include <setjmp.h> /* longjmp */
#include <limits.h> /* LONG_MAX */
-#include <stddef.h>
-#include <gluos.h>
-#include "dict.h"
-#include "geom.h"
-#include "memalloc.h"
#include "mesh.h"
+#include "geom.h"
+#include "tess.h"
+#include "dict.h"
#include "priorityq.h"
+#include "memalloc.h"
#include "sweep.h"
-#include "tess.h"
#define TRUE 1
#define FALSE 0
diff --git a/third_party/glu/libtess/tess.c b/third_party/glu/libtess/tess.c
index 303b83c5e5..c59a178966 100644
--- a/third_party/glu/libtess/tess.c
+++ b/third_party/glu/libtess/tess.c
@@ -39,18 +39,17 @@
** $Header: //depot/main/gfx/lib/glu/libtess/tess.c#7 $
*/
+#include "gluos.h"
+#include <stddef.h>
#include <assert.h>
#include <setjmp.h>
-#include <stddef.h>
-
-#include <gluos.h>
#include "memalloc.h"
+#include "tess.h"
#include "mesh.h"
#include "normal.h"
-#include "render.h"
#include "sweep.h"
-#include "tess.h"
#include "tessmono.h"
+#include "render.h"
#define GLU_TESS_DEFAULT_TOLERANCE 0.0
#define GLU_TESS_MESH 100112 /* void (*)(GLUmesh *mesh) */
@@ -92,7 +91,7 @@ typedef struct { GLUhalfEdge e, eSym; } EdgePair;
GLUtesselator * GLAPIENTRY
-internal_gluNewTess( void )
+gluNewTess( void )
{
GLUtesselator *tess;
@@ -164,11 +163,11 @@ static void GotoState( GLUtesselator *tess, enum TessState newState )
switch( tess->state ) {
case T_DORMANT:
CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_BEGIN_POLYGON );
- internal_gluTessBeginPolygon( tess, NULL );
+ gluTessBeginPolygon( tess, NULL );
break;
case T_IN_POLYGON:
CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_BEGIN_CONTOUR );
- internal_gluTessBeginContour( tess );
+ gluTessBeginContour( tess );
break;
default:
assert(0);
@@ -178,7 +177,7 @@ static void GotoState( GLUtesselator *tess, enum TessState newState )
switch( tess->state ) {
case T_IN_CONTOUR:
CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_END_CONTOUR );
- internal_gluTessEndContour( tess );
+ gluTessEndContour( tess );
break;
case T_IN_POLYGON:
CALL_ERROR_OR_ERROR_DATA( GLU_TESS_MISSING_END_POLYGON );
@@ -195,7 +194,7 @@ static void GotoState( GLUtesselator *tess, enum TessState newState )
void GLAPIENTRY
-internal_gluDeleteTess( GLUtesselator *tess )
+gluDeleteTess( GLUtesselator *tess )
{
RequireState( tess, T_DORMANT );
memFree( tess );
@@ -203,7 +202,7 @@ internal_gluDeleteTess( GLUtesselator *tess )
void GLAPIENTRY
-internal_gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value )
+gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value )
{
GLenum windingRule;
@@ -242,7 +241,7 @@ internal_gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value )
/* Returns tessellator property */
void GLAPIENTRY
-internal_gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value )
+gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value )
{
switch (which) {
case GLU_TESS_TOLERANCE:
@@ -270,7 +269,7 @@ internal_gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value
} /* gluGetTessProperty() */
void GLAPIENTRY
-internal_gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z )
+gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z )
{
tess->normal[0] = x;
tess->normal[1] = y;
@@ -278,7 +277,7 @@ internal_gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z
}
void GLAPIENTRY
-internal_gluTessCallback( GLUtesselator *tess, GLenum which, void (GLAPIENTRY *fn)())
+gluTessCallback( GLUtesselator *tess, GLenum which, void (GLAPIENTRY *fn)())
{
switch( which ) {
case GLU_TESS_BEGIN:
@@ -417,7 +416,7 @@ static int EmptyCache( GLUtesselator *tess )
void GLAPIENTRY
-internal_gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data )
+gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data )
{
int i, tooLarge = FALSE;
GLdouble x, clamped[3];
@@ -464,7 +463,7 @@ internal_gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data )
void GLAPIENTRY
-internal_gluTessBeginPolygon( GLUtesselator *tess, void *data )
+gluTessBeginPolygon( GLUtesselator *tess, void *data )
{
RequireState( tess, T_DORMANT );
@@ -478,7 +477,7 @@ internal_gluTessBeginPolygon( GLUtesselator *tess, void *data )
void GLAPIENTRY
-internal_gluTessBeginContour( GLUtesselator *tess )
+gluTessBeginContour( GLUtesselator *tess )
{
RequireState( tess, T_IN_POLYGON );
@@ -495,14 +494,14 @@ internal_gluTessBeginContour( GLUtesselator *tess )
void GLAPIENTRY
-internal_gluTessEndContour( GLUtesselator *tess )
+gluTessEndContour( GLUtesselator *tess )
{
RequireState( tess, T_IN_CONTOUR );
tess->state = T_IN_POLYGON;
}
void GLAPIENTRY
-internal_gluTessEndPolygon( GLUtesselator *tess )
+gluTessEndPolygon( GLUtesselator *tess )
{
GLUmesh *mesh;
diff --git a/third_party/glu/libtess/tess.h b/third_party/glu/libtess/tess.h
index ca0769e414..d8d3d21983 100644
--- a/third_party/glu/libtess/tess.h
+++ b/third_party/glu/libtess/tess.h
@@ -42,11 +42,10 @@
#ifndef __tess_h_
#define __tess_h_
+#include <sk_glu.h>
#include <setjmp.h>
-
-#include <internal_glu.h>
-#include "dict.h"
#include "mesh.h"
+#include "dict.h"
#include "priorityq.h"
/* The begin/end calls must be properly nested. We keep track of
diff --git a/third_party/glu/libtess/tessmono.c b/third_party/glu/libtess/tessmono.c
index 0bdc7874a4..2e2cc7901f 100644
--- a/third_party/glu/libtess/tessmono.c
+++ b/third_party/glu/libtess/tessmono.c
@@ -39,13 +39,12 @@
** $Header: //depot/main/gfx/lib/glu/libtess/tessmono.c#5 $
*/
-#include <assert.h>
+#include "gluos.h"
#include <stdlib.h>
-
-#include <gluos.h>
#include "geom.h"
#include "mesh.h"
#include "tessmono.h"
+#include <assert.h>
#define AddWinding(eDst,eSrc) (eDst->winding += eSrc->winding, \
eDst->Sym->winding += eSrc->Sym->winding)
diff --git a/third_party/glu/internal_glu.h b/third_party/glu/sk_glu.h
index 02c9cc8083..7b2b261d10 100644
--- a/third_party/glu/internal_glu.h
+++ b/third_party/glu/sk_glu.h
@@ -33,8 +33,8 @@
// only the definitions, constants and function declarations necessary
// to compile the GLU tessellator.
-#ifndef INTERNAL_GLU_H_
-#define INTERNAL_GLU_H_
+#ifndef SK_GLU_H_
+#define SK_GLU_H_
#include "gluos.h"
@@ -110,32 +110,32 @@ typedef struct GLUtesselator GLUtesselator;
extern "C" {
#endif
-extern GLUtesselator * GLAPIENTRY internal_gluNewTess(void);
-extern void GLAPIENTRY internal_gluDeleteTess(GLUtesselator *tess);
-extern void GLAPIENTRY internal_gluTessProperty(GLUtesselator *tess,
+extern GLUtesselator * GLAPIENTRY Sk_gluNewTess(void);
+extern void GLAPIENTRY Sk_gluDeleteTess(GLUtesselator *tess);
+extern void GLAPIENTRY Sk_gluTessProperty(GLUtesselator *tess,
GLenum which,
GLdouble value);
-extern void GLAPIENTRY internal_gluGetTessProperty(GLUtesselator *tess,
+extern void GLAPIENTRY Sk_gluGetTessProperty(GLUtesselator *tess,
GLenum which,
GLdouble *value);
-extern void GLAPIENTRY internal_gluTessNormal(GLUtesselator *tess,
+extern void GLAPIENTRY Sk_gluTessNormal(GLUtesselator *tess,
GLdouble x,
GLdouble y,
GLdouble z);
-extern void GLAPIENTRY internal_gluTessCallback(GLUtesselator *tess,
+extern void GLAPIENTRY Sk_gluTessCallback(GLUtesselator *tess,
GLenum which,
void (GLAPIENTRY *fn)());
-extern void GLAPIENTRY internal_gluTessVertex(GLUtesselator *tess,
+extern void GLAPIENTRY Sk_gluTessVertex(GLUtesselator *tess,
GLdouble coords[3],
void *data);
-extern void GLAPIENTRY internal_gluTessBeginPolygon(GLUtesselator *tess,
+extern void GLAPIENTRY Sk_gluTessBeginPolygon(GLUtesselator *tess,
void *data);
-extern void GLAPIENTRY internal_gluTessBeginContour(GLUtesselator *tess);
-extern void GLAPIENTRY internal_gluTessEndContour(GLUtesselator *tess);
-extern void GLAPIENTRY internal_gluTessEndPolygon(GLUtesselator *tess);
+extern void GLAPIENTRY Sk_gluTessBeginContour(GLUtesselator *tess);
+extern void GLAPIENTRY Sk_gluTessEndContour(GLUtesselator *tess);
+extern void GLAPIENTRY Sk_gluTessEndPolygon(GLUtesselator *tess);
#ifdef __cplusplus
}
#endif
-#endif // INTERNAL_GLU_H_
+#endif // SK_GLU_H_