epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 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 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 9 | |
| 10 | #ifndef SkDisplayMovie_DEFINED |
| 11 | #define SkDisplayMovie_DEFINED |
| 12 | |
| 13 | #include "SkAnimator.h" |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 14 | #include "SkADrawable.h" |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 15 | #include "SkMemberInfo.h" |
| 16 | |
| 17 | struct SkEventState; |
| 18 | |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 19 | class SkDisplayMovie : public SkADrawable { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 20 | DECLARE_DISPLAY_MEMBER_INFO(Movie); |
| 21 | SkDisplayMovie(); |
| 22 | virtual ~SkDisplayMovie(); |
| 23 | void buildMovie(); |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 24 | SkDisplayable* deepCopy(SkAnimateMaker* ) override; |
| 25 | void dirty() override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 26 | bool doEvent(const SkEvent& evt) { |
| 27 | return fLoaded && fMovie.doEvent(evt); |
| 28 | } |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 29 | bool doEvent(SkDisplayEvent::Kind , SkEventState* state ) override; |
| 30 | bool draw(SkAnimateMaker& ) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 31 | #ifdef SK_DUMP_ENABLED |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 32 | void dump(SkAnimateMaker* ) override; |
| 33 | void dumpEvents() override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 34 | #endif |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 35 | bool enable(SkAnimateMaker& ) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 36 | const SkAnimator* getAnimator() const { return &fMovie; } |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 37 | bool hasEnable() const override; |
| 38 | void onEndElement(SkAnimateMaker& ) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 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: |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 48 | typedef SkADrawable INHERITED; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | #endif // SkDisplayMovie_DEFINED |