2011-05-24 Stephen White <senorblanco@chromium.org>
authorsenorblanco@chromium.org <senorblanco@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 May 2011 18:50:48 +0000 (18:50 +0000)
committersenorblanco@chromium.org <senorblanco@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 May 2011 18:50:48 +0000 (18:50 +0000)
        Reviewed by Kenneth Russell.

        Remove most style checks on Source/ThirdParty/glu, since it doesn't
        follow WebKit style.
        https://bugs.webkit.org/show_bug.cgi?id=61365

        * Scripts/webkitpy/style/checker.py:
2011-05-24  Stephen White  <senorblanco@chromium.org>

        Reviewed by Kenneth Russell.

        Unfork glu sources as much as possible.
        https://bugs.webkit.org/show_bug.cgi?id=61365

        Restore the glu sources closer to the original version on oss.sgi.com
        by removing the WebKit-specific include paths, restoring the include
        order, and renaming the glu* functions via #defines rather than in
        the source.

        * glu/README.webkit:
        Update the README to reflect the changes from trunk.
        * glu/glu.gyp:
        Add Source/Thirdparty/glu as an include path, so we can remove the
        hardcoded paths from the source files.
        * glu/gluos.h:
        Add #defines to rename the glu entry points to internal_*.
        * glu/internal_glu.h:
        * glu/libtess/dict.c:
        * glu/libtess/geom.c:
        * glu/libtess/geom.h:
        * glu/libtess/memalloc.c:
        * glu/libtess/mesh.c:
        * glu/libtess/mesh.h:
        * glu/libtess/normal.c:
        * glu/libtess/normal.h:
        * glu/libtess/priorityq-heap.c:
        * glu/libtess/priorityq-sort.h:
        * glu/libtess/priorityq.c:
        * glu/libtess/priorityq.h:
        * glu/libtess/render.c:
        * glu/libtess/render.h:
        * glu/libtess/sweep.c:
        * glu/libtess/sweep.h:
        * glu/libtess/tess.c:
        * glu/libtess/tess.h:
        * glu/libtess/tessmono.c:
        Remove WebKit-specific include paths, and internal_ prefixes from glu
        entry points.  Restore include order to original source order.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87178 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
Source/ThirdParty/ChangeLog
Source/ThirdParty/glu/README.webkit
Source/ThirdParty/glu/glu.gyp
Source/ThirdParty/glu/gluos.h
Source/ThirdParty/glu/internal_glu.h
Source/ThirdParty/glu/libtess/dict.c
Source/ThirdParty/glu/libtess/geom.c
Source/ThirdParty/glu/libtess/geom.h
Source/ThirdParty/glu/libtess/memalloc.c
Source/ThirdParty/glu/libtess/mesh.c
Source/ThirdParty/glu/libtess/mesh.h
Source/ThirdParty/glu/libtess/normal.c
Source/ThirdParty/glu/libtess/normal.h
Source/ThirdParty/glu/libtess/priorityq-heap.c
Source/ThirdParty/glu/libtess/priorityq-sort.h
Source/ThirdParty/glu/libtess/priorityq.c
Source/ThirdParty/glu/libtess/priorityq.h
Source/ThirdParty/glu/libtess/render.c
Source/ThirdParty/glu/libtess/render.h
Source/ThirdParty/glu/libtess/sweep.c
Source/ThirdParty/glu/libtess/sweep.h
Source/ThirdParty/glu/libtess/tess.c
Source/ThirdParty/glu/libtess/tess.h
Source/ThirdParty/glu/libtess/tessmono.c
Tools/ChangeLog
Tools/Scripts/webkitpy/style/checker.py

