1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/animator/SkMatrixParts.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,119 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2006 The Android Open Source Project 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 +#ifndef SkMatrixParts_DEFINED 1.14 +#define SkMatrixParts_DEFINED 1.15 + 1.16 +#include "SkDisplayable.h" 1.17 +#include "SkMemberInfo.h" 1.18 +#include "SkPathMeasure.h" 1.19 + 1.20 +class SkDrawPath; 1.21 +class SkDrawRect; 1.22 +class SkPolygon; 1.23 + 1.24 +class SkDrawMatrix; 1.25 +// class SkMatrix; 1.26 + 1.27 +class SkMatrixPart : public SkDisplayable { 1.28 +public: 1.29 + SkMatrixPart(); 1.30 + virtual bool add() = 0; 1.31 + virtual void dirty(); 1.32 + virtual SkDisplayable* getParent() const; 1.33 + virtual bool setParent(SkDisplayable* parent); 1.34 +#ifdef SK_DEBUG 1.35 + virtual bool isMatrixPart() const { return true; } 1.36 +#endif 1.37 +protected: 1.38 + SkDrawMatrix* fMatrix; 1.39 +}; 1.40 + 1.41 +class SkRotate : public SkMatrixPart { 1.42 + DECLARE_MEMBER_INFO(Rotate); 1.43 + SkRotate(); 1.44 +protected: 1.45 + virtual bool add(); 1.46 + SkScalar degrees; 1.47 + SkPoint center; 1.48 +}; 1.49 + 1.50 +class SkScale : public SkMatrixPart { 1.51 + DECLARE_MEMBER_INFO(Scale); 1.52 + SkScale(); 1.53 +protected: 1.54 + virtual bool add(); 1.55 + SkScalar x; 1.56 + SkScalar y; 1.57 + SkPoint center; 1.58 +}; 1.59 + 1.60 +class SkSkew : public SkMatrixPart { 1.61 + DECLARE_MEMBER_INFO(Skew); 1.62 + SkSkew(); 1.63 +protected: 1.64 + virtual bool add(); 1.65 + SkScalar x; 1.66 + SkScalar y; 1.67 + SkPoint center; 1.68 +}; 1.69 + 1.70 +class SkTranslate : public SkMatrixPart { 1.71 + DECLARE_MEMBER_INFO(Translate); 1.72 + SkTranslate(); 1.73 +protected: 1.74 + virtual bool add(); 1.75 + SkScalar x; 1.76 + SkScalar y; 1.77 +}; 1.78 + 1.79 +class SkFromPath : public SkMatrixPart { 1.80 + DECLARE_MEMBER_INFO(FromPath); 1.81 + SkFromPath(); 1.82 + virtual ~SkFromPath(); 1.83 +protected: 1.84 + virtual bool add(); 1.85 + int32_t mode; 1.86 + SkScalar offset; 1.87 + SkDrawPath* path; 1.88 + SkPathMeasure fPathMeasure; 1.89 +}; 1.90 + 1.91 +class SkRectToRect : public SkMatrixPart { 1.92 + DECLARE_MEMBER_INFO(RectToRect); 1.93 + SkRectToRect(); 1.94 + virtual ~SkRectToRect(); 1.95 +#ifdef SK_DUMP_ENABLED 1.96 + virtual void dump(SkAnimateMaker* ); 1.97 +#endif 1.98 + virtual const SkMemberInfo* preferredChild(SkDisplayTypes type); 1.99 +protected: 1.100 + virtual bool add(); 1.101 + SkDrawRect* source; 1.102 + SkDrawRect* destination; 1.103 +}; 1.104 + 1.105 +class SkPolyToPoly : public SkMatrixPart { 1.106 + DECLARE_MEMBER_INFO(PolyToPoly); 1.107 + SkPolyToPoly(); 1.108 + virtual ~SkPolyToPoly(); 1.109 +#ifdef SK_DUMP_ENABLED 1.110 + virtual void dump(SkAnimateMaker* ); 1.111 +#endif 1.112 + virtual void onEndElement(SkAnimateMaker& ); 1.113 + virtual const SkMemberInfo* preferredChild(SkDisplayTypes type); 1.114 +protected: 1.115 + virtual bool add(); 1.116 + SkPolygon* source; 1.117 + SkPolygon* destination; 1.118 +}; 1.119 + 1.120 +// !!! add concat matrix ? 1.121 + 1.122 +#endif // SkMatrixParts_DEFINED