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 SkMatrixParts_DEFINED
11 #define SkMatrixParts_DEFINED
13 #include "SkDisplayable.h"
14 #include "SkMemberInfo.h"
15 #include "SkPathMeasure.h"
24 class SkMatrixPart : public SkDisplayable {
27 virtual bool add() = 0;
29 virtual SkDisplayable* getParent() const;
30 virtual bool setParent(SkDisplayable* parent);
32 virtual bool isMatrixPart() const { return true; }
35 SkDrawMatrix* fMatrix;
38 class SkRotate : public SkMatrixPart {
39 DECLARE_MEMBER_INFO(Rotate);
42 bool add() SK_OVERRIDE;
47 class SkScale : public SkMatrixPart {
48 DECLARE_MEMBER_INFO(Scale);
51 bool add() SK_OVERRIDE;
57 class SkSkew : public SkMatrixPart {
58 DECLARE_MEMBER_INFO(Skew);
61 bool add() SK_OVERRIDE;
67 class SkTranslate : public SkMatrixPart {
68 DECLARE_MEMBER_INFO(Translate);
71 bool add() SK_OVERRIDE;
76 class SkFromPath : public SkMatrixPart {
77 DECLARE_MEMBER_INFO(FromPath);
79 virtual ~SkFromPath();
81 bool add() SK_OVERRIDE;
85 SkPathMeasure fPathMeasure;
88 class SkRectToRect : public SkMatrixPart {
89 DECLARE_MEMBER_INFO(RectToRect);
91 virtual ~SkRectToRect();
92 #ifdef SK_DUMP_ENABLED
93 void dump(SkAnimateMaker* ) SK_OVERRIDE;
95 const SkMemberInfo* preferredChild(SkDisplayTypes type) SK_OVERRIDE;
97 bool add() SK_OVERRIDE;
99 SkDrawRect* destination;
102 class SkPolyToPoly : public SkMatrixPart {
103 DECLARE_MEMBER_INFO(PolyToPoly);
105 virtual ~SkPolyToPoly();
106 #ifdef SK_DUMP_ENABLED
107 void dump(SkAnimateMaker* ) SK_OVERRIDE;
109 void onEndElement(SkAnimateMaker& ) SK_OVERRIDE;
110 const SkMemberInfo* preferredChild(SkDisplayTypes type) SK_OVERRIDE;
112 bool add() SK_OVERRIDE;
114 SkPolygon* destination;
117 // !!! add concat matrix ?
119 #endif // SkMatrixParts_DEFINED