michael@0: /* michael@0: * Copyright 2012 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: #ifndef SkPathWriter_DEFINED michael@0: #define SkPathWriter_DEFINED michael@0: michael@0: #include "SkPath.h" michael@0: michael@0: class SkPathWriter { michael@0: public: michael@0: SkPathWriter(SkPath& path); michael@0: void close(); michael@0: void cubicTo(const SkPoint& pt1, const SkPoint& pt2, const SkPoint& pt3); michael@0: void deferredLine(const SkPoint& pt); michael@0: void deferredMove(const SkPoint& pt); michael@0: void deferredMoveLine(const SkPoint& pt); michael@0: bool hasMove() const; michael@0: void init(); michael@0: bool isClosed() const; michael@0: bool isEmpty() const { return fEmpty; } michael@0: void lineTo(); michael@0: const SkPath* nativePath() const; michael@0: void nudge(); michael@0: void quadTo(const SkPoint& pt1, const SkPoint& pt2); michael@0: bool someAssemblyRequired() const; michael@0: michael@0: private: michael@0: bool changedSlopes(const SkPoint& pt) const; michael@0: void moveTo(); michael@0: michael@0: SkPath* fPathPtr; michael@0: SkPoint fDefer[2]; michael@0: SkPoint fFirstPt; michael@0: int fCloses; michael@0: int fMoves; michael@0: bool fEmpty; michael@0: bool fHasMove; michael@0: bool fMoved; michael@0: }; michael@0: michael@0: michael@0: #endif /* defined(__PathOps__SkPathWriter__) */