Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
michael@0 | 1 | |
michael@0 | 2 | /* |
michael@0 | 3 | * Copyright 2006 The Android Open Source Project |
michael@0 | 4 | * |
michael@0 | 5 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 6 | * found in the LICENSE file. |
michael@0 | 7 | */ |
michael@0 | 8 | |
michael@0 | 9 | |
michael@0 | 10 | #ifndef SkAnimateBase_DEFINED |
michael@0 | 11 | #define SkAnimateBase_DEFINED |
michael@0 | 12 | |
michael@0 | 13 | #include "SkDisplayable.h" |
michael@0 | 14 | #include "SkMath.h" |
michael@0 | 15 | #include "SkMemberInfo.h" |
michael@0 | 16 | #include "SkTypedArray.h" |
michael@0 | 17 | |
michael@0 | 18 | class SkApply; |
michael@0 | 19 | class SkDrawable; |
michael@0 | 20 | |
michael@0 | 21 | class SkAnimateBase : public SkDisplayable { |
michael@0 | 22 | public: |
michael@0 | 23 | DECLARE_MEMBER_INFO(AnimateBase); |
michael@0 | 24 | SkAnimateBase(); |
michael@0 | 25 | virtual ~SkAnimateBase(); |
michael@0 | 26 | virtual int components(); |
michael@0 | 27 | virtual SkDisplayable* deepCopy(SkAnimateMaker* ); |
michael@0 | 28 | virtual void dirty(); |
michael@0 | 29 | #ifdef SK_DUMP_ENABLED |
michael@0 | 30 | virtual void dump(SkAnimateMaker* ); |
michael@0 | 31 | #endif |
michael@0 | 32 | int entries() { return fValues.count() / components(); } |
michael@0 | 33 | virtual bool hasExecute() const; |
michael@0 | 34 | bool isDynamic() const { return SkToBool(fDynamic); } |
michael@0 | 35 | virtual SkDisplayable* getParent() const; |
michael@0 | 36 | virtual bool getProperty(int index, SkScriptValue* value) const; |
michael@0 | 37 | SkMSec getStart() const { return fStart; } |
michael@0 | 38 | SkOperand* getValues() { return fValues.begin(); } |
michael@0 | 39 | SkDisplayTypes getValuesType() { return fValues.getType(); } |
michael@0 | 40 | virtual void onEndElement(SkAnimateMaker& ); |
michael@0 | 41 | void packARGB(SkScalar [], int count, SkTDOperandArray* ); |
michael@0 | 42 | virtual void refresh(SkAnimateMaker& ); |
michael@0 | 43 | void setChanged(bool changed) { fChanged = changed; } |
michael@0 | 44 | void setHasEndEvent() { fHasEndEvent = true; } |
michael@0 | 45 | virtual bool setParent(SkDisplayable* ); |
michael@0 | 46 | virtual bool setProperty(int index, SkScriptValue& value); |
michael@0 | 47 | void setTarget(SkAnimateMaker& ); |
michael@0 | 48 | virtual bool targetNeedsInitialization() const; |
michael@0 | 49 | protected: |
michael@0 | 50 | SkMSec begin; |
michael@0 | 51 | SkTDScalarArray blend; |
michael@0 | 52 | SkMSec dur; |
michael@0 | 53 | // !!! make field part of a union with fFieldInfo, or fValues, something known later? |
michael@0 | 54 | SkString field; // temporary; once target is known, this is reset |
michael@0 | 55 | SkString formula; |
michael@0 | 56 | SkString from; |
michael@0 | 57 | SkString lval; |
michael@0 | 58 | SkScalar repeat; |
michael@0 | 59 | SkString target; // temporary; once target is known, this is reset |
michael@0 | 60 | SkString to; |
michael@0 | 61 | SkApply* fApply; |
michael@0 | 62 | const SkMemberInfo* fFieldInfo; |
michael@0 | 63 | int fFieldOffset; |
michael@0 | 64 | SkMSec fStart; // corrected time when this apply was enabled |
michael@0 | 65 | SkDrawable* fTarget; |
michael@0 | 66 | SkTypedArray fValues; |
michael@0 | 67 | unsigned fChanged : 1; // true when value referenced by script has changed |
michael@0 | 68 | unsigned fDelayed : 1; // enabled, but undrawn pending delay |
michael@0 | 69 | unsigned fDynamic : 1; |
michael@0 | 70 | unsigned fHasEndEvent : 1; |
michael@0 | 71 | unsigned fHasValues : 1; // set if 'values' passed instead of 'to' |
michael@0 | 72 | unsigned fMirror : 1; |
michael@0 | 73 | unsigned fReset : 1; |
michael@0 | 74 | unsigned fResetPending : 1; |
michael@0 | 75 | unsigned fTargetIsScope : 1; |
michael@0 | 76 | private: |
michael@0 | 77 | typedef SkDisplayable INHERITED; |
michael@0 | 78 | friend class SkActive; |
michael@0 | 79 | friend class SkApply; |
michael@0 | 80 | friend class SkDisplayList; |
michael@0 | 81 | }; |
michael@0 | 82 | |
michael@0 | 83 | #endif // SkAnimateBase_DEFINED |