index b4ff0cc..cd3f256 100644 (file)
@@ -1,3 +1,45 @@
+2011-05-24  Stephen White  <senorblanco@chromium.org>
+
+        Reviewed by Kenneth Russell.
+
+        Unfork glu sources as much as possible.
+        https://bugs.webkit.org/show_bug.cgi?id=61365
+
+        Restore the glu sources closer to the original version on oss.sgi.com
+        by removing the WebKit-specific include paths, restoring the include
+        order, and renaming the glu* functions via #defines rather than in
+        the source.
+
+        * glu/README.webkit:
+        Update the README to reflect the changes from trunk.
+        * glu/glu.gyp:
+        Add Source/Thirdparty/glu as an include path, so we can remove the
+        hardcoded paths from the source files.
+        * glu/gluos.h:
+        Add #defines to rename the glu entry points to internal_*.
+        * glu/internal_glu.h:
+        * glu/libtess/dict.c:
+        * glu/libtess/geom.c:
+        * glu/libtess/geom.h:
+        * glu/libtess/memalloc.c:
+        * glu/libtess/mesh.c:
+        * glu/libtess/mesh.h:
+        * glu/libtess/normal.c:
+        * glu/libtess/normal.h:
+        * glu/libtess/priorityq-heap.c:
+        * glu/libtess/priorityq-sort.h:
+        * glu/libtess/priorityq.c:
+        * glu/libtess/priorityq.h:
+        * glu/libtess/render.c:
+        * glu/libtess/render.h:
+        * glu/libtess/sweep.c:
+        * glu/libtess/sweep.h:
+        * glu/libtess/tess.c:
+        * glu/libtess/tess.h:
+        * glu/libtess/tessmono.c:
+        Remove WebKit-specific include paths, and internal_ prefixes from glu
+        entry points.  Restore include order to original source order.
+
 2011-05-19  Evan Martin  <evan@chromium.org>
 
         Reviewed by Tony Chang.
index 5941f4b..e7d4e21 100644 (file)
@@ -8,17 +8,13 @@ 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.  All entry points to the tesselator were prefixed
+    with internal_ via #defines, to avoid symbol collisions with any
+    host OS version of GLU.
 
   - The removal of inclusion of GL/glu.h and replacement with an
     include of internal_glu.h.
 
-  - Includes were modified to be scoped within ThirdParty/glu/ and
-    ThirdParty/glu/libtess/.
-
-  - The entry points to the tessellator were prefixed with internal_
-    to avoid symbol collisions with any host OS version of GLU.
-
   - In tess.c, the obsolete entry points gluBeginPolygon,
     gluNextContour and gluEndPolygon in tess.c were #if 0'd out.
     Default branches were added to the switch statements in GotoState.
