reed | f5872d2 | 2015-01-10 17:59:31 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef sk_types_priv_DEFINED |
| 9 | #define sk_types_priv_DEFINED |
| 10 | |
| 11 | #include "sk_types.h" |
| 12 | |
| 13 | class SkMaskFilter; |
| 14 | class SkPaint; |
| 15 | class SkShader; |
| 16 | |
| 17 | static inline const SkPaint& AsPaint(const sk_paint_t& cpaint) { |
| 18 | return reinterpret_cast<const SkPaint&>(cpaint); |
| 19 | } |
| 20 | |
| 21 | static inline const SkPaint* AsPaint(const sk_paint_t* cpaint) { |
| 22 | return reinterpret_cast<const SkPaint*>(cpaint); |
| 23 | } |
| 24 | |
| 25 | static inline SkPaint* AsPaint(sk_paint_t* cpaint) { |
| 26 | return reinterpret_cast<SkPaint*>(cpaint); |
| 27 | } |
| 28 | |
| 29 | static inline SkMaskFilter* AsMaskFilter(sk_maskfilter_t* cfilter) { |
| 30 | return reinterpret_cast<SkMaskFilter*>(cfilter); |
| 31 | } |
| 32 | |
| 33 | static inline sk_maskfilter_t* ToMaskFilter(SkMaskFilter* filter) { |
| 34 | return reinterpret_cast<sk_maskfilter_t*>(filter); |
| 35 | } |
| 36 | |
| 37 | static inline SkShader* AsShader(sk_shader_t* cshader) { |
| 38 | return reinterpret_cast<SkShader*>(cshader); |
| 39 | } |
| 40 | |
| 41 | #endif |