diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-03-28 20:47:09 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-03-28 20:47:09 +0000 |
commit | 9d18b7873ce9b44f130a41e0cbd0a3df76ab9adf (patch) | |
tree | 5f5f96e33ea96bdaf6c0dc4fbb32f78db26a4642 /gpu/src/GrPathUtils.h | |
parent | cae5fba82e687d674b076b10cdc8aba46e1ac3b3 (diff) |
This CL implements a tesselated path renderer, using GLU's libtess. All of the
fill modes except hairline are supported. Note that the path renderer is not
enabled by default; to enable it, replace "GrCreatePathRenderer_none.cpp" with
"GrCreatePathRenderer_tesselated.cpp" in skia.gyp, and run gyp_skia, and build.
This change also contains a number of build fixes for Win32 (for building
SampleApp on VS2008) and Mac (for my ancient Mac Pro which supports
GL_EXT_framebuffer_object but not GL_ARB_framebuffer_object). Also,
priorityq-heap.c was removed from the SampleApp build, since it's #included by
priorityq.c (weird, I know).
NB: When this change is rolled into chrome, some modifications to chromium's
skia.gyp will be necessary.
Review URL: http://codereview.appspot.com/4289072/
git-svn-id: http://skia.googlecode.com/svn/trunk@1012 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrPathUtils.h')
-rw-r--r-- | gpu/src/GrPathUtils.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/gpu/src/GrPathUtils.h b/gpu/src/GrPathUtils.h new file mode 100644 index 0000000000..97841dd1e2 --- /dev/null +++ b/gpu/src/GrPathUtils.h @@ -0,0 +1,52 @@ +/* + Copyright 2011 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +#ifndef GrPathUtils_DEFINED +#define GrPathUtils_DEFINED + +#include "GrNoncopyable.h" +#include "GrScalar.h" + +class GrPathIter; +struct GrPoint; + +/** + * Utilities for evaluating paths. + */ +class GrPathUtils : public GrNoncopyable { +public: + static int worstCasePointCount(GrPathIter* path, + int* subpaths, + GrScalar tol); + static uint32_t quadraticPointCount(const GrPoint points[], GrScalar tol); + static uint32_t generateQuadraticPoints(const GrPoint& p0, + const GrPoint& p1, + const GrPoint& p2, + GrScalar tolSqd, + GrPoint** points, + uint32_t pointsLeft); + static uint32_t cubicPointCount(const GrPoint points[], GrScalar tol); + static uint32_t generateCubicPoints(const GrPoint& p0, + const GrPoint& p1, + const GrPoint& p2, + const GrPoint& p3, + GrScalar tolSqd, + GrPoint** points, + uint32_t pointsLeft); + + static const GrScalar gTolerance; +}; +#endif |