blob: 92089d7266303e9b9bf6f93def7aca010aa2a80e [file] [log] [blame]
reedf5872d22015-01-10 17:59:31 -08001/*
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
13class SkMaskFilter;
14class SkPaint;
15class SkShader;
16
17static inline const SkPaint& AsPaint(const sk_paint_t& cpaint) {
18 return reinterpret_cast<const SkPaint&>(cpaint);
19}
20
21static inline const SkPaint* AsPaint(const sk_paint_t* cpaint) {
22 return reinterpret_cast<const SkPaint*>(cpaint);
23}
24
25static inline SkPaint* AsPaint(sk_paint_t* cpaint) {
26 return reinterpret_cast<SkPaint*>(cpaint);
27}
28
29static inline SkMaskFilter* AsMaskFilter(sk_maskfilter_t* cfilter) {
30 return reinterpret_cast<SkMaskFilter*>(cfilter);
31}
32
33static inline sk_maskfilter_t* ToMaskFilter(SkMaskFilter* filter) {
34 return reinterpret_cast<sk_maskfilter_t*>(filter);
35}
36
37static inline SkShader* AsShader(sk_shader_t* cshader) {
38 return reinterpret_cast<SkShader*>(cshader);
39}
40
41#endif