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 AsPaint(const sk_paint_t & cpaint)17static inline const SkPaint& AsPaint(const sk_paint_t& cpaint) { 18 return reinterpret_cast<const SkPaint&>(cpaint); 19 } 20 AsPaint(const sk_paint_t * cpaint)21static inline const SkPaint* AsPaint(const sk_paint_t* cpaint) { 22 return reinterpret_cast<const SkPaint*>(cpaint); 23 } 24 AsPaint(sk_paint_t * cpaint)25static inline SkPaint* AsPaint(sk_paint_t* cpaint) { 26 return reinterpret_cast<SkPaint*>(cpaint); 27 } 28 AsMaskFilter(sk_maskfilter_t * cfilter)29static inline SkMaskFilter* AsMaskFilter(sk_maskfilter_t* cfilter) { 30 return reinterpret_cast<SkMaskFilter*>(cfilter); 31 } 32 ToMaskFilter(SkMaskFilter * filter)33static inline sk_maskfilter_t* ToMaskFilter(SkMaskFilter* filter) { 34 return reinterpret_cast<sk_maskfilter_t*>(filter); 35 } 36 AsShader(sk_shader_t * cshader)37static inline SkShader* AsShader(sk_shader_t* cshader) { 38 return reinterpret_cast<SkShader*>(cshader); 39 } 40 41 #endif 42