Remove GrPath typedef
Review URL: http://codereview.appspot.com/6128045/
git-svn-id: http://skia.googlecode.com/svn/trunk@3780 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gyp/gpu.gyp b/gyp/gpu.gyp
index f0f9821..5e05c9a 100644
--- a/gyp/gpu.gyp
+++ b/gyp/gpu.gyp
@@ -186,7 +186,6 @@
'../include/gpu/GrMatrix.h',
'../include/gpu/GrNoncopyable.h',
'../include/gpu/GrPaint.h',
- '../include/gpu/GrPath.h',
'../include/gpu/GrPoint.h',
'../include/gpu/GrRect.h',
'../include/gpu/GrRefCnt.h',
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h
index c94755d..6f1c5d4 100644
--- a/include/gpu/GrClip.h
+++ b/include/gpu/GrClip.h
@@ -13,9 +13,9 @@
#include "GrClipIterator.h"
#include "GrRect.h"
-#include "GrPath.h"
#include "GrTemplates.h"
+#include "SkPath.h"
#include "SkTArray.h"
class GrClip {
@@ -45,7 +45,7 @@
GrClipType getElementType(int i) const { return fList[i].fType; }
- const GrPath& getPath(int i) const {
+ const SkPath& getPath(int i) const {
GrAssert(kPath_ClipType == fList[i].fType);
return fList[i].fPath;
}
@@ -113,7 +113,7 @@
struct Element {
GrClipType fType;
GrRect fRect;
- GrPath fPath;
+ SkPath fPath;
GrPathFill fPathFill;
SkRegion::Op fOp;
bool fDoAA;
diff --git a/include/gpu/GrClipIterator.h b/include/gpu/GrClipIterator.h
index 4f98c5c..5d3bd45 100644
--- a/include/gpu/GrClipIterator.h
+++ b/include/gpu/GrClipIterator.h
@@ -11,8 +11,8 @@
#ifndef GrClipIterator_DEFINED
#define GrClipIterator_DEFINED
-#include "GrPath.h"
#include "GrRect.h"
+#include "SkPath.h"
#include "SkRegion.h"
/**
@@ -41,7 +41,7 @@
* Return the current path. It is an error to call this when isDone() is
* true or when getType() is kRect_Type.
*/
- virtual const GrPath* getPath() = 0;
+ virtual const SkPath* getPath() = 0;
/**
* Return the fill rule for the path. It is an error to call this when
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index d3723c7..b26d2b3 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -411,7 +411,7 @@
* @param translate optional additional translation applied to the
* path.
*/
- void drawPath(const GrPaint& paint, const GrPath& path, GrPathFill fill,
+ void drawPath(const GrPaint& paint, const SkPath& path, GrPathFill fill,
const GrPoint* translate = NULL);
/**
@@ -728,12 +728,12 @@
GrDrawTarget* prepareToDraw(const GrPaint& paint, DrawCategory drawType);
- GrPathRenderer* getPathRenderer(const GrPath& path,
+ GrPathRenderer* getPathRenderer(const SkPath& path,
GrPathFill fill,
const GrDrawTarget* target,
bool antiAlias);
- void internalDrawPath(const GrPaint& paint, const GrPath& path,
+ void internalDrawPath(const GrPaint& paint, const SkPath& path,
GrPathFill fill, const GrPoint* translate);
/**
diff --git a/include/gpu/GrGlyph.h b/include/gpu/GrGlyph.h
index a0d81a1..f79de7c 100644
--- a/include/gpu/GrGlyph.h
+++ b/include/gpu/GrGlyph.h
@@ -11,8 +11,8 @@
#ifndef GrGlyph_DEFINED
#define GrGlyph_DEFINED
-#include "GrPath.h"
#include "GrRect.h"
+#include "SkPath.h"
class GrAtlas;
@@ -26,7 +26,7 @@
typedef uint32_t PackedID;
GrAtlas* fAtlas;
- GrPath* fPath;
+ SkPath* fPath;
PackedID fPackedID;
GrIRect16 fBounds;
GrIPoint16 fAtlasLocation;
diff --git a/include/gpu/GrPath.h b/include/gpu/GrPath.h
deleted file mode 100644
index 7da0d48..0000000
--- a/include/gpu/GrPath.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-/*
- * Copyright 2010 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-
-
-#ifndef GrPath_DEFINED
-#define GrPath_DEFINED
-
-#include "GrTypes.h"
-#include "SkPath.h"
-
-typedef SkPath GrPath;
-
-#endif
-
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 5ad90f4..74dc2cf 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -18,7 +18,6 @@
#include "GrContext.h"
#include "GrFontScaler.h"
#include "GrClipIterator.h"
-#include "GrPath.h"
// skia headers
#include "SkBitmap.h"
@@ -120,7 +119,7 @@
}
}
- virtual const GrPath* getPath() SK_OVERRIDE {
+ virtual const SkPath* getPath() SK_OVERRIDE {
return fCurr->fPath;
}
@@ -147,7 +146,7 @@
virtual bool getPackedGlyphBounds(GrGlyph::PackedID, GrIRect* bounds);
virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
int rowBytes, void* image);
- virtual bool getGlyphPath(uint16_t glyphID, GrPath*);
+ virtual bool getGlyphPath(uint16_t glyphID, SkPath*);
private:
SkGlyphCache* fStrike;
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 28aeef1..ca7ecdc 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -200,7 +200,7 @@
}
}
-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 @@
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 be6e19e..027ec5b 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -235,7 +235,7 @@
////////////////////////////////////////////////////////////////////////////////
bool GrClipMaskManager::drawPath(GrGpu* gpu,
- const GrPath& path,
+ const SkPath& path,
GrPathFill fill,
bool doAA) {
@@ -545,7 +545,7 @@
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 @@
////////////////////////////////////////////////////////////////////////////////
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 3e7b88e..e698791 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 @@
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 7ee2b71..835ab23 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1293,7 +1293,7 @@
// 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 @@
* 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 @@
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 @@
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 @@
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 b164131..27e3fa8 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -150,7 +150,7 @@
#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 a606dd5..3bb8543 100644
--- a/src/gpu/GrDefaultTextContext.cpp
+++ b/src/gpu/GrDefaultTextContext.cpp
@@ -220,7 +220,7 @@
}
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 cecc514..aa18792 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -145,7 +145,7 @@
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 403f03a..a1d0eb6 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 @@
/// 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 95c29ff..d2e099b 100644
--- a/src/gpu/SkGrFontScaler.cpp
+++ b/src/gpu/SkGrFontScaler.cpp
@@ -159,7 +159,7 @@
}
// 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 6e51e19..4adc7e9 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 @@
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();
}