本文整理汇总了C++中SkPath::getLastPt方法的典型用法代码示例。如果您正苦于以下问题:C++ SkPath::getLastPt方法的具体用法?C++ SkPath::getLastPt怎么用?C++ SkPath::getLastPt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkPath
的用法示例。
在下文中一共展示了SkPath::getLastPt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finishContour
void SkPathStroker::finishContour(bool close, bool currIsLine) {
if (fSegmentCount > 0) {
SkPoint pt;
if (close) {
fJoiner(&fOuter, &fInner, fPrevUnitNormal, fPrevPt,
fFirstUnitNormal, fRadius, fInvMiterLimit,
fPrevIsLine, currIsLine);
fOuter.close();
// now add fInner as its own contour
fInner.getLastPt(&pt);
fOuter.moveTo(pt.fX, pt.fY);
fOuter.reversePathTo(fInner);
fOuter.close();
} else { // add caps to start and end
// cap the end
fInner.getLastPt(&pt);
fCapper(&fOuter, fPrevPt, fPrevNormal, pt,
currIsLine ? &fInner : NULL);
fOuter.reversePathTo(fInner);
// cap the start
fCapper(&fOuter, fFirstPt, -fFirstNormal, fFirstOuterPt,
fPrevIsLine ? &fInner : NULL);
fOuter.close();
}
}
fInner.reset();
fSegmentCount = -1;
}
示例2: finishContour
void SkPathStroker::finishContour(bool close, bool currIsLine) {
if (fSegmentCount > 0) {
SkPoint pt;
if (close) {
fJoiner(&fOuter, &fInner, fPrevUnitNormal, fPrevPt,
fFirstUnitNormal, fRadius, fInvMiterLimit,
fPrevIsLine, currIsLine);
fOuter.close();
// now add fInner as its own contour
fInner.getLastPt(&pt);
fOuter.moveTo(pt.fX, pt.fY);
fOuter.reversePathTo(fInner);
fOuter.close();
} else { // add caps to start and end
// cap the end
fInner.getLastPt(&pt);
fCapper(&fOuter, fPrevPt, fPrevNormal, pt,
currIsLine ? &fInner : NULL);
fOuter.reversePathTo(fInner);
// cap the start
fCapper(&fOuter, fFirstPt, -fFirstNormal, fFirstOuterPt,
fPrevIsLine ? &fInner : NULL);
fOuter.close();
}
}
// since we may re-use fInner, we rewind instead of reset, to save on
// reallocating its internal storage.
fInner.rewind();
fSegmentCount = -1;
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_skia_src,代码行数:31,代码来源:SkStroke.cpp
示例3: draw
void draw(SkCanvas* canvas) {
SkPath path;
path.moveTo(100, 100);
path.quadTo(100, 20, 20, 100);
SkMatrix matrix;
matrix.setRotate(36, 100, 100);
path.transform(matrix);
SkPoint last;
path.getLastPt(&last);
SkDebugf("last point: %g, %g\n", last.fX, last.fY);
}
示例4:
static void
_update_path(mbe_t *mbe) {
SkPath *path = mbe->path;
SkPath *subpath = mbe->subpath;
SkMatrix canvas_matrix;
SkPoint point;
MB_MATRIX_2_SKMATRIX(canvas_matrix, mbe->states->matrix);
path->addPath(*subpath, canvas_matrix);
subpath->getLastPt(&point);
subpath->rewind();
subpath->moveTo(point);
}
示例5: mbe_arc
void mbe_arc(mbe_t *mbe, co_aix x, co_aix y, co_aix radius,
co_aix angle_start, co_aix angle_stop) {
SkPoint point;
SkPath *subpath = mbe->subpath;
SkRect rect;
SkScalar x0, y0;
SkScalar ang_start, ang_stop;
SkScalar sweep;
SkScalar r; /* radius */
subpath->getLastPt(&point);
x0 = point.fX;
y0 = point.fX;
r = CO_AIX_2_SKSCALAR(radius);
ang_start = CO_AIX_2_SKSCALAR(angle_start * 180 / PI);
ang_stop = CO_AIX_2_SKSCALAR(angle_stop * 180 / PI);
/* Skia can only draw an arc in clockwise directly. We negative
* start and stop point to draw the arc in the mirror along x-axis
* in a sub-path. Then, the sub-path are reflected along x-axis,
* again. We get a right path, and add it to the path of mbe_t.
*/
if(ang_start > ang_stop) {
SkPath tmppath;
SkMatrix matrix;
co_aix reflect[6] = { 1, 0, 0,
0, -1, 0};
rect.set(-r, -r, r, r);
sweep = ang_start - ang_stop;
tmppath.arcTo(rect, -ang_start, sweep, false);
reflect[2] = x;
reflect[5] = y;
MB_MATRIX_2_SKMATRIX(matrix, reflect);
subpath->addPath(tmppath, matrix);
} else {
rect.set(x0 - r, y0 - r, x0 + r, y0 + r);
sweep = ang_stop - ang_start;
subpath->arcTo(rect, ang_start, sweep, false);
}
}