diff options
Diffstat (limited to 'libs/graphics/animator/SkBoundable.h')
-rw-r--r-- | libs/graphics/animator/SkBoundable.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libs/graphics/animator/SkBoundable.h b/libs/graphics/animator/SkBoundable.h new file mode 100644 index 0000000000..d3e3586527 --- /dev/null +++ b/libs/graphics/animator/SkBoundable.h @@ -0,0 +1,33 @@ +#ifndef SkBoundable_DEFINED +#define SkBoundable_DEFINED + +#include "SkDrawable.h" +#include "SkRect.h" + +class SkBoundable : public SkDrawable { +public: + SkBoundable(); + virtual void clearBounder(); + virtual void enableBounder(); + virtual void getBounds(SkRect* ); + bool hasBounds() { return fBounds.fLeft != (S16)0x8000U; } + void setBounds(SkRect16& bounds) { fBounds = bounds; } +protected: + void clearBounds() { fBounds.fLeft = (S16) SkToU16(0x8000); }; // mark bounds as unset + SkRect16 fBounds; +private: + typedef SkDrawable INHERITED; +}; + +class SkBoundableAuto { +public: + SkBoundableAuto(SkBoundable* boundable, SkAnimateMaker& maker); + ~SkBoundableAuto(); +private: + SkBoundable* fBoundable; + SkAnimateMaker& fMaker; + SkBoundableAuto& operator= (const SkBoundableAuto& ); +}; + +#endif // SkBoundable_DEFINED + |