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 17struct SkEventState; 18 19class 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(); 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& ); 36 const SkAnimator* getAnimator() const { return &fMovie; } 37 virtual bool hasEnable() const; 38 virtual void onEndElement(SkAnimateMaker& ); 39protected: 40 SkString src; 41 SkAnimator fMovie; 42 SkBool8 fDecodedSuccessfully; 43 SkBool8 fLoaded; 44 SkBool8 fMovieBuilt; 45 friend class SkAnimateMaker; 46 friend class SkPost; 47private: 48 typedef SkDrawable INHERITED; 49}; 50 51#endif // SkDisplayMovie_DEFINED 52