diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-30 15:29:48 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-30 15:29:48 +0000 |
commit | fa2f2a48f6822b88ab895fece1998af549c16ebe (patch) | |
tree | 0d599b224e79d079c58c811a628da3aa7e1382cb /src/core/SkEdgeBuilder.cpp | |
parent | 7950a9eba71f65365d88021680a16f245ad3fa68 (diff) |
Revert "add asserts to point<-->verb helpers"
This reverts commit b4775ac7b55802e87231768f002e4b42f233b0aa.
git-svn-id: http://skia.googlecode.com/svn/trunk@9347 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkEdgeBuilder.cpp')
-rw-r--r-- | src/core/SkEdgeBuilder.cpp | 51 |
1 files changed, 5 insertions, 46 deletions
diff --git a/src/core/SkEdgeBuilder.cpp b/src/core/SkEdgeBuilder.cpp index 9ac4e97443..608a83c7c7 100644 --- a/src/core/SkEdgeBuilder.cpp +++ b/src/core/SkEdgeBuilder.cpp @@ -153,22 +153,12 @@ int SkEdgeBuilder::buildPoly(const SkPath& path, const SkIRect* iclip, return edgePtr - fEdgeList; } -static void handle_quad(SkEdgeBuilder* builder, const SkPoint pts[3]) { - SkPoint monoX[5]; - int n = SkChopQuadAtYExtrema(pts, monoX); - for (int i = 0; i <= n; i++) { - builder->addQuad(&monoX[i * 2]); - } -} - int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip, int shiftUp) { fAlloc.reset(); fList.reset(); fShiftUp = shiftUp; - SkScalar conicTol = SK_ScalarHalf * (1 << shiftUp); - if (SkPath::kLine_SegmentMask == path.getSegmentMasks()) { return this->buildPoly(path, iclip, shiftUp); } @@ -202,24 +192,6 @@ int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip, this->addClipper(&clipper); } break; - case SkPath::kConic_Verb: { - const int MAX_POW2 = 4; - const int MAX_QUADS = 1 << MAX_POW2; - const int MAX_QUAD_PTS = 1 + 2 * MAX_QUADS; - SkPoint storage[MAX_QUAD_PTS]; - - SkConic conic; - conic.set(pts, iter.conicWeight()); - int pow2 = conic.computeQuadPOW2(conicTol); - pow2 = SkMin32(pow2, MAX_POW2); - int quadCount = conic.chopIntoQuadsPOW2(storage, pow2); - SkASSERT(quadCount <= MAX_QUADS); - for (int i = 0; i < quadCount; ++i) { - if (clipper.clipQuad(&storage[i * 2], clip)) { - this->addClipper(&clipper); - } - } - } break; case SkPath::kCubic_Verb: if (clipper.clipCubic(pts, clip)) { this->addClipper(&clipper); @@ -242,26 +214,13 @@ int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip, this->addLine(pts); break; case SkPath::kQuad_Verb: { - handle_quad(this, pts); + SkPoint monoX[5]; + int n = SkChopQuadAtYExtrema(pts, monoX); + for (int i = 0; i <= n; i++) { + this->addQuad(&monoX[i * 2]); + } break; } - case SkPath::kConic_Verb: { - const int MAX_POW2 = 4; - const int MAX_QUADS = 1 << MAX_POW2; - const int MAX_QUAD_PTS = 1 + 2 * MAX_QUADS; - SkPoint storage[MAX_QUAD_PTS]; - - SkConic conic; - conic.set(pts, iter.conicWeight()); - int pow2 = conic.computeQuadPOW2(conicTol); - pow2 = SkMin32(pow2, MAX_POW2); - int quadCount = conic.chopIntoQuadsPOW2(storage, pow2); - SkASSERT(quadCount <= MAX_QUADS); - SkDebugf("--- quadCount = %d\n", quadCount); - for (int i = 0; i < quadCount; ++i) { - handle_quad(this, &storage[i * 2]); - } - } break; case SkPath::kCubic_Verb: { SkPoint monoY[10]; int n = SkChopCubicAtYExtrema(pts, monoY); |