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 SkDrawMatrix_DEFINED
11 #define SkDrawMatrix_DEFINED
13 #include "SkADrawable.h"
15 #include "SkMemberInfo.h"
16 #include "SkIntArray.h"
20 class SkDrawMatrix : public SkADrawable {
21 DECLARE_DRAW_MEMBER_INFO(Matrix);
23 virtual ~SkDrawMatrix();
24 bool addChild(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
25 bool childrenNeedDisposing() const SK_OVERRIDE;
26 void dirty() SK_OVERRIDE;
27 bool draw(SkAnimateMaker& ) SK_OVERRIDE;
28 #ifdef SK_DUMP_ENABLED
29 void dump(SkAnimateMaker* ) SK_OVERRIDE;
31 SkMatrix& getMatrix();
32 bool getProperty(int index, SkScriptValue* value) const SK_OVERRIDE;
33 void initialize() SK_OVERRIDE;
34 void onEndElement(SkAnimateMaker& ) SK_OVERRIDE;
35 void setChildHasID() SK_OVERRIDE;
36 bool setProperty(int index, SkScriptValue& ) SK_OVERRIDE;
38 void concat(SkMatrix& inMatrix) {
39 fConcat.preConcat(inMatrix);
42 SkDisplayable* deepCopy(SkAnimateMaker* ) SK_OVERRIDE;
45 void rotate(SkScalar degrees, SkPoint& center) {
46 fMatrix.preRotate(degrees, center.fX, center.fY);
49 void set(SkMatrix& src) {
50 fMatrix.preConcat(src);
53 void scale(SkScalar scaleX, SkScalar scaleY, SkPoint& center) {
54 fMatrix.preScale(scaleX, scaleY, center.fX, center.fY);
57 void skew(SkScalar skewX, SkScalar skewY, SkPoint& center) {
58 fMatrix.preSkew(skewX, skewY, center.fX, center.fY);
61 void translate(SkScalar x, SkScalar y) {
62 fMatrix.preTranslate(x, y);
65 SkTDScalarArray matrix;
68 SkTDMatrixPartArray fParts;
71 typedef SkADrawable INHERITED;
74 #endif // SkDrawMatrix_DEFINED