OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkImage_Base_DEFINED | 8 #ifndef SkImage_Base_DEFINED |
9 #define SkImage_Base_DEFINED | 9 #define SkImage_Base_DEFINED |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // Set true by caches when they cache content that's derived from the curren
t pixels. | 71 // Set true by caches when they cache content that's derived from the curren
t pixels. |
72 mutable SkAtomic<bool> fAddedToCache; | 72 mutable SkAtomic<bool> fAddedToCache; |
73 | 73 |
74 typedef SkImage INHERITED; | 74 typedef SkImage INHERITED; |
75 }; | 75 }; |
76 | 76 |
77 static inline SkImage_Base* as_IB(SkImage* image) { | 77 static inline SkImage_Base* as_IB(SkImage* image) { |
78 return static_cast<SkImage_Base*>(image); | 78 return static_cast<SkImage_Base*>(image); |
79 } | 79 } |
80 | 80 |
| 81 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { |
| 82 return static_cast<SkImage_Base*>(image.get()); |
| 83 } |
| 84 |
81 static inline const SkImage_Base* as_IB(const SkImage* image) { | 85 static inline const SkImage_Base* as_IB(const SkImage* image) { |
82 return static_cast<const SkImage_Base*>(image); | 86 return static_cast<const SkImage_Base*>(image); |
83 } | 87 } |
84 | 88 |
85 #endif | 89 #endif |
OLD | NEW |