2 * Copyright 2014 Google Inc.
3 * Copyright 2015 Xamarin Inc.
4 * Copyright 2017 Microsoft Corporation. All rights reserved.
6 * Use of this source code is governed by a BSD-style license that can be
7 * found in the LICENSE file.
10 #include "SkColorTable.h"
12 #include "sk_colortable.h"
14 #include "sk_types_priv.h"
16 void sk_colortable_unref(sk_colortable_t* ctable) {
17 SkSafeUnref(AsColorTable(ctable));
20 sk_colortable_t* sk_colortable_new(const sk_pmcolor_t* colors, int count) {
21 return ToColorTable(new SkColorTable(colors, count));
24 int sk_colortable_count(const sk_colortable_t* ctable) {
25 return AsColorTable(ctable)->count();
28 void sk_colortable_read_colors(const sk_colortable_t* ctable, sk_pmcolor_t** colors) {
29 *colors = (SkColor*) AsColorTable(ctable)->readColors();