• Home
  • Raw
  • Download

Lines Matching +full:is +full:- +full:path +full:- +full:inside

4  * Use of this source code is governed by a BSD-style license that can be
23 static SkPoint rotate90(const SkPoint& p) { return {p.fY, -p.fX}; } in rotate90()
24 static SkPoint rotate180(const SkPoint& p) { return p * -1; } in rotate180()
92 // Returns the fill path
93 SkPath getFillPath(const SkPath& path, const SkPaint& paint);
107 void initForPath(const SkPath& path, const SkPaint& paint);
119 // Appends path in reverse to result
120 static void appendPathReversed(const PathRecorder& path, PathRecorder* result);
129 void SkPathStroker2::initForPath(const SkPath& path, const SkPaint& paint) { in initForPath() argument
137 SkPath SkPathStroker2::getFillPath(const SkPath& path, const SkPaint& paint) { in getFillPath() argument
138 initForPath(path, paint); in getFillPath()
142 SkPath::Iter it(path, false); in getFillPath()
160 SkDebugf("Unhandled path verb %d\n", segment.fVerb); in getFillPath()
169 const bool isClosed = path.isLastContourClosed(); in getFillPath()
176 // Walk inner path in reverse, appending to result in getFillPath()
184 const SkPoint tangent = line.fPoints[1] - line.fPoints[0]; in strokeLine()
189 fInner.moveTo(line.fPoints[0] - offset); in strokeLine()
192 fInner.lineTo(line.fPoints[1] - offset); in strokeLine()
198 // Back at the start of the path: just close the stroked outline in endcap()
221 // Common path endpoint of the two segments is the midpoint of the miter line. in join()
227 // Check who's inside and who's outside. in join()
236 if (SkScalarNearlyZero(1 - cosTheta)) { in join()
241 // Before and after have the same origin and magnitude, so before+after is the diagonal of in join()
242 // their rhombus. Origin of this vector is the midpoint of the miter line. in join()
248 // where miterLength is the length of the miter from outer point to inner corner. in join()
249 // miterVec's origin is the midpoint of the miter line, so we use strokeWidth/2. in join()
250 // Sqrt is just an application of half-angle identities. in join()
257 outer->lineTo(miterMidpt + miterVec); in join()
258 outer->lineTo(miterMidpt + dest); in join()
260 // Inner miter is more involved. We're already at t=1 (on inside stroke) of 'prev'. in join()
262 // (midpoint - miterVec), or if we need to add extra "loop" geometry. in join()
265 // 'alpha' is angle between prev tangent and the curr inwards normal in join()
266 const float cosAlpha = prevUnitTangent.dot(-after); in join()
268 // This is the point at which the inside "corner" of curr at t=0 will lie on a in join()
269 // line connecting the inner and outer corners of prev at t=0. If len is below in join()
270 // this threshold, the inside corner of curr will "poke through" the start of prev, in join()
274 // This is the point at which the inner miter point will lie on the inner stroke in join()
275 // boundary of the curr segment. If len is below this threshold, the miter point in join()
276 // moves 'inside' of the stroked outline, and we'll need the inner loop geometry. in join()
277 const float threshold2 = halfMiterLength * halfMiterLength - radiusSquared; in join()
278 // If a segment length is smaller than the larger of the two thresholds, in join()
284 // Connect to the miter midpoint (common path endpoint of the two segments), in join()
285 // and then to t=0 (on inside) of the next segment. This adds an interior "loop" of in join()
288 inner->lineTo(miterMidpt); in join()
289 inner->lineTo(miterMidpt - dest); in join()
292 inner->setLastPt(miterMidpt - miterVec); in join()
307 void SkPathStroker2::appendPathReversed(const PathRecorder& path, PathRecorder* result) { in appendPathReversed() argument
308 const int numVerbs = path.countVerbs(); in appendPathReversed()
309 const int numPoints = path.countPoints(); in appendPathReversed()
310 const std::vector<uint8_t>& verbs = path.verbs(); in appendPathReversed()
311 const std::vector<SkPoint>& points = path.points(); in appendPathReversed()
313 for (int i = numVerbs - 1, j = numPoints; i >= 0; i--) { in appendPathReversed()
317 j -= 1; in appendPathReversed()
319 result->lineTo(points[j - 1]); in appendPathReversed()
338 const SkPoint tangent = seg.fPoints[1] - seg.fPoints[0]; in unitNormal()
345 const SkPoint diff = lineSeg.fPoints[1] - lineSeg.fPoints[0]; in squaredLineLength()
396 this->toggle(fShowSkeleton); in onChar()
399 this->toggle(fShowSkiaStroke); in onChar()
402 this->toggle(fShowHidden); in onChar()
404 case '-': in onChar()
405 fWidth -= 5; in onChar()
417 canvas->drawColor(0xFFEEEEEE); in draw()
419 SkPath path; in draw() local
420 this->makePath(&path); in draw()
426 canvas->drawPath(path, fStrokePaint); in draw()
431 SkPath fillPath = stroker.getFillPath(path, fStrokePaint); in draw()
432 canvas->drawPath(fillPath, fNewFillPaint); in draw()
435 canvas->drawPath(fillPath, fHiddenPaint); in draw()
438 canvas->drawPath(path, fSkeletonPaint); in draw()
440 canvas->drawPoints(SkCanvas::kPoints_PointMode, kN, fPts, fPtsPaint); in draw()
443 canvas->translate(0, 400); in draw()
445 canvas->drawPath(path, fMirrorStrokePaint); in draw()
448 skpathutils::FillPathWithPaint(path, fStrokePaint, &hidden); in draw()
449 canvas->drawPath(hidden, fHiddenPaint); in draw()
452 canvas->drawPath(path, fSkeletonPaint); in draw()
459 const SkRect r = SkRect::MakeXYWH(x - tol, y - tol, tol * 2, tol * 2); in onFindClickHandler()
463 fPts[i] = c->fCurr; in onFindClickHandler()
476 void makePath(SkPath* path) { in makePath() argument
477 path->moveTo(fPts[0]); in makePath()
479 path->lineTo(fPts[i]); in makePath()