| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkBoundable_DEFINED | 10 #ifndef SkBoundable_DEFINED |
| 11 #define SkBoundable_DEFINED | 11 #define SkBoundable_DEFINED |
| 12 | 12 |
| 13 #include "SkDrawable.h" | 13 #include "SkADrawable.h" |
| 14 #include "SkRect.h" | 14 #include "SkRect.h" |
| 15 | 15 |
| 16 class SkBoundable : public SkDrawable { | 16 class SkBoundable : public SkADrawable { |
| 17 public: | 17 public: |
| 18 SkBoundable(); | 18 SkBoundable(); |
| 19 virtual void clearBounder(); | 19 virtual void clearBounder(); |
| 20 virtual void enableBounder(); | 20 virtual void enableBounder(); |
| 21 virtual void getBounds(SkRect* ); | 21 virtual void getBounds(SkRect* ); |
| 22 bool hasBounds() { return fBounds.fLeft != (int16_t)0x8000U; } | 22 bool hasBounds() { return fBounds.fLeft != (int16_t)0x8000U; } |
| 23 void setBounds(SkIRect& bounds) { fBounds = bounds; } | 23 void setBounds(SkIRect& bounds) { fBounds = bounds; } |
| 24 protected: | 24 protected: |
| 25 void clearBounds() { fBounds.fLeft = (int16_t) SkToU16(0x8000); }; // mark b
ounds as unset | 25 void clearBounds() { fBounds.fLeft = (int16_t) SkToU16(0x8000); }; // mark b
ounds as unset |
| 26 SkIRect fBounds; | 26 SkIRect fBounds; |
| 27 private: | 27 private: |
| 28 typedef SkDrawable INHERITED; | 28 typedef SkADrawable INHERITED; |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 class SkBoundableAuto { | 31 class SkBoundableAuto { |
| 32 public: | 32 public: |
| 33 SkBoundableAuto(SkBoundable* boundable, SkAnimateMaker& maker); | 33 SkBoundableAuto(SkBoundable* boundable, SkAnimateMaker& maker); |
| 34 ~SkBoundableAuto(); | 34 ~SkBoundableAuto(); |
| 35 private: | 35 private: |
| 36 SkBoundable* fBoundable; | 36 SkBoundable* fBoundable; |
| 37 SkAnimateMaker& fMaker; | 37 SkAnimateMaker& fMaker; |
| 38 SkBoundableAuto& operator= (const SkBoundableAuto& ); | 38 SkBoundableAuto& operator= (const SkBoundableAuto& ); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 #endif // SkBoundable_DEFINED | 41 #endif // SkBoundable_DEFINED |
| OLD | NEW |