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 "SkADrawable.h"
15 #include "SkMemberInfo.h"
16 
17 struct SkEventState;
18 
19 class SkDisplayMovie : public SkADrawable {
20     DECLARE_DISPLAY_MEMBER_INFO(Movie);
21     SkDisplayMovie();
22     virtual ~SkDisplayMovie();
23     void buildMovie();
24     SkDisplayable* deepCopy(SkAnimateMaker* ) override;
25     void dirty() override;
doEvent(const SkEvent & evt)26     bool doEvent(const SkEvent& evt) {
27         return fLoaded && fMovie.doEvent(evt);
28     }
29     bool doEvent(SkDisplayEvent::Kind , SkEventState* state ) override;
30     bool draw(SkAnimateMaker& ) override;
31 #ifdef SK_DUMP_ENABLED
32     void dump(SkAnimateMaker* ) override;
33     void dumpEvents() override;
34 #endif
35     bool enable(SkAnimateMaker& ) override;
getAnimator()36     const SkAnimator* getAnimator() const { return &fMovie; }
37     bool hasEnable() const override;
38     void onEndElement(SkAnimateMaker& ) override;
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 SkADrawable INHERITED;
49 };
50 
51 #endif // SkDisplayMovie_DEFINED
52