diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrAAConvexPathRenderer.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrClipMaskManager.cpp | 6 | ||||
-rw-r--r-- | src/gpu/GrClipMaskManager.h | 4 | ||||
-rw-r--r-- | src/gpu/GrContext.cpp | 10 | ||||
-rw-r--r-- | src/gpu/GrDefaultPathRenderer.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrDefaultTextContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrPathUtils.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrPathUtils.h | 4 | ||||
-rw-r--r-- | src/gpu/SkGrFontScaler.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gr_unittests.cpp | 120 |
10 files changed, 18 insertions, 138 deletions
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp index 28aeef1d54..ca7ecdcb4a 100644 --- a/src/gpu/GrAAConvexPathRenderer.cpp +++ b/src/gpu/GrAAConvexPathRenderer.cpp @@ -200,7 +200,7 @@ void update_degenerate_test(DegenerateTestData* data, const GrPoint& pt) { } } -inline SkPath::Direction get_direction(const GrPath& path, const GrMatrix& m) { +inline SkPath::Direction get_direction(const SkPath& path, const GrMatrix& m) { SkPath::Direction dir; GR_DEBUGCODE(bool succeeded = ) path.cheapComputeDirection(&dir); @@ -220,7 +220,7 @@ inline SkPath::Direction get_direction(const GrPath& path, const GrMatrix& m) { return dir; } -bool get_segments(const GrPath& path, +bool get_segments(const SkPath& path, const GrMatrix& m, SegmentArray* segments, SkPoint* fanPt, diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index be6e19e704..027ec5bb4e 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -235,7 +235,7 @@ void setUpBooleanBlendCoeffs(GrDrawState* drawState, SkRegion::Op op) { //////////////////////////////////////////////////////////////////////////////// bool GrClipMaskManager::drawPath(GrGpu* gpu, - const GrPath& path, + const SkPath& path, GrPathFill fill, bool doAA) { @@ -545,7 +545,7 @@ bool GrClipMaskManager::createStencilClipMask(GrGpu* gpu, SkRegion::Op op = (c == start) ? startOp : clipCopy.getOp(c); GrPathRenderer* pr = NULL; - const GrPath* clipPath = NULL; + const SkPath* clipPath = NULL; if (kRect_ClipType == clipCopy.getElementType(c)) { canRenderDirectToStencil = true; fill = kEvenOdd_PathFill; @@ -639,7 +639,7 @@ bool GrClipMaskManager::createStencilClipMask(GrGpu* gpu, //////////////////////////////////////////////////////////////////////////////// GrPathRenderer* GrClipMaskManager::getClipPathRenderer(GrGpu* gpu, - const GrPath& path, + const SkPath& path, GrPathFill fill, bool antiAlias) { if (NULL == fPathRendererChain) { diff --git a/src/gpu/GrClipMaskManager.h b/src/gpu/GrClipMaskManager.h index 3e7b88eaab..e698791677 100644 --- a/src/gpu/GrClipMaskManager.h +++ b/src/gpu/GrClipMaskManager.h @@ -10,7 +10,7 @@ #define GrClipMaskManager_DEFINED #include "GrRect.h" -#include "GrPath.h" +#include "SkPath.h" class GrGpu; class GrClip; @@ -79,7 +79,7 @@ private: bool createAlphaClipMask(GrGpu* gpu, const GrClip& clipIn); bool drawPath(GrGpu* gpu, - const GrPath& path, + const SkPath& path, GrPathFill fill, bool doAA); diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 7ee2b71746..835ab23368 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -1293,7 +1293,7 @@ SkPath::FillType gr_fill_to_sk_fill(GrPathFill fill) { // path bounds will be a subset of the clip bounds. returns false if // path bounds would be empty. bool get_path_and_clip_bounds(const GrDrawTarget* target, - const GrPath& path, + const SkPath& path, const GrVec* translate, GrIRect* pathBounds, GrIRect* clipBounds) { @@ -1336,7 +1336,7 @@ bool get_path_and_clip_bounds(const GrDrawTarget* target, * scratch texture. */ -bool sw_draw_path_to_mask_texture(const GrPath& clientPath, +bool sw_draw_path_to_mask_texture(const SkPath& clientPath, const GrIRect& pathDevBounds, GrPathFill fill, GrContext* context, @@ -1606,7 +1606,7 @@ bool onDrawPath(const SkPath& path, return false; } -void GrContext::drawPath(const GrPaint& paint, const GrPath& path, +void GrContext::drawPath(const GrPaint& paint, const SkPath& path, GrPathFill fill, const GrPoint* translate) { if (path.isEmpty()) { @@ -1629,7 +1629,7 @@ void GrContext::drawPath(const GrPaint& paint, const GrPath& path, internalDrawPath(paint, path, fill, translate); } -void GrContext::internalDrawPath(const GrPaint& paint, const GrPath& path, +void GrContext::internalDrawPath(const GrPaint& paint, const SkPath& path, GrPathFill fill, const GrPoint* translate) { // Note that below we may sw-rasterize the path into a scratch texture. @@ -2113,7 +2113,7 @@ GrDrawTarget* GrContext::prepareToDraw(const GrPaint& paint, return target; } -GrPathRenderer* GrContext::getPathRenderer(const GrPath& path, +GrPathRenderer* GrContext::getPathRenderer(const SkPath& path, GrPathFill fill, const GrDrawTarget* target, bool antiAlias) { diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp index b164131eba..27e3fa89a5 100644 --- a/src/gpu/GrDefaultPathRenderer.cpp +++ b/src/gpu/GrDefaultPathRenderer.cpp @@ -150,7 +150,7 @@ GR_STATIC_CONST_SAME_STENCIL(gDirectToStencil, #define STENCIL_OFF 0 // Always disable stencil (even when needed) -static inline bool single_pass_path(const GrPath& path, GrPathFill fill) { +static inline bool single_pass_path(const SkPath& path, GrPathFill fill) { #if STENCIL_OFF return true; #else diff --git a/src/gpu/GrDefaultTextContext.cpp b/src/gpu/GrDefaultTextContext.cpp index a606dd5c64..3bb8543c34 100644 --- a/src/gpu/GrDefaultTextContext.cpp +++ b/src/gpu/GrDefaultTextContext.cpp @@ -220,7 +220,7 @@ void GrDefaultTextContext::drawPackedGlyph(GrGlyph::PackedID packed, } if (NULL == glyph->fPath) { - GrPath* path = new GrPath; + SkPath* path = new SkPath; if (!scaler->getGlyphPath(glyph->glyphID(), path)) { // flag the glyph as being dead? delete path; diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp index cecc514f35..aa18792574 100644 --- a/src/gpu/GrPathUtils.cpp +++ b/src/gpu/GrPathUtils.cpp @@ -145,7 +145,7 @@ uint32_t GrPathUtils::generateCubicPoints(const GrPoint& p0, return a + b; } -int GrPathUtils::worstCasePointCount(const GrPath& path, int* subpaths, +int GrPathUtils::worstCasePointCount(const SkPath& path, int* subpaths, GrScalar tol) { if (tol < gMinCurveTol) { tol = gMinCurveTol; diff --git a/src/gpu/GrPathUtils.h b/src/gpu/GrPathUtils.h index 403f03ae16..a1d0eb630b 100644 --- a/src/gpu/GrPathUtils.h +++ b/src/gpu/GrPathUtils.h @@ -11,7 +11,7 @@ #define GrPathUtils_DEFINED #include "GrMatrix.h" -#include "GrPath.h" +#include "SkPath.h" #include "SkTArray.h" /** @@ -24,7 +24,7 @@ namespace GrPathUtils { /// Since we divide by tol if we're computing exact worst-case bounds, /// very small tolerances will be increased to gMinCurveTol. - int worstCasePointCount(const GrPath&, + int worstCasePointCount(const SkPath&, int* subpaths, GrScalar tol); diff --git a/src/gpu/SkGrFontScaler.cpp b/src/gpu/SkGrFontScaler.cpp index 95c29ffe69..d2e099b03d 100644 --- a/src/gpu/SkGrFontScaler.cpp +++ b/src/gpu/SkGrFontScaler.cpp @@ -159,7 +159,7 @@ bool SkGrFontScaler::getPackedGlyphImage(GrGlyph::PackedID packed, } // we should just return const SkPath* (NULL means false) -bool SkGrFontScaler::getGlyphPath(uint16_t glyphID, GrPath* path) { +bool SkGrFontScaler::getGlyphPath(uint16_t glyphID, SkPath* path) { const SkGlyph& glyph = fStrike->getGlyphIDMetrics(glyphID); const SkPath* skPath = fStrike->findPath(glyph); diff --git a/src/gpu/gr_unittests.cpp b/src/gpu/gr_unittests.cpp index 6e51e19a7c..4adc7e9c82 100644 --- a/src/gpu/gr_unittests.cpp +++ b/src/gpu/gr_unittests.cpp @@ -11,7 +11,6 @@ #include "GrBinHashKey.h" #include "GrDrawTarget.h" #include "GrMatrix.h" -#include "GrPath.h" #include "GrRedBlackTree.h" #include "GrTDArray.h" @@ -102,130 +101,11 @@ static void test_binHashKey() GrAssert(keyA.getHash() != keyB.getHash()); } -static void test_convex() { -#if 0 - GrPath testPath; - GrPath::Iter testIter; - - GrPath pt; - pt.moveTo(0, 0); - pt.close(); - - testIter.reset(pt); - testPath.resetFromIter(&testIter); - GrAssert(kConvex_ConvexHint == testPath.getConvexHint()); - - GrPath line; - line.moveTo(GrIntToScalar(12), GrIntToScalar(20)); - line.lineTo(GrIntToScalar(-12), GrIntToScalar(-20)); - line.close(); - - testIter.reset(line); - testPath.resetFromIter(&testIter); - GrAssert(kConvex_ConvexHint == testPath.getConvexHint()); - - GrPath triLeft; - triLeft.moveTo(0, 0); - triLeft.lineTo(1, 0); - triLeft.lineTo(1, 1); - triLeft.close(); - - testIter.reset(triLeft); - testPath.resetFromIter(&testIter); - GrAssert(kConvex_ConvexHint == testPath.getConvexHint()); - - GrPath triRight; - triRight.moveTo(0, 0); - triRight.lineTo(-1, 0); - triRight.lineTo(1, 1); - triRight.close(); - - testIter.reset(triRight); - testPath.resetFromIter(&testIter); - GrAssert(kConvex_ConvexHint == testPath.getConvexHint()); - - GrPath square; - square.moveTo(0, 0); - square.lineTo(1, 0); - square.lineTo(1, 1); - square.lineTo(0, 1); - square.close(); - - testIter.reset(square); - testPath.resetFromIter(&testIter); - GrAssert(kConvex_ConvexHint == testPath.getConvexHint()); - - GrPath redundantSquare; - square.moveTo(0, 0); - square.lineTo(0, 0); - square.lineTo(0, 0); - square.lineTo(1, 0); - square.lineTo(1, 0); - square.lineTo(1, 0); - square.lineTo(1, 1); - square.lineTo(1, 1); - square.lineTo(1, 1); - square.lineTo(0, 1); - square.lineTo(0, 1); - square.lineTo(0, 1); - square.close(); - - testIter.reset(redundantSquare); - testPath.resetFromIter(&testIter); - GrAssert(kConvex_ConvexHint == testPath.getConvexHint()); - - GrPath bowTie; - bowTie.moveTo(0, 0); - bowTie.lineTo(0, 0); - bowTie.lineTo(0, 0); - bowTie.lineTo(1, 1); - bowTie.lineTo(1, 1); - bowTie.lineTo(1, 1); - bowTie.lineTo(1, 0); - bowTie.lineTo(1, 0); - bowTie.lineTo(1, 0); - bowTie.lineTo(0, 1); - bowTie.lineTo(0, 1); - bowTie.lineTo(0, 1); - bowTie.close(); - - testIter.reset(bowTie); - testPath.resetFromIter(&testIter); - GrAssert(kConcave_ConvexHint == testPath.getConvexHint()); - - GrPath spiral; - spiral.moveTo(0, 0); - spiral.lineTo(1, 0); - spiral.lineTo(1, 1); - spiral.lineTo(0, 1); - spiral.lineTo(0,.5); - spiral.lineTo(.5,.5); - spiral.lineTo(.5,.75); - spiral.close(); - - testIter.reset(spiral); - testPath.resetFromIter(&testIter); - GrAssert(kConcave_ConvexHint == testPath.getConvexHint()); - - GrPath dent; - dent.moveTo(0, 0); - dent.lineTo(1, 1); - dent.lineTo(0, 1); - dent.lineTo(-.5,2); - dent.lineTo(-2, 1); - dent.close(); - - testIter.reset(dent); - testPath.resetFromIter(&testIter); - GrAssert(kConcave_ConvexHint == testPath.getConvexHint()); -#endif -} void gr_run_unittests() { test_tdarray(); test_bsearch(); test_binHashKey(); - test_convex(); GrRedBlackTree<int>::UnitTest(); GrDrawTarget::VertexLayoutUnitTest(); } |