OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "sk_paint.h" | 8 #include "sk_paint.h" |
9 #include "sk_types_priv.h" | 9 #include "sk_types_priv.h" |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #define CTypeSkTypeMap MAKE_FROM_TO_NAME(sk_stroke_cap_t) | 35 #define CTypeSkTypeMap MAKE_FROM_TO_NAME(sk_stroke_cap_t) |
36 #include "sk_c_from_to.h" | 36 #include "sk_c_from_to.h" |
37 | 37 |
38 #define CType sk_stroke_join_t | 38 #define CType sk_stroke_join_t |
39 #define SKType SkPaint::Join | 39 #define SKType SkPaint::Join |
40 #define CTypeSkTypeMap MAKE_FROM_TO_NAME(sk_stroke_join_t) | 40 #define CTypeSkTypeMap MAKE_FROM_TO_NAME(sk_stroke_join_t) |
41 #include "sk_c_from_to.h" | 41 #include "sk_c_from_to.h" |
42 | 42 |
43 ////////////////////////////////////////////////////////////////////////////////
////////////////// | 43 ////////////////////////////////////////////////////////////////////////////////
////////////////// |
44 | 44 |
45 sk_paint_t* sk_paint_new() { | 45 sk_paint_t* sk_paint_new() { return (sk_paint_t*)new SkPaint; } |
46 return (sk_paint_t*)SkNEW(SkPaint); | |
47 } | |
48 | 46 |
49 void sk_paint_delete(sk_paint_t* cpaint) { | 47 void sk_paint_delete(sk_paint_t* cpaint) { delete AsPaint(cpaint); } |
50 SkDELETE(AsPaint(cpaint)); | |
51 } | |
52 | 48 |
53 bool sk_paint_is_antialias(const sk_paint_t* cpaint) { | 49 bool sk_paint_is_antialias(const sk_paint_t* cpaint) { |
54 return AsPaint(*cpaint).isAntiAlias(); | 50 return AsPaint(*cpaint).isAntiAlias(); |
55 } | 51 } |
56 | 52 |
57 void sk_paint_set_antialias(sk_paint_t* cpaint, bool aa) { | 53 void sk_paint_set_antialias(sk_paint_t* cpaint, bool aa) { |
58 AsPaint(cpaint)->setAntiAlias(aa); | 54 AsPaint(cpaint)->setAntiAlias(aa); |
59 } | 55 } |
60 | 56 |
61 sk_color_t sk_paint_get_color(const sk_paint_t* cpaint) { | 57 sk_color_t sk_paint_get_color(const sk_paint_t* cpaint) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 MAP( HUE_SK_XFERMODE_MODE, SkXfermode::kHue_Mode ); | 161 MAP( HUE_SK_XFERMODE_MODE, SkXfermode::kHue_Mode ); |
166 MAP( SATURATION_SK_XFERMODE_MODE, SkXfermode::kSaturation_Mode ); | 162 MAP( SATURATION_SK_XFERMODE_MODE, SkXfermode::kSaturation_Mode ); |
167 MAP( COLOR_SK_XFERMODE_MODE, SkXfermode::kColor_Mode ); | 163 MAP( COLOR_SK_XFERMODE_MODE, SkXfermode::kColor_Mode ); |
168 MAP( LUMINOSITY_SK_XFERMODE_MODE, SkXfermode::kLuminosity_Mode ); | 164 MAP( LUMINOSITY_SK_XFERMODE_MODE, SkXfermode::kLuminosity_Mode ); |
169 #undef MAP | 165 #undef MAP |
170 default: | 166 default: |
171 return; | 167 return; |
172 } | 168 } |
173 AsPaint(paint)->setXfermodeMode(skmode); | 169 AsPaint(paint)->setXfermodeMode(skmode); |
174 } | 170 } |
OLD | NEW |