3 * Copyright 2006 The Android Open Source Project
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
10 #ifndef SkPathParts_DEFINED
11 #define SkPathParts_DEFINED
13 #include "SkDisplayable.h"
14 #include "SkMemberInfo.h"
20 class SkPathPart : public SkDisplayable {
23 virtual bool add() = 0;
25 virtual SkDisplayable* getParent() const;
26 virtual bool setParent(SkDisplayable* parent);
28 virtual bool isPathPart() const { return true; }
34 class SkMoveTo : public SkPathPart {
35 DECLARE_MEMBER_INFO(MoveTo);
37 bool add() SK_OVERRIDE;
43 class SkRMoveTo : public SkMoveTo {
44 DECLARE_MEMBER_INFO(RMoveTo);
45 bool add() SK_OVERRIDE;
47 typedef SkMoveTo INHERITED;
50 class SkLineTo : public SkPathPart {
51 DECLARE_MEMBER_INFO(LineTo);
53 bool add() SK_OVERRIDE;
59 class SkRLineTo : public SkLineTo {
60 DECLARE_MEMBER_INFO(RLineTo);
61 bool add() SK_OVERRIDE;
63 typedef SkLineTo INHERITED;
66 class SkQuadTo : public SkPathPart {
67 DECLARE_MEMBER_INFO(QuadTo);
69 bool add() SK_OVERRIDE;
77 class SkRQuadTo : public SkQuadTo {
78 DECLARE_MEMBER_INFO(RQuadTo);
79 bool add() SK_OVERRIDE;
81 typedef SkQuadTo INHERITED;
84 class SkCubicTo : public SkPathPart {
85 DECLARE_MEMBER_INFO(CubicTo);
87 bool add() SK_OVERRIDE;
97 class SkRCubicTo : public SkCubicTo {
98 DECLARE_MEMBER_INFO(RCubicTo);
99 bool add() SK_OVERRIDE;
101 typedef SkCubicTo INHERITED;
104 class SkClose : public SkPathPart {
105 DECLARE_EMPTY_MEMBER_INFO(Close);
106 bool add() SK_OVERRIDE;
109 class SkAddGeom : public SkPathPart {
110 DECLARE_PRIVATE_MEMBER_INFO(AddGeom);
113 int /*SkPath::Direction*/ direction;
116 class SkAddRect : public SkAddGeom {
117 DECLARE_MEMBER_INFO(AddRect);
119 bool add() SK_OVERRIDE;
123 typedef SkAddGeom INHERITED;
126 class SkAddOval : public SkAddRect {
127 DECLARE_MEMBER_INFO(AddOval);
128 bool add() SK_OVERRIDE;
130 typedef SkAddRect INHERITED;
133 class SkAddCircle : public SkAddGeom {
134 DECLARE_MEMBER_INFO(AddCircle);
136 bool add() SK_OVERRIDE;
141 typedef SkAddGeom INHERITED;
144 class SkAddRoundRect : public SkAddRect {
145 DECLARE_MEMBER_INFO(AddRoundRect);
147 bool add() SK_OVERRIDE;
151 typedef SkAddRect INHERITED;
154 class SkAddPath : public SkPathPart {
155 DECLARE_MEMBER_INFO(AddPath);
157 bool add() SK_OVERRIDE;
159 typedef SkPathPart INHERITED;
160 SkDrawMatrix* matrix;
164 #endif // SkPathParts_DEFINED