1 2 /* 3 * Copyright 2006 The Android Open Source Project 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9 10 #ifndef SkDisplayMovie_DEFINED 11 #define SkDisplayMovie_DEFINED 12 13 #include "SkAnimator.h" 14 #include "SkDrawable.h" 15 #include "SkMemberInfo.h" 16 17 struct SkEventState; 18 19 class SkDisplayMovie : public SkDrawable { 20 DECLARE_DISPLAY_MEMBER_INFO(Movie); 21 SkDisplayMovie(); 22 virtual ~SkDisplayMovie(); 23 void buildMovie(); 24 virtual SkDisplayable* deepCopy(SkAnimateMaker* ); 25 virtual void dirty(); doEvent(const SkEvent & evt)26 bool doEvent(const SkEvent& evt) { 27 return fLoaded && fMovie.doEvent(evt); 28 } 29 virtual bool doEvent(SkDisplayEvent::Kind , SkEventState* state ); 30 virtual bool draw(SkAnimateMaker& ); 31 #ifdef SK_DUMP_ENABLED 32 virtual void dump(SkAnimateMaker* ); 33 virtual void dumpEvents(); 34 #endif 35 virtual bool enable(SkAnimateMaker& ); getAnimator()36 const SkAnimator* getAnimator() const { return &fMovie; } 37 virtual bool hasEnable() const; 38 virtual void onEndElement(SkAnimateMaker& ); 39 protected: 40 SkString src; 41 SkAnimator fMovie; 42 SkBool8 fDecodedSuccessfully; 43 SkBool8 fLoaded; 44 SkBool8 fMovieBuilt; 45 friend class SkAnimateMaker; 46 friend class SkPost; 47 private: 48 typedef SkDrawable INHERITED; 49 }; 50 51 #endif // SkDisplayMovie_DEFINED 52 53