gfx/skia/trunk/src/animator/SkDisplayApply.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/animator/SkDisplayApply.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,106 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2006 The Android Open Source Project
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +
    1.13 +#ifndef SkDisplayApply_DEFINED
    1.14 +#define SkDisplayApply_DEFINED
    1.15 +
    1.16 +#include "SkAnimateBase.h"
    1.17 +#include "SkDrawable.h"
    1.18 +#include "SkIntArray.h"
    1.19 +
    1.20 +class SkActive;
    1.21 +
    1.22 +class SkApply : public SkDrawable {
    1.23 +    DECLARE_MEMBER_INFO(Apply);
    1.24 +public:
    1.25 +
    1.26 +    SkApply();
    1.27 +    virtual ~SkApply();
    1.28 +
    1.29 +    enum Transition {
    1.30 +        kTransition_normal,
    1.31 +        kTransition_reverse
    1.32 +    };
    1.33 +
    1.34 +    enum Mode {
    1.35 +        kMode_create,
    1.36 +        kMode_immediate,
    1.37 +        //kMode_once
    1.38 +    };
    1.39 +    void activate(SkAnimateMaker& );
    1.40 +    void append(SkApply* apply);
    1.41 +    void appendActive(SkActive* );
    1.42 +    void applyValues(int animatorIndex, SkOperand* values, int count,
    1.43 +        SkDisplayTypes , SkMSec time);
    1.44 +    virtual bool contains(SkDisplayable*);
    1.45 +//  void createActive(SkAnimateMaker& );
    1.46 +    virtual SkDisplayable* deepCopy(SkAnimateMaker* );
    1.47 +    void disable();
    1.48 +    virtual bool draw(SkAnimateMaker& );
    1.49 +#ifdef SK_DUMP_ENABLED
    1.50 +    virtual void dump(SkAnimateMaker* );
    1.51 +#endif
    1.52 +    virtual bool enable(SkAnimateMaker& );
    1.53 +    void enableCreate(SkAnimateMaker& );
    1.54 +    void enableDynamic(SkAnimateMaker& );
    1.55 +    void endSave(int index);
    1.56 +    Mode getMode() { return mode; }
    1.57 +    virtual bool getProperty(int index, SkScriptValue* value) const;
    1.58 +    SkDrawable* getScope() { return scope; }
    1.59 +    void getStep(SkScriptValue* );
    1.60 +    SkDrawable* getTarget(SkAnimateBase* );
    1.61 +    bool hasDelayedAnimator() const;
    1.62 +    virtual bool hasEnable() const;
    1.63 +    bool inactivate(SkAnimateMaker& maker);
    1.64 +    virtual void initialize();
    1.65 +    bool interpolate(SkAnimateMaker& , SkMSec time);
    1.66 +    virtual void onEndElement(SkAnimateMaker& );
    1.67 +    virtual const SkMemberInfo* preferredChild(SkDisplayTypes type);
    1.68 +    void refresh(SkAnimateMaker& );
    1.69 +    void reset();
    1.70 +    virtual bool resolveIDs(SkAnimateMaker& maker, SkDisplayable* original, SkApply* );
    1.71 +    bool resolveField(SkAnimateMaker& , SkDisplayable* parent, SkString* str);
    1.72 +    void save(int index);
    1.73 +    void setEmbedded() { fEmbedded = true; }
    1.74 +    virtual bool setProperty(int index, SkScriptValue& );
    1.75 +    virtual void setSteps(int _steps);
    1.76 +//  virtual void setTime(SkMSec time);
    1.77 +#ifdef SK_DEBUG
    1.78 +    virtual void validate();
    1.79 +#endif
    1.80 +private:
    1.81 +    SkMSec begin;
    1.82 +    SkBool dontDraw;
    1.83 +    SkString dynamicScope;
    1.84 +    SkMSec interval;
    1.85 +    Mode mode;
    1.86 +#if 0
    1.87 +    SkBool pickup;
    1.88 +#endif
    1.89 +    SkBool restore;
    1.90 +    SkDrawable* scope;
    1.91 +    int32_t steps;
    1.92 +    Transition transition;
    1.93 +    SkActive* fActive;
    1.94 +    SkTDAnimateArray fAnimators;
    1.95 +//  SkDrawable* fCurrentScope;
    1.96 +    SkMSec fLastTime;   // used only to return script property time
    1.97 +    SkTDDrawableArray fScopes;
    1.98 +    SkBool fAppended : 1;
    1.99 +    SkBool fContainsScope : 1;
   1.100 +    SkBool fDeleteScope : 1;
   1.101 +    SkBool fEmbedded : 1;
   1.102 +    SkBool fEnabled : 1;
   1.103 +    SkBool fEnabling : 1; // set if calling interpolate from enable
   1.104 +    friend class SkActive;
   1.105 +    friend class SkDisplayList;
   1.106 +    typedef SkDrawable INHERITED;
   1.107 +};
   1.108 +
   1.109 +#endif // SkDisplayApply_DEFINED

mercurial