1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/animator/SkDrawGroup.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,72 @@ 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 SkDrawGroup_DEFINED 1.14 +#define SkDrawGroup_DEFINED 1.15 + 1.16 +#include "SkDrawable.h" 1.17 +#include "SkIntArray.h" 1.18 +#include "SkMemberInfo.h" 1.19 + 1.20 +class SkGroup : public SkDrawable { //interface for schema element <g> 1.21 +public: 1.22 + DECLARE_MEMBER_INFO(Group); 1.23 + SkGroup(); 1.24 + virtual ~SkGroup(); 1.25 + virtual bool addChild(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE; 1.26 + virtual bool contains(SkDisplayable* ); 1.27 + SkGroup* copy(); 1.28 + SkBool copySet(int index); 1.29 + virtual SkDisplayable* deepCopy(SkAnimateMaker* ); 1.30 + virtual bool doEvent(SkDisplayEvent::Kind , SkEventState* state ); 1.31 + virtual bool draw(SkAnimateMaker& ); 1.32 +#ifdef SK_DUMP_ENABLED 1.33 + virtual void dump(SkAnimateMaker* ); 1.34 + virtual void dumpDrawables(SkAnimateMaker* ); 1.35 + virtual void dumpEvents(); 1.36 +#endif 1.37 + int findGroup(SkDrawable* drawable, SkTDDrawableArray** list, 1.38 + SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList); 1.39 + virtual bool enable(SkAnimateMaker& ); 1.40 + SkTDDrawableArray* getChildren() { return &fChildren; } 1.41 + SkGroup* getOriginal() { return fOriginal; } 1.42 + virtual bool hasEnable() const; 1.43 + virtual void initialize(); 1.44 + SkBool isACopy() { return fOriginal != NULL; } 1.45 + void markCopyClear(int index); 1.46 + void markCopySet(int index); 1.47 + void markCopySize(int index); 1.48 + bool markedForDelete(int index) const { return (fCopies[index >> 5] & 1 << (index & 0x1f)) == 0; } 1.49 + void reset(); 1.50 + bool resolveIDs(SkAnimateMaker& maker, SkDisplayable* original, SkApply* ); 1.51 + virtual void setSteps(int steps); 1.52 +#ifdef SK_DEBUG 1.53 + virtual void validate(); 1.54 +#endif 1.55 +protected: 1.56 + bool ifCondition(SkAnimateMaker& maker, SkDrawable* drawable, 1.57 + SkString& conditionString); 1.58 + SkString condition; 1.59 + SkString enableCondition; 1.60 + SkTDDrawableArray fChildren; 1.61 + SkTDDrawableArray* fParentList; 1.62 + SkTDIntArray fCopies; 1.63 + SkGroup* fOriginal; 1.64 +private: 1.65 + typedef SkDrawable INHERITED; 1.66 +}; 1.67 + 1.68 +class SkSave: public SkGroup { 1.69 + DECLARE_MEMBER_INFO(Save); 1.70 + virtual bool draw(SkAnimateMaker& ); 1.71 +private: 1.72 + typedef SkGroup INHERITED; 1.73 +}; 1.74 + 1.75 +#endif // SkDrawGroup_DEFINED