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 SkDrawPath_DEFINED
11 #define SkDrawPath_DEFINED
13 #include "SkBoundable.h"
14 #include "SkIntArray.h"
15 #include "SkMemberInfo.h"
18 class SkDrawPath : public SkBoundable {
19 DECLARE_DRAW_MEMBER_INFO(Path);
21 virtual ~SkDrawPath();
22 bool addChild(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
23 bool childHasID() { return SkToBool(fChildHasID); }
24 bool childrenNeedDisposing() const SK_OVERRIDE;
25 void dirty() SK_OVERRIDE;
26 bool draw(SkAnimateMaker& ) SK_OVERRIDE;
27 SkDisplayable* getParent() const SK_OVERRIDE;
28 #ifdef SK_DUMP_ENABLED
29 void dump(SkAnimateMaker* ) SK_OVERRIDE;
32 bool getProperty(int index, SkScriptValue* value) const SK_OVERRIDE;
33 bool setProperty(int index, SkScriptValue& value) SK_OVERRIDE;
34 void onEndElement(SkAnimateMaker& ) SK_OVERRIDE;
35 void setChildHasID() SK_OVERRIDE;
36 bool setParent(SkDisplayable* parent) SK_OVERRIDE;
37 bool isPath() const SK_OVERRIDE { return true; }
43 SkTDPathPartArray fParts;
44 mutable SkScalar fLength;
45 SkDisplayable* fParent; // SkPolyToPoly or SkFromPath, for instance
49 typedef SkBoundable INHERITED;
52 class SkPolyline : public SkDrawPath {
53 DECLARE_MEMBER_INFO(Polyline);
54 bool addChild(SkAnimateMaker& , SkDisplayable*) SK_OVERRIDE;
55 void onEndElement(SkAnimateMaker& ) SK_OVERRIDE;
57 SkTDScalarArray points;
59 typedef SkDrawPath INHERITED;
62 class SkPolygon : public SkPolyline {
63 DECLARE_MEMBER_INFO(Polygon);
64 void onEndElement(SkAnimateMaker& ) SK_OVERRIDE;
66 typedef SkPolyline INHERITED;
69 #endif // SkDrawPath_DEFINED