blob: 76e2d9ccc7c885c7655608320b1f343266dc835b [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
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.com8a1c16f2008-12-17 15:59:43 +00009
10#ifndef SkDisplayMovie_DEFINED
11#define SkDisplayMovie_DEFINED
12
13#include "SkAnimator.h"
reed986ca612014-11-26 08:50:45 -080014#include "SkADrawable.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000015#include "SkMemberInfo.h"
16
17struct SkEventState;
18
reed986ca612014-11-26 08:50:45 -080019class SkDisplayMovie : public SkADrawable {
reed@android.com8a1c16f2008-12-17 15:59:43 +000020 DECLARE_DISPLAY_MEMBER_INFO(Movie);
21 SkDisplayMovie();
22 virtual ~SkDisplayMovie();
23 void buildMovie();
mtklein36352bf2015-03-25 18:17:31 -070024 SkDisplayable* deepCopy(SkAnimateMaker* ) override;
25 void dirty() override;
reed@android.com8a1c16f2008-12-17 15:59:43 +000026 bool doEvent(const SkEvent& evt) {
27 return fLoaded && fMovie.doEvent(evt);
28 }
mtklein36352bf2015-03-25 18:17:31 -070029 bool doEvent(SkDisplayEvent::Kind , SkEventState* state ) override;
30 bool draw(SkAnimateMaker& ) override;
reed@android.com8a1c16f2008-12-17 15:59:43 +000031#ifdef SK_DUMP_ENABLED
mtklein36352bf2015-03-25 18:17:31 -070032 void dump(SkAnimateMaker* ) override;
33 void dumpEvents() override;
reed@android.com8a1c16f2008-12-17 15:59:43 +000034#endif
mtklein36352bf2015-03-25 18:17:31 -070035 bool enable(SkAnimateMaker& ) override;
reed@android.com8a1c16f2008-12-17 15:59:43 +000036 const SkAnimator* getAnimator() const { return &fMovie; }
mtklein36352bf2015-03-25 18:17:31 -070037 bool hasEnable() const override;
38 void onEndElement(SkAnimateMaker& ) override;
reed@android.com8a1c16f2008-12-17 15:59:43 +000039protected:
40 SkString src;
41 SkAnimator fMovie;
42 SkBool8 fDecodedSuccessfully;
43 SkBool8 fLoaded;
44 SkBool8 fMovieBuilt;
45 friend class SkAnimateMaker;
46 friend class SkPost;
47private:
reed986ca612014-11-26 08:50:45 -080048 typedef SkADrawable INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +000049};
50
51#endif // SkDisplayMovie_DEFINED