Updating Xamarin/Microsoft file headers
[platform/upstream/libSkiaSharp.git] / src / c / sk_colortable.cpp
1 /*
2  * Copyright 2014 Google Inc.
3  * Copyright 2015 Xamarin Inc.
4  * Copyright 2017 Microsoft Corporation. All rights reserved.
5  *
6  * Use of this source code is governed by a BSD-style license that can be
7  * found in the LICENSE file.
8  */
9
10 #include "SkColorTable.h"
11
12 #include "sk_colortable.h"
13
14 #include "sk_types_priv.h"
15
16 void sk_colortable_unref(sk_colortable_t* ctable) {
17     SkSafeUnref(AsColorTable(ctable));
18 }
19
20 sk_colortable_t* sk_colortable_new(const sk_pmcolor_t* colors, int count) {
21     return ToColorTable(new SkColorTable(colors, count));
22 }
23
24 int sk_colortable_count(const sk_colortable_t* ctable) {
25     return AsColorTable(ctable)->count();
26 }
27
28 void sk_colortable_read_colors(const sk_colortable_t* ctable, sk_pmcolor_t** colors) {
29     *colors = (SkColor*) AsColorTable(ctable)->readColors();
30 }