1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/animator/SkAnimatorScript2.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2011 Google Inc. 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 +#ifndef SkAnimatorScript2_DEFINED 1.12 +#define SkAnimatorScript2_DEFINED 1.13 + 1.14 +#include "SkDisplayable.h" 1.15 +#include "SkScript2.h" 1.16 +#include "SkTypedArray.h" 1.17 + 1.18 +class SkAnimateMaker; 1.19 +struct SkMemberInfo; 1.20 + 1.21 +#ifndef SkAnimatorScript_DEFINED 1.22 +struct SkDisplayEnumMap { 1.23 + SkDisplayTypes fType; 1.24 + const char* fValues; 1.25 +}; 1.26 +#endif 1.27 + 1.28 +class SkAnimatorScript2 : public SkScriptEngine2 { 1.29 +public: 1.30 + SkAnimatorScript2(SkAnimateMaker& , SkDisplayable* working, SkDisplayTypes type); 1.31 + ~SkAnimatorScript2(); 1.32 + bool evalMemberCommon(const SkMemberInfo* info, 1.33 + SkDisplayable* displayable, SkOperand2* value); 1.34 + SkAnimateMaker& getMaker() { return fMaker; } 1.35 + SkDisplayable* getWorking() { return fWorking; } 1.36 + static bool MapEnums(const char* ptr, const char* match, size_t len, int* value); 1.37 + static const SkDisplayEnumMap& GetEnumValues(SkDisplayTypes type); 1.38 + static SkDisplayTypes ToDisplayType(SkOperand2::OpType type); 1.39 + static SkOperand2::OpType ToOpType(SkDisplayTypes type); 1.40 +private: 1.41 + SkAnimateMaker& fMaker; 1.42 + SkDisplayable* fWorking; 1.43 + friend class SkDump; 1.44 + friend struct SkScriptNAnswer; 1.45 + // illegal 1.46 + SkAnimatorScript2& operator=(const SkAnimatorScript2&); 1.47 +#ifdef SK_DEBUG 1.48 +public: 1.49 + static void UnitTest(); 1.50 +#endif 1.51 +}; 1.52 + 1.53 +#endif // SkAnimatorScript2_DEFINED