当前位置: 首页>>代码示例>>C++>>正文


C++ SkPath::getLastPt方法代码示例

本文整理汇总了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;
}
开发者ID:0omega,项目名称:platform_external_skia,代码行数:29,代码来源:SkStroke.cpp

示例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);
}
开发者ID:HalCanary,项目名称:skia-hc,代码行数:11,代码来源:Path_getLastPt.cpp

示例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);
}
开发者ID:aguai,项目名称:MadButterfly,代码行数:14,代码来源:graph_engine_skia.cpp

示例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);
    }
}
开发者ID:aguai,项目名称:MadButterfly,代码行数:42,代码来源:graph_engine_skia.cpp


注:本文中的SkPath::getLastPt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。