diff -r 000000000000 -r 6474c204b198 gfx/skia/trunk/src/animator/SkBoundable.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx/skia/trunk/src/animator/SkBoundable.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,41 @@ + +/* + * Copyright 2006 The Android Open Source Project + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +#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 != (int16_t)0x8000U; } + void setBounds(SkIRect& bounds) { fBounds = bounds; } +protected: + void clearBounds() { fBounds.fLeft = (int16_t) SkToU16(0x8000); }; // mark bounds as unset + SkIRect 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