7365c3aa77
This splits out the cogl_path_ api into a separate cogl-path sub-library like cogl-pango and cogl-gst. This enables developers to build Cogl with this sub-library disabled if they don't need it which can be useful when its important to keep the size of an application and its dependencies down to a minimum. The functions cogl_framebuffer_{fill,stroke}_path have been renamed to cogl_path_{fill,stroke}. There were a few places in core cogl and cogl-gst that referenced the CoglPath api and these have been decoupled by using the CoglPrimitive api instead. In the case of cogl_framebuffer_push_path_clip() the core clip stack no longer accepts path clips directly but it's now possible to get a CoglPrimitive for the fill of a path and so the implementation of cogl_framebuffer_push_path_clip() now lives in cogl-path and works as a shim that first gets a CoglPrimitive and uses cogl_framebuffer_push_primitive_clip instead. We may want to consider renaming cogl_framebuffer_push_path_clip to put it in the cogl_path_ namespace. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 8aadfd829239534fb4ec8255cdea813d698c5a3f) So as to avoid breaking the 1.x API or even the ABI since we are quite late in the 1.16 development cycle the patch was modified to build cogl-path as a noinst_LTLIBRARY before building cogl and link the code directly into libcogl.so as it was previously. This way we can wait until the start of the 1.18 cycle before splitting the code into a separate libcogl-path.so. This also adds shims for cogl_framebuffer_fill/stroke_path() to avoid breaking the 1.x API/ABI.
122 lines
5 KiB
C
122 lines
5 KiB
C
/*
|
|
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
|
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
|
* Copyright (C) 2010 Intel Corporation
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
* to deal in the Software without restriction, including without limitation
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice including the dates of first publication and
|
|
* either this permission notice or a reference to
|
|
* http://oss.sgi.com/projects/FreeB/
|
|
* shall be included in all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
* SOFTWARE.
|
|
*
|
|
* Except as contained in this notice, the name of Silicon Graphics, Inc.
|
|
* shall not be used in advertising or otherwise to promote the sale, use or
|
|
* other dealings in this Software without prior written authorization from
|
|
* Silicon Graphics, Inc.
|
|
*/
|
|
|
|
#ifndef __TESSELATOR_H__
|
|
#define __TESSELATOR_H__
|
|
|
|
/* This just includes the defines needed by the tesselator code */
|
|
|
|
#include "cogl/cogl-defines.h"
|
|
#include "cogl/cogl-gl-header.h"
|
|
|
|
typedef struct GLUtesselator GLUtesselator;
|
|
|
|
#define GLU_TESS_MAX_COORD 1.0e150
|
|
|
|
void gluBeginPolygon (GLUtesselator* tess);
|
|
void gluDeleteTess (GLUtesselator* tess);
|
|
void gluEndPolygon (GLUtesselator* tess);
|
|
|
|
typedef void (_GLUfuncptr)();
|
|
|
|
void gluGetTessProperty (GLUtesselator* tess, GLenum which, double* data);
|
|
|
|
GLUtesselator *gluNewTess (void);
|
|
void gluNextContour (GLUtesselator* tess, GLenum type);
|
|
|
|
void gluTessBeginContour (GLUtesselator* tess);
|
|
void gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
|
|
void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
|
|
void gluTessEndContour (GLUtesselator* tess);
|
|
void gluTessEndPolygon (GLUtesselator* tess);
|
|
void gluTessNormal (GLUtesselator* tess, double valueX, double valueY, double valueZ);
|
|
void gluTessProperty (GLUtesselator* tess, GLenum which, double data);
|
|
void gluTessVertex (GLUtesselator* tess, double *location, GLvoid* data);
|
|
|
|
/* ErrorCode */
|
|
#define GLU_INVALID_ENUM 100900
|
|
#define GLU_INVALID_VALUE 100901
|
|
#define GLU_OUT_OF_MEMORY 100902
|
|
|
|
/* TessCallback */
|
|
#define GLU_TESS_BEGIN 100100
|
|
#define GLU_BEGIN 100100
|
|
#define GLU_TESS_VERTEX 100101
|
|
#define GLU_VERTEX 100101
|
|
#define GLU_TESS_END 100102
|
|
#define GLU_END 100102
|
|
#define GLU_TESS_ERROR 100103
|
|
#define GLU_TESS_EDGE_FLAG 100104
|
|
#define GLU_EDGE_FLAG 100104
|
|
#define GLU_TESS_COMBINE 100105
|
|
#define GLU_TESS_BEGIN_DATA 100106
|
|
#define GLU_TESS_VERTEX_DATA 100107
|
|
#define GLU_TESS_END_DATA 100108
|
|
#define GLU_TESS_ERROR_DATA 100109
|
|
#define GLU_TESS_EDGE_FLAG_DATA 100110
|
|
#define GLU_TESS_COMBINE_DATA 100111
|
|
|
|
/* TessContour */
|
|
#define GLU_CW 100120
|
|
#define GLU_CCW 100121
|
|
#define GLU_INTERIOR 100122
|
|
#define GLU_EXTERIOR 100123
|
|
#define GLU_UNKNOWN 100124
|
|
|
|
/* TessProperty */
|
|
#define GLU_TESS_WINDING_RULE 100140
|
|
#define GLU_TESS_BOUNDARY_ONLY 100141
|
|
#define GLU_TESS_TOLERANCE 100142
|
|
|
|
/* TessError */
|
|
#define GLU_TESS_ERROR1 100151
|
|
#define GLU_TESS_ERROR2 100152
|
|
#define GLU_TESS_ERROR3 100153
|
|
#define GLU_TESS_ERROR4 100154
|
|
#define GLU_TESS_ERROR5 100155
|
|
#define GLU_TESS_ERROR6 100156
|
|
#define GLU_TESS_ERROR7 100157
|
|
#define GLU_TESS_ERROR8 100158
|
|
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
|
|
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
|
|
#define GLU_TESS_MISSING_END_POLYGON 100153
|
|
#define GLU_TESS_MISSING_END_CONTOUR 100154
|
|
#define GLU_TESS_COORD_TOO_LARGE 100155
|
|
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
|
|
|
|
/* TessWinding */
|
|
#define GLU_TESS_WINDING_ODD 100130
|
|
#define GLU_TESS_WINDING_NONZERO 100131
|
|
#define GLU_TESS_WINDING_POSITIVE 100132
|
|
#define GLU_TESS_WINDING_NEGATIVE 100133
|
|
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
|
|
|
#endif /* __TESSELATOR_H__ */
|