• 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
20 static SkPoint rotate90(const SkPoint& p) { return {p.fY, -p.fX}; } in rotate90()
21 static SkPoint rotate180(const SkPoint& p) { return p * -1; } in rotate180()
89 // Returns the fill path
90 SkPath getFillPath(const SkPath& path, const SkPaint& paint);
104 void initForPath(const SkPath& path, const SkPaint& paint);
116 // Appends path in reverse to result
117 static void appendPathReversed(const PathRecorder& path, PathRecorder* result);
126 void SkPathStroker2::initForPath(const SkPath& path, const SkPaint& paint) { in initForPath() argument
134 SkPath SkPathStroker2::getFillPath(const SkPath& path, const SkPaint& paint) { in getFillPath() argument
135 initForPath(path, paint); in getFillPath()
139 SkPath::Iter it(path, false); in getFillPath()
157 SkDebugf("Unhandled path verb %d\n", segment.fVerb); in getFillPath()
166 const bool isClosed = path.isLastContourClosed(); in getFillPath()
173 // Walk inner path in reverse, appending to result in getFillPath()
181 const SkPoint tangent = line.fPoints[1] - line.fPoints[0]; in strokeLine()
186 fInner.moveTo(line.fPoints[0] - offset); in strokeLine()
189 fInner.lineTo(line.fPoints[1] - offset); in strokeLine()
195 // Back at the start of the path: just close the stroked outline in endcap()
218 // Common path endpoint of the two segments is the midpoint of the miter line. in join()
224 // Check who's inside and who's outside. in join()
233 if (SkScalarNearlyZero(1 - cosTheta)) { in join()
238 // Before and after have the same origin and magnitude, so before+after is the diagonal of in join()
239 // their rhombus. Origin of this vector is the midpoint of the miter line. in join()
245 // where miterLength is the length of the miter from outer point to inner corner. in join()
246 // miterVec's origin is the midpoint of the miter line, so we use strokeWidth/2. in join()
247 // Sqrt is just an application of half-angle identities. in join()
254 outer->lineTo(miterMidpt + miterVec); in join()
255 outer->lineTo(miterMidpt + dest); in join()
257 // Inner miter is more involved. We're already at t=1 (on inside stroke) of 'prev'. in join()
259 // (midpoint - miterVec), or if we need to add extra "loop" geometry. in join()
262 // 'alpha' is angle between prev tangent and the curr inwards normal in join()
263 const float cosAlpha = prevUnitTangent.dot(-after); in join()
265 // This is the point at which the inside "corner" of curr at t=0 will lie on a in join()
266 // line connecting the inner and outer corners of prev at t=0. If len is below in join()
267 // this threshold, the inside corner of curr will "poke through" the start of prev, in join()
271 // This is the point at which the inner miter point will lie on the inner stroke in join()
272 // boundary of the curr segment. If len is below this threshold, the miter point in join()
273 // moves 'inside' of the stroked outline, and we'll need the inner loop geometry. in join()
274 const float threshold2 = halfMiterLength * halfMiterLength - radiusSquared; in join()
275 // If a segment length is smaller than the larger of the two thresholds, in join()
281 // Connect to the miter midpoint (common path endpoint of the two segments), in join()
282 // and then to t=0 (on inside) of the next segment. This adds an interior "loop" of in join()
285 inner->lineTo(miterMidpt); in join()
286 inner->lineTo(miterMidpt - dest); in join()
289 inner->setLastPt(miterMidpt - miterVec); in join()
304 void SkPathStroker2::appendPathReversed(const PathRecorder& path, PathRecorder* result) { in appendPathReversed() argument
305 const int numVerbs = path.countVerbs(); in appendPathReversed()
306 const int numPoints = path.countPoints(); in appendPathReversed()
307 const std::vector<uint8_t>& verbs = path.verbs(); in appendPathReversed()
308 const std::vector<SkPoint>& points = path.points(); in appendPathReversed()
310 for (int i = numVerbs - 1, j = numPoints; i >= 0; i--) { in appendPathReversed()
314 j -= 1; in appendPathReversed()
316 result->lineTo(points[j - 1]); in appendPathReversed()
335 const SkPoint tangent = seg.fPoints[1] - seg.fPoints[0]; in unitNormal()
342 const SkPoint diff = lineSeg.fPoints[1] - lineSeg.fPoints[0]; in squaredLineLength()
397 this->toggle(fShowSkeleton); in onChar()
400 this->toggle(fShowSkiaStroke); in onChar()
403 this->toggle(fShowHidden); in onChar()
405 case '-': in onChar()
406 fWidth -= 5; in onChar()
417 void makePath(SkPath* path) { in makePath() argument
418 path->moveTo(fPts[0]); in makePath()
420 path->lineTo(fPts[i]); in makePath()
425 canvas->drawColor(0xFFEEEEEE); in onDrawContent()
427 SkPath path; in onDrawContent() local
428 this->makePath(&path); in onDrawContent()
434 canvas->drawPath(path, fStrokePaint); in onDrawContent()
439 SkPath fillPath = stroker.getFillPath(path, fStrokePaint); in onDrawContent()
440 canvas->drawPath(fillPath, fNewFillPaint); in onDrawContent()
443 canvas->drawPath(fillPath, fHiddenPaint); in onDrawContent()
446 canvas->drawPath(path, fSkeletonPaint); in onDrawContent()
448 canvas->drawPoints(SkCanvas::kPoints_PointMode, kN, fPts, fPtsPaint); in onDrawContent()
451 canvas->translate(0, 400); in onDrawContent()
453 canvas->drawPath(path, fMirrorStrokePaint); in onDrawContent()
456 fStrokePaint.getFillPath(path, &hidden); in onDrawContent()
457 canvas->drawPath(hidden, fHiddenPaint); in onDrawContent()
460 canvas->drawPath(path, fSkeletonPaint); in onDrawContent()
466 const SkRect r = SkRect::MakeXYWH(x - tol, y - tol, tol * 2, tol * 2); in onFindClickHandler()
470 fPts[i] = c->fCurr; in onFindClickHandler()