index 51cbc84..b1dac00 100644 (file)
@@ -3,7 +3,7 @@
     'target_name': 'libtess',
     'type': 'static_library',
     'include_dirs': [
-      '../..',
+      '.',
     ],
     'sources': [
       'gluos.h',
index 6380cb2..3efc8c7 100644 (file)
@@ -42,6 +42,18 @@ typedef unsigned int GLenum;
 typedef float GLfloat;
 typedef void GLvoid;
 
+#define gluNewTess internal_gluNewTess
+#define gluDeleteTess internal_gluDeleteTess
+#define gluTessProperty internal_gluTessProperty
+#define gluGetTessProperty internal_gluGetTessProperty
+#define gluTessNormal internal_gluTessNormal
+#define gluTessCallback internal_gluTessCallback
+#define gluTessVertex internal_gluTessVertex
+#define gluTessBeginPolygon internal_gluTessBeginPolygon
+#define gluTessBeginContour internal_gluTessBeginContour
+#define gluTessEndContour internal_gluTessEndContour
+#define gluTessEndPolygon internal_gluTessEndPolygon
+
 #undef MIN
 #undef MAX
 
index 4c0e863..02c9cc8 100644 (file)
@@ -36,7 +36,7 @@
 #ifndef INTERNAL_GLU_H_
 #define INTERNAL_GLU_H_
 
-#include "ThirdParty/glu/gluos.h"
+#include "gluos.h"
 
 /* Primitives */
 #define GL_LINE_LOOP                            0x0002
index bbae1f2..e149fd5 100644 (file)
@@ -40,8 +40,8 @@
 */
 
 #include <stddef.h>
-#include "ThirdParty/glu/libtess/dict-list.h"
-#include "ThirdParty/glu/libtess/memalloc.h"
+#include "dict-list.h"
+#include "memalloc.h"
 
 /* really __gl_dictListNewDict */
 Dict *dictNewDict( void *frame,
index c404202..461d8b4 100644 (file)
 ** $Header: //depot/main/gfx/lib/glu/libtess/geom.c#5 $
 */
 
+#include "gluos.h"
 #include <assert.h>
-#include "ThirdParty/glu/gluos.h"
-#include "ThirdParty/glu/libtess/mesh.h"
-#include "ThirdParty/glu/libtess/geom.h"
+#include "mesh.h"
+#include "geom.h"
 
 int __gl_vertLeq( GLUvertex *u, GLUvertex *v )
 {
index d6c8497..b4d0c66 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef __geom_h_
 #define __geom_h_
 
-#include "ThirdParty/glu/libtess/mesh.h"
+#include "mesh.h"
 
 #ifdef NO_BRANCH_CONDITIONS
 /* MIPS architecture has special instructions to evaluate boolean
index 530646f..bd5b4ac 100644 (file)
@@ -39,8 +39,8 @@
 ** $Header: //depot/main/gfx/lib/glu/libtess/memalloc.c#5 $
 */
 
+#include "memalloc.h"
 #include "string.h"
-#include "ThirdParty/glu/libtess/memalloc.h"
 
 int __gl_memInit( size_t maxFast )
 {
index 096f898..7305fab 100644 (file)
 ** $Header: //depot/main/gfx/lib/glu/libtess/mesh.c#6 $
 */
 
-#include <assert.h>
+#include "gluos.h"
 #include <stddef.h>
-#include "ThirdParty/glu/gluos.h"
-#include "ThirdParty/glu/libtess/memalloc.h"
-#include "ThirdParty/glu/libtess/mesh.h"
+#include <assert.h>
+#include "mesh.h"
+#include "memalloc.h"
 
 #define TRUE 1
 #define FALSE 0
index b836411..a92de0e 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef __mesh_h_
 #define __mesh_h_
 
-#include "ThirdParty/glu/internal_glu.h"
+#include <internal_glu.h>
 
 typedef struct GLUmesh GLUmesh; 
 
index bbe57fd..8fb22f1 100644 (file)
 ** $Header: //depot/main/gfx/lib/glu/libtess/normal.c#5 $
 */
 
-#include <assert.h>
+#include "gluos.h"
+#include "mesh.h"
+#include "tess.h"
+#include "normal.h"
 #include <math.h>
-#include "ThirdParty/glu/gluos.h"
-#include "ThirdParty/glu/libtess/mesh.h"
-#include "ThirdParty/glu/libtess/normal.h"
-#include "ThirdParty/glu/libtess/tess.h"
+#include <assert.h>
 
 #define TRUE 1
 #define FALSE 0
index f52bd09..5a68747 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef __normal_h_
 #define __normal_h_
 
-#include "ThirdParty/glu/libtess/tess.h"
+#include "tess.h"
 
 /* __gl_projectPolygon( tess ) determines the polygon normal
  * and project vertices onto the plane of the polygon.
index 43af727..163bde6 100644 (file)
 ** $Header: //depot/main/gfx/lib/glu/libtess/priorityq-heap.c#5 $
 */
 
+#include <stddef.h>
 #include <assert.h>
 #include <limits.h>
-#include <stddef.h>
-#include "ThirdParty/glu/libtess/memalloc.h"
-#include "ThirdParty/glu/libtess/priorityq-heap.h"
+#include "priorityq-heap.h"
+#include "memalloc.h"
 
 #define INIT_SIZE      32
 
index 2a5e71c..12c2f0d 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef __priorityq_sort_h_
 #define __priorityq_sort_h_
 
-#include "ThirdParty/glu/libtess/priorityq-heap.h"
+#include "priorityq-heap.h"
 
 #undef PQkey
 #undef PQhandle
index 93f4179..4b9e1ae 100644 (file)
 ** $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 "ThirdParty/glu/gluos.h"
-#include "ThirdParty/glu/libtess/memalloc.h"
+#include "memalloc.h"
 
 /* Include all the code for the regular heap-based queue here. */
 
-#include "ThirdParty/glu/libtess/priorityq-heap.c"
+#include "priorityq-heap.c"
 
 /* Now redefine all the function names to map to their "Sort" versions. */
 
-#include "ThirdParty/glu/libtess/priorityq-sort.h"
+#include "priorityq-sort.h"
 
 /* really __gl_pqSortNewPriorityQ */
 PriorityQ *pqNewPriorityQ( int (*leq)(PQkey key1, PQkey key2) )
index 69af188..3ae6b0c 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef __priorityq_sort_h_
 #define __priorityq_sort_h_
 
-#include "ThirdParty/glu/libtess/priorityq-heap.h"
+#include "priorityq-heap.h"
 
 #undef PQkey
 #undef PQhandle
index e7534f5..aff1298 100644 (file)
 ** $Header: //depot/main/gfx/lib/glu/libtess/render.c#5 $
 */
 
+#include "gluos.h"
 #include <assert.h>
 #include <stddef.h>
-#include "ThirdParty/glu/gluos.h"
-#include "ThirdParty/glu/libtess/mesh.h"
-#include "ThirdParty/glu/libtess/render.h"
-#include "ThirdParty/glu/libtess/tess.h"
+#include "mesh.h"
+#include "tess.h"
+#include "render.h"
 
 #define TRUE 1
 #define FALSE 0
index 5f3e06c..598423e 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef __render_h_
 #define __render_h_
 
-#include "ThirdParty/glu/libtess/mesh.h"
+#include "mesh.h"
 
 /* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle
  * fans, strips, and separate triangles.  A substantial effort is made
index 415f592..6fe8a47 100644 (file)
 ** $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 "ThirdParty/glu/gluos.h"
-#include "ThirdParty/glu/libtess/dict.h"
-#include "ThirdParty/glu/libtess/geom.h"
-#include "ThirdParty/glu/libtess/memalloc.h"
-#include "ThirdParty/glu/libtess/mesh.h"
-#include "ThirdParty/glu/libtess/priorityq.h"
-#include "ThirdParty/glu/libtess/sweep.h"
-#include "ThirdParty/glu/libtess/tess.h"
+#include "mesh.h"
+#include "geom.h"
+#include "tess.h"
+#include "dict.h"
+#include "priorityq.h"
+#include "memalloc.h"
+#include "sweep.h"
 
 #define TRUE 1
 #define FALSE 0
index 931a59a..75d3e64 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef __sweep_h_
 #define __sweep_h_
 
-#include "ThirdParty/glu/libtess/mesh.h"
+#include "mesh.h"
 
 /* __gl_computeInterior( tess ) computes the planar arrangement specified
  * by the given contours, and further subdivides this arrangement
index 0a63953..c59a178 100644 (file)
 ** $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 "ThirdParty/glu/gluos.h"
-#include "ThirdParty/glu/libtess/memalloc.h"
-#include "ThirdParty/glu/libtess/mesh.h"
-#include "ThirdParty/glu/libtess/normal.h"
-#include "ThirdParty/glu/libtess/render.h"
-#include "ThirdParty/glu/libtess/sweep.h"
-#include "ThirdParty/glu/libtess/tess.h"
-#include "ThirdParty/glu/libtess/tessmono.h"
+#include "memalloc.h"
+#include "tess.h"
+#include "mesh.h"
+#include "normal.h"
+#include "sweep.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;
 
index f837b90..053fa00 100644 (file)
 #ifndef __tess_h_
 #define __tess_h_
 
+#include <internal_glu.h>
 #include <setjmp.h>
-
-#include "ThirdParty/glu/internal_glu.h"
-#include "ThirdParty/glu/libtess/dict.h"
-#include "ThirdParty/glu/libtess/mesh.h"
-#include "ThirdParty/glu/libtess/priorityq.h"
+#include "mesh.h"
+#include "dict.h"
+#include "priorityq.h"
 
 /* The begin/end calls must be properly nested.  We keep track of
  * the current state to enforce the ordering.
index 68fbe68..2e2cc79 100644 (file)
 ** $Header: //depot/main/gfx/lib/glu/libtess/tessmono.c#5 $
 */
 
-#include <assert.h>
+#include "gluos.h"
 #include <stdlib.h>
-
-#include "ThirdParty/glu/gluos.h"
-#include "ThirdParty/glu/libtess/geom.h"
-#include "ThirdParty/glu/libtess/mesh.h"
-#include "ThirdParty/glu/libtess/tessmono.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)
index 69c420a..e470a4c 100644 (file)
@@ -1,3 +1,13 @@
+2011-05-24  Stephen White  <senorblanco@chromium.org>
+
+        Reviewed by Kenneth Russell.
+
+        Remove most style checks on Source/ThirdParty/glu, since it doesn't
+        follow WebKit style.
+        https://bugs.webkit.org/show_bug.cgi?id=61365
+
+        * Scripts/webkitpy/style/checker.py:
+
 2011-05-24  Adam Roben  <aroben@apple.com>
 
         Don't allow forcing builds through the build.webkit.org web interface
index 27ba294..20973a5 100644 (file)
@@ -206,6 +206,13 @@ _PATH_RULES_SPECIFIER = [
      ["-readability/naming",
       "-build/header_guard",
       "-build/include_order"]),
+
+    ([# glu's libtess is third-party code, and doesn't follow WebKit style.
+      "Source/ThirdParty/glu"],
+     ["-readability",
+      "-whitespace",
+      "-build/header_guard",
+      "-build/include_order"]),
 ]