1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/animator/SkBoundable.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,41 @@ 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 SkBoundable_DEFINED 1.14 +#define SkBoundable_DEFINED 1.15 + 1.16 +#include "SkDrawable.h" 1.17 +#include "SkRect.h" 1.18 + 1.19 +class SkBoundable : public SkDrawable { 1.20 +public: 1.21 + SkBoundable(); 1.22 + virtual void clearBounder(); 1.23 + virtual void enableBounder(); 1.24 + virtual void getBounds(SkRect* ); 1.25 + bool hasBounds() { return fBounds.fLeft != (int16_t)0x8000U; } 1.26 + void setBounds(SkIRect& bounds) { fBounds = bounds; } 1.27 +protected: 1.28 + void clearBounds() { fBounds.fLeft = (int16_t) SkToU16(0x8000); }; // mark bounds as unset 1.29 + SkIRect fBounds; 1.30 +private: 1.31 + typedef SkDrawable INHERITED; 1.32 +}; 1.33 + 1.34 +class SkBoundableAuto { 1.35 +public: 1.36 + SkBoundableAuto(SkBoundable* boundable, SkAnimateMaker& maker); 1.37 + ~SkBoundableAuto(); 1.38 +private: 1.39 + SkBoundable* fBoundable; 1.40 + SkAnimateMaker& fMaker; 1.41 + SkBoundableAuto& operator= (const SkBoundableAuto& ); 1.42 +}; 1.43 + 1.44 +#endif // SkBoundable_DEFINED